forked from scaleway/ultraviolet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc
78 lines (78 loc) · 2.07 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
77
78
{
"root": true,
"env": {
"browser": true
},
"extends": [
"@scaleway/react/typescript"
],
"parserOptions": {
"project": [
"tsconfig.json"
]
},
"plugins": [
"@emotion"
],
"rules": {
"no-restricted-syntax": [
// https://eslint.org/docs/rules/no-restricted-syntax#disallow-specified-syntax-no-restricted-syntax
"warn",
{
"message": "for..in loops iterate over the entire prototype chain, which is virtually never what you want. Use Object.{keys,values,entries}, and iterate over the resulting array.",
"selector": "ForInStatement"
},
{
"message": "Labels are a form of GOTO; using them makes code confusing and hard to maintain and understand.",
"selector": "LabeledStatement"
},
{
"message": "`with` is disallowed in strict mode because it makes code impossible to predict and optimize.",
"selector": "WithStatement"
},
{
"message": "Deprecated color usage, use colors instead.",
"selector": "MemberExpression[object.object.name='theme'] Identifier[name='colorsDeprecated'], MemberExpression[object.name='colorsDeprecated'] Identifier[name='colorsDeprecated']"
}
],
// Import
"import/no-extraneous-dependencies": [
"error",
{
"devDependencies": [
"**/__stories__/**/*",
"**/__tests__/**/*",
"rollup.config.mjs"
]
}
],
// React
"react/jsx-props-no-spreading": "warn",
"react/sort-prop-types": "off",
// emotion
"@emotion/styled-import": "error",
"@emotion/no-vanilla": "error",
"@emotion/import-from-emotion": "error",
"@emotion/syntax-preference": [
"error",
"string"
]
},
"overrides": [
{
"env": {
"jest": true
},
"files": [
"**/__stories__/**/*.{ts,tsx}",
"**/__tests__/**/*.{ts,tsx}"
],
"rules": {
"no-console": "off",
"no-alert": "off",
"react/prop-types": "off",
"react/jsx-props-no-spreading": "off"
}
}
]
}