Skip to content

Commit

Permalink
chore(tools): update consistent-callback-type
Browse files Browse the repository at this point in the history
  • Loading branch information
mainframev committed Oct 2, 2024
1 parent 4d0cb89 commit 47eaf03
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions tools/eslint-rules/rules/consistent-callback-type.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
import { ESLintUtils, AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils';
import { ESLintUtils, AST_NODE_TYPES, TSESTree, TSESLint } from '@typescript-eslint/utils';

// NOTE: The rule will be available in ESLint configs as "@nx/workspace-consistent-callback-type"
export const RULE_NAME = 'consistent-callback-type';

export const rule = ESLintUtils.RuleCreator(() => __filename)({
type Docs = {
recommended: TSESLint.RuleRecommendation;
};

export const rule = ESLintUtils.RuleCreator<Docs>(() => __filename)({
name: RULE_NAME,
meta: {
type: 'problem',
Expand Down Expand Up @@ -41,7 +45,7 @@ export const rule = ESLintUtils.RuleCreator(() => __filename)({
typeAnnotation.type === AST_NODE_TYPES.TSTypeReference &&
typeAnnotation.typeName.type === AST_NODE_TYPES.Identifier &&
typeAnnotation.typeName.name === 'EventHandler' &&
typeAnnotation.typeParameters
typeAnnotation.typeArguments
)
) {
context.report({
Expand Down

0 comments on commit 47eaf03

Please sign in to comment.