|
15 | 15 | "jsx": true |
16 | 16 | } |
17 | 17 | }, |
18 | | - "plugins": ["unicorn", "react-hooks", "no-unsanitized", "header", "import"], |
| 18 | + "plugins": ["unicorn", "react-hooks", "no-unsanitized", "header", "import", "simple-import-sort"], |
19 | 19 | "rules": { |
20 | 20 | "@typescript-eslint/no-unused-vars": "error", |
21 | 21 | "@typescript-eslint/consistent-type-definitions": ["error", "interface"], |
|
69 | 69 | ] |
70 | 70 | } |
71 | 71 | ], |
72 | | - "sort-imports": ["error", { "ignoreDeclarationSort": true }], |
73 | | - "import/order": ["error", { "alphabetize": { "order": "asc" } }], |
74 | 72 | "import/no-useless-path-segments": [ |
75 | 73 | "warn", |
76 | 74 | { |
77 | 75 | "noUselessIndex": true |
78 | 76 | } |
79 | | - ] |
| 77 | + ], |
| 78 | + "simple-import-sort/imports": "error" |
80 | 79 | }, |
81 | 80 | "settings": { |
82 | 81 | "react": { |
|
98 | 97 | "env": { |
99 | 98 | "jest": true |
100 | 99 | } |
| 100 | + }, |
| 101 | + { |
| 102 | + "files": ["src/**", "pages/**", "test/**", "scripts/**"], |
| 103 | + "rules": { |
| 104 | + "simple-import-sort/imports": [ |
| 105 | + "error", |
| 106 | + { |
| 107 | + "groups": [ |
| 108 | + // External packages come first. |
| 109 | + ["^react", "^(?!@cloudscape)@?\\w"], |
| 110 | + // Cloudscape packages. |
| 111 | + ["^@cloudscape"], |
| 112 | + // Things that start with a letter (or digit or underscore), or `~` followed by a letter. |
| 113 | + ["^~\\w"], |
| 114 | + // Anything not matched in another group. |
| 115 | + ["^"], |
| 116 | + // Styles come last. |
| 117 | + [ |
| 118 | + "^.+\\.?(css)$","^.+\\.?(css.js)$", "^.+\\.?(scss)$", "^.+\\.?(selectors.js)$" |
| 119 | + ] |
| 120 | + ] |
| 121 | + } |
| 122 | + ] |
| 123 | + } |
101 | 124 | } |
102 | 125 | ] |
103 | 126 | } |
0 commit comments