forked from pinterest/gestalt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.json
118 lines (118 loc) · 2.88 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
{
"extends": [
"airbnb",
"plugin:cypress/recommended",
"plugin:eslint-comments/recommended",
"plugin:flowtype/recommended",
"plugin:jest/recommended",
"plugin:jsx-a11y/recommended",
"plugin:react/recommended",
"prettier",
"prettier/flowtype",
"prettier/react"
],
"env": {
"browser": true,
"es6": true
},
"parser": "babel-eslint",
"plugins": [
"eslint-comments",
"flowtype",
"jest",
"jsx-a11y",
"prettier",
"react",
"react-hooks",
"import"
],
"rules": {
"eslint-comments/no-unused-disable": "error",
"flowtype/require-exact-type": ["error", "always"],
"flowtype/require-valid-file-annotation": [
"error",
"always",
{
"annotationStyle": "line",
"strict": true
}
],
"import/extensions": ["error", "always", { "ignorePackages": true }],
"import/no-anonymous-default-export": "error",
"import/no-extraneous-dependencies": "off",
"import/no-namespace": "error",
"import/no-relative-parent-imports": "error",
"import/no-unresolved": "off",
"jsx-a11y/label-has-associated-control": [
"error",
{
"labelComponents": ["Label"],
"labelAttributes": ["htmlFor"],
"controlComponents": ["CheckBox"],
"depth": 3
}
],
"jsx-a11y/label-has-for": [
"error",
{ "components": ["label"], "allowChildren": true }
],
"no-await-in-loop": "off",
"no-return-await": "off",
"prettier/prettier": [
"error",
{ "trailingComma": "es5", "singleQuote": true }
],
"react-hooks/exhaustive-deps": "error",
"react-hooks/rules-of-hooks": "error",
"react/destructuring-assignment": "off",
"react/jsx-filename-extension": "off",
"react/jsx-props-no-spreading": "off",
"react/no-array-index-key": "off",
"react/require-default-props": "off",
"react/state-in-constructor": ["error", "never"],
"react/static-property-placement": ["error", "static public field"]
},
"overrides": [
{
"files": ["packages/gestalt-codemods/**/*.js", "scripts/**/*.js"],
"rules": {
"flowtype/require-exact-type": "off",
"flowtype/require-valid-file-annotation": "off"
}
},
{
"files": ["**/*.test.js"],
"env": {
"jest": true
},
"globals": {
"page": true,
"browser": true
}
},
{
"files": ["**/*.flowtest.js"],
"rules": {
"no-unused-vars": "off"
}
},
{
"files": [
"cypress/**/*.js",
"scripts/templates/accessibility_ComponentName_spec.js"
],
"rules": {
"jest/expect-expect": "off",
"flowtype/require-valid-file-annotation": "off"
}
},
{
"files": ["scripts/danger/*.js"],
"globals": {
"danger": true,
"markdown": true,
"warn": true
}
}
]
}