Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

chore: export all Options and MessageIds types from rule files#10556

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletionspackages/eslint-plugin/src/rules/array-type.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -74,13 +74,13 @@ function typeNeedsParentheses(node: TSESTree.Node): boolean {
}

export type OptionString = 'array' | 'array-simple' | 'generic';
type Options = [
exporttype Options = [
{
default: OptionString;
readonly?: OptionString;
},
];
type MessageIds =
exporttype MessageIds =
| 'errorStringArray'
| 'errorStringArrayReadonly'
| 'errorStringArraySimple'
Expand Down
2 changes: 1 addition & 1 deletionpackages/eslint-plugin/src/rules/await-thenable.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -15,7 +15,7 @@ import {
} from '../util';
import { getForStatementHeadLoc } from '../util/getForStatementHeadLoc';

type MessageId =
exporttype MessageId =
| 'await'
| 'awaitUsingOfNonAsyncDisposable'
| 'convertToOrdinaryFor'
Expand Down
14 changes: 8 additions & 6 deletionspackages/eslint-plugin/src/rules/ban-ts-comment.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -4,22 +4,24 @@ import { AST_TOKEN_TYPES } from '@typescript-eslint/utils';

import { createRule, getStringLength, nullThrows } from '../util';

type DirectiveConfig =
const defaultMinimumDescriptionLength = 3;

export type DirectiveConfig =
| boolean
| 'allow-with-description'
| { descriptionFormat: string };

interfaceOptions {
exportinterfaceOptionsShape {
minimumDescriptionLength?: number;
'ts-check'?: DirectiveConfig;
'ts-expect-error'?: DirectiveConfig;
'ts-ignore'?: DirectiveConfig;
'ts-nocheck'?: DirectiveConfig;
}

const defaultMinimumDescriptionLength = 3;
export type Options = [OptionsShape];

type MessageIds =
exporttype MessageIds =
| 'replaceTsIgnoreWithTsExpectError'
| 'tsDirectiveComment'
| 'tsDirectiveCommentDescriptionNotMatchPattern'
Expand All@@ -31,7 +33,7 @@ interface MatchedTSDirective {
directive: string;
}

export default createRule<[Options], MessageIds>({
export default createRule<Options, MessageIds>({
name: 'ban-ts-comment',
meta: {
type: 'problem',
Expand DownExpand Up@@ -203,7 +205,7 @@ export default createRule<[Options], MessageIds>({
return;
}

const fullDirective = `ts-${directive}` as keyofOptions;
const fullDirective = `ts-${directive}` as keyofOptionsShape;

const option = options[fullDirective];
if (option === true) {
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -11,8 +11,8 @@ import {
nullThrows,
} from '../util';

type Options = ['fields' | 'getters'];
type MessageIds =
exporttype Options = ['fields' | 'getters'];
exporttype MessageIds =
| 'preferFieldStyle'
| 'preferFieldStyleSuggestion'
| 'preferGetterStyle'
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -9,15 +9,15 @@ import {
getStaticMemberAccessValue,
} from '../util';

type Options = [
exporttype Options = [
{
enforceForClassFields?: boolean;
exceptMethods?: string[];
ignoreClassesThatImplementAnInterface?: boolean | 'public-fields';
ignoreOverrideMethods?: boolean;
},
];
type MessageIds = 'missingThis';
exporttype MessageIds = 'missingThis';

export default createRule<Options, MessageIds>({
name: 'class-methods-use-this',
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -4,8 +4,8 @@ import { AST_NODE_TYPES } from '@typescript-eslint/utils';

import { createRule, nullThrows, NullThrowsReasons } from '../util';

type MessageIds = 'preferConstructor' | 'preferTypeAnnotation';
type Options = ['constructor' | 'type-annotation'];
exporttype MessageIds = 'preferConstructor' | 'preferTypeAnnotation';
exporttype Options = ['constructor' | 'type-annotation'];

export default createRule<Options, MessageIds>({
name: 'consistent-generic-constructors',
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -12,11 +12,11 @@ import {
nullThrows,
} from '../util';

type MessageIds =
exporttype MessageIds =
| 'preferIndexSignature'
| 'preferIndexSignatureSuggestion'
| 'preferRecord';
type Options = ['index-signature' | 'record'];
exporttype Options = ['index-signature' | 'record'];

export default createRule<Options, MessageIds>({
name: 'consistent-indexed-object-style',
Expand Down
4 changes: 2 additions & 2 deletionspackages/eslint-plugin/src/rules/consistent-return.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -13,8 +13,8 @@ import { getESLintCoreRule } from '../util/getESLintCoreRule';

const baseRule = getESLintCoreRule('consistent-return');

type Options = InferOptionsTypeFromRule<typeof baseRule>;
type MessageIds = InferMessageIdsTypeFromRule<typeof baseRule>;
exporttype Options = InferOptionsTypeFromRule<typeof baseRule>;
exporttype MessageIds = InferMessageIdsTypeFromRule<typeof baseRule>;

type FunctionNode =
| TSESTree.ArrowFunctionExpression
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -14,7 +14,7 @@ import {
NullThrowsReasons,
} from '../util';

type Options = [
exporttype Options = [
{
fixMixedExportsWithInlineTypeSpecifier: boolean;
},
Expand All@@ -34,7 +34,7 @@ interface ReportValueExport {
valueSpecifiers: TSESTree.ExportSpecifier[];
}

type MessageIds =
exporttype MessageIds =
| 'multipleExportsAreTypes'
| 'singleExportIsType'
| 'typeOverValue';
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -19,7 +19,7 @@ import {
type Prefer = 'no-type-imports' | 'type-imports';
type FixStyle = 'inline-type-imports' | 'separate-type-imports';

type Options = [
exporttype Options = [
{
disallowTypeAnnotations?: boolean;
fixStyle?: FixStyle;
Expand All@@ -45,7 +45,7 @@ interface ReportValueImport {
valueSpecifiers: TSESTree.ImportClause[];
}

type MessageIds =
exporttype MessageIds =
| 'avoidImportType'
| 'noImportTypeAnnotations'
| 'someImportsAreOnlyTypes'
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -11,7 +11,7 @@ import {
isValidFunctionExpressionReturnType,
} from '../util/explicitReturnTypeUtils';

type Options = [
exporttype Options = [
{
allowConciseArrowFunctionExpressionsStartingWithVoid?: boolean;
allowDirectConstAssertionInArrowFunctions?: boolean;
Expand All@@ -23,7 +23,7 @@ type Options = [
allowTypedFunctionExpressions?: boolean;
},
];
type MessageIds = 'missingReturnType';
exporttype MessageIds = 'missingReturnType';

type FunctionNode =
| TSESTree.ArrowFunctionExpression
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -31,9 +31,9 @@ interface Config {
};
}

type Options = [Config];
exporttype Options = [Config];

type MessageIds =
exporttype MessageIds =
| 'addExplicitAccessibility'
| 'missingAccessibility'
| 'unwantedPublicAccessibility';
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -18,7 +18,7 @@ import {
isTypedFunctionExpression,
} from '../util/explicitReturnTypeUtils';

type Options = [
exporttype Options = [
{
allowArgumentsExplicitlyTypedAsAny?: boolean;
allowDirectConstAssertionInArrowFunctions?: boolean;
Expand All@@ -27,7 +27,7 @@ type Options = [
allowTypedFunctionExpressions?: boolean;
},
];
type MessageIds =
exporttype MessageIds =
| 'anyTypedArg'
| 'anyTypedArgUnnamed'
| 'missingArgType'
Expand Down
6 changes: 2 additions & 4 deletionspackages/eslint-plugin/src/rules/naming-convention.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -21,7 +21,7 @@ import {
} from '../util';
import { Modifiers, parseOptions, SCHEMA } from './naming-convention-utils';

type MessageIds =
exporttype MessageIds =
| 'doesNotMatchFormat'
| 'doesNotMatchFormatTrimmed'
| 'missingAffix'
Expand All@@ -32,7 +32,7 @@ type MessageIds =
// Note that this intentionally does not strictly type the modifiers/types properties.
// This is because doing so creates a huge headache, as the rule's code doesn't need to care.
// The JSON Schema strictly types these properties, so we know the user won't input invalid config.
type Options = Selector[];
exporttype Options = Selector[];

// This essentially mirrors ESLint's `camelcase` rule
// note that that rule ignores leading and trailing underscores and only checks those in the middle of a variable name
Expand DownExpand Up@@ -789,5 +789,3 @@ function requiresQuoting(
: `${node.value}`;
return _requiresQuoting(name, target);
}

export type { MessageIds, Options };
2 changes: 1 addition & 1 deletionpackages/eslint-plugin/src/rules/no-array-delete.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -9,7 +9,7 @@ import {
getParserServices,
} from '../util';

type MessageId = 'noArrayDelete' | 'useSplice';
exporttype MessageId = 'noArrayDelete' | 'useSplice';

export default createRule<[], MessageId>({
name: 'no-array-delete',
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,7 +8,7 @@ import { AST_NODE_TYPES, AST_TOKEN_TYPES } from '@typescript-eslint/utils';

import { createRule } from '../util';

type MessageId =
exporttype MessageId =
| 'confusingAssign'
| 'confusingEqual'
| 'confusingOperator'
Expand Down
4 changes: 2 additions & 2 deletionspackages/eslint-plugin/src/rules/no-dupe-class-members.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -12,8 +12,8 @@ import { getESLintCoreRule } from '../util/getESLintCoreRule';

const baseRule = getESLintCoreRule('no-dupe-class-members');

type Options = InferOptionsTypeFromRule<typeof baseRule>;
type MessageIds = InferMessageIdsTypeFromRule<typeof baseRule>;
exporttype Options = InferOptionsTypeFromRule<typeof baseRule>;
exporttype MessageIds = InferMessageIdsTypeFromRule<typeof baseRule>;

export default createRule<Options, MessageIds>({
name: 'no-dupe-class-members',
Expand Down
4 changes: 2 additions & 2 deletionspackages/eslint-plugin/src/rules/no-empty-function.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -13,8 +13,8 @@ import { getESLintCoreRule } from '../util/getESLintCoreRule';

const baseRule = getESLintCoreRule('no-empty-function');

type Options = InferOptionsTypeFromRule<typeof baseRule>;
type MessageIds = InferMessageIdsTypeFromRule<typeof baseRule>;
exporttype Options = InferOptionsTypeFromRule<typeof baseRule>;
exporttype MessageIds = InferMessageIdsTypeFromRule<typeof baseRule>;

const defaultOptions: Options = [
{
Expand Down
4 changes: 2 additions & 2 deletionspackages/eslint-plugin/src/rules/no-empty-interface.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,12 +5,12 @@ import { AST_NODE_TYPES } from '@typescript-eslint/utils';

import { createRule, isDefinitionFile } from '../util';

type Options = [
exporttype Options = [
{
allowSingleExtends?: boolean;
},
];
type MessageIds = 'noEmpty' | 'noEmptyWithSuper';
exporttype MessageIds = 'noEmpty' | 'noEmptyWithSuper';

export default createRule<Options, MessageIds>({
name: 'no-empty-interface',
Expand Down
4 changes: 2 additions & 2 deletionspackages/eslint-plugin/src/rules/no-extraneous-class.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -4,15 +4,15 @@ import { AST_NODE_TYPES } from '@typescript-eslint/utils';

import { createRule } from '../util';

type Options = [
exporttype Options = [
{
allowConstructorOnly?: boolean;
allowEmpty?: boolean;
allowStaticOnly?: boolean;
allowWithDecorator?: boolean;
},
];
type MessageIds = 'empty' | 'onlyConstructor' | 'onlyStatic';
exporttype MessageIds = 'empty' | 'onlyConstructor' | 'onlyStatic';

export default createRule<Options, MessageIds>({
name: 'no-extraneous-class',
Expand Down
4 changes: 2 additions & 2 deletionspackages/eslint-plugin/src/rules/no-floating-promises.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -18,7 +18,7 @@ import {
typeMatchesSomeSpecifier,
} from '../util';

type Options = [
exporttype Options = [
{
allowForKnownSafeCalls?: TypeOrValueSpecifier[];
allowForKnownSafePromises?: TypeOrValueSpecifier[];
Expand All@@ -28,7 +28,7 @@ type Options = [
},
];

type MessageId =
exporttype MessageId =
| 'floating'
| 'floatingFixAwait'
| 'floatingFixVoid'
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -10,8 +10,8 @@ import {
NullThrowsReasons,
} from '../util';

type Options = [];
type MessageIds = 'useTopLevelQualifier';
exporttype Options = [];
exporttype MessageIds = 'useTopLevelQualifier';

export default createRule<Options, MessageIds>({
name: 'no-import-type-side-effects',
Expand Down
4 changes: 2 additions & 2 deletionspackages/eslint-plugin/src/rules/no-inferrable-types.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,13 +5,13 @@ import { AST_NODE_TYPES } from '@typescript-eslint/utils';

import { createRule, nullThrows, NullThrowsReasons } from '../util';

type Options = [
exporttype Options = [
{
ignoreParameters?: boolean;
ignoreProperties?: boolean;
},
];
type MessageIds = 'noInferrableType';
exporttype MessageIds = 'noInferrableType';

export default createRule<Options, MessageIds>({
name: 'no-inferrable-types',
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -9,7 +9,7 @@ interface Options {
allowInGenericTypeArguments?: boolean | [string, ...string[]];
}

type MessageIds =
exporttype MessageIds =
| 'invalidVoidForGeneric'
| 'invalidVoidNotReturn'
| 'invalidVoidNotReturnOrGeneric'
Expand Down
4 changes: 2 additions & 2 deletionspackages/eslint-plugin/src/rules/no-loop-func.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -12,8 +12,8 @@ import { getESLintCoreRule } from '../util/getESLintCoreRule';

const baseRule = getESLintCoreRule('no-loop-func');

type Options = InferOptionsTypeFromRule<typeof baseRule>;
type MessageIds = InferMessageIdsTypeFromRule<typeof baseRule>;
exporttype Options = InferOptionsTypeFromRule<typeof baseRule>;
exporttype MessageIds = InferMessageIdsTypeFromRule<typeof baseRule>;

export default createRule<Options, MessageIds>({
name: 'no-loop-func',
Expand Down
6 changes: 4 additions & 2 deletionspackages/eslint-plugin/src/rules/no-loss-of-precision.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,8 +8,10 @@ import { getESLintCoreRule } from '../util/getESLintCoreRule';

const baseRule = getESLintCoreRule('no-loss-of-precision');

type Options = InferOptionsTypeFromRule<NonNullable<typeof baseRule>>;
type MessageIds = InferMessageIdsTypeFromRule<NonNullable<typeof baseRule>>;
export type Options = InferOptionsTypeFromRule<NonNullable<typeof baseRule>>;
export type MessageIds = InferMessageIdsTypeFromRule<
NonNullable<typeof baseRule>
>;

export default createRule<Options, MessageIds>({
name: 'no-loss-of-precision',
Expand Down
Loading
Loading

[8]ページ先頭

©2009-2025 Movatter.jp