Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a3f84e1

Browse files
Validarkbradzacher
authored andcommitted
chore(eslint-plugin): Add missing rule function types (typescript-eslint#1047)
1 parent 054df27 commit a3f84e1

File tree

6 files changed

+15
-7
lines changed

6 files changed

+15
-7
lines changed

packages/eslint-plugin/src/rules/indent-new-do-not-use/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ const KNOWN_NODES = new Set([
9292
AST_NODE_TYPES.WithStatement,
9393
AST_NODE_TYPES.YieldExpression,
9494
AST_NODE_TYPES.JSXIdentifier,
95-
AST_NODE_TYPES.JSXNamespacedName,
9695
AST_NODE_TYPES.JSXMemberExpression,
9796
AST_NODE_TYPES.JSXEmptyExpression,
9897
AST_NODE_TYPES.JSXExpressionContainer,
@@ -164,7 +163,7 @@ const KNOWN_NODES = new Set([
164163
'TSPlusToken',
165164
AST_NODE_TYPES.TSPropertySignature,
166165
AST_NODE_TYPES.TSQualifiedName,
167-
AST_NODE_TYPES.TSQuestionToken,
166+
'TSQuestionToken',
168167
AST_NODE_TYPES.TSRestType,
169168
AST_NODE_TYPES.TSThisType,
170169
AST_NODE_TYPES.TSTupleType,

packages/eslint-plugin/src/rules/indent.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ const KNOWN_NODES = new Set([
6969
'TSPlusToken',
7070
AST_NODE_TYPES.TSPropertySignature,
7171
AST_NODE_TYPES.TSQualifiedName,
72-
AST_NODE_TYPES.TSQuestionToken,
72+
'TSQuestionToken',
7373
AST_NODE_TYPES.TSRestType,
7474
AST_NODE_TYPES.TSThisType,
7575
AST_NODE_TYPES.TSTupleType,

packages/experimental-utils/src/ts-eslint/Rule.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,8 @@ interface RuleListener {
226226
AssignmentPattern?: RuleFunction<TSESTree.AssignmentPattern>;
227227
AssignmentExpression?: RuleFunction<TSESTree.AssignmentExpression>;
228228
AwaitExpression?: RuleFunction<TSESTree.AwaitExpression>;
229+
BigIntLiteral?: RuleFunction<TSESTree.BigIntLiteral>;
230+
BinaryExpression?: RuleFunction<TSESTree.BinaryExpression>;
229231
BlockStatement?: RuleFunction<TSESTree.BlockStatement>;
230232
BreakStatement?: RuleFunction<TSESTree.BreakStatement>;
231233
CallExpression?: RuleFunction<TSESTree.CallExpression>;
@@ -249,6 +251,8 @@ interface RuleListener {
249251
ForInStatement?: RuleFunction<TSESTree.ForInStatement>;
250252
ForOfStatement?: RuleFunction<TSESTree.ForOfStatement>;
251253
ForStatement?: RuleFunction<TSESTree.ForStatement>;
254+
FunctionDeclaration?: RuleFunction<TSESTree.FunctionDeclaration>;
255+
FunctionExpression?: RuleFunction<TSESTree.FunctionExpression>;
252256
Identifier?: RuleFunction<TSESTree.Identifier>;
253257
IfStatement?: RuleFunction<TSESTree.IfStatement>;
254258
Import?: RuleFunction<TSESTree.Import>;
@@ -295,6 +299,7 @@ interface RuleListener {
295299
ThrowStatement?: RuleFunction<TSESTree.ThrowStatement>;
296300
Token?: RuleFunction<TSESTree.Token>;
297301
TryStatement?: RuleFunction<TSESTree.TryStatement>;
302+
TSAbstractClassProperty?: RuleFunction<TSESTree.TSAbstractClassProperty>;
298303
TSAbstractKeyword?: RuleFunction<TSESTree.TSAbstractKeyword>;
299304
TSAbstractMethodDefinition?: RuleFunction<
300305
TSESTree.TSAbstractMethodDefinition
@@ -308,24 +313,31 @@ interface RuleListener {
308313
TSCallSignatureDeclaration?: RuleFunction<
309314
TSESTree.TSCallSignatureDeclaration
310315
>;
316+
TSClassImplements?: RuleFunction<TSESTree.TSClassImplements>;
311317
TSConditionalType?: RuleFunction<TSESTree.TSConditionalType>;
318+
TSConstructorType?: RuleFunction<TSESTree.TSConstructorType>;
312319
TSConstructSignatureDeclaration?: RuleFunction<
313320
TSESTree.TSConstructSignatureDeclaration
314321
>;
315322
TSDeclareKeyword?: RuleFunction<TSESTree.TSDeclareKeyword>;
316323
TSDeclareFunction?: RuleFunction<TSESTree.TSDeclareFunction>;
324+
TSEmptyBodyFunctionExpression?: RuleFunction<
325+
TSESTree.TSEmptyBodyFunctionExpression
326+
>;
317327
TSEnumDeclaration?: RuleFunction<TSESTree.TSEnumDeclaration>;
318328
TSEnumMember?: RuleFunction<TSESTree.TSEnumMember>;
319329
TSExportAssignment?: RuleFunction<TSESTree.TSExportAssignment>;
320330
TSExportKeyword?: RuleFunction<TSESTree.TSExportKeyword>;
321331
TSExternalModuleReference?: RuleFunction<TSESTree.TSExternalModuleReference>;
332+
TSFunctionType?: RuleFunction<TSESTree.TSFunctionType>;
322333
TSImportEqualsDeclaration?: RuleFunction<TSESTree.TSImportEqualsDeclaration>;
323334
TSImportType?: RuleFunction<TSESTree.TSImportType>;
324335
TSIndexedAccessType?: RuleFunction<TSESTree.TSIndexedAccessType>;
325336
TSIndexSignature?: RuleFunction<TSESTree.TSIndexSignature>;
326337
TSInferType?: RuleFunction<TSESTree.TSInferType>;
327338
TSInterfaceBody?: RuleFunction<TSESTree.TSInterfaceBody>;
328339
TSInterfaceDeclaration?: RuleFunction<TSESTree.TSInterfaceDeclaration>;
340+
TSInterfaceHeritage?: RuleFunction<TSESTree.TSInterfaceHeritage>;
329341
TSIntersectionType?: RuleFunction<TSESTree.TSIntersectionType>;
330342
TSLiteralType?: RuleFunction<TSESTree.TSLiteralType>;
331343
TSMappedType?: RuleFunction<TSESTree.TSMappedType>;

packages/parser/src/visitor-keys.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ export const visitorKeys = eslintVisitorKeys.unionWith({
9999
TSProtectedKeyword: [],
100100
TSPublicKeyword: [],
101101
TSQualifiedName: ['left', 'right'],
102-
TSQuestionToken: [],
103102
TSReadonlyKeyword: [],
104103
TSRestType: ['typeAnnotation'],
105104
TSStaticKeyword: [],

packages/typescript-estree/src/ts-estree/ast-node-types.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ export enum AST_NODE_TYPES {
4747
JSXFragment = 'JSXFragment',
4848
JSXIdentifier = 'JSXIdentifier',
4949
JSXMemberExpression = 'JSXMemberExpression',
50-
JSXNamespacedName = 'JSXNamespacedName', // https://github.com/Microsoft/TypeScript/issues/7411
5150
JSXOpeningElement = 'JSXOpeningElement',
5251
JSXOpeningFragment = 'JSXOpeningFragment',
5352
JSXSpreadAttribute = 'JSXSpreadAttribute',
@@ -135,7 +134,6 @@ export enum AST_NODE_TYPES {
135134
TSProtectedKeyword = 'TSProtectedKeyword',
136135
TSPublicKeyword = 'TSPublicKeyword',
137136
TSQualifiedName = 'TSQualifiedName',
138-
TSQuestionToken = 'TSQuestionToken',
139137
TSReadonlyKeyword = 'TSReadonlyKeyword',
140138
TSRestType = 'TSRestType',
141139
TSStaticKeyword = 'TSStaticKeyword',

packages/typescript-estree/src/ts-estree/ts-estree.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ interface ClassDeclarationBase extends BaseNode {
465465

466466
interface ClassPropertyBase extends BaseNode {
467467
key: PropertyName;
468-
value: Expression;
468+
value: Expression | null;
469469
computed: boolean;
470470
static: boolean;
471471
readonly?: boolean;

0 commit comments

Comments
 (0)