@abinnovision/eslint-config-react 3.2.1-beta.1 → 4.0.0-beta.2
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/dist/configs/react.cjs +55 -37
- package/dist/configs/react.mjs +55 -37
- package/package.json +2 -2
package/dist/configs/react.cjs
CHANGED
|
@@ -29,61 +29,91 @@ const config = (0, eslint_config.defineConfig)([{
|
|
|
29
29
|
*
|
|
30
30
|
* @see https://eslint-react.xyz/docs/rules/dom-no-dangerously-set-innerhtml
|
|
31
31
|
*/
|
|
32
|
-
"@eslint-react/dom
|
|
32
|
+
"@eslint-react/dom-no-dangerously-set-innerhtml": "error",
|
|
33
33
|
/**
|
|
34
34
|
* Disallow dangerouslySetInnerHTML with children.
|
|
35
35
|
*
|
|
36
36
|
* @see https://eslint-react.xyz/docs/rules/dom-no-dangerously-set-innerhtml-with-children
|
|
37
37
|
*/
|
|
38
|
-
"@eslint-react/dom
|
|
38
|
+
"@eslint-react/dom-no-dangerously-set-innerhtml-with-children": "error",
|
|
39
39
|
/**
|
|
40
40
|
* Disallow javascript: URLs.
|
|
41
41
|
*
|
|
42
42
|
* @see https://eslint-react.xyz/docs/rules/dom-no-script-url
|
|
43
43
|
*/
|
|
44
|
-
"@eslint-react/dom
|
|
44
|
+
"@eslint-react/dom-no-script-url": "error",
|
|
45
45
|
/**
|
|
46
46
|
* Enforce security attributes on target="_blank" links.
|
|
47
47
|
*
|
|
48
48
|
* @see https://eslint-react.xyz/docs/rules/dom-no-unsafe-target-blank
|
|
49
49
|
*/
|
|
50
|
-
"@eslint-react/dom
|
|
50
|
+
"@eslint-react/dom-no-unsafe-target-blank": "error",
|
|
51
51
|
/**
|
|
52
52
|
* Require sandbox attribute on iframes.
|
|
53
53
|
*
|
|
54
54
|
* @see https://eslint-react.xyz/docs/rules/dom-no-missing-iframe-sandbox
|
|
55
55
|
*/
|
|
56
|
-
"@eslint-react/dom
|
|
56
|
+
"@eslint-react/dom-no-missing-iframe-sandbox": "error",
|
|
57
57
|
/**
|
|
58
58
|
* Disallow unsafe iframe sandbox values.
|
|
59
59
|
*
|
|
60
60
|
* @see https://eslint-react.xyz/docs/rules/dom-no-unsafe-iframe-sandbox
|
|
61
61
|
*/
|
|
62
|
-
"@eslint-react/dom
|
|
62
|
+
"@eslint-react/dom-no-unsafe-iframe-sandbox": "error",
|
|
63
|
+
/**
|
|
64
|
+
* Disallow string style prop; use an object instead.
|
|
65
|
+
*
|
|
66
|
+
* @see https://eslint-react.xyz/docs/rules/dom-no-string-style-prop
|
|
67
|
+
*/
|
|
68
|
+
"@eslint-react/dom-no-string-style-prop": "error",
|
|
69
|
+
/**
|
|
70
|
+
* Disallow unknown DOM properties.
|
|
71
|
+
*
|
|
72
|
+
* @see https://eslint-react.xyz/docs/rules/dom-no-unknown-property
|
|
73
|
+
*/
|
|
74
|
+
"@eslint-react/dom-no-unknown-property": "error",
|
|
75
|
+
/**
|
|
76
|
+
* Require an explicit type attribute on button elements.
|
|
77
|
+
*
|
|
78
|
+
* @see https://eslint-react.xyz/docs/rules/dom-no-missing-button-type
|
|
79
|
+
*/
|
|
80
|
+
"@eslint-react/dom-no-missing-button-type": "warn",
|
|
63
81
|
/**
|
|
64
82
|
* Prevent memory leaks from event listeners.
|
|
65
83
|
*
|
|
66
84
|
* @see https://eslint-react.xyz/docs/rules/web-api-no-leaked-event-listener
|
|
67
85
|
*/
|
|
68
|
-
"@eslint-react/web-api
|
|
86
|
+
"@eslint-react/web-api-no-leaked-event-listener": "error",
|
|
69
87
|
/**
|
|
70
88
|
* Prevent memory leaks from intervals.
|
|
71
89
|
*
|
|
72
90
|
* @see https://eslint-react.xyz/docs/rules/web-api-no-leaked-interval
|
|
73
91
|
*/
|
|
74
|
-
"@eslint-react/web-api
|
|
92
|
+
"@eslint-react/web-api-no-leaked-interval": "error",
|
|
75
93
|
/**
|
|
76
94
|
* Prevent memory leaks from timeouts.
|
|
77
95
|
*
|
|
78
96
|
* @see https://eslint-react.xyz/docs/rules/web-api-no-leaked-timeout
|
|
79
97
|
*/
|
|
80
|
-
"@eslint-react/web-api
|
|
98
|
+
"@eslint-react/web-api-no-leaked-timeout": "error",
|
|
81
99
|
/**
|
|
82
100
|
* Prevent memory leaks from resize observers.
|
|
83
101
|
*
|
|
84
102
|
* @see https://eslint-react.xyz/docs/rules/web-api-no-leaked-resize-observer
|
|
85
103
|
*/
|
|
86
|
-
"@eslint-react/web-api
|
|
104
|
+
"@eslint-react/web-api-no-leaked-resize-observer": "error",
|
|
105
|
+
/**
|
|
106
|
+
* Prevent memory leaks from unaborted fetch requests.
|
|
107
|
+
*
|
|
108
|
+
* @see https://eslint-react.xyz/docs/rules/web-api-no-leaked-fetch
|
|
109
|
+
*/
|
|
110
|
+
"@eslint-react/web-api-no-leaked-fetch": "error",
|
|
111
|
+
/**
|
|
112
|
+
* Prevent memory leaks from intersection observers.
|
|
113
|
+
*
|
|
114
|
+
* @see https://eslint-react.xyz/docs/rules/web-api-no-leaked-intersection-observer
|
|
115
|
+
*/
|
|
116
|
+
"@eslint-react/web-api-no-leaked-intersection-observer": "error",
|
|
87
117
|
/**
|
|
88
118
|
* Warn against using array indices as keys.
|
|
89
119
|
*
|
|
@@ -103,29 +133,17 @@ const config = (0, eslint_config.defineConfig)([{
|
|
|
103
133
|
*/
|
|
104
134
|
"@eslint-react/no-unstable-context-value": "warn",
|
|
105
135
|
/**
|
|
106
|
-
* Warn against
|
|
107
|
-
*
|
|
108
|
-
* @see https://eslint-react.xyz/docs/rules/no-unnecessary-use-callback
|
|
109
|
-
*/
|
|
110
|
-
"@eslint-react/no-unnecessary-use-callback": "warn",
|
|
111
|
-
/**
|
|
112
|
-
* Warn against unnecessary useMemo.
|
|
113
|
-
*
|
|
114
|
-
* @see https://eslint-react.xyz/docs/rules/no-unnecessary-use-memo
|
|
115
|
-
*/
|
|
116
|
-
"@eslint-react/no-unnecessary-use-memo": "warn",
|
|
117
|
-
/**
|
|
118
|
-
* Disallow duplicate props in JSX.
|
|
136
|
+
* Warn against referential-type values used as default props.
|
|
119
137
|
*
|
|
120
|
-
* @see https://eslint-react.xyz/docs/rules/
|
|
138
|
+
* @see https://eslint-react.xyz/docs/rules/no-unstable-default-props
|
|
121
139
|
*/
|
|
122
|
-
"@eslint-react/
|
|
140
|
+
"@eslint-react/no-unstable-default-props": "warn",
|
|
123
141
|
/**
|
|
124
|
-
*
|
|
142
|
+
* Prevent leaked values (e.g. 0/NaN) from conditional rendering.
|
|
125
143
|
*
|
|
126
|
-
* @see https://eslint-react.xyz/docs/rules/
|
|
144
|
+
* @see https://eslint-react.xyz/docs/rules/no-leaked-conditional-rendering
|
|
127
145
|
*/
|
|
128
|
-
"@eslint-react/
|
|
146
|
+
"@eslint-react/no-leaked-conditional-rendering": "error",
|
|
129
147
|
/**
|
|
130
148
|
* Require keys for array elements.
|
|
131
149
|
*
|
|
@@ -133,11 +151,17 @@ const config = (0, eslint_config.defineConfig)([{
|
|
|
133
151
|
*/
|
|
134
152
|
"@eslint-react/no-missing-key": "error",
|
|
135
153
|
/**
|
|
154
|
+
* Disallow duplicate keys on sibling elements.
|
|
155
|
+
*
|
|
156
|
+
* @see https://eslint-react.xyz/docs/rules/no-duplicate-key
|
|
157
|
+
*/
|
|
158
|
+
"@eslint-react/no-duplicate-key": "error",
|
|
159
|
+
/**
|
|
136
160
|
* Disallow children prop.
|
|
137
161
|
*
|
|
138
|
-
* @see https://eslint-react.xyz/docs/rules/no-children-prop
|
|
162
|
+
* @see https://eslint-react.xyz/docs/rules/jsx-no-children-prop
|
|
139
163
|
*/
|
|
140
|
-
"@eslint-react/no-children-prop": "error",
|
|
164
|
+
"@eslint-react/jsx-no-children-prop": "error",
|
|
141
165
|
/**
|
|
142
166
|
* Disallow direct state mutation.
|
|
143
167
|
*
|
|
@@ -145,17 +169,11 @@ const config = (0, eslint_config.defineConfig)([{
|
|
|
145
169
|
*/
|
|
146
170
|
"@eslint-react/no-direct-mutation-state": "error",
|
|
147
171
|
/**
|
|
148
|
-
* Disallow string refs.
|
|
149
|
-
*
|
|
150
|
-
* @see https://eslint-react.xyz/docs/rules/no-string-refs
|
|
151
|
-
*/
|
|
152
|
-
"@eslint-react/no-string-refs": "error",
|
|
153
|
-
/**
|
|
154
172
|
* Disallow findDOMNode.
|
|
155
173
|
*
|
|
156
174
|
* @see https://eslint-react.xyz/docs/rules/dom-no-find-dom-node
|
|
157
175
|
*/
|
|
158
|
-
"@eslint-react/dom
|
|
176
|
+
"@eslint-react/dom-no-find-dom-node": "error"
|
|
159
177
|
}
|
|
160
178
|
}]);
|
|
161
179
|
//#endregion
|
package/dist/configs/react.mjs
CHANGED
|
@@ -26,61 +26,91 @@ const config = defineConfig([{
|
|
|
26
26
|
*
|
|
27
27
|
* @see https://eslint-react.xyz/docs/rules/dom-no-dangerously-set-innerhtml
|
|
28
28
|
*/
|
|
29
|
-
"@eslint-react/dom
|
|
29
|
+
"@eslint-react/dom-no-dangerously-set-innerhtml": "error",
|
|
30
30
|
/**
|
|
31
31
|
* Disallow dangerouslySetInnerHTML with children.
|
|
32
32
|
*
|
|
33
33
|
* @see https://eslint-react.xyz/docs/rules/dom-no-dangerously-set-innerhtml-with-children
|
|
34
34
|
*/
|
|
35
|
-
"@eslint-react/dom
|
|
35
|
+
"@eslint-react/dom-no-dangerously-set-innerhtml-with-children": "error",
|
|
36
36
|
/**
|
|
37
37
|
* Disallow javascript: URLs.
|
|
38
38
|
*
|
|
39
39
|
* @see https://eslint-react.xyz/docs/rules/dom-no-script-url
|
|
40
40
|
*/
|
|
41
|
-
"@eslint-react/dom
|
|
41
|
+
"@eslint-react/dom-no-script-url": "error",
|
|
42
42
|
/**
|
|
43
43
|
* Enforce security attributes on target="_blank" links.
|
|
44
44
|
*
|
|
45
45
|
* @see https://eslint-react.xyz/docs/rules/dom-no-unsafe-target-blank
|
|
46
46
|
*/
|
|
47
|
-
"@eslint-react/dom
|
|
47
|
+
"@eslint-react/dom-no-unsafe-target-blank": "error",
|
|
48
48
|
/**
|
|
49
49
|
* Require sandbox attribute on iframes.
|
|
50
50
|
*
|
|
51
51
|
* @see https://eslint-react.xyz/docs/rules/dom-no-missing-iframe-sandbox
|
|
52
52
|
*/
|
|
53
|
-
"@eslint-react/dom
|
|
53
|
+
"@eslint-react/dom-no-missing-iframe-sandbox": "error",
|
|
54
54
|
/**
|
|
55
55
|
* Disallow unsafe iframe sandbox values.
|
|
56
56
|
*
|
|
57
57
|
* @see https://eslint-react.xyz/docs/rules/dom-no-unsafe-iframe-sandbox
|
|
58
58
|
*/
|
|
59
|
-
"@eslint-react/dom
|
|
59
|
+
"@eslint-react/dom-no-unsafe-iframe-sandbox": "error",
|
|
60
|
+
/**
|
|
61
|
+
* Disallow string style prop; use an object instead.
|
|
62
|
+
*
|
|
63
|
+
* @see https://eslint-react.xyz/docs/rules/dom-no-string-style-prop
|
|
64
|
+
*/
|
|
65
|
+
"@eslint-react/dom-no-string-style-prop": "error",
|
|
66
|
+
/**
|
|
67
|
+
* Disallow unknown DOM properties.
|
|
68
|
+
*
|
|
69
|
+
* @see https://eslint-react.xyz/docs/rules/dom-no-unknown-property
|
|
70
|
+
*/
|
|
71
|
+
"@eslint-react/dom-no-unknown-property": "error",
|
|
72
|
+
/**
|
|
73
|
+
* Require an explicit type attribute on button elements.
|
|
74
|
+
*
|
|
75
|
+
* @see https://eslint-react.xyz/docs/rules/dom-no-missing-button-type
|
|
76
|
+
*/
|
|
77
|
+
"@eslint-react/dom-no-missing-button-type": "warn",
|
|
60
78
|
/**
|
|
61
79
|
* Prevent memory leaks from event listeners.
|
|
62
80
|
*
|
|
63
81
|
* @see https://eslint-react.xyz/docs/rules/web-api-no-leaked-event-listener
|
|
64
82
|
*/
|
|
65
|
-
"@eslint-react/web-api
|
|
83
|
+
"@eslint-react/web-api-no-leaked-event-listener": "error",
|
|
66
84
|
/**
|
|
67
85
|
* Prevent memory leaks from intervals.
|
|
68
86
|
*
|
|
69
87
|
* @see https://eslint-react.xyz/docs/rules/web-api-no-leaked-interval
|
|
70
88
|
*/
|
|
71
|
-
"@eslint-react/web-api
|
|
89
|
+
"@eslint-react/web-api-no-leaked-interval": "error",
|
|
72
90
|
/**
|
|
73
91
|
* Prevent memory leaks from timeouts.
|
|
74
92
|
*
|
|
75
93
|
* @see https://eslint-react.xyz/docs/rules/web-api-no-leaked-timeout
|
|
76
94
|
*/
|
|
77
|
-
"@eslint-react/web-api
|
|
95
|
+
"@eslint-react/web-api-no-leaked-timeout": "error",
|
|
78
96
|
/**
|
|
79
97
|
* Prevent memory leaks from resize observers.
|
|
80
98
|
*
|
|
81
99
|
* @see https://eslint-react.xyz/docs/rules/web-api-no-leaked-resize-observer
|
|
82
100
|
*/
|
|
83
|
-
"@eslint-react/web-api
|
|
101
|
+
"@eslint-react/web-api-no-leaked-resize-observer": "error",
|
|
102
|
+
/**
|
|
103
|
+
* Prevent memory leaks from unaborted fetch requests.
|
|
104
|
+
*
|
|
105
|
+
* @see https://eslint-react.xyz/docs/rules/web-api-no-leaked-fetch
|
|
106
|
+
*/
|
|
107
|
+
"@eslint-react/web-api-no-leaked-fetch": "error",
|
|
108
|
+
/**
|
|
109
|
+
* Prevent memory leaks from intersection observers.
|
|
110
|
+
*
|
|
111
|
+
* @see https://eslint-react.xyz/docs/rules/web-api-no-leaked-intersection-observer
|
|
112
|
+
*/
|
|
113
|
+
"@eslint-react/web-api-no-leaked-intersection-observer": "error",
|
|
84
114
|
/**
|
|
85
115
|
* Warn against using array indices as keys.
|
|
86
116
|
*
|
|
@@ -100,29 +130,17 @@ const config = defineConfig([{
|
|
|
100
130
|
*/
|
|
101
131
|
"@eslint-react/no-unstable-context-value": "warn",
|
|
102
132
|
/**
|
|
103
|
-
* Warn against
|
|
104
|
-
*
|
|
105
|
-
* @see https://eslint-react.xyz/docs/rules/no-unnecessary-use-callback
|
|
106
|
-
*/
|
|
107
|
-
"@eslint-react/no-unnecessary-use-callback": "warn",
|
|
108
|
-
/**
|
|
109
|
-
* Warn against unnecessary useMemo.
|
|
110
|
-
*
|
|
111
|
-
* @see https://eslint-react.xyz/docs/rules/no-unnecessary-use-memo
|
|
112
|
-
*/
|
|
113
|
-
"@eslint-react/no-unnecessary-use-memo": "warn",
|
|
114
|
-
/**
|
|
115
|
-
* Disallow duplicate props in JSX.
|
|
133
|
+
* Warn against referential-type values used as default props.
|
|
116
134
|
*
|
|
117
|
-
* @see https://eslint-react.xyz/docs/rules/
|
|
135
|
+
* @see https://eslint-react.xyz/docs/rules/no-unstable-default-props
|
|
118
136
|
*/
|
|
119
|
-
"@eslint-react/
|
|
137
|
+
"@eslint-react/no-unstable-default-props": "warn",
|
|
120
138
|
/**
|
|
121
|
-
*
|
|
139
|
+
* Prevent leaked values (e.g. 0/NaN) from conditional rendering.
|
|
122
140
|
*
|
|
123
|
-
* @see https://eslint-react.xyz/docs/rules/
|
|
141
|
+
* @see https://eslint-react.xyz/docs/rules/no-leaked-conditional-rendering
|
|
124
142
|
*/
|
|
125
|
-
"@eslint-react/
|
|
143
|
+
"@eslint-react/no-leaked-conditional-rendering": "error",
|
|
126
144
|
/**
|
|
127
145
|
* Require keys for array elements.
|
|
128
146
|
*
|
|
@@ -130,11 +148,17 @@ const config = defineConfig([{
|
|
|
130
148
|
*/
|
|
131
149
|
"@eslint-react/no-missing-key": "error",
|
|
132
150
|
/**
|
|
151
|
+
* Disallow duplicate keys on sibling elements.
|
|
152
|
+
*
|
|
153
|
+
* @see https://eslint-react.xyz/docs/rules/no-duplicate-key
|
|
154
|
+
*/
|
|
155
|
+
"@eslint-react/no-duplicate-key": "error",
|
|
156
|
+
/**
|
|
133
157
|
* Disallow children prop.
|
|
134
158
|
*
|
|
135
|
-
* @see https://eslint-react.xyz/docs/rules/no-children-prop
|
|
159
|
+
* @see https://eslint-react.xyz/docs/rules/jsx-no-children-prop
|
|
136
160
|
*/
|
|
137
|
-
"@eslint-react/no-children-prop": "error",
|
|
161
|
+
"@eslint-react/jsx-no-children-prop": "error",
|
|
138
162
|
/**
|
|
139
163
|
* Disallow direct state mutation.
|
|
140
164
|
*
|
|
@@ -142,17 +166,11 @@ const config = defineConfig([{
|
|
|
142
166
|
*/
|
|
143
167
|
"@eslint-react/no-direct-mutation-state": "error",
|
|
144
168
|
/**
|
|
145
|
-
* Disallow string refs.
|
|
146
|
-
*
|
|
147
|
-
* @see https://eslint-react.xyz/docs/rules/no-string-refs
|
|
148
|
-
*/
|
|
149
|
-
"@eslint-react/no-string-refs": "error",
|
|
150
|
-
/**
|
|
151
169
|
* Disallow findDOMNode.
|
|
152
170
|
*
|
|
153
171
|
* @see https://eslint-react.xyz/docs/rules/dom-no-find-dom-node
|
|
154
172
|
*/
|
|
155
|
-
"@eslint-react/dom
|
|
173
|
+
"@eslint-react/dom-no-find-dom-node": "error"
|
|
156
174
|
}
|
|
157
175
|
}]);
|
|
158
176
|
//#endregion
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abinnovision/eslint-config-react",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0-beta.2",
|
|
4
4
|
"description": "Shared ESLint configuration for React applications, building on @abinnovision/eslint-config-base.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
},
|
|
60
60
|
"prettier": "@abinnovision/prettier-config",
|
|
61
61
|
"dependencies": {
|
|
62
|
-
"@eslint-react/eslint-plugin": "^
|
|
62
|
+
"@eslint-react/eslint-plugin": "^5.14.10",
|
|
63
63
|
"eslint-plugin-better-tailwindcss": "^4.6.1",
|
|
64
64
|
"eslint-plugin-react-hooks": "^7.1.1"
|
|
65
65
|
},
|