|
1 | 1 | import pack from './utils/pack'; |
| 2 | +import { ESLint } from 'eslint'; |
2 | 3 |
|
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 | + }; |
10 | 13 |
|
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: {}, |
15 | 20 | }, |
16 | | - rules: {}, |
17 | | - }, |
18 | | - }); |
| 21 | + }); |
19 | 22 |
|
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 | + }; |
27 | 30 |
|
28 | | - const compiler = pack('good', loaderOptions); |
| 31 | + const compiler = pack('good', loaderOptions); |
29 | 32 |
|
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