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 11import test from 'tape' ;
2- import { CLIEngine } from 'eslint' ;
2+ import { CLIEngine , ESLint } from 'eslint' ;
33import eslintrc from '..' ;
44import reactRules from '../rules/react' ;
55import reactA11yRules from '../rules/react-a11y' ;
66
7- const cli = new CLIEngine ( {
7+ const cli = new ( CLIEngine || ESLint ) ( {
88 useEslintrc : false ,
99 baseConfig : eslintrc ,
1010
@@ -19,7 +19,7 @@ const cli = new CLIEngine({
1919function lint ( text ) {
2020 // @see https://eslint.org/docs/developer-guide/nodejs-api.html#executeonfiles
2121 // @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 ) ;
2323 return linter . results [ 0 ] ;
2424}
2525
You can’t perform that action at this time.
0 commit comments