Skip to content

Commit 4bc5785

Browse files
committed
Remove places where CLIEngine is used
1 parent 81aa4c6 commit 4bc5785

File tree

1 file changed

+10
-22
lines changed

1 file changed

+10
-22
lines changed

tests/lib/util/define-regexp-handler.js

+10-22
Original file line numberDiff line numberDiff line change
@@ -36,30 +36,18 @@ describe("define-regexp-handler", () => {
3636
})
3737

3838
function lint(text) {
39-
if (ESLint) {
40-
const eslint = new ESLint({
41-
cwd: TEST_CWD,
42-
plugins: { "eslint-plugin-es-x": plugin },
43-
useEslintrc: false,
44-
overrideConfig: {
45-
parserOptions: {
46-
ecmaVersion: 2019,
47-
},
48-
plugins: ["es-x"],
49-
},
50-
})
51-
return eslint
52-
.lintText(text, { filePath: "test.js" })
53-
.then((results) => results[0])
54-
}
55-
const engine = new (require("eslint").CLIEngine)({
39+
const eslint = new ESLint({
5640
cwd: TEST_CWD,
41+
plugins: { "eslint-plugin-es-x": plugin },
5742
useEslintrc: false,
58-
plugins: ["es-x"],
59-
parserOptions: {
60-
ecmaVersion: 2019,
43+
overrideConfig: {
44+
parserOptions: {
45+
ecmaVersion: 2019,
46+
},
47+
plugins: ["es-x"],
6148
},
6249
})
63-
engine.addPlugin("eslint-plugin-es-x", plugin)
64-
return Promise.resolve(engine.executeOnText(text, "test.js").results[0])
50+
return eslint
51+
.lintText(text, { filePath: "test.js" })
52+
.then((results) => results[0])
6553
}

0 commit comments

Comments
 (0)