@pawover/eslint-rules 0.0.2 → 0.2.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/dist/core.antfu.js +59 -3
- package/dist/core.imports.js +45 -0
- package/dist/core.javascript.js +980 -0
- package/dist/core.react.js +459 -15
- package/dist/core.reactHooks.js +85 -0
- package/dist/core.stylistic.js +460 -0
- package/dist/core.typescript.js +715 -0
- package/dist/index.js +1 -1
- package/dist/types/core.antfu.d.ts +59 -1
- package/dist/types/core.antfu.d.ts.map +1 -1
- package/dist/types/core.imports.d.ts +45 -0
- package/dist/types/core.imports.d.ts.map +1 -1
- package/dist/types/core.javascript.d.ts +980 -0
- package/dist/types/core.javascript.d.ts.map +1 -1
- package/dist/types/core.react.d.ts +455 -11
- package/dist/types/core.react.d.ts.map +1 -1
- package/dist/types/core.reactHooks.d.ts +85 -0
- package/dist/types/core.reactHooks.d.ts.map +1 -1
- package/dist/types/core.stylistic.d.ts +460 -0
- package/dist/types/core.stylistic.d.ts.map +1 -1
- package/dist/types/core.typescript.d.ts +715 -0
- package/dist/types/core.typescript.d.ts.map +1 -1
- package/dist/types/index.d.ts +3 -3
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +53 -38
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core.javascript.d.ts","sourceRoot":"","sources":["../../src/core.javascript.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"core.javascript.d.ts","sourceRoot":"","sources":["../../src/core.javascript.ts"],"names":[],"mappings":";IAEE;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG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G;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;;;;AA1pCL,wBA4pCE"}
|
|
@@ -1,99 +1,543 @@
|
|
|
1
1
|
declare const _default: {
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* @desc 验证子组件错误是否使用 Error Boundaries 而非 try/catch
|
|
4
|
+
* @descEN Validates usage of Error Boundaries instead of try/catch for errors in child components
|
|
5
|
+
* @see https://www.eslint-react.xyz/docs/rules/error-boundaries
|
|
6
|
+
*/
|
|
3
7
|
"react/error-boundaries": number;
|
|
8
|
+
/**
|
|
9
|
+
* @desc 验证 useEffect 等 Hooks 的依赖列表完整性
|
|
10
|
+
* @descEN Verifies the list of dependencies for Hooks like useEffect and similar
|
|
11
|
+
* @see https://www.eslint-react.xyz/docs/rules/exhaustive-deps
|
|
12
|
+
*/
|
|
4
13
|
"react/exhaustive-deps": number;
|
|
14
|
+
/**
|
|
15
|
+
* @desc 禁止在 render 期间对全局变量赋值/修改
|
|
16
|
+
* @descEN Validates against assignment/mutation of globals during render
|
|
17
|
+
* @see https://www.eslint-react.xyz/docs/rules/globals
|
|
18
|
+
*/
|
|
19
|
+
"react/globals": number;
|
|
20
|
+
/**
|
|
21
|
+
* @desc 禁止修改 props、state 等不可变值
|
|
22
|
+
* @descEN Validates against mutating props, state, and other values that are immutable
|
|
23
|
+
* @see https://www.eslint-react.xyz/docs/rules/immutability
|
|
24
|
+
*/
|
|
5
25
|
"react/immutability": number;
|
|
26
|
+
/**
|
|
27
|
+
* @desc 禁止在 setState 回调中访问 this.state
|
|
28
|
+
* @descEN Disallows accessing this.state inside setState calls
|
|
29
|
+
* @see https://www.eslint-react.xyz/docs/rules/no-access-state-in-setstate
|
|
30
|
+
*/
|
|
6
31
|
"react/no-access-state-in-setstate": number;
|
|
32
|
+
/**
|
|
33
|
+
* @desc 禁止使用数组索引作为 key
|
|
34
|
+
* @descEN Disallows using an item's index in the array as its key
|
|
35
|
+
* @see https://www.eslint-react.xyz/docs/rules/no-array-index-key
|
|
36
|
+
*/
|
|
7
37
|
"react/no-array-index-key": number;
|
|
38
|
+
/**
|
|
39
|
+
* @desc 禁止使用 Children.count
|
|
40
|
+
* @descEN Disallows the use of Children.count from the react package
|
|
41
|
+
* @see https://www.eslint-react.xyz/docs/rules/no-children-count
|
|
42
|
+
*/
|
|
8
43
|
"react/no-children-count": number;
|
|
44
|
+
/**
|
|
45
|
+
* @desc 禁止使用 Children.forEach
|
|
46
|
+
* @descEN Disallows the use of Children.forEach from the react package
|
|
47
|
+
* @see https://www.eslint-react.xyz/docs/rules/no-children-for-each
|
|
48
|
+
*/
|
|
9
49
|
"react/no-children-for-each": number;
|
|
50
|
+
/**
|
|
51
|
+
* @desc 禁止使用 Children.map
|
|
52
|
+
* @descEN Disallows the use of Children.map from the react package
|
|
53
|
+
* @see https://www.eslint-react.xyz/docs/rules/no-children-map
|
|
54
|
+
*/
|
|
10
55
|
"react/no-children-map": number;
|
|
56
|
+
/**
|
|
57
|
+
* @desc 禁止使用 Children.only
|
|
58
|
+
* @descEN Disallows the use of Children.only from the react package
|
|
59
|
+
* @see https://www.eslint-react.xyz/docs/rules/no-children-only
|
|
60
|
+
*/
|
|
11
61
|
"react/no-children-only": number;
|
|
62
|
+
/**
|
|
63
|
+
* @desc 禁止使用 Children.toArray
|
|
64
|
+
* @descEN Disallows the use of Children.toArray from the react package
|
|
65
|
+
* @see https://www.eslint-react.xyz/docs/rules/no-children-to-array
|
|
66
|
+
*/
|
|
12
67
|
"react/no-children-to-array": number;
|
|
68
|
+
/**
|
|
69
|
+
* @desc 禁止使用类组件(错误边界除外)
|
|
70
|
+
* @descEN Disallows class components except for error boundaries
|
|
71
|
+
* @see https://www.eslint-react.xyz/docs/rules/no-class-component
|
|
72
|
+
*/
|
|
13
73
|
"react/no-class-component": number;
|
|
74
|
+
/**
|
|
75
|
+
* @desc 禁止使用 cloneElement
|
|
76
|
+
* @descEN Disallows cloneElement
|
|
77
|
+
* @see https://www.eslint-react.xyz/docs/rules/no-clone-element
|
|
78
|
+
*/
|
|
14
79
|
"react/no-clone-element": number;
|
|
80
|
+
/**
|
|
81
|
+
* @desc 禁止使用 componentWillMount,替换为 UNSAFE_componentWillMount
|
|
82
|
+
* @descEN Replaces usage of componentWillMount with UNSAFE_componentWillMount
|
|
83
|
+
* @see https://www.eslint-react.xyz/docs/rules/no-component-will-mount
|
|
84
|
+
*/
|
|
15
85
|
"react/no-component-will-mount": number;
|
|
86
|
+
/**
|
|
87
|
+
* @desc 禁止使用 componentWillReceiveProps,替换为 UNSAFE_componentWillReceiveProps
|
|
88
|
+
* @descEN Replaces usage of componentWillReceiveProps with UNSAFE_componentWillReceiveProps
|
|
89
|
+
* @see https://www.eslint-react.xyz/docs/rules/no-component-will-receive-props
|
|
90
|
+
*/
|
|
16
91
|
"react/no-component-will-receive-props": number;
|
|
92
|
+
/**
|
|
93
|
+
* @desc 禁止使用 componentWillUpdate,替换为 UNSAFE_componentWillUpdate
|
|
94
|
+
* @descEN Replaces usage of componentWillUpdate with UNSAFE_componentWillUpdate
|
|
95
|
+
* @see https://www.eslint-react.xyz/docs/rules/no-component-will-update
|
|
96
|
+
*/
|
|
17
97
|
"react/no-component-will-update": number;
|
|
98
|
+
/**
|
|
99
|
+
* @desc 禁止使用 Context.Provider,替换为 Context
|
|
100
|
+
* @descEN Replaces usage of Context.Provider with Context
|
|
101
|
+
* @see https://www.eslint-react.xyz/docs/rules/no-context-provider
|
|
102
|
+
*/
|
|
18
103
|
"react/no-context-provider": number;
|
|
104
|
+
/**
|
|
105
|
+
* @desc 禁止在函数组件中使用 createRef
|
|
106
|
+
* @descEN Disallows createRef in function components
|
|
107
|
+
* @see https://www.eslint-react.xyz/docs/rules/no-create-ref
|
|
108
|
+
*/
|
|
19
109
|
"react/no-create-ref": number;
|
|
110
|
+
/**
|
|
111
|
+
* @desc 禁止直接修改 this.state
|
|
112
|
+
* @descEN Disallows direct mutation of this.state
|
|
113
|
+
* @see https://www.eslint-react.xyz/docs/rules/no-direct-mutation-state
|
|
114
|
+
*/
|
|
20
115
|
"react/no-direct-mutation-state": number;
|
|
116
|
+
/**
|
|
117
|
+
* @desc 防止渲染列表时兄弟元素存在重复 key
|
|
118
|
+
* @descEN Prevents duplicate key props on sibling elements when rendering lists
|
|
119
|
+
* @see https://www.eslint-react.xyz/docs/rules/no-duplicate-key
|
|
120
|
+
*/
|
|
21
121
|
"react/no-duplicate-key": number;
|
|
122
|
+
/**
|
|
123
|
+
* @desc 禁止使用 forwardRef,改为将 ref 作为 prop 传递
|
|
124
|
+
* @descEN Replaces usage of forwardRef with passing ref as a prop
|
|
125
|
+
* @see https://www.eslint-react.xyz/docs/rules/no-forward-ref
|
|
126
|
+
*/
|
|
22
127
|
"react/no-forward-ref": number;
|
|
128
|
+
/**
|
|
129
|
+
* @desc 防止隐式传递 children prop
|
|
130
|
+
* @descEN Prevents implicitly passing the children prop to components
|
|
131
|
+
* @see https://www.eslint-react.xyz/docs/rules/no-implicit-children
|
|
132
|
+
*/
|
|
23
133
|
"react/no-implicit-children": number;
|
|
134
|
+
/**
|
|
135
|
+
* @desc 防止隐式传递 key prop
|
|
136
|
+
* @descEN Prevents implicitly passing the key prop to components
|
|
137
|
+
* @see https://www.eslint-react.xyz/docs/rules/no-implicit-key
|
|
138
|
+
*/
|
|
24
139
|
"react/no-implicit-key": number;
|
|
140
|
+
/**
|
|
141
|
+
* @desc 防止隐式传递 ref prop
|
|
142
|
+
* @descEN Prevents implicitly passing the ref prop to components
|
|
143
|
+
* @see https://www.eslint-react.xyz/docs/rules/no-implicit-ref
|
|
144
|
+
*/
|
|
25
145
|
"react/no-implicit-ref": number;
|
|
146
|
+
/**
|
|
147
|
+
* @desc 防止有问题的泄漏值被渲染
|
|
148
|
+
* @descEN Prevents problematic leaked values from being rendered
|
|
149
|
+
* @see https://www.eslint-react.xyz/docs/rules/no-leaked-conditional-rendering
|
|
150
|
+
*/
|
|
26
151
|
"react/no-leaked-conditional-rendering": number;
|
|
152
|
+
/**
|
|
153
|
+
* @desc 要求所有组件都有 displayName
|
|
154
|
+
* @descEN Enforces that all components have a displayName that can be used in DevTools
|
|
155
|
+
* @see https://www.eslint-react.xyz/docs/rules/no-missing-component-display-name
|
|
156
|
+
*/
|
|
27
157
|
"react/no-missing-component-display-name": number;
|
|
158
|
+
/**
|
|
159
|
+
* @desc 要求所有 context 都有 displayName
|
|
160
|
+
* @descEN Enforces that all contexts have a displayName that can be used in DevTools
|
|
161
|
+
* @see https://www.eslint-react.xyz/docs/rules/no-missing-context-display-name
|
|
162
|
+
*/
|
|
28
163
|
"react/no-missing-context-display-name": number;
|
|
164
|
+
/**
|
|
165
|
+
* @desc 禁止列表渲染中缺少 key
|
|
166
|
+
* @descEN Disallows missing key on items in list rendering
|
|
167
|
+
* @see https://www.eslint-react.xyz/docs/rules/no-missing-key
|
|
168
|
+
*/
|
|
29
169
|
"react/no-missing-key": number;
|
|
170
|
+
/**
|
|
171
|
+
* @desc 防止错误使用 captureOwnerStack
|
|
172
|
+
* @descEN Prevents incorrect usage of captureOwnerStack
|
|
173
|
+
* @see https://www.eslint-react.xyz/docs/rules/no-misused-capture-owner-stack
|
|
174
|
+
*/
|
|
30
175
|
"react/no-misused-capture-owner-stack": number;
|
|
176
|
+
/**
|
|
177
|
+
* @desc 禁止在其他组件内部嵌套定义组件
|
|
178
|
+
* @descEN Disallows nesting component definitions inside other components
|
|
179
|
+
* @see https://www.eslint-react.xyz/docs/rules/no-nested-component-definitions
|
|
180
|
+
*/
|
|
31
181
|
"react/no-nested-component-definitions": number;
|
|
182
|
+
/**
|
|
183
|
+
* @desc 禁止在其他组件或 hooks 内嵌套 lazy 组件声明
|
|
184
|
+
* @descEN Disallows nesting lazy component declarations inside other components or hooks
|
|
185
|
+
* @see https://www.eslint-react.xyz/docs/rules/no-nested-lazy-component-declarations
|
|
186
|
+
*/
|
|
32
187
|
"react/no-nested-lazy-component-declarations": number;
|
|
33
|
-
|
|
188
|
+
/**
|
|
189
|
+
* @desc 禁止在 componentDidMount 中调用 setState
|
|
190
|
+
* @descEN Disallows calling this.setState in componentDidMount outside functions such as callbacks
|
|
191
|
+
* @see https://www.eslint-react.xyz/docs/rules/no-set-state-in-component-did-mount
|
|
192
|
+
*/
|
|
34
193
|
"react/no-set-state-in-component-did-mount": number;
|
|
194
|
+
/**
|
|
195
|
+
* @desc 禁止在 componentDidUpdate 中调用 setState
|
|
196
|
+
* @descEN Disallows calling this.setState in componentDidUpdate outside functions such as callbacks
|
|
197
|
+
* @see https://www.eslint-react.xyz/docs/rules/no-set-state-in-component-did-update
|
|
198
|
+
*/
|
|
35
199
|
"react/no-set-state-in-component-did-update": number;
|
|
200
|
+
/**
|
|
201
|
+
* @desc 禁止在 componentWillUpdate 中调用 setState
|
|
202
|
+
* @descEN Disallows calling this.setState in componentWillUpdate outside functions such as callbacks
|
|
203
|
+
* @see https://www.eslint-react.xyz/docs/rules/no-set-state-in-component-will-update
|
|
204
|
+
*/
|
|
36
205
|
"react/no-set-state-in-component-will-update": number;
|
|
37
|
-
|
|
38
|
-
|
|
206
|
+
/**
|
|
207
|
+
* @desc 要求以 use 为前缀的函数体内至少使用一个 Hook
|
|
208
|
+
* @descEN Enforces that a function with the use prefix uses at least one Hook inside it
|
|
209
|
+
* @see https://www.eslint-react.xyz/docs/rules/no-unnecessary-use-prefix
|
|
210
|
+
*/
|
|
39
211
|
"react/no-unnecessary-use-prefix": number;
|
|
212
|
+
/**
|
|
213
|
+
* @desc 警告使用 UNSAFE_componentWillMount
|
|
214
|
+
* @descEN Warns about the use of UNSAFE_componentWillMount in class components
|
|
215
|
+
* @see https://www.eslint-react.xyz/docs/rules/no-unsafe-component-will-mount
|
|
216
|
+
*/
|
|
40
217
|
"react/no-unsafe-component-will-mount": number;
|
|
218
|
+
/**
|
|
219
|
+
* @desc 警告使用 UNSAFE_componentWillReceiveProps
|
|
220
|
+
* @descEN Warns about the use of UNSAFE_componentWillReceiveProps in class components
|
|
221
|
+
* @see https://www.eslint-react.xyz/docs/rules/no-unsafe-component-will-receive-props
|
|
222
|
+
*/
|
|
41
223
|
"react/no-unsafe-component-will-receive-props": number;
|
|
224
|
+
/**
|
|
225
|
+
* @desc 警告使用 UNSAFE_componentWillUpdate
|
|
226
|
+
* @descEN Warns about the use of UNSAFE_componentWillUpdate in class components
|
|
227
|
+
* @see https://www.eslint-react.xyz/docs/rules/no-unsafe-component-will-update
|
|
228
|
+
*/
|
|
42
229
|
"react/no-unsafe-component-will-update": number;
|
|
230
|
+
/**
|
|
231
|
+
* @desc 防止非稳定值作为 Context.Provider 的 value
|
|
232
|
+
* @descEN Prevents non-stable values from being used as a value for Context.Provider
|
|
233
|
+
* @see https://www.eslint-react.xyz/docs/rules/no-unstable-context-value
|
|
234
|
+
*/
|
|
43
235
|
"react/no-unstable-context-value": number;
|
|
236
|
+
/**
|
|
237
|
+
* @desc 防止引用类型值用作对象解构的默认 props
|
|
238
|
+
* @descEN Prevents using referential-type values as default props in object destructuring
|
|
239
|
+
* @see https://www.eslint-react.xyz/docs/rules/no-unstable-default-props
|
|
240
|
+
*/
|
|
44
241
|
"react/no-unstable-default-props": number;
|
|
242
|
+
/**
|
|
243
|
+
* @desc 警告未使用的类组件方法和属性
|
|
244
|
+
* @descEN Warns about unused class component methods and properties
|
|
245
|
+
* @see https://www.eslint-react.xyz/docs/rules/no-unused-class-component-members
|
|
246
|
+
*/
|
|
45
247
|
"react/no-unused-class-component-members": number;
|
|
248
|
+
/**
|
|
249
|
+
* @desc 警告已定义但从未使用的组件 props
|
|
250
|
+
* @descEN Warns about component props that are defined but never used
|
|
251
|
+
* @see https://www.eslint-react.xyz/docs/rules/no-unused-props
|
|
252
|
+
*/
|
|
46
253
|
"react/no-unused-props": number;
|
|
47
|
-
|
|
254
|
+
/**
|
|
255
|
+
* @desc 将 useContext 替换为 use
|
|
256
|
+
* @descEN Replaces usage of useContext with use
|
|
257
|
+
* @see https://www.eslint-react.xyz/docs/rules/no-use-context
|
|
258
|
+
*/
|
|
48
259
|
"react/no-use-context": number;
|
|
49
|
-
|
|
50
|
-
|
|
260
|
+
/**
|
|
261
|
+
* @desc 验证组件和 hooks 在 render 期间不调用已知的不纯函数
|
|
262
|
+
* @descEN Validates that components and hooks are pure by checking that they do not call known-impure functions during render
|
|
263
|
+
* @see https://www.eslint-react.xyz/docs/rules/purity
|
|
264
|
+
*/
|
|
51
265
|
"react/purity": number;
|
|
266
|
+
/**
|
|
267
|
+
* @desc 验证 ref 的正确使用,禁止在 render 期间读写 ref.current
|
|
268
|
+
* @descEN Validates correct usage of refs by checking that ref.current is not read or written during render
|
|
269
|
+
* @see https://www.eslint-react.xyz/docs/rules/refs
|
|
270
|
+
*/
|
|
52
271
|
"react/refs": number;
|
|
272
|
+
/**
|
|
273
|
+
* @desc 强制 Hooks 规则
|
|
274
|
+
* @descEN Enforces the Rules of Hooks
|
|
275
|
+
* @see https://www.eslint-react.xyz/docs/rules/rules-of-hooks
|
|
276
|
+
*/
|
|
53
277
|
"react/rules-of-hooks": number;
|
|
278
|
+
/**
|
|
279
|
+
* @desc 禁止在 effect 中同步设置状态
|
|
280
|
+
* @descEN Validates against setting state synchronously in an effect
|
|
281
|
+
* @see https://www.eslint-react.xyz/docs/rules/set-state-in-effect
|
|
282
|
+
*/
|
|
54
283
|
"react/set-state-in-effect": number;
|
|
284
|
+
/**
|
|
285
|
+
* @desc 禁止在 render 期间无条件设置状态
|
|
286
|
+
* @descEN Validates against unconditionally setting state during render
|
|
287
|
+
* @see https://www.eslint-react.xyz/docs/rules/set-state-in-render
|
|
288
|
+
*/
|
|
55
289
|
"react/set-state-in-render": number;
|
|
290
|
+
/**
|
|
291
|
+
* @desc 验证组件是静态的,不会在每次 render 时重建
|
|
292
|
+
* @descEN Validates that components are static, not recreated every render
|
|
293
|
+
* @see https://www.eslint-react.xyz/docs/rules/static-components
|
|
294
|
+
*/
|
|
295
|
+
"react/static-components": number;
|
|
296
|
+
/**
|
|
297
|
+
* @desc 验证 React Compiler 不支持的语法
|
|
298
|
+
* @descEN Validates against syntax that React Compiler does not support
|
|
299
|
+
* @see https://www.eslint-react.xyz/docs/rules/unsupported-syntax
|
|
300
|
+
*/
|
|
56
301
|
"react/unsupported-syntax": number;
|
|
302
|
+
/**
|
|
303
|
+
* @desc 验证 useMemo 的回调返回一个值
|
|
304
|
+
* @descEN Validates that useMemo is called with a callback that returns a value
|
|
305
|
+
* @see https://www.eslint-react.xyz/docs/rules/use-memo
|
|
306
|
+
*/
|
|
57
307
|
"react/use-memo": number;
|
|
308
|
+
/**
|
|
309
|
+
* @desc 强制正确使用 useState,包括解构和对称命名
|
|
310
|
+
* @descEN Enforces correct usage of useState, including destructuring, symmetric naming of the value and setter
|
|
311
|
+
* @see https://www.eslint-react.xyz/docs/rules/use-state
|
|
312
|
+
*/
|
|
58
313
|
"react/use-state": number;
|
|
314
|
+
/**
|
|
315
|
+
* @desc 禁止将 children 作为 prop 传递
|
|
316
|
+
* @descEN Disallows passing children as a prop
|
|
317
|
+
* @see https://www.eslint-react.xyz/docs/rules/jsx-no-children-prop
|
|
318
|
+
*/
|
|
59
319
|
"react/jsx-no-children-prop": number;
|
|
320
|
+
/**
|
|
321
|
+
* @desc 禁止同时将 children 作为 prop 与嵌套内容传递
|
|
322
|
+
* @descEN Disallows passing children as a prop when children are also passed as nested content
|
|
323
|
+
* @see https://www.eslint-react.xyz/docs/rules/jsx-no-children-prop-with-children
|
|
324
|
+
*/
|
|
60
325
|
"react/jsx-no-children-prop-with-children": number;
|
|
326
|
+
/**
|
|
327
|
+
* @desc 防止注释字符串被意外插入 JSX 文本节点
|
|
328
|
+
* @descEN Prevents comment strings from being accidentally inserted into a JSX element's text nodes
|
|
329
|
+
* @see https://www.eslint-react.xyz/docs/rules/jsx-no-comment-textnodes
|
|
330
|
+
*/
|
|
61
331
|
"react/jsx-no-comment-textnodes": number;
|
|
332
|
+
/**
|
|
333
|
+
* @desc 防止展开操作符后使用 key 导致自动 JSX 运行时去优化
|
|
334
|
+
* @descEN Prevent patterns that cause deoptimization when using the automatic JSX runtime
|
|
335
|
+
* @see https://www.eslint-react.xyz/docs/rules/jsx-no-key-after-spread
|
|
336
|
+
*/
|
|
62
337
|
"react/jsx-no-key-after-spread": number;
|
|
338
|
+
/**
|
|
339
|
+
* @desc 捕获 JSX 中从模板字符串复制遗留的 $ 符号
|
|
340
|
+
* @descEN Catches $ before {expr} in JSX — typically from template literal ${expr} being copy-pasted into JSX
|
|
341
|
+
* @see https://www.eslint-react.xyz/docs/rules/jsx-no-leaked-dollar
|
|
342
|
+
*/
|
|
63
343
|
"react/jsx-no-leaked-dollar": number;
|
|
344
|
+
/**
|
|
345
|
+
* @desc 捕获 JSX 文本节点开头的分号
|
|
346
|
+
* @descEN Catches ; at the start of JSX text nodes — typically from accidentally placing a statement-ending ; inside JSX
|
|
347
|
+
* @see https://www.eslint-react.xyz/docs/rules/jsx-no-leaked-semicolon
|
|
348
|
+
*/
|
|
64
349
|
"react/jsx-no-leaked-semicolon": number;
|
|
350
|
+
/**
|
|
351
|
+
* @desc 禁止 JSX 命名空间语法
|
|
352
|
+
* @descEN Disallow JSX namespace syntax, as React does not support them
|
|
353
|
+
* @see https://www.eslint-react.xyz/docs/rules/jsx-no-namespace
|
|
354
|
+
*/
|
|
65
355
|
"react/jsx-no-namespace": number;
|
|
356
|
+
/**
|
|
357
|
+
* @desc 禁止无用的 Fragment 元素
|
|
358
|
+
* @descEN Disallows useless fragment elements
|
|
359
|
+
* @see https://www.eslint-react.xyz/docs/rules/jsx-no-useless-fragment
|
|
360
|
+
*/
|
|
66
361
|
"react/jsx-no-useless-fragment": number;
|
|
362
|
+
/**
|
|
363
|
+
* @desc 验证和转换 React Client/Server 函数定义
|
|
364
|
+
* @descEN Validates and transforms React Client/Server Function definitions
|
|
365
|
+
* @see https://www.eslint-react.xyz/docs/rules/rsc-function-definition
|
|
366
|
+
*/
|
|
67
367
|
"react/rsc-function-definition": number;
|
|
68
|
-
|
|
368
|
+
/**
|
|
369
|
+
* @desc 禁止 DOM 元素使用 dangerouslySetInnerHTML
|
|
370
|
+
* @descEN Disallows DOM elements from using dangerouslySetInnerHTML
|
|
371
|
+
* @see https://www.eslint-react.xyz/docs/rules/dom-no-dangerously-set-innerhtml
|
|
372
|
+
*/
|
|
69
373
|
"react/dom-no-dangerously-set-innerhtml": number;
|
|
374
|
+
/**
|
|
375
|
+
* @desc 禁止同时使用 dangerouslySetInnerHTML 和 children
|
|
376
|
+
* @descEN Disallows DOM elements from using dangerouslySetInnerHTML and children at the same time
|
|
377
|
+
* @see https://www.eslint-react.xyz/docs/rules/dom-no-dangerously-set-innerhtml-with-children
|
|
378
|
+
*/
|
|
379
|
+
"react/dom-no-dangerously-set-innerhtml-with-children": number;
|
|
380
|
+
/**
|
|
381
|
+
* @desc 禁止使用 findDOMNode
|
|
382
|
+
* @descEN Disallows findDOMNode
|
|
383
|
+
* @see https://www.eslint-react.xyz/docs/rules/dom-no-find-dom-node
|
|
384
|
+
*/
|
|
70
385
|
"react/dom-no-find-dom-node": number;
|
|
386
|
+
/**
|
|
387
|
+
* @desc 禁止使用 flushSync
|
|
388
|
+
* @descEN Disallows flushSync
|
|
389
|
+
* @see https://www.eslint-react.xyz/docs/rules/dom-no-flush-sync
|
|
390
|
+
*/
|
|
71
391
|
"react/dom-no-flush-sync": number;
|
|
392
|
+
/**
|
|
393
|
+
* @desc 禁止使用 ReactDOM.hydrate,替换为 hydrateRoot
|
|
394
|
+
* @descEN Replaces usage of ReactDOM.hydrate with hydrateRoot
|
|
395
|
+
* @see https://www.eslint-react.xyz/docs/rules/dom-no-hydrate
|
|
396
|
+
*/
|
|
72
397
|
"react/dom-no-hydrate": number;
|
|
398
|
+
/**
|
|
399
|
+
* @desc 要求 button 元素使用显式 type 属性
|
|
400
|
+
* @descEN Enforces an explicit type attribute for button elements
|
|
401
|
+
* @see https://www.eslint-react.xyz/docs/rules/dom-no-missing-button-type
|
|
402
|
+
*/
|
|
73
403
|
"react/dom-no-missing-button-type": number;
|
|
404
|
+
/**
|
|
405
|
+
* @desc 要求 iframe 元素使用显式 sandbox 属性
|
|
406
|
+
* @descEN Enforces an explicit sandbox attribute for iframe elements
|
|
407
|
+
* @see https://www.eslint-react.xyz/docs/rules/dom-no-missing-iframe-sandbox
|
|
408
|
+
*/
|
|
74
409
|
"react/dom-no-missing-iframe-sandbox": number;
|
|
75
|
-
|
|
410
|
+
/**
|
|
411
|
+
* @desc 禁止使用 ReactDOM.render,替换为 createRoot
|
|
412
|
+
* @descEN Replaces usage of ReactDOM.render with createRoot(node).render
|
|
413
|
+
* @see https://www.eslint-react.xyz/docs/rules/dom-no-render
|
|
414
|
+
*/
|
|
76
415
|
"react/dom-no-render": number;
|
|
416
|
+
/**
|
|
417
|
+
* @desc 禁止使用 ReactDOM.render 的返回值
|
|
418
|
+
* @descEN Disallows the return value of ReactDOM.render
|
|
419
|
+
* @see https://www.eslint-react.xyz/docs/rules/dom-no-render-return-value
|
|
420
|
+
*/
|
|
421
|
+
"react/dom-no-render-return-value": number;
|
|
422
|
+
/**
|
|
423
|
+
* @desc 禁止使用 javascript: URL 作为属性值
|
|
424
|
+
* @descEN Disallows javascript: URLs as attribute values
|
|
425
|
+
* @see https://www.eslint-react.xyz/docs/rules/dom-no-script-url
|
|
426
|
+
*/
|
|
77
427
|
"react/dom-no-script-url": number;
|
|
428
|
+
/**
|
|
429
|
+
* @desc 禁止使用字符串 style prop,应使用对象
|
|
430
|
+
* @descEN Disallows the use of string style prop in JSX. Use an object instead
|
|
431
|
+
* @see https://www.eslint-react.xyz/docs/rules/dom-no-string-style-prop
|
|
432
|
+
*/
|
|
78
433
|
"react/dom-no-string-style-prop": number;
|
|
434
|
+
/**
|
|
435
|
+
* @desc 禁止未知的 DOM 属性
|
|
436
|
+
* @descEN Disallows unknown DOM properties
|
|
437
|
+
* @see https://www.eslint-react.xyz/docs/rules/dom-no-unknown-property
|
|
438
|
+
*/
|
|
79
439
|
"react/dom-no-unknown-property": number;
|
|
440
|
+
/**
|
|
441
|
+
* @desc 强制 iframe 的 sandbox 属性不能设置为不安全组合
|
|
442
|
+
* @descEN Enforces that the sandbox attribute for iframe elements is not set to unsafe combinations
|
|
443
|
+
* @see https://www.eslint-react.xyz/docs/rules/dom-no-unsafe-iframe-sandbox
|
|
444
|
+
*/
|
|
80
445
|
"react/dom-no-unsafe-iframe-sandbox": number;
|
|
446
|
+
/**
|
|
447
|
+
* @desc 禁止 target=_blank 缺少 rel=noreferrer noopener
|
|
448
|
+
* @descEN Disallows target=_blank without rel=noreferrer noopener
|
|
449
|
+
* @see https://www.eslint-react.xyz/docs/rules/dom-no-unsafe-target-blank
|
|
450
|
+
*/
|
|
81
451
|
"react/dom-no-unsafe-target-blank": number;
|
|
452
|
+
/**
|
|
453
|
+
* @desc 禁止使用 useFormState,替换为 useActionState
|
|
454
|
+
* @descEN Replaces usage of useFormState with useActionState
|
|
455
|
+
* @see https://www.eslint-react.xyz/docs/rules/dom-no-use-form-state
|
|
456
|
+
*/
|
|
82
457
|
"react/dom-no-use-form-state": number;
|
|
458
|
+
/**
|
|
459
|
+
* @desc 禁止在 void DOM 元素中使用 children
|
|
460
|
+
* @descEN Disallows children in void DOM elements
|
|
461
|
+
* @see https://www.eslint-react.xyz/docs/rules/dom-no-void-elements-with-children
|
|
462
|
+
*/
|
|
83
463
|
"react/dom-no-void-elements-with-children": number;
|
|
84
|
-
|
|
464
|
+
/**
|
|
465
|
+
* @desc 要求 addEventListener 有对应的 removeEventListener
|
|
466
|
+
* @descEN Enforces that every addEventListener has a corresponding removeEventListener
|
|
467
|
+
* @see https://www.eslint-react.xyz/docs/rules/web-api-no-leaked-event-listener
|
|
468
|
+
*/
|
|
85
469
|
"react/web-api-no-leaked-event-listener": number;
|
|
470
|
+
/**
|
|
471
|
+
* @desc 要求 fetch 有对应的 AbortController 中止
|
|
472
|
+
* @descEN Enforces that every fetch has a corresponding AbortController abort in the cleanup function
|
|
473
|
+
* @see https://www.eslint-react.xyz/docs/rules/web-api-no-leaked-fetch
|
|
474
|
+
*/
|
|
475
|
+
"react/web-api-no-leaked-fetch": number;
|
|
476
|
+
/**
|
|
477
|
+
* @desc 要求 setInterval 有对应的 clearInterval
|
|
478
|
+
* @descEN Enforces that every setInterval has a corresponding clearInterval
|
|
479
|
+
* @see https://www.eslint-react.xyz/docs/rules/web-api-no-leaked-interval
|
|
480
|
+
*/
|
|
86
481
|
"react/web-api-no-leaked-interval": number;
|
|
482
|
+
/**
|
|
483
|
+
* @desc 要求 ResizeObserver 有对应的 disconnect
|
|
484
|
+
* @descEN Enforces that every ResizeObserver created has a corresponding disconnect
|
|
485
|
+
* @see https://www.eslint-react.xyz/docs/rules/web-api-no-leaked-resize-observer
|
|
486
|
+
*/
|
|
87
487
|
"react/web-api-no-leaked-resize-observer": number;
|
|
488
|
+
/**
|
|
489
|
+
* @desc 要求 setTimeout 有对应的 clearTimeout
|
|
490
|
+
* @descEN Enforces that every setTimeout has a corresponding clearTimeout
|
|
491
|
+
* @see https://www.eslint-react.xyz/docs/rules/web-api-no-leaked-timeout
|
|
492
|
+
*/
|
|
88
493
|
"react/web-api-no-leaked-timeout": number;
|
|
494
|
+
/**
|
|
495
|
+
* @desc 强制 context 名称为有效组件名并以 Context 结尾
|
|
496
|
+
* @descEN Enforces the context name to be a valid component name with the suffix Context
|
|
497
|
+
* @see https://www.eslint-react.xyz/docs/rules/naming-convention-context-name
|
|
498
|
+
*/
|
|
89
499
|
"react/naming-convention-context-name": number;
|
|
500
|
+
/**
|
|
501
|
+
* @desc 强制 useId 赋值的标识符命名为 id 或以 Id 结尾
|
|
502
|
+
* @descEN Enforces identifier names assigned from useId calls to be either id or end with Id
|
|
503
|
+
* @see https://www.eslint-react.xyz/docs/rules/naming-convention-id-name
|
|
504
|
+
*/
|
|
90
505
|
"react/naming-convention-id-name": number;
|
|
506
|
+
/**
|
|
507
|
+
* @desc 强制 useRef 赋值的标识符命名为 ref 或以 Ref 结尾
|
|
508
|
+
* @descEN Enforces identifier names assigned from useRef calls to be either ref or end with Ref
|
|
509
|
+
* @see https://www.eslint-react.xyz/docs/rules/naming-convention-ref-name
|
|
510
|
+
*/
|
|
91
511
|
"react/naming-convention-ref-name": number;
|
|
92
|
-
|
|
512
|
+
/**
|
|
513
|
+
* @desc 以 JSON 格式报告所有函数组件
|
|
514
|
+
* @descEN Reports all function components in JSON format
|
|
515
|
+
* @see https://www.eslint-react.xyz/docs/rules/debug-function-component
|
|
516
|
+
*/
|
|
93
517
|
"react/debug-function-component": number;
|
|
518
|
+
/**
|
|
519
|
+
* @desc 以 JSON 格式报告所有 Hooks
|
|
520
|
+
* @descEN Reports all React Hooks in JSON format
|
|
521
|
+
* @see https://www.eslint-react.xyz/docs/rules/debug-hook
|
|
522
|
+
*/
|
|
94
523
|
"react/debug-hook": number;
|
|
524
|
+
/**
|
|
525
|
+
* @desc 以 JSON 格式报告所有从 React 初始化的标识符
|
|
526
|
+
* @descEN Reports all identifiers initialized from React in JSON format
|
|
527
|
+
* @see https://www.eslint-react.xyz/docs/rules/debug-is-from-react
|
|
528
|
+
*/
|
|
95
529
|
"react/debug-is-from-react": number;
|
|
530
|
+
/**
|
|
531
|
+
* @desc 以 JSON 格式报告所有从 ref 初始化或派生的标识符
|
|
532
|
+
* @descEN Reports all identifiers initialized or derived from refs in JSON format
|
|
533
|
+
* @see https://www.eslint-react.xyz/docs/rules/debug-is-from-ref
|
|
534
|
+
*/
|
|
96
535
|
"react/debug-is-from-ref": number;
|
|
536
|
+
/**
|
|
537
|
+
* @desc 以 JSON 格式报告所有 JSX 元素和片段
|
|
538
|
+
* @descEN Reports all JSX elements and fragments in JSON format
|
|
539
|
+
* @see https://www.eslint-react.xyz/docs/rules/debug-jsx
|
|
540
|
+
*/
|
|
97
541
|
"react/debug-jsx": number;
|
|
98
542
|
};
|
|
99
543
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core.react.d.ts","sourceRoot":"","sources":["../../src/core.react.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"core.react.d.ts","sourceRoot":"","sources":["../../src/core.react.ts"],"names":[],"mappings":";IACE;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;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