eslint-config-seekingalpha-react 7.49.0 → 8.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,9 @@
1
1
  # Change Log
2
2
 
3
+ ## 8.0.0 - 2025-03-07
4
+
5
+ - [new] expose flat config
6
+
3
7
  ## 7.49.0 - 2025-03-01
4
8
 
5
9
  - [deps] upgrade `eslint-plugin-react-hooks` to version `5.2.0`
package/flat.js ADDED
@@ -0,0 +1,16 @@
1
+ import jsxA11yConfig from './rules/eslint-plugin-jsx-a11y/flat.js';
2
+ import reactConfig from './rules/eslint-plugin-react/flat.js';
3
+ import reactHooksConfig from './rules/eslint-plugin-react-hooks/flat.js';
4
+
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,
15
+ },
16
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-config-seekingalpha-react",
3
- "version": "7.49.0",
3
+ "version": "8.0.0",
4
4
  "description": "SeekingAlpha's sharable React.js ESLint config",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -0,0 +1,10 @@
1
+ import jsxA11y from 'eslint-plugin-jsx-a11y';
2
+
3
+ import config from './index.js';
4
+
5
+ export default {
6
+ plugins: {
7
+ 'jsx-a11y': jsxA11y,
8
+ },
9
+ rules: config.rules,
10
+ };
@@ -0,0 +1,14 @@
1
+ import reactPlugin from 'eslint-plugin-react';
2
+
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
+ },
14
+ };
@@ -13,35 +13,35 @@ module.exports = {
13
13
  },
14
14
  ],
15
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',
16
+ /*
17
+ * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-child-element-spacing.md
18
+ * Disabled to work with prettier
19
+ */
20
+ 'react/jsx-child-element-spacing': 'off',
18
21
 
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
- ],
22
+ /*
23
+ * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-closing-bracket-location.md
24
+ * disable to work with prettier
25
+ */
26
+ 'react/jsx-closing-bracket-location': 'off',
27
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',
28
+ /*
29
+ * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-closing-tag-location.md
30
+ * disable to work with prettier
31
+ */
32
+ 'react/jsx-closing-tag-location': 'off',
30
33
 
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
- ],
34
+ /*
35
+ * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-curly-spacing.md
36
+ * disable to work with prettier
37
+ */
38
+ 'react/jsx-curly-spacing': 'off',
42
39
 
43
- // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-equals-spacing.md
44
- 'react/jsx-equals-spacing': ['error', 'never'],
40
+ /*
41
+ * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-equals-spacing.md
42
+ * disable to work with prettier
43
+ */
44
+ 'react/jsx-equals-spacing': 'off',
45
45
 
46
46
  // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-filename-extension.md
47
47
  'react/jsx-filename-extension': [
@@ -51,20 +51,29 @@ module.exports = {
51
51
  },
52
52
  ],
53
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'],
54
+ /*
55
+ * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-first-prop-new-line.md
56
+ * disable to work with prettier
57
+ */
58
+ 'react/jsx-first-prop-new-line': 'off',
56
59
 
57
60
  // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-fragments.md
58
61
  'react/jsx-fragments': ['error', 'syntax'],
59
62
 
60
63
  // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-handler-names.md
61
- 'react/jsx-handler-names': ['off'],
64
+ 'react/jsx-handler-names': 'off',
62
65
 
63
- // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-indent.md
64
- 'react/jsx-indent': ['error', config.jsxIndent],
66
+ /*
67
+ * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-indent.md
68
+ * disable to work with prettier
69
+ */
70
+ 'react/jsx-indent': 'off',
65
71
 
66
- // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-indent-props.md
67
- 'react/jsx-indent-props': ['error', config.jsxIndentProps],
72
+ /*
73
+ * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-indent-props.md
74
+ * disable ti work with prettier
75
+ */
76
+ 'react/jsx-indent-props': 'off',
68
77
 
69
78
  // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-key.md
70
79
  'react/jsx-key': [
@@ -84,17 +93,17 @@ module.exports = {
84
93
  },
85
94
  ],
