Skip to content

Commit be75630

Browse files
feat: support ESLint 7.x (#139)
Closes #138
1 parent a934cd7 commit be75630

7 files changed

+3991
-3988
lines changed

.travis.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ env:
66
matrix:
77
- ESLINT=5
88
- ESLINT=6
9+
- ESLINT=7
910

1011
node_js:
1112
- 10.12
@@ -22,7 +23,7 @@ jobs:
2223
- stage: release
2324
if: branch = master AND type != pull_request AND fork = false
2425
node_js: 14
25-
env: ESLINT=6
26+
env: ESLINT=7
2627
script: npm run build
2728
deploy:
2829
provider: script

lib/rules/consistent-data-testid.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ export const RULE_NAME = 'consistent-data-testid';
66
export type MessageIds = 'invalidTestId';
77
type Options = [
88
{
9-
testIdPattern: string;
109
testIdAttribute?: string | string[];
10+
testIdPattern: string;
1111
}
1212
];
1313

lib/rules/no-debug.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ import {
1313
} from '../node-utils';
1414

1515
export const RULE_NAME = 'no-debug';
16+
export type MessageIds = 'noDebug';
17+
type Options = [
18+
{ renderFunctions?: string[]; }
19+
];
1620

1721
function isRenderVariableDeclarator(
1822
node: TSESTree.VariableDeclarator,
@@ -45,7 +49,7 @@ function hasTestingLibraryImportModule(
4549
return LIBRARY_MODULES.some(module => module === literal.value);
4650
}
4751

48-
export default ESLintUtils.RuleCreator(getDocsUrl)({
52+
export default ESLintUtils.RuleCreator(getDocsUrl)<Options, MessageIds>({
4953
name: RULE_NAME,
5054
meta: {
5155
type: 'problem',

lib/rules/no-render-in-setup.ts

+7-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ import {
1212

1313
export const RULE_NAME = 'no-render-in-setup';
1414
export type MessageIds = 'noRenderInSetup';
15+
type Options = [
16+
{
17+
allowTestingFrameworkSetupHook?: string;
18+
renderFunctions?: string[];
19+
}
20+
];
1521

1622
export function findClosestBeforeHook(
1723
node: TSESTree.Node,
@@ -29,7 +35,7 @@ export function findClosestBeforeHook(
2935
return findClosestBeforeHook(node.parent, testingFrameworkSetupHooksToFilter);
3036
}
3137

32-
export default ESLintUtils.RuleCreator(getDocsUrl)({
38+
export default ESLintUtils.RuleCreator(getDocsUrl)<Options, MessageIds>({
3339
name: RULE_NAME,
3440
meta: {
3541
type: 'problem',

lib/rules/prefer-find-by.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,8 @@ import {
1515
import { getDocsUrl, SYNC_QUERIES_COMBINATIONS } from '../utils';
1616

1717
export const RULE_NAME = 'prefer-find-by';
18-
19-
type Options = [];
2018
export type MessageIds = 'preferFindBy';
19+
type Options = [];
2120

2221
export const WAIT_METHODS = ['waitFor', 'waitForElement', 'wait'];
2322

0 commit comments

Comments
 (0)