Skip to content

Commit 45949be

Browse files
committed
feat: support ESLint 7.x
1 parent a934cd7 commit 45949be

File tree

5 files changed

+3986
-3985
lines changed

5 files changed

+3986
-3985
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/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

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

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

1619
export function findClosestBeforeHook(
1720
node: TSESTree.Node,
@@ -29,7 +32,7 @@ export function findClosestBeforeHook(
2932
return findClosestBeforeHook(node.parent, testingFrameworkSetupHooksToFilter);
3033
}
3134

32-
export default ESLintUtils.RuleCreator(getDocsUrl)({
35+
export default ESLintUtils.RuleCreator(getDocsUrl)<Options, MessageIds>({
3336
name: RULE_NAME,
3437
meta: {
3538
type: 'problem',

0 commit comments

Comments
 (0)