-
Notifications
You must be signed in to change notification settings - Fork 1
/
.eslintrc
76 lines (76 loc) · 2.27 KB
/
.eslintrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
{
"plugins": ["import", "simple-import-sort", "prettier", "testing-library"],
"extends": ["eslint:recommended", "prettier"],
"overrides": [
{
"files": ["*.ts", "*.tsx"],
"extends": ["react-app", "plugin:@typescript-eslint/recommended"],
"parser": "@typescript-eslint/parser"
},
{
"files": ["*.stories.*"],
"rules": {
"@typescript-eslint/explicit-module-boundary-types": "off"
}
},
{
"files": [
"**/__tests__/**/*.[jt]s?(x)",
"**/?(*.)+(spec|test).[jt]s?(x)"
],
"extends": ["react-app/jest", "plugin:testing-library/react"],
"rules": {
"@typescript-eslint/no-non-null-assertion": "off",
"no-multi-str": "off"
}
}
],
"ignorePatterns": ["build/**/*", "!.storybook", "tsconfig.json"],
"env": { "es6": true },
"parserOptions": {
"ecmaVersion": 2018,
"sourceType": "module"
},
"rules": {
// Rules for auto sort of imports
"simple-import-sort/imports": [
"error",
{
"groups": [
// Side effect imports.
["^\\u0000"],
// Packages.
// Packages. `react` related packages come first.
// Things that start with a letter (or digit or underscore), or
// `@` followed by a letter.
["^react", "^@?\\w"],
// Root imports
// Shared imports should be separate from application imports.
["^(shared)(/.*|$)"],
["^(typings)(/.*|$)"],
[
"^(app)(/.*|$)",
"^(assets|theme)(/.*|$)",
"^(contexts)(/.*|$)",
"^(constants)(/.*|$)",
"^(hooks)(/.*|$)",
"^(utils)(/.*|$)",
"^(services)(/.*|$)",
"^(components)(/.*|$)",
"^(types)(/.*|$)",
"^(templates)(/.*|$)"
],
["^(pages)(/.*|$)", "^(features)(/.*|$)"],
// Parent imports. Put `..` last.
["^\\.\\.(?!/?$)", "^\\.\\./?$"],
// Other relative imports. Put same-folder imports and `.` last.
["^\\./(?=.*/)(?!/?$)", "^\\.(?!/?$)", "^\\./?$"]
]
}
],
"simple-import-sort/exports": "error",
"import/first": "error",
"import/newline-after-import": "error",
"import/no-duplicates": "error"
}
}