Skip to content

Commit f550ded

Browse files
committed
[eslint config] [tests] fix for eslint 7
1 parent 562e351 commit f550ded

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/eslint-config-airbnb/test/test-react-order.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import test from 'tape';
2-
import { CLIEngine } from 'eslint';
2+
import { CLIEngine, ESLint } from 'eslint';
33
import eslintrc from '..';
44
import reactRules from '../rules/react';
55
import 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({
1919
function 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

0 commit comments

Comments
 (0)