Skip to content

Commit

Permalink
fix: use correct property hasSuggestions rather than hasSuggestion (
Browse files Browse the repository at this point in the history
  • Loading branch information
SimenB authored Sep 17, 2021
1 parent 46ac6fc commit dfd2368
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 11 deletions.
8 changes: 2 additions & 6 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,11 @@ type RuleModule = TSESLint.RuleModule<string, unknown[]> & {
meta: Required<Pick<TSESLint.RuleMetaData<string>, '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<TMessageIds extends string> {
hasSuggestion?: boolean;
hasSuggestions?: boolean;
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/rules/no-done-callback.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export default createRule({
},
schema: [],
type: 'suggestion',
hasSuggestion: true,
hasSuggestions: true,
},
defaultOptions: [],
create(context) {
Expand Down
2 changes: 1 addition & 1 deletion src/rules/no-focused-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export default createRule({
},
schema: [],
type: 'suggestion',
hasSuggestion: true,
hasSuggestions: true,
},
defaultOptions: [],
create: context => ({
Expand Down
2 changes: 1 addition & 1 deletion src/rules/prefer-expect-assertions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export default createRule<[RuleOptions], MessageIds>({
suggestRemovingExtraArguments: 'Remove extra arguments',
},
type: 'suggestion',
hasSuggestion: true,
hasSuggestions: true,
schema: [
{
type: 'object',
Expand Down
2 changes: 1 addition & 1 deletion src/rules/prefer-strict-equal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export default createRule({
},
type: 'suggestion',
schema: [],
hasSuggestion: true,
hasSuggestions: true,
},
defaultOptions: [],
create(context) {
Expand Down
2 changes: 1 addition & 1 deletion tools/regenerate-docs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit dfd2368

Please sign in to comment.