|
1 | 1 | import antfu from "@antfu/eslint-config" |
2 | 2 |
|
| 3 | +const sortImports = { |
| 4 | + "perfectionist/sort-imports": [ |
| 5 | + "error", |
| 6 | + { |
| 7 | + type: "natural", |
| 8 | + internalPattern: ["^@/", "^~/", "^#[a-zA-Z0-9-]+/"], |
| 9 | + newlinesBetween: "always", |
| 10 | + groups: [ |
| 11 | + ["builtin", "builtin-type"], |
| 12 | + ["external", "external-type"], |
| 13 | + ["internal", "internal-type"], |
| 14 | + ["parent", "parent-type"], |
| 15 | + ["sibling", "sibling-type"], |
| 16 | + ["index", "index-type"], |
| 17 | + "object", |
| 18 | + "unknown", |
| 19 | + ], |
| 20 | + }, |
| 21 | + ], |
| 22 | +} |
| 23 | + |
3 | 24 | export default antfu({ |
4 | 25 | ignores: ["**/*.json"], |
5 | 26 | markdown: false, |
6 | 27 | stylistic: false, |
7 | 28 | jsonc: false, |
8 | 29 | jsx: false, |
9 | 30 | toml: false, |
10 | | - yaml: false, |
11 | 31 | test: { overrides: { "test/no-import-node-test": "off" } }, |
12 | 32 | typescript: { |
13 | 33 | tsconfigPath: "tsconfig.json", |
| 34 | + ignoresTypeAware: ["copy.ts", "*.config.*"], |
| 35 | + |
| 36 | + overridesTypeAware: { |
| 37 | + "ts/no-floating-promises": [ |
| 38 | + "error", |
| 39 | + { |
| 40 | + allowForKnownSafeCalls: [ |
| 41 | + { from: "package", package: "node:test", name: ["describe", "it", "test"] }, |
| 42 | + ], |
| 43 | + }, |
| 44 | + ], |
| 45 | + }, |
| 46 | + |
14 | 47 | overrides: { |
15 | 48 | "no-console": "off", |
16 | | - "ts/no-use-before-define": "off", |
| 49 | + "antfu/no-top-level-await": "off", |
| 50 | + "node/prefer-global/process": "off", |
17 | 51 | "ts/consistent-type-definitions": "off", |
18 | 52 | "ts/consistent-type-imports": ["error", { fixStyle: "inline-type-imports" }], |
19 | 53 | "ts/no-unsafe-argument": "off", |
20 | 54 | "ts/no-unsafe-assignment": "off", |
21 | | - "node/prefer-global/process": "off", |
22 | | - "antfu/no-top-level-await": "off", |
23 | | - "import/consistent-type-specifier-style": "off", |
| 55 | + "ts/no-use-before-define": "off", |
| 56 | + "unused-imports/no-unused-vars": "off", |
24 | 57 |
|
25 | | - "perfectionist/sort-imports": [ |
26 | | - "error", |
27 | | - { |
28 | | - type: "natural", |
29 | | - internalPattern: ["^@/", "^~/", "^#[a-zA-Z0-9-]+/"], |
30 | | - newlinesBetween: "always", |
31 | | - groups: [ |
32 | | - ["builtin", "builtin-type"], |
33 | | - ["external", "external-type"], |
34 | | - ["internal", "internal-type"], |
35 | | - ["parent", "parent-type"], |
36 | | - ["sibling", "sibling-type"], |
37 | | - ["index", "index-type"], |
38 | | - "object", |
39 | | - "unknown", |
40 | | - ], |
41 | | - }, |
42 | | - ], |
| 58 | + ...sortImports, |
43 | 59 | }, |
44 | 60 | }, |
45 | 61 | }) |
0 commit comments