forked from dennis-kurochkin/servicepro-web
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.cjs
94 lines (94 loc) · 2.78 KB
/
.eslintrc.cjs
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
88
89
90
91
92
93
94
module.exports = {
root: true,
env: { browser: true, es2020: true },
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react-hooks/recommended',
],
ignorePatterns: ['dist', '.eslintrc.cjs'],
parser: '@typescript-eslint/parser',
plugins: [
'react-refresh',
"react",
"unused-imports",
"no-relative-import-paths",
"import",
],
rules: {
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
"quotes": ["error", "single"],
"semi": ["error", "never"],
"no-trailing-spaces": ["error"],
"indent": ["error", 2, { "SwitchCase": 1 }],
"no-multiple-empty-lines": ["error", { "max": 1 } ],
"comma-dangle": ["error", {
"arrays": "always-multiline",
"objects": "always-multiline",
"imports": "always-multiline",
"exports": "always-multiline"
}],
"object-curly-spacing": ["error", "always"],
"space-before-blocks": ["error", { "functions": "always", "keywords": "always", "classes": "always" }],
"space-before-function-paren": ["error", {"anonymous": "never", "named": "never", "asyncArrow": "always"}],
"no-multi-spaces": ["error"],
"eol-last": ["error", "always"],
"unused-imports/no-unused-imports": "error",
'no-unused-vars': 'warn',
"react/jsx-max-props-per-line": ["error", { "maximum": 1 }],
"react/jsx-sort-props": ["warn", {
"callbacksLast": true,
"shorthandLast": true,
"noSortAlphabetically": true,
"reservedFirst": true
}],
"react/jsx-boolean-value": ["error", "never"],
"react/jsx-closing-bracket-location": ["error"],
"react/jsx-closing-tag-location": ["error"],
"no-relative-import-paths/no-relative-import-paths": [
"warn",
{ "allowSameFolder": true, "rootDir": "src" }
],
"import/order": ["error", {
"newlines-between": "never",
"groups": [
"builtin",
"external",
"internal",
"parent",
"sibling",
"index"
],
"pathGroupsExcludedImportTypes": [],
"pathGroups": [
{
"pattern": "react*",
"group": "builtin",
"position": "after"
},
{
"pattern": "react*/**",
"group": "external",
"position": "before"
},
{
"pattern": "+(App|api|components|consts|data|features|hooks|pages|services|store|types|helpers)*/**",
"group": "index",
"position": "after"
},
{
"pattern": "+(App|api|components|consts|data|features|hooks|pages|services|store|types|helpers)*",
"group": "index",
"position": "after"
}
],
"alphabetize": {
"order": "asc",
"caseInsensitive": true,
}
}]
},
}