Skip to content

Commit d1a5196

Browse files
committedJun 18, 2023
feat: use simple-import-sort to sort imports
1 parent 2271da1 commit d1a5196

File tree

3 files changed

+24
-8
lines changed

3 files changed

+24
-8
lines changed
 

‎packages/eslint-config-basic/index.js

+9-8
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ module.exports = defineConfig({
3838
"unicorn",
3939
"unused-imports",
4040
"no-only-tests",
41+
"simple-import-sort",
4142
],
4243
extends: [
4344
"./standard",
@@ -287,20 +288,20 @@ module.exports = defineConfig({
287288
],
288289
rules: {
289290
// import
290-
"import/order": [
291-
"error",
292-
{
293-
"newlines-between": "always",
294-
"warnOnUnassignedImports": true,
295-
"alphabetize": { order: "asc", caseInsensitive: true },
296-
},
297-
],
298291
"import/first": "error",
299292
"import/no-mutable-exports": "error",
300293
"import/no-unresolved": "off",
301294
"import/no-absolute-path": "off",
302295
"import/namespace": "off", // Disable this for better performance
303296

297+
"simple-import-sort/imports": [
298+
"error",
299+
{
300+
groups: [["^node:"], ["^@?\\w"], ["^"], ["^\\u0000"], ["^\\."]],
301+
},
302+
],
303+
"simple-import-sort/exports": "error",
304+
304305
// array-func
305306
"array-func/prefer-array-from": "off",
306307

‎packages/eslint-config-basic/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
"eslint-plugin-no-only-tests": "^3.1.0",
4949
"eslint-plugin-promise": "^6.1.1",
5050
"eslint-plugin-regexp": "^1.15.0",
51+
"eslint-plugin-simple-import-sort": "^10.0.0",
5152
"eslint-plugin-toml": "^0.5.0",
5253
"eslint-plugin-unicorn": "^47.0.0",
5354
"eslint-plugin-unused-imports": "^2.0.0",

‎pnpm-lock.yaml

+14
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)
Please sign in to comment.