-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.json
87 lines (87 loc) · 2.27 KB
/
.eslintrc.json
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
77
78
79
80
81
82
83
84
85
86
87
{
"env": {
"browser": true,
"es2021": true,
"jest": true
},
"extends": [
"eslint:recommended",
"plugin:react/recommended",
"plugin:storybook/recommended",
"plugin:@typescript-eslint/recommended",
"prettier"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": ["react", "@typescript-eslint", "react-hooks", "simple-import-sort"],
"rules": {
"prefer-const": "error",
"react/jsx-uses-react": "off",
"react/react-in-jsx-scope": "off",
"react/display-name": "off",
"react/prop-types": "off",
"react/jsx-props-no-spreading": "off",
"simple-import-sort/imports": "error",
"simple-import-sort/exports": "error",
"no-undef": "off",
"@typescript-eslint/triple-slash-reference": "off",
"@typescript-eslint/no-unused-vars": "warn",
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/ban-ts-comment": "off",
"max-len": [
"warn",
{
"code": 120,
"ignoreComments": true,
"ignoreStrings": true,
"ignoreTemplateLiterals": true
}
]
},
"overrides": [
{
"files": ["**/*.js", "**/*.ts", "**/*.tsx"],
"rules": {
"simple-import-sort/imports": [
"error",
{
"groups": [
["^react$", "^[a-z]", "^@[a-z]"],
["^@/"],
["^\\.\\.(?!/?$)", "^\\.\\./?$"],
["^\\./(?=.*/)(?!/?$)", "^\\.(?!/?$)", "^\\./?$"],
["^.+\\.s?css$"],
["^\\u0000"]
]
}
],
"no-restricted-imports": [
"error",
{
"patterns": [
{
"group": ["@/entities/*/**", "@/features/*/*/**", "@/widgets/*/**", "@/pages/*/**"],
"message": "Direct access to the internal parts of the module is prohibited"
},
{
"group": ["../**/entities", "../**/features", "../**/widgets", "../**/pages"],
"message": "Prefer absolute imports instead of relatives"
}
]
}
]
}
}
],
"settings": {
"react": {
"version": "detect"
}
}
}