Skip to content

Commit 4ffdebe

Browse files
committed
chore: add suggestion property to relevant rules
1 parent 3b709ec commit 4ffdebe

File tree

4 files changed

+10
-2
lines changed

4 files changed

+10
-2
lines changed

src/index.ts

+7
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@ import { join, parse } from 'path';
33
import globals from './globals.json';
44
import * as snapshotProcessor from './processors/snapshot-processor';
55

6+
// can be removed once we've on v3: https://github.com/typescript-eslint/typescript-eslint/issues/2060
7+
declare module '@typescript-eslint/experimental-utils/dist/ts-eslint/Rule' {
8+
export interface RuleMetaDataDocs {
9+
suggestion?: boolean;
10+
}
11+
}
12+
613
// copied from https://github.com/babel/babel/blob/d8da63c929f2d28c401571e2a43166678c555bc4/packages/babel-helpers/src/helpers.js#L602-L606
714
/* istanbul ignore next */
815
const interopRequireDefault = (obj: any): { default: any } =>

src/rules/no-test-callback.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ export default createRule({
88
category: 'Best Practices',
99
description: 'Avoid using a callback in asynchronous tests',
1010
recommended: false,
11+
suggestion: true,
1112
},
1213
messages: {
1314
illegalTestCallback: 'Illegal usage of test callback',
1415
suggestWrappingInPromise: 'Wrap in `new Promise({{ callback }} => ...`',
1516
useAwaitInsteadOfCallback:
1617
'Use await instead of callback in async functions',
1718
},
18-
fixable: 'code',
1919
schema: [],
2020
type: 'suggestion',
2121
},

src/rules/prefer-expect-assertions.ts

+1
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ export default createRule<[], MessageIds>({
6969
description:
7070
'Suggest using `expect.assertions()` OR `expect.hasAssertions()`',
7171
recommended: false,
72+
suggestion: true,
7273
},
7374
messages: {
7475
hasAssertionsTakesNoArguments:

src/rules/prefer-strict-equal.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ export default createRule({
1313
category: 'Best Practices',
1414
description: 'Suggest using toStrictEqual()',
1515
recommended: false,
16+
suggestion: true,
1617
},
1718
messages: {
1819
useToStrictEqual: 'Use `toStrictEqual()` instead',
1920
suggestReplaceWithStrictEqual: 'Replace with `toStrictEqual()`',
2021
},
21-
fixable: 'code',
2222
type: 'suggestion',
2323
schema: [],
2424
},

0 commit comments

Comments
 (0)