From 867152a65eaf6c64b31631b2a6d1e45866717420 Mon Sep 17 00:00:00 2001 From: Joshua Chen Date: Sat, 14 May 2022 12:21:36 +0800 Subject: [PATCH] refactor: improve message? --- .../src/rules/consistent-generic-constructors.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/eslint-plugin/src/rules/consistent-generic-constructors.ts b/packages/eslint-plugin/src/rules/consistent-generic-constructors.ts index eaceb6131e0..894846ee91c 100644 --- a/packages/eslint-plugin/src/rules/consistent-generic-constructors.ts +++ b/packages/eslint-plugin/src/rules/consistent-generic-constructors.ts @@ -1,4 +1,4 @@ -import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; import { createRule } from '../util'; type MessageIds = 'preferLHS' | 'preferRHS'; @@ -15,9 +15,9 @@ export default createRule({ }, messages: { preferLHS: - 'The generic type arguments should be specified on the left-hand side of the constructor call.', + 'The generic type arguments should be specified on the left-hand side of the declaration as a type annotation.', preferRHS: - 'The generic type arguments should be specified on the right-hand side of the constructor call.', + 'The generic type arguments should be specified on the right-hand side of the declaration as constructor type arguments.', }, fixable: 'code', schema: [ @@ -29,7 +29,7 @@ export default createRule({ defaultOptions: ['rhs'], create(context, [mode]) { return { - VariableDeclarator(node: TSESTree.VariableDeclarator): void { + VariableDeclarator(node): void { const sourceCode = context.getSourceCode(); const lhs = node.id.typeAnnotation?.typeAnnotation; const rhs = node.init;