|
1 | | -import type { |
2 | | - ClassicConfig, |
3 | | - FlatConfig, |
4 | | - LooseRuleDefinition, |
5 | | - SharedConfig, |
6 | | -} from '@typescript-eslint/utils/ts-eslint' |
| 1 | +import type { LooseRuleDefinition } from '@typescript-eslint/utils/ts-eslint' |
| 2 | +import type { Linter } from 'eslint' |
7 | 3 |
|
8 | | -type UnoCSSEslintRuleEntry = SharedConfig.RuleLevel |
| 4 | +type UnocssEnforceClassCompile = [] | [{ |
| 5 | + prefix?: string |
| 6 | + enableFix?: boolean |
| 7 | +}] |
| 8 | + |
| 9 | +type UnocssOrder = [] | [{ |
| 10 | + unoFunctions?: string[] |
| 11 | + unoVariables?: string[] |
| 12 | +}] |
9 | 13 |
|
10 | 14 | export interface UnoCSSEslintPlugin { |
11 | 15 | rules: Record<string, LooseRuleDefinition> |
12 | 16 | } |
13 | 17 |
|
14 | | -export interface UnoCSSEslintFlatConfig extends FlatConfig.Config { |
| 18 | +export interface UnoCSSEslintFlatConfig extends Linter.Config { |
15 | 19 | plugins: { |
16 | | - unocss: UnoCSSEslintPlugin |
| 20 | + unocss: any |
17 | 21 | } |
18 | 22 | rules: { |
19 | | - readonly 'unocss/order': UnoCSSEslintRuleEntry |
20 | | - readonly 'unocss/order-attributify': UnoCSSEslintRuleEntry |
| 23 | + readonly 'unocss/order': Linter.RuleEntry<UnocssOrder> |
| 24 | + readonly 'unocss/order-attributify': Linter.RuleEntry<[]> |
| 25 | + readonly 'unocss/blocklist'?: Linter.RuleEntry<[]> |
| 26 | + readonly 'unocss/enforce-class-compile'?: Linter.RuleEntry<UnocssEnforceClassCompile> |
21 | 27 | } |
22 | 28 | } |
23 | 29 |
|
24 | | -export interface UnoCSSEslintRecommendedConfig extends ClassicConfig.Config { |
| 30 | +export interface UnoCSSEslintRecommendedConfig extends Linter.LegacyConfig { |
25 | 31 | rules: { |
26 | | - readonly '@unocss/order': UnoCSSEslintRuleEntry |
27 | | - readonly '@unocss/order-attributify': UnoCSSEslintRuleEntry |
| 32 | + readonly '@unocss/order': Linter.RuleEntry<UnocssOrder> |
| 33 | + readonly '@unocss/order-attributify': Linter.RuleEntry<[]> |
| 34 | + readonly '@unocss/blocklist'?: Linter.RuleEntry<[]> |
| 35 | + readonly '@unocss/enforce-class-compile'?: Linter.RuleEntry<UnocssEnforceClassCompile> |
28 | 36 | } |
29 | 37 | } |
30 | 38 |
|
|
0 commit comments