Skip to content

Commit

Permalink
chore(eslint-plugin): Add missing rule function types (#1047)
Browse files Browse the repository at this point in the history
  • Loading branch information
Validark authored and bradzacher committed Oct 9, 2019
1 parent 054df27 commit a3f84e1
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 7 deletions.
Expand Up @@ -92,7 +92,6 @@ const KNOWN_NODES = new Set([
AST_NODE_TYPES.WithStatement,
AST_NODE_TYPES.YieldExpression,
AST_NODE_TYPES.JSXIdentifier,
AST_NODE_TYPES.JSXNamespacedName,
AST_NODE_TYPES.JSXMemberExpression,
AST_NODE_TYPES.JSXEmptyExpression,
AST_NODE_TYPES.JSXExpressionContainer,
Expand Down Expand Up @@ -164,7 +163,7 @@ const KNOWN_NODES = new Set([
'TSPlusToken',
AST_NODE_TYPES.TSPropertySignature,
AST_NODE_TYPES.TSQualifiedName,
AST_NODE_TYPES.TSQuestionToken,
'TSQuestionToken',
AST_NODE_TYPES.TSRestType,
AST_NODE_TYPES.TSThisType,
AST_NODE_TYPES.TSTupleType,
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin/src/rules/indent.ts
Expand Up @@ -69,7 +69,7 @@ const KNOWN_NODES = new Set([
'TSPlusToken',
AST_NODE_TYPES.TSPropertySignature,
AST_NODE_TYPES.TSQualifiedName,
AST_NODE_TYPES.TSQuestionToken,
'TSQuestionToken',
AST_NODE_TYPES.TSRestType,
AST_NODE_TYPES.TSThisType,
AST_NODE_TYPES.TSTupleType,
Expand Down
12 changes: 12 additions & 0 deletions packages/experimental-utils/src/ts-eslint/Rule.ts
Expand Up @@ -226,6 +226,8 @@ interface RuleListener {
AssignmentPattern?: RuleFunction<TSESTree.AssignmentPattern>;
AssignmentExpression?: RuleFunction<TSESTree.AssignmentExpression>;
AwaitExpression?: RuleFunction<TSESTree.AwaitExpression>;
BigIntLiteral?: RuleFunction<TSESTree.BigIntLiteral>;
BinaryExpression?: RuleFunction<TSESTree.BinaryExpression>;
BlockStatement?: RuleFunction<TSESTree.BlockStatement>;
BreakStatement?: RuleFunction<TSESTree.BreakStatement>;
CallExpression?: RuleFunction<TSESTree.CallExpression>;
Expand All @@ -249,6 +251,8 @@ interface RuleListener {
ForInStatement?: RuleFunction<TSESTree.ForInStatement>;
ForOfStatement?: RuleFunction<TSESTree.ForOfStatement>;
ForStatement?: RuleFunction<TSESTree.ForStatement>;
FunctionDeclaration?: RuleFunction<TSESTree.FunctionDeclaration>;
FunctionExpression?: RuleFunction<TSESTree.FunctionExpression>;
Identifier?: RuleFunction<TSESTree.Identifier>;
IfStatement?: RuleFunction<TSESTree.IfStatement>;
Import?: RuleFunction<TSESTree.Import>;
Expand Down Expand Up @@ -295,6 +299,7 @@ interface RuleListener {
ThrowStatement?: RuleFunction<TSESTree.ThrowStatement>;
Token?: RuleFunction<TSESTree.Token>;
TryStatement?: RuleFunction<TSESTree.TryStatement>;
TSAbstractClassProperty?: RuleFunction<TSESTree.TSAbstractClassProperty>;
TSAbstractKeyword?: RuleFunction<TSESTree.TSAbstractKeyword>;
TSAbstractMethodDefinition?: RuleFunction<
TSESTree.TSAbstractMethodDefinition
Expand All @@ -308,24 +313,31 @@ interface RuleListener {
TSCallSignatureDeclaration?: RuleFunction<
TSESTree.TSCallSignatureDeclaration
>;
TSClassImplements?: RuleFunction<TSESTree.TSClassImplements>;
TSConditionalType?: RuleFunction<TSESTree.TSConditionalType>;
TSConstructorType?: RuleFunction<TSESTree.TSConstructorType>;
TSConstructSignatureDeclaration?: RuleFunction<
TSESTree.TSConstructSignatureDeclaration
>;
TSDeclareKeyword?: RuleFunction<TSESTree.TSDeclareKeyword>;
TSDeclareFunction?: RuleFunction<TSESTree.TSDeclareFunction>;
TSEmptyBodyFunctionExpression?: RuleFunction<
TSESTree.TSEmptyBodyFunctionExpression
>;
TSEnumDeclaration?: RuleFunction<TSESTree.TSEnumDeclaration>;
TSEnumMember?: RuleFunction<TSESTree.TSEnumMember>;
TSExportAssignment?: RuleFunction<TSESTree.TSExportAssignment>;
TSExportKeyword?: RuleFunction<TSESTree.TSExportKeyword>;
TSExternalModuleReference?: RuleFunction<TSESTree.TSExternalModuleReference>;
TSFunctionType?: RuleFunction<TSESTree.TSFunctionType>;
TSImportEqualsDeclaration?: RuleFunction<TSESTree.TSImportEqualsDeclaration>;
TSImportType?: RuleFunction<TSESTree.TSImportType>;
TSIndexedAccessType?: RuleFunction<TSESTree.TSIndexedAccessType>;
TSIndexSignature?: RuleFunction<TSESTree.TSIndexSignature>;
TSInferType?: RuleFunction<TSESTree.TSInferType>;
TSInterfaceBody?: RuleFunction<TSESTree.TSInterfaceBody>;
TSInterfaceDeclaration?: RuleFunction<TSESTree.TSInterfaceDeclaration>;
TSInterfaceHeritage?: RuleFunction<TSESTree.TSInterfaceHeritage>;
TSIntersectionType?: RuleFunction<TSESTree.TSIntersectionType>;
TSLiteralType?: RuleFunction<TSESTree.TSLiteralType>;
TSMappedType?: RuleFunction<TSESTree.TSMappedType>;
Expand Down
1 change: 0 additions & 1 deletion packages/parser/src/visitor-keys.ts
Expand Up @@ -99,7 +99,6 @@ export const visitorKeys = eslintVisitorKeys.unionWith({
TSProtectedKeyword: [],
TSPublicKeyword: [],
TSQualifiedName: ['left', 'right'],
TSQuestionToken: [],
TSReadonlyKeyword: [],
TSRestType: ['typeAnnotation'],
TSStaticKeyword: [],
Expand Down
2 changes: 0 additions & 2 deletions packages/typescript-estree/src/ts-estree/ast-node-types.ts
Expand Up @@ -47,7 +47,6 @@ export enum AST_NODE_TYPES {
JSXFragment = 'JSXFragment',
JSXIdentifier = 'JSXIdentifier',
JSXMemberExpression = 'JSXMemberExpression',
JSXNamespacedName = 'JSXNamespacedName', // https://github.com/Microsoft/TypeScript/issues/7411
JSXOpeningElement = 'JSXOpeningElement',
JSXOpeningFragment = 'JSXOpeningFragment',
JSXSpreadAttribute = 'JSXSpreadAttribute',
Expand Down Expand Up @@ -135,7 +134,6 @@ export enum AST_NODE_TYPES {
TSProtectedKeyword = 'TSProtectedKeyword',
TSPublicKeyword = 'TSPublicKeyword',
TSQualifiedName = 'TSQualifiedName',
TSQuestionToken = 'TSQuestionToken',
TSReadonlyKeyword = 'TSReadonlyKeyword',
TSRestType = 'TSRestType',
TSStaticKeyword = 'TSStaticKeyword',
Expand Down
2 changes: 1 addition & 1 deletion packages/typescript-estree/src/ts-estree/ts-estree.ts
Expand Up @@ -465,7 +465,7 @@ interface ClassDeclarationBase extends BaseNode {

interface ClassPropertyBase extends BaseNode {
key: PropertyName;
value: Expression;
value: Expression | null;
computed: boolean;
static: boolean;
readonly?: boolean;
Expand Down

0 comments on commit a3f84e1

Please sign in to comment.