11import { join } from "node:path" ;
2-
2+ import eslint from "eslint" ;
33import ESLintPlugin from "../src" ;
4-
54import pack from "./utils/pack" ;
65
6+ const configType =
7+ Number . parseFloat ( eslint . ESLint . version ) >= 9 ? "flat" : "eslintrc" ;
8+ const config =
9+ Number . parseFloat ( eslint . ESLint . version ) >= 9
10+ ? join ( __dirname , "./config-for-tests/eslint.config.mjs" )
11+ : join ( __dirname , "./config-for-tests/.eslintrc.js" ) ;
12+
713describe ( "multiple instances" , ( ) => {
814 it ( "should don't fail" , async ( ) => {
915 const compiler = pack (
@@ -12,18 +18,14 @@ describe("multiple instances", () => {
1218 {
1319 plugins : [
1420 new ESLintPlugin ( {
15- overrideConfigFile : join (
16- __dirname ,
17- "./config-for-tests/eslint.config.mjs" ,
18- ) ,
21+ configType,
22+ overrideConfigFile : config ,
1923 ignore : false ,
2024 exclude : "error.js" ,
2125 } ) ,
2226 new ESLintPlugin ( {
23- overrideConfigFile : join (
24- __dirname ,
25- "./config-for-tests/eslint.config.mjs" ,
26- ) ,
27+ configType,
28+ overrideConfigFile : config ,
2729 ignore : false ,
2830 exclude : "error.js" ,
2931 } ) ,
@@ -43,18 +45,14 @@ describe("multiple instances", () => {
4345 {
4446 plugins : [
4547 new ESLintPlugin ( {
46- overrideConfigFile : join (
47- __dirname ,
48- "./config-for-tests/eslint.config.mjs" ,
49- ) ,
48+ configType,
49+ overrideConfigFile : config ,
5050 ignore : false ,
5151 exclude : "good.js" ,
5252 } ) ,
5353 new ESLintPlugin ( {
54- overrideConfigFile : join (
55- __dirname ,
56- "./config-for-tests/eslint.config.mjs" ,
57- ) ,
54+ configType,
55+ overrideConfigFile : config ,
5856 ignore : false ,
5957 exclude : "error.js" ,
6058 } ) ,
@@ -72,18 +70,14 @@ describe("multiple instances", () => {
7270 {
7371 plugins : [
7472 new ESLintPlugin ( {
75- overrideConfigFile : join (
76- __dirname ,
77- "./config-for-tests/eslint.config.mjs" ,
78- ) ,
73+ configType,
74+ overrideConfigFile : config ,
7975 ignore : false ,
8076 exclude : "error.js" ,
8177 } ) ,
8278 new ESLintPlugin ( {
83- overrideConfigFile : join (
84- __dirname ,
85- "./config-for-tests/eslint.config.mjs" ,
86- ) ,
79+ configType,
80+ overrideConfigFile : config ,
8781 ignore : false ,
8882 exclude : "good.js" ,
8983 } ) ,
0 commit comments