eslint-plugin-react-jsx 5.24.3 → 5.24.5
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/index.js +34 -89
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -6,35 +6,27 @@ import { collapseMultilineText, findAttribute, getChildren, getElementFullType,
|
|
|
6
6
|
import { AST_NODE_TYPES } from "@typescript-eslint/types";
|
|
7
7
|
import { Check } from "@eslint-react/ast";
|
|
8
8
|
import ts from "typescript";
|
|
9
|
-
|
|
10
9
|
//#region \0rolldown/runtime.js
|
|
11
10
|
var __defProp = Object.defineProperty;
|
|
12
11
|
var __exportAll = (all, no_symbols) => {
|
|
13
12
|
let target = {};
|
|
14
|
-
for (var name in all) {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
-
if (!no_symbols) {
|
|
21
|
-
__defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
22
|
-
}
|
|
13
|
+
for (var name in all) __defProp(target, name, {
|
|
14
|
+
get: all[name],
|
|
15
|
+
enumerable: true
|
|
16
|
+
});
|
|
17
|
+
if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
23
18
|
return target;
|
|
24
19
|
};
|
|
25
|
-
|
|
26
20
|
//#endregion
|
|
27
21
|
//#region package.json
|
|
28
22
|
var name$2 = "eslint-plugin-react-jsx";
|
|
29
|
-
var version = "5.24.
|
|
30
|
-
|
|
23
|
+
var version = "5.24.5";
|
|
31
24
|
//#endregion
|
|
32
25
|
//#region src/utils/create-rule.ts
|
|
33
26
|
function getDocsUrl(ruleName) {
|
|
34
27
|
return `https://eslint-react.xyz/docs/rules/jsx-${ruleName}`;
|
|
35
28
|
}
|
|
36
29
|
const createRule = ESLintUtils.RuleCreator(getDocsUrl);
|
|
37
|
-
|
|
38
30
|
//#endregion
|
|
39
31
|
//#region src/utils/remove-jsx-attribute.ts
|
|
40
32
|
function removeJsxAttribute(context, fixer, attribute) {
|
|
@@ -42,10 +34,6 @@ function removeJsxAttribute(context, fixer, attribute) {
|
|
|
42
34
|
while (start > 0 && /\s/.test(context.sourceCode.text[start - 1] ?? "")) start--;
|
|
43
35
|
return fixer.removeRange([start, attribute.range[1]]);
|
|
44
36
|
}
|
|
45
|
-
|
|
46
|
-
//#endregion
|
|
47
|
-
//#region src/rules/no-children-prop-with-children/no-children-prop-with-children.ts
|
|
48
|
-
const RULE_NAME$7 = "no-children-prop-with-children";
|
|
49
37
|
var no_children_prop_with_children_default = createRule({
|
|
50
38
|
meta: {
|
|
51
39
|
type: "problem",
|
|
@@ -59,9 +47,8 @@ var no_children_prop_with_children_default = createRule({
|
|
|
59
47
|
},
|
|
60
48
|
schema: []
|
|
61
49
|
},
|
|
62
|
-
name:
|
|
63
|
-
create: create$7
|
|
64
|
-
defaultOptions: []
|
|
50
|
+
name: "no-children-prop-with-children",
|
|
51
|
+
create: create$7
|
|
65
52
|
});
|
|
66
53
|
function create$7(context) {
|
|
67
54
|
return {
|
|
@@ -105,10 +92,6 @@ function create$7(context) {
|
|
|
105
92
|
}
|
|
106
93
|
};
|
|
107
94
|
}
|
|
108
|
-
|
|
109
|
-
//#endregion
|
|
110
|
-
//#region src/rules/no-children-prop/no-children-prop.ts
|
|
111
|
-
const RULE_NAME$6 = "no-children-prop";
|
|
112
95
|
var no_children_prop_default = createRule({
|
|
113
96
|
meta: {
|
|
114
97
|
type: "suggestion",
|
|
@@ -121,9 +104,8 @@ var no_children_prop_default = createRule({
|
|
|
121
104
|
},
|
|
122
105
|
schema: []
|
|
123
106
|
},
|
|
124
|
-
name:
|
|
125
|
-
create: create$6
|
|
126
|
-
defaultOptions: []
|
|
107
|
+
name: "no-children-prop",
|
|
108
|
+
create: create$6
|
|
127
109
|
});
|
|
128
110
|
function create$6(context) {
|
|
129
111
|
return {
|
|
@@ -192,10 +174,6 @@ function buildFix$1(context, node, prop, childrenText) {
|
|
|
192
174
|
return [removePropFix, fixer.insertTextBefore(node.closingElement, childrenText)];
|
|
193
175
|
};
|
|
194
176
|
}
|
|
195
|
-
|
|
196
|
-
//#endregion
|
|
197
|
-
//#region src/rules/no-comment-textnodes/no-comment-textnodes.ts
|
|
198
|
-
const RULE_NAME$5 = "no-comment-textnodes";
|
|
199
177
|
var no_comment_textnodes_default = createRule({
|
|
200
178
|
meta: {
|
|
201
179
|
type: "problem",
|
|
@@ -203,9 +181,8 @@ var no_comment_textnodes_default = createRule({
|
|
|
203
181
|
messages: { default: "Possible misused comment in text node. Comments inside children section of tag should be placed inside braces." },
|
|
204
182
|
schema: []
|
|
205
183
|
},
|
|
206
|
-
name:
|
|
207
|
-
create: create$5
|
|
208
|
-
defaultOptions: []
|
|
184
|
+
name: "no-comment-textnodes",
|
|
185
|
+
create: create$5
|
|
209
186
|
});
|
|
210
187
|
function create$5(context) {
|
|
211
188
|
return { JSXText(node) {
|
|
@@ -217,7 +194,6 @@ function create$5(context) {
|
|
|
217
194
|
});
|
|
218
195
|
} };
|
|
219
196
|
}
|
|
220
|
-
|
|
221
197
|
//#endregion
|
|
222
198
|
//#region ../../.pkgs/eff/dist/index.js
|
|
223
199
|
const pipeArguments = (self, args) => {
|
|
@@ -242,7 +218,7 @@ const pipeArguments = (self, args) => {
|
|
|
242
218
|
const Prototype = { pipe() {
|
|
243
219
|
return pipeArguments(this, arguments);
|
|
244
220
|
} };
|
|
245
|
-
|
|
221
|
+
(function() {
|
|
246
222
|
function PipeableBase() {}
|
|
247
223
|
PipeableBase.prototype = Prototype;
|
|
248
224
|
return PipeableBase;
|
|
@@ -277,33 +253,28 @@ const dual = function(arity, body) {
|
|
|
277
253
|
};
|
|
278
254
|
const identity = (a) => a;
|
|
279
255
|
const cast = identity;
|
|
280
|
-
|
|
281
|
-
const constTrue = constant(true);
|
|
282
|
-
const constFalse = constant(false);
|
|
283
|
-
const constNull = constant(null);
|
|
284
|
-
const constUndefined = constant(void 0);
|
|
285
|
-
const compose = dual(2, (ab, bc) => (a) => bc(ab(a)));
|
|
256
|
+
dual(2, (ab, bc) => (a) => bc(ab(a)));
|
|
286
257
|
const absurd = (_) => {
|
|
287
258
|
throw new Error("Called `absurd` function which should be uncallable");
|
|
288
259
|
};
|
|
289
|
-
|
|
260
|
+
cast(absurd);
|
|
290
261
|
function not(predicate) {
|
|
291
262
|
return (data) => !predicate(data);
|
|
292
263
|
}
|
|
293
|
-
|
|
264
|
+
dual(2, (a, b) => (data) => a(data) && b(data));
|
|
294
265
|
const or = dual(2, (a, b) => (data) => a(data) || b(data));
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
266
|
+
dual(2, (a, b) => (data) => a(data) !== b(data));
|
|
267
|
+
dual(2, (a, b) => (data) => a(data) === b(data));
|
|
268
|
+
dual(2, (antecedent, consequent) => (data) => !antecedent(data) || consequent(data));
|
|
269
|
+
dual(2, (a, b) => (data) => !a(data) && !b(data));
|
|
270
|
+
dual(2, (a, b) => (data) => !a(data) || !b(data));
|
|
300
271
|
function isFunction(input) {
|
|
301
272
|
return typeof input === "function";
|
|
302
273
|
}
|
|
303
274
|
function isObjectKeyword(input) {
|
|
304
275
|
return typeof input === "object" && input !== null || isFunction(input);
|
|
305
276
|
}
|
|
306
|
-
|
|
277
|
+
dual(2, (data, property) => isObjectKeyword(data) && property in data);
|
|
307
278
|
const dropWhile = dual(2, (self, predicate) => {
|
|
308
279
|
const input = Array.isArray(self) ? self : Array.from(self);
|
|
309
280
|
const len = input.length;
|
|
@@ -311,17 +282,13 @@ const dropWhile = dual(2, (self, predicate) => {
|
|
|
311
282
|
while (idx < len && predicate(input[idx], idx)) idx++;
|
|
312
283
|
return input.slice(idx);
|
|
313
284
|
});
|
|
314
|
-
|
|
285
|
+
dual(2, (self, predicate) => {
|
|
315
286
|
const input = Array.isArray(self) ? self : Array.from(self);
|
|
316
287
|
const len = input.length;
|
|
317
288
|
let idx = 0;
|
|
318
289
|
while (idx < len && predicate(input[idx], idx)) idx++;
|
|
319
290
|
return input.slice(0, idx);
|
|
320
291
|
});
|
|
321
|
-
|
|
322
|
-
//#endregion
|
|
323
|
-
//#region src/rules/no-key-after-spread/no-key-after-spread.ts
|
|
324
|
-
const RULE_NAME$4 = "no-key-after-spread";
|
|
325
292
|
var no_key_after_spread_default = createRule({
|
|
326
293
|
meta: {
|
|
327
294
|
type: "problem",
|
|
@@ -329,9 +296,8 @@ var no_key_after_spread_default = createRule({
|
|
|
329
296
|
messages: { default: "Placing 'key' after spread props causes deoptimization when using the automatic JSX runtime. Put 'key' before any spread props." },
|
|
330
297
|
schema: []
|
|
331
298
|
},
|
|
332
|
-
name:
|
|
333
|
-
create: create$4
|
|
334
|
-
defaultOptions: []
|
|
299
|
+
name: "no-key-after-spread",
|
|
300
|
+
create: create$4
|
|
335
301
|
});
|
|
336
302
|
function create$4(context) {
|
|
337
303
|
if (!context.sourceCode.text.includes("key=")) return {};
|
|
@@ -344,10 +310,6 @@ function create$4(context) {
|
|
|
344
310
|
});
|
|
345
311
|
} };
|
|
346
312
|
}
|
|
347
|
-
|
|
348
|
-
//#endregion
|
|
349
|
-
//#region src/rules/no-leaked-dollar/no-leaked-dollar.ts
|
|
350
|
-
const RULE_NAME$3 = "no-leaked-dollar";
|
|
351
313
|
var no_leaked_dollar_default = createRule({
|
|
352
314
|
meta: {
|
|
353
315
|
type: "suggestion",
|
|
@@ -360,9 +322,8 @@ var no_leaked_dollar_default = createRule({
|
|
|
360
322
|
},
|
|
361
323
|
schema: []
|
|
362
324
|
},
|
|
363
|
-
name:
|
|
364
|
-
create: create$3
|
|
365
|
-
defaultOptions: []
|
|
325
|
+
name: "no-leaked-dollar",
|
|
326
|
+
create: create$3
|
|
366
327
|
});
|
|
367
328
|
function create$3(context) {
|
|
368
329
|
if (!context.sourceCode.text.includes("$")) return {};
|
|
@@ -400,10 +361,6 @@ function isNonSubstantiveChild(child) {
|
|
|
400
361
|
if (isWhitespaceOrEmptyStringExpression(child)) return true;
|
|
401
362
|
return child.type === AST_NODE_TYPES.JSXExpressionContainer && child.expression.type === AST_NODE_TYPES.JSXEmptyExpression;
|
|
402
363
|
}
|
|
403
|
-
|
|
404
|
-
//#endregion
|
|
405
|
-
//#region src/rules/no-leaked-semicolon/no-leaked-semicolon.ts
|
|
406
|
-
const RULE_NAME$2 = "no-leaked-semicolon";
|
|
407
364
|
var no_leaked_semicolon_default = createRule({
|
|
408
365
|
meta: {
|
|
409
366
|
type: "problem",
|
|
@@ -416,9 +373,8 @@ var no_leaked_semicolon_default = createRule({
|
|
|
416
373
|
},
|
|
417
374
|
schema: []
|
|
418
375
|
},
|
|
419
|
-
name:
|
|
420
|
-
create: create$2
|
|
421
|
-
defaultOptions: []
|
|
376
|
+
name: "no-leaked-semicolon",
|
|
377
|
+
create: create$2
|
|
422
378
|
});
|
|
423
379
|
function create$2(context) {
|
|
424
380
|
return { JSXText(node) {
|
|
@@ -436,10 +392,6 @@ function create$2(context) {
|
|
|
436
392
|
});
|
|
437
393
|
} };
|
|
438
394
|
}
|
|
439
|
-
|
|
440
|
-
//#endregion
|
|
441
|
-
//#region src/rules/no-namespace/no-namespace.ts
|
|
442
|
-
const RULE_NAME$1 = "no-namespace";
|
|
443
395
|
var no_namespace_default = createRule({
|
|
444
396
|
meta: {
|
|
445
397
|
type: "problem",
|
|
@@ -447,9 +399,8 @@ var no_namespace_default = createRule({
|
|
|
447
399
|
messages: { default: "A React component '{{name}}' must not be in a namespace, as React does not support them." },
|
|
448
400
|
schema: []
|
|
449
401
|
},
|
|
450
|
-
name:
|
|
451
|
-
create: create$1
|
|
452
|
-
defaultOptions: []
|
|
402
|
+
name: "no-namespace",
|
|
403
|
+
create: create$1
|
|
453
404
|
});
|
|
454
405
|
function create$1(context) {
|
|
455
406
|
return { JSXElement(node) {
|
|
@@ -462,7 +413,6 @@ function create$1(context) {
|
|
|
462
413
|
});
|
|
463
414
|
} };
|
|
464
415
|
}
|
|
465
|
-
|
|
466
416
|
//#endregion
|
|
467
417
|
//#region src/rules/no-useless-fragment/no-useless-fragment.ts
|
|
468
418
|
const RULE_NAME = "no-useless-fragment";
|
|
@@ -487,14 +437,14 @@ const schema = [{
|
|
|
487
437
|
var no_useless_fragment_default = createRule({
|
|
488
438
|
meta: {
|
|
489
439
|
type: "suggestion",
|
|
440
|
+
defaultOptions: [...defaultOptions],
|
|
490
441
|
docs: { description: "Disallows useless fragment elements." },
|
|
491
442
|
fixable: "code",
|
|
492
443
|
messages: { default: "A fragment {{reason}} is useless." },
|
|
493
444
|
schema
|
|
494
445
|
},
|
|
495
446
|
name: RULE_NAME,
|
|
496
|
-
create
|
|
497
|
-
defaultOptions
|
|
447
|
+
create
|
|
498
448
|
});
|
|
499
449
|
function create(context, [option]) {
|
|
500
450
|
const options = {
|
|
@@ -563,7 +513,6 @@ function buildFix(context, node) {
|
|
|
563
513
|
return fixer.replaceTextRange([start, node.range[1]], text);
|
|
564
514
|
};
|
|
565
515
|
}
|
|
566
|
-
|
|
567
516
|
//#endregion
|
|
568
517
|
//#region src/plugin.ts
|
|
569
518
|
const plugin = {
|
|
@@ -582,7 +531,6 @@ const plugin = {
|
|
|
582
531
|
"no-useless-fragment": no_useless_fragment_default
|
|
583
532
|
}
|
|
584
533
|
};
|
|
585
|
-
|
|
586
534
|
//#endregion
|
|
587
535
|
//#region src/configs/recommended.ts
|
|
588
536
|
var recommended_exports = /* @__PURE__ */ __exportAll({
|
|
@@ -603,7 +551,6 @@ const rules$1 = {
|
|
|
603
551
|
};
|
|
604
552
|
const plugins$1 = { "react-jsx": plugin };
|
|
605
553
|
const settings$1 = { "react-x": DEFAULT_ESLINT_REACT_SETTINGS };
|
|
606
|
-
|
|
607
554
|
//#endregion
|
|
608
555
|
//#region src/configs/strict.ts
|
|
609
556
|
var strict_exports = /* @__PURE__ */ __exportAll({
|
|
@@ -620,7 +567,6 @@ const rules = {
|
|
|
620
567
|
};
|
|
621
568
|
const plugins = { ...plugins$1 };
|
|
622
569
|
const settings = { ...settings$1 };
|
|
623
|
-
|
|
624
570
|
//#endregion
|
|
625
571
|
//#region src/index.ts
|
|
626
572
|
function createConfig(base) {
|
|
@@ -641,6 +587,5 @@ const finalPlugin = {
|
|
|
641
587
|
["strict"]: createConfig(strict_exports)
|
|
642
588
|
}
|
|
643
589
|
};
|
|
644
|
-
|
|
645
590
|
//#endregion
|
|
646
|
-
export { finalPlugin as default };
|
|
591
|
+
export { finalPlugin as default };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-react-jsx",
|
|
3
|
-
"version": "5.24.
|
|
3
|
+
"version": "5.24.5",
|
|
4
4
|
"description": "ESLint React's ESLint plugin for React Flavored JSX rules.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -37,11 +37,11 @@
|
|
|
37
37
|
"dist"
|
|
38
38
|
],
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@eslint-react/ast": "5.24.
|
|
41
|
-
"@eslint-react/core": "5.24.
|
|
42
|
-
"@eslint-react/eslint": "5.24.
|
|
43
|
-
"@eslint-react/jsx": "5.24.
|
|
44
|
-
"@eslint-react/shared": "5.24.
|
|
40
|
+
"@eslint-react/ast": "5.24.5",
|
|
41
|
+
"@eslint-react/core": "5.24.5",
|
|
42
|
+
"@eslint-react/eslint": "5.24.5",
|
|
43
|
+
"@eslint-react/jsx": "5.24.5",
|
|
44
|
+
"@eslint-react/shared": "5.24.5",
|
|
45
45
|
"@typescript-eslint/types": "^8.71.0",
|
|
46
46
|
"@typescript-eslint/utils": "^8.71.0"
|
|
47
47
|
},
|