eslint-plugin-react-jsx 5.28.8 → 5.30.0-beta.1
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.d.ts +0 -2
- package/dist/index.js +17 -27
- package/package.json +7 -7
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { DEFAULT_ESLINT_REACT_SETTINGS } from "@eslint-react/shared";
|
|
2
2
|
import * as ESLintUtils from "@typescript-eslint/utils/eslint-utils";
|
|
3
|
-
import * as core from "@eslint-react/core";
|
|
4
3
|
import { getText } from "@eslint-react/eslint";
|
|
5
|
-
import { collapseMultilineText, findAttribute, getChildren, getElementFullType, hasAnyAttribute, hasChildren, isAttribute, isEmptyStringExpression, isFragmentElement, isHostElement, isWhitespaceText } from "@eslint-react/jsx";
|
|
4
|
+
import { collapseMultilineText, findAttribute, getChildren, getCreateElementChildrenArguments, getCreateElementProp, getElementFullType, hasAnyAttribute, hasChildren, isAttribute, isEmptyStringExpression, isFragmentElement, isHostElement, isWhitespaceText } from "@eslint-react/jsx";
|
|
6
5
|
import { AST_NODE_TYPES } from "@typescript-eslint/types";
|
|
7
6
|
import { Check } from "@eslint-react/ast";
|
|
7
|
+
import * as core from "@eslint-react/core";
|
|
8
8
|
import ts from "typescript";
|
|
9
|
-
|
|
9
|
+
// \0rolldown/runtime.js
|
|
10
10
|
var __defProp = Object.defineProperty;
|
|
11
11
|
var __exportAll = (all, no_symbols) => {
|
|
12
12
|
let target = {};
|
|
@@ -17,18 +17,15 @@ var __exportAll = (all, no_symbols) => {
|
|
|
17
17
|
if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
18
18
|
return target;
|
|
19
19
|
};
|
|
20
|
-
|
|
21
|
-
//#region package.json
|
|
20
|
+
// package.json
|
|
22
21
|
var name$2 = "eslint-plugin-react-jsx";
|
|
23
|
-
var version = "5.
|
|
24
|
-
|
|
25
|
-
//#region src/utils/create-rule.ts
|
|
22
|
+
var version = "5.30.0-beta.1";
|
|
23
|
+
// src/utils/create-rule.ts
|
|
26
24
|
function getDocsUrl(ruleName) {
|
|
27
25
|
return `https://eslint-react.xyz/docs/rules/jsx-${ruleName}`;
|
|
28
26
|
}
|
|
29
27
|
const createRule = ESLintUtils.RuleCreator(getDocsUrl);
|
|
30
|
-
|
|
31
|
-
//#region src/utils/remove-jsx-attribute.ts
|
|
28
|
+
// src/utils/remove-jsx-attribute.ts
|
|
32
29
|
function removeJSXAttribute(context, fixer, attribute) {
|
|
33
30
|
let start = attribute.range[0];
|
|
34
31
|
while (start > 0 && /\s/.test(context.sourceCode.text[start - 1] ?? "")) start--;
|
|
@@ -53,9 +50,9 @@ var no_children_prop_with_children_default = createRule({
|
|
|
53
50
|
function create$7(context) {
|
|
54
51
|
return {
|
|
55
52
|
CallExpression(node) {
|
|
56
|
-
const prop =
|
|
53
|
+
const prop = getCreateElementProp(context, node, "children");
|
|
57
54
|
if (prop == null) return;
|
|
58
|
-
if (
|
|
55
|
+
if (getCreateElementChildrenArguments(context, node).length === 0) return;
|
|
59
56
|
context.report({
|
|
60
57
|
messageId: "default",
|
|
61
58
|
node: prop
|
|
@@ -110,9 +107,9 @@ var no_children_prop_default = createRule({
|
|
|
110
107
|
function create$6(context) {
|
|
111
108
|
return {
|
|
112
109
|
CallExpression(node) {
|
|
113
|
-
const prop =
|
|
110
|
+
const prop = getCreateElementProp(context, node, "children");
|
|
114
111
|
if (prop == null) return;
|
|
115
|
-
if (
|
|
112
|
+
if (getCreateElementChildrenArguments(context, node).length > 0) return;
|
|
116
113
|
context.report({
|
|
117
114
|
messageId: "default",
|
|
118
115
|
node: prop
|
|
@@ -195,8 +192,7 @@ function create$5(context) {
|
|
|
195
192
|
});
|
|
196
193
|
} };
|
|
197
194
|
}
|
|
198
|
-
|
|
199
|
-
//#region ../../.pkgs/eff/dist/index.js
|
|
195
|
+
// ../../.pkgs/eff/dist/index.js
|
|
200
196
|
const pipeArguments = (self, args) => {
|
|
201
197
|
switch (args.length) {
|
|
202
198
|
case 0: return self;
|
|
@@ -414,8 +410,7 @@ function create$1(context) {
|
|
|
414
410
|
});
|
|
415
411
|
} };
|
|
416
412
|
}
|
|
417
|
-
|
|
418
|
-
//#region src/rules/no-useless-fragment/no-useless-fragment.ts
|
|
413
|
+
// src/rules/no-useless-fragment/no-useless-fragment.ts
|
|
419
414
|
const RULE_NAME = "no-useless-fragment";
|
|
420
415
|
const defaultOptions = [{
|
|
421
416
|
allowEmptyFragment: false,
|
|
@@ -514,8 +509,7 @@ function buildFix(context, node) {
|
|
|
514
509
|
return fixer.replaceTextRange([start, node.range[1]], text);
|
|
515
510
|
};
|
|
516
511
|
}
|
|
517
|
-
|
|
518
|
-
//#region src/plugin.ts
|
|
512
|
+
// src/plugin.ts
|
|
519
513
|
const plugin = {
|
|
520
514
|
meta: {
|
|
521
515
|
name: name$2,
|
|
@@ -532,8 +526,7 @@ const plugin = {
|
|
|
532
526
|
"no-useless-fragment": no_useless_fragment_default
|
|
533
527
|
}
|
|
534
528
|
};
|
|
535
|
-
|
|
536
|
-
//#region src/configs/recommended.ts
|
|
529
|
+
// src/configs/recommended.ts
|
|
537
530
|
var recommended_exports = /* @__PURE__ */ __exportAll({
|
|
538
531
|
name: () => name$1,
|
|
539
532
|
plugins: () => plugins$1,
|
|
@@ -552,8 +545,7 @@ const rules$1 = {
|
|
|
552
545
|
};
|
|
553
546
|
const plugins$1 = { "react-jsx": plugin };
|
|
554
547
|
const settings$1 = { "react-x": DEFAULT_ESLINT_REACT_SETTINGS };
|
|
555
|
-
|
|
556
|
-
//#region src/configs/strict.ts
|
|
548
|
+
// src/configs/strict.ts
|
|
557
549
|
var strict_exports = /* @__PURE__ */ __exportAll({
|
|
558
550
|
name: () => name,
|
|
559
551
|
plugins: () => plugins,
|
|
@@ -568,8 +560,7 @@ const rules = {
|
|
|
568
560
|
};
|
|
569
561
|
const plugins = { ...plugins$1 };
|
|
570
562
|
const settings = { ...settings$1 };
|
|
571
|
-
|
|
572
|
-
//#region src/index.ts
|
|
563
|
+
// src/index.ts
|
|
573
564
|
function createConfig(base) {
|
|
574
565
|
return {
|
|
575
566
|
...base,
|
|
@@ -588,5 +579,4 @@ const finalPlugin = {
|
|
|
588
579
|
["strict"]: createConfig(strict_exports)
|
|
589
580
|
}
|
|
590
581
|
};
|
|
591
|
-
//#endregion
|
|
592
582
|
export { finalPlugin as default };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-react-jsx",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.30.0-beta.1",
|
|
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.
|
|
41
|
-
"@eslint-react/core": "5.
|
|
42
|
-
"@eslint-react/eslint": "5.
|
|
43
|
-
"@eslint-react/jsx": "5.
|
|
44
|
-
"@eslint-react/shared": "5.
|
|
40
|
+
"@eslint-react/ast": "5.30.0-beta.1",
|
|
41
|
+
"@eslint-react/core": "5.30.0-beta.1",
|
|
42
|
+
"@eslint-react/eslint": "5.30.0-beta.1",
|
|
43
|
+
"@eslint-react/jsx": "5.30.0-beta.1",
|
|
44
|
+
"@eslint-react/shared": "5.30.0-beta.1",
|
|
45
45
|
"@typescript-eslint/types": "^8.72.0",
|
|
46
46
|
"@typescript-eslint/utils": "^8.72.0"
|
|
47
47
|
},
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"@types/react-dom": "^19.3.0",
|
|
56
56
|
"dedent": "^1.7.2",
|
|
57
57
|
"eslint": "^10.13.0",
|
|
58
|
-
"tsdown": "^0.23.
|
|
58
|
+
"tsdown": "^0.23.2",
|
|
59
59
|
"typescript": "6.0.3"
|
|
60
60
|
},
|
|
61
61
|
"peerDependencies": {
|