Skip to content

Commit

Permalink
feat: support ESLint 7.x (#139)
Browse files Browse the repository at this point in the history
Closes #138
  • Loading branch information
MichaelDeBoey committed Sep 20, 2020
1 parent a934cd7 commit be75630
Show file tree
Hide file tree
Showing 7 changed files with 3,991 additions and 3,988 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Expand Up @@ -6,6 +6,7 @@ env:
matrix:
- ESLINT=5
- ESLINT=6
- ESLINT=7

node_js:
- 10.12
Expand All @@ -22,7 +23,7 @@ jobs:
- stage: release
if: branch = master AND type != pull_request AND fork = false
node_js: 14
env: ESLINT=6
env: ESLINT=7
script: npm run build
deploy:
provider: script
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/consistent-data-testid.ts
Expand Up @@ -6,8 +6,8 @@ export const RULE_NAME = 'consistent-data-testid';
export type MessageIds = 'invalidTestId';
type Options = [
{
testIdPattern: string;
testIdAttribute?: string | string[];
testIdPattern: string;
}
];

Expand Down
6 changes: 5 additions & 1 deletion lib/rules/no-debug.ts
Expand Up @@ -13,6 +13,10 @@ import {
} from '../node-utils';

export const RULE_NAME = 'no-debug';
export type MessageIds = 'noDebug';
type Options = [
{ renderFunctions?: string[]; }
];

function isRenderVariableDeclarator(
node: TSESTree.VariableDeclarator,
Expand Down Expand Up @@ -45,7 +49,7 @@ function hasTestingLibraryImportModule(
return LIBRARY_MODULES.some(module => module === literal.value);
}

export default ESLintUtils.RuleCreator(getDocsUrl)({
export default ESLintUtils.RuleCreator(getDocsUrl)<Options, MessageIds>({
name: RULE_NAME,
meta: {
type: 'problem',
Expand Down
8 changes: 7 additions & 1 deletion lib/rules/no-render-in-setup.ts
Expand Up @@ -12,6 +12,12 @@ import {

export const RULE_NAME = 'no-render-in-setup';
export type MessageIds = 'noRenderInSetup';
type Options = [
{
allowTestingFrameworkSetupHook?: string;
renderFunctions?: string[];
}
];

export function findClosestBeforeHook(
node: TSESTree.Node,
Expand All @@ -29,7 +35,7 @@ export function findClosestBeforeHook(
return findClosestBeforeHook(node.parent, testingFrameworkSetupHooksToFilter);
}

export default ESLintUtils.RuleCreator(getDocsUrl)({
export default ESLintUtils.RuleCreator(getDocsUrl)<Options, MessageIds>({
name: RULE_NAME,
meta: {
type: 'problem',
Expand Down
3 changes: 1 addition & 2 deletions lib/rules/prefer-find-by.ts
Expand Up @@ -15,9 +15,8 @@ import {
import { getDocsUrl, SYNC_QUERIES_COMBINATIONS } from '../utils';

export const RULE_NAME = 'prefer-find-by';

type Options = [];
export type MessageIds = 'preferFindBy';
type Options = [];

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

Expand Down

0 comments on commit be75630

Please sign in to comment.