Skip to content

Commit 095ee0d

Browse files
committed
fix: restrict circular plugin support to eslint ^9
1 parent 02793cb commit 095ee0d

File tree

1 file changed

+31
-27
lines changed

1 file changed

+31
-27
lines changed

test/circular-plugin.test.js

Lines changed: 31 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,38 @@
11
import pack from './utils/pack';
2+
import { ESLint } from 'eslint';
23

3-
describe('circular plugin', () => {
4-
it('should support plugins with circular configs', async () => {
5-
const plugin = {
6-
configs: {},
7-
rules: {},
8-
processors: {},
9-
};
4+
(ESLint && parseFloat(ESLint.version) < 9 ? describe.skip : describe)(
5+
'circular plugin',
6+
() => {
7+
it('should support plugins with circular configs', async () => {
8+
const plugin = {
9+
configs: {},
10+
rules: {},
11+
processors: {},
12+
};
1013

11-
Object.assign(plugin.configs, {
12-
recommended: {
13-
plugins: {
14-
self: plugin,
14+
Object.assign(plugin.configs, {
15+
recommended: {
16+
plugins: {
17+
self: plugin,
18+
},
19+
rules: {},
1520
},
16-
rules: {},
17-
},
18-
});
21+
});
1922

20-
const loaderOptions = {
21-
configType: 'flat',
22-
overrideConfig: {
23-
plugins: { plugin: plugin },
24-
},
25-
overrideConfigFile: true,
26-
};
23+
const loaderOptions = {
24+
configType: 'flat',
25+
overrideConfig: {
26+
plugins: { plugin: plugin },
27+
},
28+
overrideConfigFile: true,
29+
};
2730

28-
const compiler = pack('good', loaderOptions);
31+
const compiler = pack('good', loaderOptions);
2932

30-
const stats = await compiler.runAsync();
31-
expect(stats.hasWarnings()).toBe(false);
32-
expect(stats.hasErrors()).toBe(false);
33-
});
34-
});
33+
const stats = await compiler.runAsync();
34+
expect(stats.hasWarnings()).toBe(false);
35+
expect(stats.hasErrors()).toBe(false);
36+
});
37+
},
38+
);

0 commit comments

Comments
 (0)