From dfd2368d1cb1789b6a95a11be24c36868bb8a819 Mon Sep 17 00:00:00 2001 From: Simen Bekkhus Date: Fri, 17 Sep 2021 08:21:28 +0200 Subject: [PATCH] fix: use correct property `hasSuggestions` rather than `hasSuggestion` (#899) --- src/index.ts | 8 ++------ src/rules/no-done-callback.ts | 2 +- src/rules/no-focused-tests.ts | 2 +- src/rules/prefer-expect-assertions.ts | 2 +- src/rules/prefer-strict-equal.ts | 2 +- tools/regenerate-docs.ts | 2 +- 6 files changed, 7 insertions(+), 11 deletions(-) diff --git a/src/index.ts b/src/index.ts index 7006bdc81..03d119a89 100644 --- a/src/index.ts +++ b/src/index.ts @@ -8,15 +8,11 @@ type RuleModule = TSESLint.RuleModule & { meta: Required, 'docs'>>; }; -// can be removed once we've on v3: https://github.com/typescript-eslint/typescript-eslint/issues/2060 +// can be removed once we've on v5 of `@typescript-eslint/experimental-utils` declare module '@typescript-eslint/experimental-utils/dist/ts-eslint/Rule' { - export interface RuleMetaDataDocs { - suggestion?: boolean; - } - // eslint-disable-next-line @typescript-eslint/no-unused-vars export interface RuleMetaData { - hasSuggestion?: boolean; + hasSuggestions?: boolean; } } diff --git a/src/rules/no-done-callback.ts b/src/rules/no-done-callback.ts index 196c204cb..d059da9f7 100644 --- a/src/rules/no-done-callback.ts +++ b/src/rules/no-done-callback.ts @@ -47,7 +47,7 @@ export default createRule({ }, schema: [], type: 'suggestion', - hasSuggestion: true, + hasSuggestions: true, }, defaultOptions: [], create(context) { diff --git a/src/rules/no-focused-tests.ts b/src/rules/no-focused-tests.ts index f64700e66..82d42d98d 100644 --- a/src/rules/no-focused-tests.ts +++ b/src/rules/no-focused-tests.ts @@ -49,7 +49,7 @@ export default createRule({ }, schema: [], type: 'suggestion', - hasSuggestion: true, + hasSuggestions: true, }, defaultOptions: [], create: context => ({ diff --git a/src/rules/prefer-expect-assertions.ts b/src/rules/prefer-expect-assertions.ts index 6f564c277..f3dd081fa 100644 --- a/src/rules/prefer-expect-assertions.ts +++ b/src/rules/prefer-expect-assertions.ts @@ -84,7 +84,7 @@ export default createRule<[RuleOptions], MessageIds>({ suggestRemovingExtraArguments: 'Remove extra arguments', }, type: 'suggestion', - hasSuggestion: true, + hasSuggestions: true, schema: [ { type: 'object', diff --git a/src/rules/prefer-strict-equal.ts b/src/rules/prefer-strict-equal.ts index 9bf3ca89f..e4b6c1fde 100644 --- a/src/rules/prefer-strict-equal.ts +++ b/src/rules/prefer-strict-equal.ts @@ -21,7 +21,7 @@ export default createRule({ }, type: 'suggestion', schema: [], - hasSuggestion: true, + hasSuggestions: true, }, defaultOptions: [], create(context) { diff --git a/tools/regenerate-docs.ts b/tools/regenerate-docs.ts index bfd8b5a72..546e3fefc 100644 --- a/tools/regenerate-docs.ts +++ b/tools/regenerate-docs.ts @@ -114,7 +114,7 @@ const details: RuleDetails[] = Object.keys(config.configs.all.rules) description: rule.meta.docs.description, fixable: rule.meta.fixable ? 'fixable' - : rule.meta.hasSuggestion + : rule.meta.hasSuggestions ? 'suggest' : false, requiresTypeChecking: rule.meta.docs.requiresTypeChecking ?? false,