86
95
 
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
- ],
96
+ /*
97
+ * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-max-props-per-line.md
98
+ * disable to work with prettier
99
+ */
100
+ 'react/jsx-max-props-per-line': 'off',
95
101
 
96
- // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-newline.md
97
- 'react/jsx-newline': 'error',
102
+ /*
103
+ * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-newline.md
104
+ * disable to work with prettier
105
+ */
106
+ 'react/jsx-newline': 'off',
98
107
 
99
108
  // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-bind.md
100
109
  'react/jsx-no-bind': 'off',
@@ -138,13 +147,11 @@ module.exports = {
138
147
  // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-undef.md
139
148
  'react/jsx-no-undef': 'error',
140
149
 
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
- ],
150
+ /*
151
+ * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-one-expression-per-line.md
152
+ * disable to worl with prettier
153
+ */
154
+ 'react/jsx-one-expression-per-line': 'off',
148
155
 
149
156
  // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-curly-brace-presence.md
150
157
  'react/jsx-curly-brace-presence': [
@@ -164,8 +171,11 @@ module.exports = {
164
171
  },
165
172
  ],
166
173
 
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',
174
+ /*
175
+ * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-props-no-multi-spaces.md
176
+ * disable to work with prettier
177
+ */
178
+ 'react/jsx-props-no-multi-spaces': 'off',
169
179
 
170
180
  // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/sort-default-props.md
171
181
  'react/sort-default-props': 'off',
@@ -183,16 +193,11 @@ module.exports = {
183
193
  },
184
194
  ],
185
195
 
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
+ * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-tag-spacing.md
198
+ * disable to work with prettier
199
+ */
200
+ 'react/jsx-tag-spacing': 'off',
196
201
 
197
202
  /*
198
203
  * off after update to 16.4
@@ -203,19 +208,11 @@ module.exports = {
203
208
  // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-uses-vars.md
204
209
  'react/jsx-uses-vars': 'error',
205
210
 
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
- ],
211
+ /*
212
+ * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-wrap-multilines.md
213
+ * disable to work with prettier
214
+ */
215
+ 'react/jsx-wrap-multilines': 'off',
219
216
 
220
217
  // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-danger.md
221
218
  'react/no-danger': 'error',
@@ -226,14 +223,11 @@ module.exports = {
226
223
  // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/prefer-read-only-props.md
227
224
  'react/prefer-read-only-props': 'error',
228
225
 
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
- ],
226
+ /*
227
+ * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-curly-newline.md
228
+ * disable to work with prettier
229
+ */
230
+ 'react/jsx-curly-newline': 'off',
237
231
 
238
232
  // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-useless-fragment.md
239
233
  'react/jsx-no-useless-fragment': [
@@ -0,0 +1,10 @@
1
+ import reactHooksPlugin from 'eslint-plugin-react-hooks';
2
+
3
+ import config from './index.js';
4
+
5
+ export default {
6
+ plugins: {
7
+ 'react-hooks': reactHooksPlugin,
8
+ },
9
+ rules: config.rules,
10
+ };
package/prettier.js DELETED
@@ -1,21 +0,0 @@
1
- module.exports = {
2
- extends: ['./index.js'],
3
-
4
- rules: {
5
- 'react/jsx-child-element-spacing': 'off',
6
- 'react/jsx-closing-bracket-location': 'off',
7
- 'react/jsx-closing-tag-location': 'off',
8
- 'react/jsx-curly-newline': 'off',
9
- 'react/jsx-curly-spacing': 'off',
10
- 'react/jsx-equals-spacing': 'off',
11
- 'react/jsx-first-prop-new-line': 'off',
12
- 'react/jsx-indent': 'off',
13
- 'react/jsx-indent-props': 'off',
14
- 'react/jsx-max-props-per-line': 'off',
15
- 'react/jsx-newline': 'off',
16
- 'react/jsx-one-expression-per-line': 'off',
17
- 'react/jsx-props-no-multi-spaces': 'off',
18
- 'react/jsx-tag-spacing': 'off',
19
- 'react/jsx-wrap-multilines': 'off',
20
- },
21
- };