-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy path.eslintrc.json
165 lines (165 loc) · 4.09 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
{
"env": {
// Browser global variables like `window` etc.
"browser": true,
// CommonJS global variables and CommonJS scoping.Allows require, exports and module.
"commonjs": true,
// Enable all ECMAScript 6 features except for modules.
"es6": true,
// Jest global variables like `it` etc.
"jest": true,
// Defines things like process.env when generating through node
"node": true
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:react/recommended",
"plugin:jsx-a11y/recommended",
"plugin:react-hooks/recommended",
"plugin:jest/recommended",
"plugin:testing-library/react",
"plugin:react/jsx-runtime",
"plugin:typescript-sort-keys/recommended",
"plugin:storybook/recommended"
],
"root": true,
"ignorePatterns": ["**/*"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
// Allows for the parsing of modern ECMAScript features
"ecmaVersion": 2018,
// Allows for the use of imports
"sourceType": "module"
},
"plugins": [
"@nx",
"@typescript-eslint",
"import",
"sort-keys-fix",
"typescript-sort-keys"
],
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"rules": {
"@nx/enforce-module-boundaries": [
"error",
{
"enforceBuildableLibDependency": true,
"allow": [],
"depConstraints": [
{
"sourceTag": "*",
"onlyDependOnLibsWithTags": ["*"]
}
]
}
]
}
},
{
"files": ["*.ts", "*.tsx"],
"extends": ["plugin:@nx/typescript"],
"rules": {
"testing-library/prefer-screen-queries": 0,
"comma-dangle": [
"error",
{
"arrays": "always-multiline",
"exports": "only-multiline",
"functions": "never",
"imports": "only-multiline",
"objects": "only-multiline"
}
],
"eol-last": "error",
"import/order": [
"warn",
{
"groups": [
"builtin",
"external",
"index",
"sibling",
"parent",
"internal"
]
}
],
"jsx-quotes": ["warn", "prefer-double"],
"max-len": [
"warn",
{
"code": 120,
"ignorePattern": "d=\"([\\s\\S]*?)\""
}
],
"no-console": "warn",
"no-debugger": "warn",
"no-duplicate-imports": "warn",
"no-unused-vars": "off",
"object-curly-spacing": ["warn", "always"],
"quotes": ["warn", "double"],
"react/jsx-curly-spacing": [
"error",
{
"allowMultiline": true,
"children": {
"when": "always"
},
"spacing": {
"objectLiterals": "always"
},
"when": "always"
}
],
"react/jsx-filename-extension": [
"error",
{
"extensions": [".js", ".jsx", ".ts", ".tsx"]
}
],
"react/jsx-sort-props": [
2,
{
"callbacksLast": true,
"shorthandFirst": false,
"shorthandLast": true,
"ignoreCase": true,
"noSortAlphabetically": false
}
],
"react/prop-types": "warn",
"semi": "warn",
"sort-imports": [
"warn",
{
"ignoreCase": false,
"ignoreDeclarationSort": true,
"ignoreMemberSort": false
}
],
"sort-keys-fix/sort-keys-fix": [
"error",
"asc",
{ "caseSensitive": true, "natural": false }
]
},
"settings": {
"react": {
// Detect react version
"version": "detect"
}
}
},
{
"files": ["*.js", "*.jsx"],
"extends": ["plugin:@nx/javascript"],
"rules": {}
}
]
}