Skip to content

Commit 1d01298

Browse files
author
tombertrand
committed
Add sorted import eslint rule
1 parent f4b46a7 commit 1d01298

File tree

141 files changed

+1310
-385
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

141 files changed

+1310
-385
lines changed

.eslintrc.json

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,31 @@
11
{
2-
"extends": "react-app"
2+
"extends": "react-app",
3+
"parserOptions": {
4+
"project": "./tsconfig.json"
5+
},
6+
"plugins": ["@typescript-eslint", "simple-import-sort"],
7+
"rules": {
8+
"simple-import-sort/imports": [
9+
"error",
10+
{
11+
"groups": [
12+
["^\\u0000"],
13+
["^react"],
14+
["^@?\\w"],
15+
["^"],
16+
["^api|components|i18n|pages|types"],
17+
["^\\."],
18+
["^.+\\u0000$"]
19+
]
20+
}
21+
],
22+
"import/order": "off",
23+
"no-restricted-imports": [
24+
"error",
25+
{
26+
"name": "lodash",
27+
"message": "Don't use default import for lodash, use \"import { module } from 'lodash/module'\" instead"
28+
}
29+
]
30+
}
331
}

babel.config.js

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,4 @@
11
module.exports = {
22
// presets: ["react-app"],
3-
plugins: [
4-
[
5-
'module-resolver',
6-
{
7-
root: ['./'],
8-
},
9-
],
10-
'@babel/plugin-proposal-optional-chaining',
11-
],
3+
plugins: ["@babel/plugin-proposal-optional-chaining"],
124
};

0 commit comments

Comments
 (0)