File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
packages/eslint-config-airbnb/test Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 1
1
import test from 'tape' ;
2
- import { CLIEngine } from 'eslint' ;
2
+ import { CLIEngine , ESLint } from 'eslint' ;
3
3
import eslintrc from '..' ;
4
4
import reactRules from '../rules/react' ;
5
5
import reactA11yRules from '../rules/react-a11y' ;
6
6
7
- const cli = new CLIEngine ( {
7
+ const cli = new ( CLIEngine || ESLint ) ( {
8
8
useEslintrc : false ,
9
9
baseConfig : eslintrc ,
10
10
@@ -19,7 +19,7 @@ const cli = new CLIEngine({
19
19
function lint ( text ) {
20
20
// @see https://eslint.org/docs/developer-guide/nodejs-api.html#executeonfiles
21
21
// @see https://eslint.org/docs/developer-guide/nodejs-api.html#executeontext
22
- const linter = cli . executeOnText ( text ) ;
22
+ const linter = CLIEngine ? cli . executeOnText ( text ) : cli . lintText ( text ) ;
23
23
return linter . results [ 0 ] ;
24
24
}
25
25
You can’t perform that action at this time.
0 commit comments