You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add `"simple-import-sort"` to `"plugins"` in your .eslintrc:
73
-
74
-
```json
75
-
{
76
-
"plugins": ["simple-import-sort"]
77
-
}
78
-
```
79
-
80
-
Then add the rules for sorting imports and exports:
81
-
82
-
```json
83
-
{
84
-
"rules": {
85
-
"simple-import-sort/imports": "error",
86
-
"simple-import-sort/exports": "error"
72
+
-[eslintrc]: Add `"simple-import-sort"` to the "plugins" array in your `.eslintrc.*` file, and add the rules for sorting imports and exports. By default ESLint doesn’t parse `import` syntax – the "parserOptions" is an example of how to enable that.
73
+
74
+
```json
75
+
{
76
+
"plugins": ["simple-import-sort"],
77
+
"rules": {
78
+
"simple-import-sort/imports": "error",
79
+
"simple-import-sort/exports": "error"
80
+
},
81
+
"parserOptions": {
82
+
"sourceType": "module",
83
+
"ecmaVersion": "latest"
84
+
}
87
85
}
88
-
}
89
-
```
86
+
```
87
+
88
+
-[eslint.config.js (flat config)]: Import eslint-plugin-simple-import-sort, put it in the `plugins` object, and add the rules for sorting imports and exports. With flat config, `import` syntax is enabled by default.
0 commit comments