eslint-config-vylda-vanilla-react 4.3.0 → 5.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 +14 -0
- package/package.json +4 -4
- package/rules/hooks.mjs +1 -1
- package/rules/react.mjs +14 -14
package/Changelog.md
CHANGED
|
@@ -4,6 +4,20 @@ All notable changes to this component will be documented in this file.
|
|
|
4
4
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
5
5
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
6
6
|
|
|
7
|
+
## [5.0.0] - 2025-12-06
|
|
8
|
+
### Added
|
|
9
|
+
- some missing comments for rules [Vilda Lipold]
|
|
10
|
+
### Removed
|
|
11
|
+
- TODO comments for enabled rules [Vilda Lipold]
|
|
12
|
+
### Updated
|
|
13
|
+
- packages [Vilda Lipold]
|
|
14
|
+
- Rules
|
|
15
|
+
- react/hook-use-state [Vilda Lipold]
|
|
16
|
+
- react/jsx-no-leaked-render [Vilda Lipold]
|
|
17
|
+
- react/no-adjacent-inline-elements [Vilda Lipold]
|
|
18
|
+
- react/no-object-type-as-default-prop [Vilda Lipold]
|
|
19
|
+
- react-hooks/void-use-memo [Vilda Lipold]
|
|
20
|
+
|
|
7
21
|
## [4.3.0] - 2025-12-06
|
|
8
22
|
### Updated
|
|
9
23
|
- eslint-config-vylda-vanilla package [Vilda Lipold]
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-config-vylda-vanilla-react",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0",
|
|
4
4
|
"description": "Eslint rules for JS React projects",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -28,12 +28,12 @@
|
|
|
28
28
|
"homepage": "https://gitlab.com/Vylda/eslint-config-vylda-vanilla-react",
|
|
29
29
|
"license": "MIT",
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"eslint": "^9.39.
|
|
32
|
-
"eslint-config-vylda-vanilla": "^
|
|
31
|
+
"eslint": "^9.39.2",
|
|
32
|
+
"eslint-config-vylda-vanilla": "^5.0.0",
|
|
33
33
|
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
34
34
|
"eslint-plugin-react": "^7.37.5",
|
|
35
35
|
"eslint-plugin-react-hooks": "^7.0.1",
|
|
36
|
-
"eslint-plugin-react-refresh": "^0.4.
|
|
36
|
+
"eslint-plugin-react-refresh": "^0.4.26",
|
|
37
37
|
"globals": "^16.5.0"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
package/rules/hooks.mjs
CHANGED
|
@@ -122,7 +122,7 @@ const config = [{
|
|
|
122
122
|
// by the component/hook. See [`useMemo()` docs](https://react.dev/reference/react/useMemo)
|
|
123
123
|
// for more information..
|
|
124
124
|
// Missing URL in the official documentation.
|
|
125
|
-
'react-hooks/void-use-memo': '
|
|
125
|
+
'react-hooks/void-use-memo': 'error',
|
|
126
126
|
},
|
|
127
127
|
}];
|
|
128
128
|
|
package/rules/react.mjs
CHANGED
|
@@ -85,8 +85,8 @@ const config = [
|
|
|
85
85
|
},
|
|
86
86
|
],
|
|
87
87
|
|
|
88
|
+
// Requires that components wrapped with forwardRef must have a ref parameter.
|
|
88
89
|
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/forward-ref-uses-ref.md
|
|
89
|
-
// TODO: semver-major, enable
|
|
90
90
|
'react/forward-ref-uses-ref': 'error',
|
|
91
91
|
|
|
92
92
|
// Enforce a specific function type for function components
|
|
@@ -101,12 +101,15 @@ const config = [
|
|
|
101
101
|
|
|
102
102
|
// Ensure destructuring and symmetric naming of useState hook value and setter variables
|
|
103
103
|
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/hook-use-state.md
|
|
104
|
-
|
|
105
|
-
|
|
104
|
+
'react/hook-use-state': [
|
|
105
|
+
'error',
|
|
106
|
+
{
|
|
107
|
+
allowDestructuredState: true,
|
|
108
|
+
},
|
|
109
|
+
],
|
|
106
110
|
|
|
107
111
|
// Enforce sandbox attribute on iframe elements
|
|
108
112
|
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/iframe-missing-sandbox.md
|
|
109
|
-
// TODO: semver-major, enable
|
|
110
113
|
'react/iframe-missing-sandbox': 'error',
|
|
111
114
|
|
|
112
115
|
// Enforce boolean attributes notation in JSX
|
|
@@ -232,8 +235,7 @@ const config = [
|
|
|
232
235
|
|
|
233
236
|
// Prevent problematic leaked values from being rendered
|
|
234
237
|
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-no-leaked-render.md
|
|
235
|
-
|
|
236
|
-
'react/jsx-no-leaked-render': 'off',
|
|
238
|
+
'react/jsx-no-leaked-render': 'error',
|
|
237
239
|
|
|
238
240
|
// Prevent usage of unwrapped JSX strings
|
|
239
241
|
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-no-literals.md
|
|
@@ -270,8 +272,8 @@ const config = [
|
|
|
270
272
|
// rule in stylistic.mjs
|
|
271
273
|
'react/jsx-props-no-multi-spaces': 'error',
|
|
272
274
|
|
|
275
|
+
// Disallow JSX prop spreading the same identifier multiple times
|
|
273
276
|
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-props-no-spread-multi.md
|
|
274
|
-
// TODO: semver-major, enable
|
|
275
277
|
'react/jsx-props-no-spread-multi': 'error',
|
|
276
278
|
|
|
277
279
|
// Disallow JSX props spreading
|
|
@@ -307,8 +309,7 @@ const config = [
|
|
|
307
309
|
|
|
308
310
|
// Prevent adjacent inline elements not separated by whitespace
|
|
309
311
|
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-adjacent-inline-elements.md
|
|
310
|
-
|
|
311
|
-
'react/no-adjacent-inline-elements': 'off',
|
|
312
|
+
'react/no-adjacent-inline-elements': 'warn',
|
|
312
313
|
|
|
313
314
|
// Prevent usage of Array index in keys
|
|
314
315
|
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-array-index-key.md
|
|
@@ -366,9 +367,9 @@ const config = [
|
|
|
366
367
|
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-namespace.md
|
|
367
368
|
'react/no-namespace': 'error',
|
|
368
369
|
|
|
370
|
+
// Disallow usage of referential-type variables as default param in functional component
|
|
369
371
|
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-object-type-as-default-prop.md
|
|
370
|
-
|
|
371
|
-
'react/no-object-type-as-default-prop': 'off',
|
|
372
|
+
'react/no-object-type-as-default-prop': 'warn',
|
|
372
373
|
|
|
373
374
|
// Prevent usage of shouldComponentUpdate when extending React.PureComponent
|
|
374
375
|
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-redundant-should-component-update.md
|
|
@@ -533,8 +534,9 @@ const config = [
|
|
|
533
534
|
},
|
|
534
535
|
],
|
|
535
536
|
|
|
537
|
+
// Enforce defaultProps declarations alphabetical sorting
|
|
536
538
|
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/sort-default-props.md
|
|
537
|
-
//
|
|
539
|
+
// off because defaultProps is deprecated
|
|
538
540
|
'react/sort-default-props': ['off', { ignoreCase: true }],
|
|
539
541
|
|
|
540
542
|
// Enforce propTypes declarations alphabetical sorting
|
|
@@ -552,12 +554,10 @@ const config = [
|
|
|
552
554
|
|
|
553
555
|
// Enforce state initialization style
|
|
554
556
|
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/state-in-constructor.md
|
|
555
|
-
// TODO: set to "never" once babel-preset-airbnb supports public class fields
|
|
556
557
|
'react/state-in-constructor': ['error', 'always'],
|
|
557
558
|
|
|
558
559
|
// Enforces where React component static properties should be positioned
|
|
559
560
|
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/static-property-placement.md
|
|
560
|
-
// TODO: set to "static public field" once babel-preset-airbnb supports public class fields
|
|
561
561
|
'react/static-property-placement': ['error', 'static public field'],
|
|
562
562
|
|
|
563
563
|
// Require style prop value be an object or var
|