-
Notifications
You must be signed in to change notification settings - Fork 47.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(eslint-plugin-react-hooks): Run with TS parsers >= 2.x (#19792)
* test(eslint-plugin-react-hooks): Run with TS parsers >= 2.x * name test suites for each parser
- Loading branch information
Showing
3 changed files
with
244 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7962,22 +7962,46 @@ if (!process.env.CI) { | |
testsTypescript.invalid = testsTypescript.invalid.filter(predicate); | ||
} | ||
|
||
const parserOptions = { | ||
ecmaVersion: 6, | ||
sourceType: 'module', | ||
}; | ||
|
||
new ESLintTester({ | ||
parser: require.resolve('babel-eslint'), | ||
parserOptions, | ||
}).run('react-hooks', ReactHooksESLintRule, tests); | ||
|
||
new ESLintTester({ | ||
parser: require.resolve('@babel/eslint-parser'), | ||
parserOptions, | ||
}).run('react-hooks', ReactHooksESLintRule, tests); | ||
describe('react-hooks', () => { | ||
const parserOptions = { | ||
ecmaVersion: 6, | ||
sourceType: 'module', | ||
}; | ||
|
||
new ESLintTester({ | ||
parser: require.resolve('@typescript-eslint/parser'), | ||
parserOptions, | ||
}).run('react-hooks', ReactHooksESLintRule, testsTypescript); | ||
new ESLintTester({ | ||
parser: require.resolve('babel-eslint'), | ||
parserOptions, | ||
}).run('parser: babel-eslint', ReactHooksESLintRule, tests); | ||
|
||
new ESLintTester({ | ||
parser: require.resolve('@babel/eslint-parser'), | ||
parserOptions, | ||
}).run('parser: @babel/eslint-parser', ReactHooksESLintRule, tests); | ||
|
||
new ESLintTester({ | ||
parser: require.resolve('@typescript-eslint/parser-v2'), | ||
parserOptions, | ||
}).run( | ||
'parser: @typescript-eslint/[email protected]', | ||
ReactHooksESLintRule, | ||
testsTypescript | ||
); | ||
|
||
new ESLintTester({ | ||
parser: require.resolve('@typescript-eslint/parser-v3'), | ||
parserOptions, | ||
}).run( | ||
'parser: @typescript-eslint/[email protected]', | ||
ReactHooksESLintRule, | ||
testsTypescript | ||
); | ||
|
||
new ESLintTester({ | ||
parser: require.resolve('@typescript-eslint/parser-v4'), | ||
parserOptions, | ||
}).run( | ||
'parser: @typescript-eslint/[email protected]', | ||
ReactHooksESLintRule, | ||
testsTypescript | ||
); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.