Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Support ESLint 7.x #139

Merged
merged 1 commit into from Sep 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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