Skip to content

Commit 6f26349

Browse files
test: fix
1 parent 33a77cb commit 6f26349

File tree

2 files changed

+33
-5
lines changed

2 files changed

+33
-5
lines changed

test/config-for-tests/.eslintrc.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
module.exports = {
2+
root: true,
3+
globals: {
4+
__dirname: "readonly",
5+
__filename: "readonly",
6+
exports: "writable",
7+
module: "readonly",
8+
require: "readonly",
9+
},
10+
parserOptions: {
11+
ecmaVersion: 2018,
12+
env: {
13+
node: true,
14+
es6: true,
15+
},
16+
sourceType: "module",
17+
},
18+
rules: {
19+
"no-console": "warn",
20+
21+
"no-undef": "error",
22+
"no-var": "error",
23+
"no-unused-vars": "error",
24+
"prefer-const": "error",
25+
},
26+
};

test/utils/conf.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { join } from "node:path";
2+
import eslint from "eslint";
23

34
import ESLintPlugin from "../../src";
45

@@ -14,13 +15,14 @@ export default (entry, pluginConf = {}, webpackConf = {}) => {
1415
},
1516
plugins: [
1617
new ESLintPlugin({
17-
overrideConfigFile: join(
18-
testDir,
19-
"./config-for-tests/eslint.config.mjs",
20-
),
18+
configType:
19+
Number.parseFloat(eslint.ESLint.version) >= 9 ? "flat" : "eslintrc",
20+
overrideConfigFile:
21+
Number.parseFloat(eslint.ESLint.version) >= 9
22+
? join(testDir, "./config-for-tests/eslint.config.mjs")
23+
: join(testDir, "./config-for-tests/.eslintrc.js"),
2124
// this disables the use of .eslintignore, since it contains the fixtures
2225
// folder to skip it on the global linting, but here we want the opposite
23-
// (we only use .eslintignore on the test that checks this)
2426
ignore: false,
2527
// TODO: update tests to run both states: test.each([[{threads: false}], [{threads: true}]])('it should...', async ({threads}) => {...})
2628
threads: true,

0 commit comments

Comments
 (0)