GeezerVison is showing github.com — test(eslint-plugin-react-hooks): Run with TS parsers >= 2.x (#19792) · react/react@ed4fdfc
File treeExpand file treeCollapse file tree Open diff view settings packages/eslint-plugin-react-hooks
Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: packages/eslint-plugin-react-hooks/__tests__/ESLintRuleExhaustiveDeps-test.js +42-18Lines changed: 42 additions & 18 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -7962,22 +7962,46 @@ if (!process.env.CI) { | 7962 | 7962 | testsTypescript.invalid = testsTypescript.invalid.filter(predicate); | 7963 | 7963 | } | 7964 | 7964 |
| 7965 | | -const parserOptions = { | 7966 | | - ecmaVersion: 6, | 7967 | | - sourceType: 'module', | 7968 | | -}; | 7969 | | - | 7970 | | -new ESLintTester({ | 7971 | | - parser: require.resolve('babel-eslint'), | 7972 | | - parserOptions, | 7973 | | -}).run('react-hooks', ReactHooksESLintRule, tests); | 7974 | | - | 7975 | | -new ESLintTester({ | 7976 | | - parser: require.resolve('@babel/eslint-parser'), | 7977 | | - parserOptions, | 7978 | | -}).run('react-hooks', ReactHooksESLintRule, tests); | | 7965 | +describe('react-hooks', () => { | | 7966 | + const parserOptions = { | | 7967 | + ecmaVersion: 6, | | 7968 | + sourceType: 'module', | | 7969 | + }; | 7979 | 7970 |
| 7980 | | -new ESLintTester({ | 7981 | | - parser: require.resolve('@typescript-eslint/parser'), | 7982 | | - parserOptions, | 7983 | | -}).run('react-hooks', ReactHooksESLintRule, testsTypescript); | | 7971 | + new ESLintTester({ | | 7972 | + parser: require.resolve('babel-eslint'), | | 7973 | + parserOptions, | | 7974 | + }).run('parser: babel-eslint', ReactHooksESLintRule, tests); | | 7975 | + | | 7976 | + new ESLintTester({ | | 7977 | + parser: require.resolve('@babel/eslint-parser'), | | 7978 | + parserOptions, | | 7979 | + }).run('parser: @babel/eslint-parser', ReactHooksESLintRule, tests); | | 7980 | + | | 7981 | + new ESLintTester({ | | 7982 | + parser: require.resolve('@typescript-eslint/parser-v2'), | | 7983 | + parserOptions, | | 7984 | + }).run( | | 7985 | + | | 7986 | + ReactHooksESLintRule, | | 7987 | + testsTypescript | | 7988 | + ); | | 7989 | + | | 7990 | + new ESLintTester({ | | 7991 | + parser: require.resolve('@typescript-eslint/parser-v3'), | | 7992 | + parserOptions, | | 7993 | + }).run( | | 7994 | + | | 7995 | + ReactHooksESLintRule, | | 7996 | + testsTypescript | | 7997 | + ); | | 7998 | + | | 7999 | + new ESLintTester({ | | 8000 | + parser: require.resolve('@typescript-eslint/parser-v4'), | | 8001 | + parserOptions, | | 8002 | + }).run( | | 8003 | + | | 8004 | + ReactHooksESLintRule, | | 8005 | + testsTypescript | | 8006 | + ); | | 8007 | +}); |
Collapse file Copy file name to clipboardExpand all lines: packages/eslint-plugin-react-hooks/package.json +3-1Lines changed: 3 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 32 | 32 | "eslint": "^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0" | 33 | 33 | }, | 34 | 34 | "devDependencies": { | 35 | | - "@typescript-eslint/parser": "^2.26.0" | | 35 | + "@typescript-eslint/parser-v2": "npm:@typescript-eslint/parser@^2.26.0", | | 36 | + "@typescript-eslint/parser-v3": "npm:@typescript-eslint/parser@^3.10.0", | | 37 | + "@typescript-eslint/parser-v4": "npm:@typescript-eslint/parser@^4.1.0" | 36 | 38 | } | 37 | 39 | } |
|