|
20 | 20 | "files": ["*.ts"],
|
21 | 21 | "rules": {
|
22 | 22 | "require-await": "off",
|
23 |
| - "@typescript-eslint/require-await": "error" |
| 23 | + "@typescript-eslint/require-await": "error", |
| 24 | + "@typescript-eslint/consistent-type-imports": [ |
| 25 | + "error", |
| 26 | + { |
| 27 | + "disallowTypeAnnotations": false, // Used in tests |
| 28 | + "prefer": "type-imports", |
| 29 | + "fixStyle": "inline-type-imports" |
| 30 | + } |
| 31 | + ] |
24 | 32 | }
|
25 | 33 | },
|
26 | 34 | {
|
|
42 | 50 | "import/order": [
|
43 | 51 | "error",
|
44 | 52 | {
|
45 |
| - "alphabetize": { |
46 |
| - "order": "asc" |
47 |
| - }, |
48 |
| - "groups": [["builtin", "external", "internal"], "parent", "sibling"] |
| 53 | + "groups": [ |
| 54 | + ["builtin", "external"], |
| 55 | + "internal", |
| 56 | + ["parent", "sibling", "index"], |
| 57 | + "type" |
| 58 | + ], |
| 59 | + "pathGroups": [ |
| 60 | + { "pattern": "@/**", "group": "internal", "position": "after" } |
| 61 | + ], |
| 62 | + // Don't reclassify real externals like @babel/* into the alias group |
| 63 | + "pathGroupsExcludedImportTypes": ["builtin", "external"], |
| 64 | + "newlines-between": "always", |
| 65 | + "alphabetize": { "order": "asc", "caseInsensitive": true }, |
| 66 | + "distinctGroup": true // separates type imports into the "type" group |
49 | 67 | }
|
50 | 68 | ],
|
| 69 | + // Prevent duplicates and prefer merging into a single import |
| 70 | + "no-duplicate-imports": "off", |
| 71 | + "import/no-duplicates": ["error", { "prefer-inline": true }], |
51 | 72 | "import/no-unresolved": [
|
52 | 73 | "error",
|
53 | 74 | {
|
|
72 | 93 | "ignorePatterns": ["out", "dist", "**/*.d.ts"],
|
73 | 94 | "settings": {
|
74 | 95 | "import/resolver": {
|
75 |
| - "typescript": {} |
76 |
| - } |
| 96 | + "typescript": { "project": "./tsconfig.json" } |
| 97 | + }, |
| 98 | + "import/internal-regex": "^@/" |
77 | 99 | }
|
78 | 100 | }
|
0 commit comments