eslint-plugin-react-jsx 5.24.2 → 5.24.4
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 +44 -97
- 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.4";
|
|
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,7 +47,7 @@ var no_children_prop_with_children_default = createRule({
|
|
|
59
47
|
},
|
|
60
48
|
schema: []
|
|
61
49
|
},
|
|
62
|
-
name:
|
|
50
|
+
name: "no-children-prop-with-children",
|
|
63
51
|
create: create$7,
|
|
64
52
|
defaultOptions: []
|
|
65
53
|
});
|
|
@@ -105,10 +93,6 @@ function create$7(context) {
|
|
|
105
93
|
}
|
|
106
94
|
};
|
|
107
95
|
}
|
|
108
|
-
|
|
109
|
-
//#endregion
|
|
110
|
-
//#region src/rules/no-children-prop/no-children-prop.ts
|
|
111
|
-
const RULE_NAME$6 = "no-children-prop";
|
|
112
96
|
var no_children_prop_default = createRule({
|
|
113
97
|
meta: {
|
|
114
98
|
type: "suggestion",
|
|
@@ -121,7 +105,7 @@ var no_children_prop_default = createRule({
|
|
|
121
105
|
},
|
|
122
106
|
schema: []
|
|
123
107
|
},
|
|
124
|
-
name:
|
|
108
|
+
name: "no-children-prop",
|
|
125
109
|
create: create$6,
|
|
126
110
|
defaultOptions: []
|
|
127
111
|
});
|
|
@@ -192,10 +176,6 @@ function buildFix$1(context, node, prop, childrenText) {
|
|
|
192
176
|
return [removePropFix, fixer.insertTextBefore(node.closingElement, childrenText)];
|
|
193
177
|
};
|
|
194
178
|
}
|
|
195
|
-
|
|
196
|
-
//#endregion
|
|
197
|
-
//#region src/rules/no-comment-textnodes/no-comment-textnodes.ts
|
|
198
|
-
const RULE_NAME$5 = "no-comment-textnodes";
|
|
199
179
|
var no_comment_textnodes_default = createRule({
|
|
200
180
|
meta: {
|
|
201
181
|
type: "problem",
|
|
@@ -203,7 +183,7 @@ var no_comment_textnodes_default = createRule({
|
|
|
203
183
|
messages: { default: "Possible misused comment in text node. Comments inside children section of tag should be placed inside braces." },
|
|
204
184
|
schema: []
|
|
205
185
|
},
|
|
206
|
-
name:
|
|
186
|
+
name: "no-comment-textnodes",
|
|
207
187
|
create: create$5,
|
|
208
188
|
defaultOptions: []
|
|
209
189
|
});
|
|
@@ -217,7 +197,6 @@ function create$5(context) {
|
|
|
217
197
|
});
|
|
218
198
|
} };
|
|
219
199
|
}
|
|
220
|
-
|
|
221
200
|
//#endregion
|
|
222
201
|
//#region ../../.pkgs/eff/dist/index.js
|
|
223
202
|
const pipeArguments = (self, args) => {
|
|
@@ -242,7 +221,7 @@ const pipeArguments = (self, args) => {
|
|
|
242
221
|
const Prototype = { pipe() {
|
|
243
222
|
return pipeArguments(this, arguments);
|
|
244
223
|
} };
|
|
245
|
-
|
|
224
|
+
(function() {
|
|
246
225
|
function PipeableBase() {}
|
|
247
226
|
PipeableBase.prototype = Prototype;
|
|
248
227
|
return PipeableBase;
|
|
@@ -277,33 +256,28 @@ const dual = function(arity, body) {
|
|
|
277
256
|
};
|
|
278
257
|
const identity = (a) => a;
|
|
279
258
|
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)));
|
|
259
|
+
dual(2, (ab, bc) => (a) => bc(ab(a)));
|
|
286
260
|
const absurd = (_) => {
|
|
287
261
|
throw new Error("Called `absurd` function which should be uncallable");
|
|
288
262
|
};
|
|
289
|
-
|
|
263
|
+
cast(absurd);
|
|
290
264
|
function not(predicate) {
|
|
291
265
|
return (data) => !predicate(data);
|
|
292
266
|
}
|
|
293
|
-
|
|
267
|
+
dual(2, (a, b) => (data) => a(data) && b(data));
|
|
294
268
|
const or = dual(2, (a, b) => (data) => a(data) || b(data));
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
269
|
+
dual(2, (a, b) => (data) => a(data) !== b(data));
|
|
270
|
+
dual(2, (a, b) => (data) => a(data) === b(data));
|
|
271
|
+
dual(2, (antecedent, consequent) => (data) => !antecedent(data) || consequent(data));
|
|
272
|
+
dual(2, (a, b) => (data) => !a(data) && !b(data));
|
|
273
|
+
dual(2, (a, b) => (data) => !a(data) || !b(data));
|
|
300
274
|
function isFunction(input) {
|
|
301
275
|
return typeof input === "function";
|
|
302
276
|
}
|
|
303
277
|
function isObjectKeyword(input) {
|
|
304
278
|
return typeof input === "object" && input !== null || isFunction(input);
|
|
305
279
|
}
|
|
306
|
-
|
|
280
|
+
dual(2, (data, property) => isObjectKeyword(data) && property in data);
|
|
307
281
|
const dropWhile = dual(2, (self, predicate) => {
|
|
308
282
|
const input = Array.isArray(self) ? self : Array.from(self);
|
|
309
283
|
const len = input.length;
|
|
@@ -311,17 +285,13 @@ const dropWhile = dual(2, (self, predicate) => {
|
|
|
311
285
|
while (idx < len && predicate(input[idx], idx)) idx++;
|
|
312
286
|
return input.slice(idx);
|
|
313
287
|
});
|
|
314
|
-
|
|
288
|
+
dual(2, (self, predicate) => {
|
|
315
289
|
const input = Array.isArray(self) ? self : Array.from(self);
|
|
316
290
|
const len = input.length;
|
|
317
291
|
let idx = 0;
|
|
318
292
|
while (idx < len && predicate(input[idx], idx)) idx++;
|
|
319
293
|
return input.slice(0, idx);
|
|
320
294
|
});
|
|
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
295
|
var no_key_after_spread_default = createRule({
|
|
326
296
|
meta: {
|
|
327
297
|
type: "problem",
|
|
@@ -329,7 +299,7 @@ var no_key_after_spread_default = createRule({
|
|
|
329
299
|
messages: { default: "Placing 'key' after spread props causes deoptimization when using the automatic JSX runtime. Put 'key' before any spread props." },
|
|
330
300
|
schema: []
|
|
331
301
|
},
|
|
332
|
-
name:
|
|
302
|
+
name: "no-key-after-spread",
|
|
333
303
|
create: create$4,
|
|
334
304
|
defaultOptions: []
|
|
335
305
|
});
|
|
@@ -344,10 +314,6 @@ function create$4(context) {
|
|
|
344
314
|
});
|
|
345
315
|
} };
|
|
346
316
|
}
|
|
347
|
-
|
|
348
|
-
//#endregion
|
|
349
|
-
//#region src/rules/no-leaked-dollar/no-leaked-dollar.ts
|
|
350
|
-
const RULE_NAME$3 = "no-leaked-dollar";
|
|
351
317
|
var no_leaked_dollar_default = createRule({
|
|
352
318
|
meta: {
|
|
353
319
|
type: "suggestion",
|
|
@@ -360,7 +326,7 @@ var no_leaked_dollar_default = createRule({
|
|
|
360
326
|
},
|
|
361
327
|
schema: []
|
|
362
328
|
},
|
|
363
|
-
name:
|
|
329
|
+
name: "no-leaked-dollar",
|
|
364
330
|
create: create$3,
|
|
365
331
|
defaultOptions: []
|
|
366
332
|
});
|
|
@@ -400,10 +366,6 @@ function isNonSubstantiveChild(child) {
|
|
|
400
366
|
if (isWhitespaceOrEmptyStringExpression(child)) return true;
|
|
401
367
|
return child.type === AST_NODE_TYPES.JSXExpressionContainer && child.expression.type === AST_NODE_TYPES.JSXEmptyExpression;
|
|
402
368
|
}
|
|
403
|
-
|
|
404
|
-
//#endregion
|
|
405
|
-
//#region src/rules/no-leaked-semicolon/no-leaked-semicolon.ts
|
|
406
|
-
const RULE_NAME$2 = "no-leaked-semicolon";
|
|
407
369
|
var no_leaked_semicolon_default = createRule({
|
|
408
370
|
meta: {
|
|
409
371
|
type: "problem",
|
|
@@ -416,7 +378,7 @@ var no_leaked_semicolon_default = createRule({
|
|
|
416
378
|
},
|
|
417
379
|
schema: []
|
|
418
380
|
},
|
|
419
|
-
name:
|
|
381
|
+
name: "no-leaked-semicolon",
|
|
420
382
|
create: create$2,
|
|
421
383
|
defaultOptions: []
|
|
422
384
|
});
|
|
@@ -436,10 +398,6 @@ function create$2(context) {
|
|
|
436
398
|
});
|
|
437
399
|
} };
|
|
438
400
|
}
|
|
439
|
-
|
|
440
|
-
//#endregion
|
|
441
|
-
//#region src/rules/no-namespace/no-namespace.ts
|
|
442
|
-
const RULE_NAME$1 = "no-namespace";
|
|
443
401
|
var no_namespace_default = createRule({
|
|
444
402
|
meta: {
|
|
445
403
|
type: "problem",
|
|
@@ -447,7 +405,7 @@ var no_namespace_default = createRule({
|
|
|
447
405
|
messages: { default: "A React component '{{name}}' must not be in a namespace, as React does not support them." },
|
|
448
406
|
schema: []
|
|
449
407
|
},
|
|
450
|
-
name:
|
|
408
|
+
name: "no-namespace",
|
|
451
409
|
create: create$1,
|
|
452
410
|
defaultOptions: []
|
|
453
411
|
});
|
|
@@ -462,39 +420,33 @@ function create$1(context) {
|
|
|
462
420
|
});
|
|
463
421
|
} };
|
|
464
422
|
}
|
|
465
|
-
|
|
466
|
-
//#endregion
|
|
467
|
-
//#region src/rules/no-useless-fragment/no-useless-fragment.ts
|
|
468
|
-
const RULE_NAME = "no-useless-fragment";
|
|
469
|
-
const defaultOptions = [{
|
|
470
|
-
allowEmptyFragment: false,
|
|
471
|
-
allowExpressions: true
|
|
472
|
-
}];
|
|
473
|
-
const schema = [{
|
|
474
|
-
type: "object",
|
|
475
|
-
additionalProperties: false,
|
|
476
|
-
properties: {
|
|
477
|
-
allowEmptyFragment: {
|
|
478
|
-
type: "boolean",
|
|
479
|
-
description: "Allow empty fragments"
|
|
480
|
-
},
|
|
481
|
-
allowExpressions: {
|
|
482
|
-
type: "boolean",
|
|
483
|
-
description: "Allow fragments with a single expression child"
|
|
484
|
-
}
|
|
485
|
-
}
|
|
486
|
-
}];
|
|
487
423
|
var no_useless_fragment_default = createRule({
|
|
488
424
|
meta: {
|
|
489
425
|
type: "suggestion",
|
|
490
426
|
docs: { description: "Disallows useless fragment elements." },
|
|
491
427
|
fixable: "code",
|
|
492
428
|
messages: { default: "A fragment {{reason}} is useless." },
|
|
493
|
-
schema
|
|
429
|
+
schema: [{
|
|
430
|
+
type: "object",
|
|
431
|
+
additionalProperties: false,
|
|
432
|
+
properties: {
|
|
433
|
+
allowEmptyFragment: {
|
|
434
|
+
type: "boolean",
|
|
435
|
+
description: "Allow empty fragments"
|
|
436
|
+
},
|
|
437
|
+
allowExpressions: {
|
|
438
|
+
type: "boolean",
|
|
439
|
+
description: "Allow fragments with a single expression child"
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
}]
|
|
494
443
|
},
|
|
495
|
-
name:
|
|
444
|
+
name: "no-useless-fragment",
|
|
496
445
|
create,
|
|
497
|
-
defaultOptions
|
|
446
|
+
defaultOptions: [{
|
|
447
|
+
allowEmptyFragment: false,
|
|
448
|
+
allowExpressions: true
|
|
449
|
+
}]
|
|
498
450
|
});
|
|
499
451
|
function create(context, [option]) {
|
|
500
452
|
const options = {
|
|
@@ -563,7 +515,6 @@ function buildFix(context, node) {
|
|
|
563
515
|
return fixer.replaceTextRange([start, node.range[1]], text);
|
|
564
516
|
};
|
|
565
517
|
}
|
|
566
|
-
|
|
567
518
|
//#endregion
|
|
568
519
|
//#region src/plugin.ts
|
|
569
520
|
const plugin = {
|
|
@@ -582,7 +533,6 @@ const plugin = {
|
|
|
582
533
|
"no-useless-fragment": no_useless_fragment_default
|
|
583
534
|
}
|
|
584
535
|
};
|
|
585
|
-
|
|
586
536
|
//#endregion
|
|
587
537
|
//#region src/configs/recommended.ts
|
|
588
538
|
var recommended_exports = /* @__PURE__ */ __exportAll({
|
|
@@ -603,7 +553,6 @@ const rules$1 = {
|
|
|
603
553
|
};
|
|
604
554
|
const plugins$1 = { "react-jsx": plugin };
|
|
605
555
|
const settings$1 = { "react-x": DEFAULT_ESLINT_REACT_SETTINGS };
|
|
606
|
-
|
|
607
556
|
//#endregion
|
|
608
557
|
//#region src/configs/strict.ts
|
|
609
558
|
var strict_exports = /* @__PURE__ */ __exportAll({
|
|
@@ -620,7 +569,6 @@ const rules = {
|
|
|
620
569
|
};
|
|
621
570
|
const plugins = { ...plugins$1 };
|
|
622
571
|
const settings = { ...settings$1 };
|
|
623
|
-
|
|
624
572
|
//#endregion
|
|
625
573
|
//#region src/index.ts
|
|
626
574
|
function createConfig(base) {
|
|
@@ -641,6 +589,5 @@ const finalPlugin = {
|
|
|
641
589
|
["strict"]: createConfig(strict_exports)
|
|
642
590
|
}
|
|
643
591
|
};
|
|
644
|
-
|
|
645
592
|
//#endregion
|
|
646
|
-
export { finalPlugin as default };
|
|
593
|
+
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.4",
|
|
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.4",
|
|
41
|
+
"@eslint-react/core": "5.24.4",
|
|
42
|
+
"@eslint-react/eslint": "5.24.4",
|
|
43
|
+
"@eslint-react/jsx": "5.24.4",
|
|
44
|
+
"@eslint-react/shared": "5.24.4",
|
|
45
45
|
"@typescript-eslint/types": "^8.71.0",
|
|
46
46
|
"@typescript-eslint/utils": "^8.71.0"
|
|
47
47
|
},
|