-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathreact.json
177 lines (160 loc) · 4.88 KB
/
react.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
166
167
168
169
170
171
172
173
174
175
176
177
{
"$schema": "https://json.schemastore.org/eslintrc.json",
"extends": [
"plugin:import/react",
"plugin:react/all",
"plugin:react-hooks/recommended",
"plugin:styled-components-a11y/recommended",
"plugin:jsx-a11y/recommended",
"plugin:react-hook-form/recommended",
"plugin:react-form-fields/recommended",
"plugin:ssr-friendly/recommended",
"plugin:react-prefer-function-component/recommended",
"./prettier.json"
],
"plugins": [
"import",
"@shopify",
"storybook",
"validate-jsx-nesting",
"sonar"
],
"env": {
"browser": true
},
"rules": {
"react/jsx-filename-extension": [
"error",
{ "extensions": [".jsx", ".tsx"] }
],
"react/jsx-max-depth": ["error", { "max": 10 }],
"react/state-in-constructor": ["error", "never"],
"react/no-string-refs": ["error", { "noTemplateLiterals": true }],
"react/jsx-key": [
"error",
{
"checkFragmentShorthand": true,
"checkKeyMustBeforeSpread": true,
"warnOnDuplicates": true
}
],
"react/forbid-prop-types": [
"error",
{ "checkContextTypes": true, "checkChildContextTypes": true }
],
"react/no-unsafe": ["error", { "checkAliases": true }],
"react/boolean-prop-naming": [
"error",
{
"rule": "^(is|has|are|can|should|did|will)[A-Z]([A-Za-z0-9])+",
"validateNested": true
}
],
"react/require-default-props": [
"error",
{ "forbidDefaultForRequired": true, "functions": "defaultArguments" }
],
"react/jsx-no-target-blank": [
"error",
{ "forms": true, "warnOnSpreadAttributes": true }
],
"react/jsx-curly-brace-presence": [
"error",
{ "propElementValues": "always" }
],
"react/destructuring-assignment": [
"error",
"always",
{ "destructureInSignature": "always" }
],
"react/jsx-no-leaked-render": ["error", { "validStrategies": ["coerce"] }],
"react/display-name": ["error", { "checkContextObjects": true }],
"react/no-unknown-property": ["error", { "requireDataLowercase": true }],
"react/jsx-no-script-url": ["error", { "includeFromSettings": true }],
"react-hooks/exhaustive-deps": "error",
"jsx-a11y/lang": "error",
"jsx-a11y/prefer-tag-over-role": "error",
"jsx-a11y/no-aria-hidden-on-focusable": "error",
"jsx-a11y/alt-text": ["error", { "img": ["Image", "Img"] }],
"jsx-a11y/mouse-events-have-key-events": [
"error",
{
"hoverInHandlers": [
"onMouseOver",
"onMouseEnter",
"onPointerOver",
"onPointerEnter"
],
"hoverOutHandlers": [
"onMouseOut",
"onMouseLeave",
"onPointerOut",
"onPointerLeave"
]
}
],
"@shopify/jsx-prefer-fragment-wrappers": "error",
"@shopify/react-hooks-strict-return": "error",
"@shopify/react-no-multiple-render-methods": "error",
"react-form-fields/styled-no-mix-controlled-with-uncontrolled": "error",
"react-form-fields/styled-no-only-value-prop": "error",
"validate-jsx-nesting/no-invalid-jsx-nesting": "error",
"sonar/no-hook-setter-in-body": "error",
"sonar/no-useless-react-setstate": "error",
"react/jsx-no-literals": "off",
"react/react-in-jsx-scope": "off",
"react/jsx-sort-props": "off",
"react/sort-prop-types": "off",
"react/sort-default-props": "off",
"react/checked-requires-onchange-or-readonly": "off",
"react/require-optimization": "off",
"react/jsx-no-bind": "off",
"react/jsx-no-constructed-context-values": "off",
"react/no-object-type-as-default-prop": "off"
},
"overrides": [
{
"files": ["*.jsx"]
},
{
"files": [
"*.stories.@(ts|tsx|js|jsx|mjs|cjs|mts|cts)",
"*.story.@(ts|tsx|js|jsx|mjs|cjs|mts|cts)"
],
"rules": {
"import/no-anonymous-default-export": "off",
"storybook/await-interactions": "error",
"storybook/context-in-play-function": "error",
"storybook/csf-component": "error",
"storybook/default-exports": "error",
"storybook/hierarchy-separator": "error",
"storybook/meta-inline-properties": "error",
"storybook/no-redundant-story-name": "error",
"storybook/no-stories-of": "error",
"storybook/no-title-property-in-meta": "error",
"storybook/prefer-pascal-case": "error",
"storybook/story-exports": "error",
"storybook/use-storybook-expect": "error",
"storybook/use-storybook-testing-library": "error"
}
},
{
"files": [".storybook/main.@(js|cjs|mjs|ts|cts|mts)"],
"rules": {
"storybook/no-uninstalled-addons": "error"
}
}
],
"settings": {
"react": {
"version": "detect"
},
"jsx-a11y": {
"polymorphicPropName": "as",
"components": {
"Image": "img",
"Img": "img"
}
}
}
}