eslint-config-seekingalpha-react 7.49.0 → 9.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Change Log
2
2
 
3
+ ## 9.0.0 - 2025-03-09
4
+
5
+ - [breaking] migrate to ESM and make flat config default
6
+
7
+ ## 8.0.0 - 2025-03-07
8
+
9
+ - [new] expose flat config
10
+
3
11
  ## 7.49.0 - 2025-03-01
4
12
 
5
13
  - [deps] upgrade `eslint-plugin-react-hooks` to version `5.2.0`
package/README.md CHANGED
@@ -10,26 +10,31 @@ Install ESLint and all [Peer Dependencies](https://nodejs.org/en/blog/npm/peer-d
10
10
 
11
11
  Install SeekingAlpha shareable ESLint:
12
12
 
13
- npm install eslint-config-seekingalpha-react --save-dev
13
+ npm install eslint-config-seekingalpha-react@latest --save-dev
14
14
 
15
15
  ## Usage
16
16
 
17
- This shareable config includes all ESLint rules including ECMAScript 6 features, set of [legacy rules](https://eslint.org/docs/rules/#deprecated) and additional rules for `React` We also extend our configuration with following plugins:
17
+ This shareable config includes all rules from following plugins:
18
18
 
19
19
  - [eslint-plugin-react](https://github.com/yannickcr/eslint-plugin-react)
20
20
  - [eslint-plugin-jsx-a11y](https://github.com/evcohen/eslint-plugin-jsx-a11y)
21
21
  - [eslint-plugin-react-hooks](https://www.npmjs.com/package/eslint-plugin-react-hooks)
22
22
 
23
- If you don't need configuration extended with `React` rules, check out our [base config](https://www.npmjs.com/package/eslint-config-seekingalpha-base).
24
-
25
- Simply [extend](https://eslint.org/docs/user-guide/configuring#extending-configuration-files) the relevant .eslintrc.js configuration in your project with `seekingalpha-react` rules:
23
+ Simply [use](https://eslint.org/docs/latest/extend/shareable-configs) the eslint.config.js in your project with the configuration:
26
24
 
27
25
  ```javascript
28
- {
29
- extends: [
30
- 'seekingalpha-react'
31
- ]
32
- }
26
+ import reactConfig from 'eslint-config-seekingalpha-react';
27
+
28
+ export default [
29
+ {
30
+ plugins: {
31
+ ...reactConfig.plugins,
32
+ },
33
+ rules: {
34
+ ...reactConfig.rules,
35
+ },
36
+ },
37
+ ];
33
38
  ```
34
39
 
35
40
  ## License
package/index.js CHANGED
@@ -1,22 +1,16 @@
1
- module.exports = {
2
- extends: [
3
- // https://github.com/yannickcr/eslint-plugin-react
4
- './rules/eslint-plugin-react/index.js',
1
+ import jsxA11yConfig from './rules/eslint-plugin-jsx-a11y/index.js';
2
+ import reactConfig from './rules/eslint-plugin-react/index.js';
3
+ import reactHooksConfig from './rules/eslint-plugin-react-hooks/index.js';
5
4
 
6
- // https://github.com/evcohen/eslint-plugin-jsx-a11y
7
- './rules/eslint-plugin-jsx-a11y/index.js',
8
-
9
- // https://reactjs.org/docs/hooks-rules.html
10
- './rules/eslint-plugin-react-hooks/index.js',
11
- ],
12
-
13
- parserOptions: {
14
- ecmaVersion: 12,
15
- sourceType: 'module',
16
- ecmaFeatures: {
17
- impliedStrict: true,
18
- globalReturn: false,
19
- jsx: true,
20
- },
5
+ export default {
6
+ plugins: {
7
+ ...jsxA11yConfig.plugins,
8
+ ...reactConfig.plugins,
9
+ ...reactHooksConfig.plugins,
10
+ },
11
+ rules: {
12
+ ...jsxA11yConfig.rules,
13
+ ...reactConfig.rules,
14
+ ...reactHooksConfig.rules,
21
15
  },
22
16
  };
package/package.json CHANGED
@@ -1,8 +1,9 @@
1
1
  {
2
2
  "name": "eslint-config-seekingalpha-react",
3
- "version": "7.49.0",
3
+ "version": "9.0.0",
4
4
  "description": "SeekingAlpha's sharable React.js ESLint config",
5
5
  "main": "index.js",
6
+ "type": "module",
6
7
  "scripts": {
7
8
  "eslint-find-rules": "eslint-find-rules -u ./index.js",
8
9
  "test": "echo \"Error: no test specified\" && exit 1"
package/rules/config.js CHANGED
@@ -1,4 +1,4 @@
1
- module.exports = {
1
+ export default {
2
2
  jsxIndent: 2,
3
3
  jsxIndentProps: 2,
4
4
  jsxMaxDepth: 10,
@@ -1,8 +1,9 @@
1
- //
2
-
3
- module.exports = {
4
- plugins: ['jsx-a11y'],
1
+ import jsxA11y from 'eslint-plugin-jsx-a11y';
5
2
 
3
+ export default {
4
+ plugins: {
5
+ 'jsx-a11y': jsxA11y,
6
+ },
6
7
  rules: {
7
8
  // https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/alt-text.md
8
9
  'jsx-a11y/alt-text': [
@@ -1,5 +1,14 @@
1
- module.exports = {
2
- plugins: ['react'],
1
+ import reactPlugin from 'eslint-plugin-react';
3
2
 
4
- extends: ['./react.js', './jsx.js'],
3
+ import jsxConfig from './jsx.js';
4
+ import reactConfig from './react.js';
5
+
6
+ export default {
7
+ plugins: {
8
+ react: reactPlugin,
9
+ },
10
+ rules: {
11
+ ...jsxConfig.rules,
12
+ ...reactConfig.rules,
13
+ },
5
14
  };
@@ -1,251 +1,242 @@
1
- const config = require('../config');
1
+ import config from '../config';
2
2
 
3
3
  // https://github.com/yannickcr/eslint-plugin-react#jsx-specific-rules
4
-
5
- module.exports = {
6
- rules: {
7
- // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-boolean-value.md
8
- 'react/jsx-boolean-value': [
9
- 'error',
10
- 'never',
11
- {
12
- always: [],
13
- },
14
- ],
15
-
16
- // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-child-element-spacing.md
17
- 'react/jsx-child-element-spacing': 'error',
18
-
19
- // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-closing-bracket-location.md
20
- 'react/jsx-closing-bracket-location': [
21
- 'error',
22
- {
23
- selfClosing: 'tag-aligned',
24
- nonEmpty: 'tag-aligned',
25
- },
26
- ],
27
-
28
- // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-closing-tag-location.md
29
- 'react/jsx-closing-tag-location': 'error',
30
-
31
- // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-curly-spacing.md
32
- 'react/jsx-curly-spacing': [
33
- 'error',
34
- {
35
- when: 'never',
36
- allowMultiline: true,
37
- spacing: {
38
- objectLiterals: 'always',
39
- },
40
- },
41
- ],
42
-
43
- // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-equals-spacing.md
44
- 'react/jsx-equals-spacing': ['error', 'never'],
45
-
46
- // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-filename-extension.md
47
- 'react/jsx-filename-extension': [
48
- 'error',
49
- {
50
- extensions: ['.tsx'],
51
- },
52
- ],
53
-
54
- // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-first-prop-new-line.md
55
- 'react/jsx-first-prop-new-line': ['error', 'multiline-multiprop'],
56
-
57
- // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-fragments.md
58
- 'react/jsx-fragments': ['error', 'syntax'],
59
-
60
- // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-handler-names.md
61
- 'react/jsx-handler-names': ['off'],
62
-
63
- // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-indent.md
64
- 'react/jsx-indent': ['error', config.jsxIndent],
65
-
66
- // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-indent-props.md
67
- 'react/jsx-indent-props': ['error', config.jsxIndentProps],
68
-
69
- // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-key.md
70
- 'react/jsx-key': [
71
- 'error',
72
- {
73
- checkFragmentShorthand: true,
74
- checkKeyMustBeforeSpread: true,
75
- warnOnDuplicates: true,
76
- },
77
- ],
78
-
79
- // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-max-depth.md
80
- 'react/jsx-max-depth': [
81
- 'error',
82
- {
83
- max: config.jsxMaxDepth,
84
- },
85
- ],
86
-
87
- // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-max-props-per-line.md
88
- 'react/jsx-max-props-per-line': [
89
- 'error',
90
- {
91
- maximum: config.jsxMaxPropsPerLine,
92
- when: 'always',
93
- },
94
- ],
95
-
96
- // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-newline.md
97
- 'react/jsx-newline': 'error',
98
-
99
- // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-bind.md
100
- 'react/jsx-no-bind': 'off',
101
-
102
- // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-comment-textnodes.md
103
- 'react/jsx-no-comment-textnodes': 'error',
104
-
105
- // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-constructed-context-values.md
106
- 'react/jsx-no-constructed-context-values': 'error',
107
-
108
- // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-duplicate-props.md
109
- 'react/jsx-no-duplicate-props': [
110
- 'error',
111
- {
112
- ignoreCase: true,
113
- },
114
- ],
115
-
116
- // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-no-leaked-render.md
117
- 'react/jsx-no-leaked-render': 'error',
118
-
119
- // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-literals.md
120
- 'react/jsx-no-literals': [
121
- 'off',
122
- {
123
- noStrings: true,
124
- },
125
- ],
126
-
127
- // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-props-no-spread-multi.md
128
- 'react/jsx-props-no-spread-multi': 'error',
129
-
130
- // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-target-blank.md
131
- 'react/jsx-no-target-blank': [
132
- 'error',
133
- {
134
- enforceDynamicLinks: 'always',
135
- },
136
- ],
137
-
138
- // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-undef.md
139
- 'react/jsx-no-undef': 'error',
140
-
141
- // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-one-expression-per-line.md
142
- 'react/jsx-one-expression-per-line': [
143
- 'error',
144
- {
145
- allow: 'literal',
146
- },
147
- ],
148
-
149
- // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-curly-brace-presence.md
150
- 'react/jsx-curly-brace-presence': [
151
- 'error',
152
- {
153
- props: 'never',
154
- children: 'never',
155
- },
156
- ],
157
-
158
- // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-pascal-case.md
159
- 'react/jsx-pascal-case': [
160
- 'error',
161
- {
162
- allowAllCaps: false,
163
- ignore: [],
164
- },
165
- ],
166
-
167
- // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-props-no-multi-spaces.md
168
- 'react/jsx-props-no-multi-spaces': 'error',
169
-
170
- // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/sort-default-props.md
171
- 'react/sort-default-props': 'off',
172
-
173
- // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-sort-props.md
174
- 'react/jsx-sort-props': [
175
- 'error',
176
- {
177
- ignoreCase: true,
178
- callbacksLast: true,
179
- shorthandFirst: true,
180
- shorthandLast: false,
181
- noSortAlphabetically: false,
182
- reservedFirst: false,
183
- },
184
- ],
185
-
186
- // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-tag-spacing.md
187
- 'react/jsx-tag-spacing': [
188
- 'error',
189
- {
190
- closingSlash: 'never',
191
- beforeSelfClosing: 'always',
192
- afterOpening: 'never',
193
- beforeClosing: 'never',
194
- },
195
- ],
196
-
197
- /*
198
- * off after update to 16.4
199
- * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-uses-react.md
200
- */
201
- 'react/jsx-uses-react': 'error',
202
-
203
- // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-uses-vars.md
204
- 'react/jsx-uses-vars': 'error',
205
-
206
- // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-wrap-multilines.md
207
- 'react/jsx-wrap-multilines': [
208
- 'error',
209
- {
210
- declaration: 'parens-new-line',
211
- assignment: 'parens-new-line',
212
- return: 'parens-new-line',
213
- arrow: 'parens-new-line',
214
- condition: 'parens-new-line',
215
- logical: 'parens-new-line',
216
- prop: 'parens-new-line',
217
- },
218
- ],
219
-
220
- // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-danger.md
221
- 'react/no-danger': 'error',
222
-
223
- // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-props-no-spreading.md
224
- 'react/jsx-props-no-spreading': 'off',
225
-
226
- // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/prefer-read-only-props.md
227
- 'react/prefer-read-only-props': 'error',
228
-
229
- // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-curly-newline.md
230
- 'react/jsx-curly-newline': [
231
- 'error',
232
- {
233
- multiline: 'consistent',
234
- singleline: 'consistent',
235
- },
236
- ],
237
-
238
- // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-useless-fragment.md
239
- 'react/jsx-no-useless-fragment': [
240
- 'error',
241
- {
242
- allowExpressions: true,
243
- },
244
- ],
245
-
246
- // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-script-url.md
247
- 'react/jsx-no-script-url': 'error',
248
-
249
- 'react/no-object-type-as-default-prop': 'error',
250
- },
4
+ export default {
5
+ // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-boolean-value.md
6
+ 'react/jsx-boolean-value': [
7
+ 'error',
8
+ 'never',
9
+ {
10
+ always: [],
11
+ },
12
+ ],
13
+
14
+ /*
15
+ * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-child-element-spacing.md
16
+ * Disabled to work with prettier
17
+ */
18
+ 'react/jsx-child-element-spacing': 'off',
19
+
20
+ /*
21
+ * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-closing-bracket-location.md
22
+ * disable to work with prettier
23
+ */
24
+ 'react/jsx-closing-bracket-location': 'off',
25
+
26
+ /*
27
+ * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-closing-tag-location.md
28
+ * disable to work with prettier
29
+ */
30
+ 'react/jsx-closing-tag-location': 'off',
31
+
32
+ /*
33
+ * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-curly-spacing.md
34
+ * disable to work with prettier
35
+ */
36
+ 'react/jsx-curly-spacing': 'off',
37
+
38
+ /*
39
+ * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-equals-spacing.md
40
+ * disable to work with prettier
41
+ */
42
+ 'react/jsx-equals-spacing': 'off',
43
+
44
+ // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-filename-extension.md
45
+ 'react/jsx-filename-extension': [
46
+ 'error',
47
+ {
48
+ extensions: ['.tsx'],
49
+ },
50
+ ],
51
+
52
+ /*
53
+ * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-first-prop-new-line.md
54
+ * disable to work with prettier
55
+ */
56
+ 'react/jsx-first-prop-new-line': 'off',
57
+
58
+ // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-fragments.md
59
+ 'react/jsx-fragments': ['error', 'syntax'],
60
+
61
+ // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-handler-names.md
62
+ 'react/jsx-handler-names': 'off',
63
+
64
+ /*
65
+ * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-indent.md
66
+ * disable to work with prettier
67
+ */
68
+ 'react/jsx-indent': 'off',
69
+
70
+ /*
71
+ * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-indent-props.md
72
+ * disable ti work with prettier
73
+ */
74
+ 'react/jsx-indent-props': 'off',
75
+
76
+ // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-key.md
77
+ 'react/jsx-key': [
78
+ 'error',
79
+ {
80
+ checkFragmentShorthand: true,
81
+ checkKeyMustBeforeSpread: true,
82
+ warnOnDuplicates: true,
83
+ },
84
+ ],
85
+
86
+ // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-max-depth.md
87
+ 'react/jsx-max-depth': [
88
+ 'error',
89
+ {
90
+ max: config.jsxMaxDepth,
91
+ },
92
+ ],
93
+
94
+ /*
95
+ * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-max-props-per-line.md
96
+ * disable to work with prettier
97
+ */
98
+ 'react/jsx-max-props-per-line': 'off',
99
+
100
+ /*
101
+ * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-newline.md
102
+ * disable to work with prettier
103
+ */
104
+ 'react/jsx-newline': 'off',
105
+
106
+ // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-bind.md
107
+ 'react/jsx-no-bind': 'off',
108
+
109
+ // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-comment-textnodes.md
110
+ 'react/jsx-no-comment-textnodes': 'error',
111
+
112
+ // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-constructed-context-values.md
113
+ 'react/jsx-no-constructed-context-values': 'error',
114
+
115
+ // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-duplicate-props.md
116
+ 'react/jsx-no-duplicate-props': [
117
+ 'error',
118
+ {
119
+ ignoreCase: true,
120
+ },
121
+ ],
122
+
123
+ // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-no-leaked-render.md
124
+ 'react/jsx-no-leaked-render': 'error',
125
+
126
+ // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-literals.md
127
+ 'react/jsx-no-literals': [
128
+ 'off',
129
+ {
130
+ noStrings: true,
131
+ },
132
+ ],
133
+
134
+ // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-props-no-spread-multi.md
135
+ 'react/jsx-props-no-spread-multi': 'error',
136
+
137
+ // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-target-blank.md
138
+ 'react/jsx-no-target-blank': [
139
+ 'error',
140
+ {
141
+ enforceDynamicLinks: 'always',
142
+ },
143
+ ],
144
+
145
+ // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-undef.md
146
+ 'react/jsx-no-undef': 'error',
147
+
148
+ /*
149
+ * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-one-expression-per-line.md
150
+ * disable to worl with prettier
151
+ */
152
+ 'react/jsx-one-expression-per-line': 'off',
153
+
154
+ // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-curly-brace-presence.md
155
+ 'react/jsx-curly-brace-presence': [
156
+ 'error',
157
+ {
158
+ props: 'never',
159
+ children: 'never',
160
+ },
161
+ ],
162
+
163
+ // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-pascal-case.md
164
+ 'react/jsx-pascal-case': [
165
+ 'error',
166
+ {
167
+ allowAllCaps: false,
168
+ ignore: [],
169
+ },
170
+ ],
171
+
172
+ /*
173
+ * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-props-no-multi-spaces.md
174
+ * disable to work with prettier
175
+ */
176
+ 'react/jsx-props-no-multi-spaces': 'off',
177
+
178
+ // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/sort-default-props.md
179
+ 'react/sort-default-props': 'off',
180
+
181
+ // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-sort-props.md
182
+ 'react/jsx-sort-props': [
183
+ 'error',
184
+ {
185
+ ignoreCase: true,
186
+ callbacksLast: true,
187
+ shorthandFirst: true,
188
+ shorthandLast: false,
189
+ noSortAlphabetically: false,
190
+ reservedFirst: false,
191
+ },
192
+ ],
193
+
194
+ /*
195
+ * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-tag-spacing.md
196
+ * disable to work with prettier
197
+ */
198
+ 'react/jsx-tag-spacing': 'off',
199
+
200
+ /*
201
+ * off after update to 16.4
202
+ * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-uses-react.md
203
+ */
204
+ 'react/jsx-uses-react': 'error',
205
+
206
+ // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-uses-vars.md
207
+ 'react/jsx-uses-vars': 'error',
208
+
209
+ /*
210
+ * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-wrap-multilines.md
211
+ * disable to work with prettier
212
+ */
213
+ 'react/jsx-wrap-multilines': 'off',
214
+
215
+ // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-danger.md
216
+ 'react/no-danger': 'error',
217
+
218
+ // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-props-no-spreading.md
219
+ 'react/jsx-props-no-spreading': 'off',
220
+
221
+ // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/prefer-read-only-props.md
222
+ 'react/prefer-read-only-props': 'error',
223
+
224
+ /*
225
+ * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-curly-newline.md
226
+ * disable to work with prettier
227
+ */
228
+ 'react/jsx-curly-newline': 'off',
229
+
230
+ // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-useless-fragment.md
231
+ 'react/jsx-no-useless-fragment': [
232
+ 'error',
233
+ {
234
+ allowExpressions: true,
235
+ },
236
+ ],
237
+
238
+ // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-script-url.md
239
+ 'react/jsx-no-script-url': 'error',
240
+
241
+ 'react/no-object-type-as-default-prop': 'error',
251
242
  };