eslint-plugin-react-x 1.15.1-beta.2 → 1.15.1-next.3
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 +6 -5
- package/dist/index.mjs +6 -5
- package/package.json +8 -8
package/dist/index.js
CHANGED
|
@@ -41,7 +41,7 @@ var ts25__default = /*#__PURE__*/_interopDefault(ts25);
|
|
|
41
41
|
|
|
42
42
|
// package.json
|
|
43
43
|
var name = "eslint-plugin-react-x";
|
|
44
|
-
var version = "1.15.1-
|
|
44
|
+
var version = "1.15.1-next.3";
|
|
45
45
|
var createRule = shared.createRuleForPlugin("x");
|
|
46
46
|
|
|
47
47
|
// src/rules/avoid-shorthand-boolean.ts
|
|
@@ -2430,18 +2430,19 @@ var prefer_react_namespace_import_default = createRule({
|
|
|
2430
2430
|
const isTypeImport = node.parent.importKind === "type";
|
|
2431
2431
|
const importStringPrefix = `import${isTypeImport ? " type" : ""}`;
|
|
2432
2432
|
const importSourceQuoted = `${quote}${importSource}${quote}`;
|
|
2433
|
+
const sourceCode = context.sourceCode.getText(node.parent);
|
|
2434
|
+
const semiColon = sourceCode.endsWith(";") ? ";" : "";
|
|
2433
2435
|
if (!hasOtherSpecifiers) {
|
|
2434
2436
|
return fixer.replaceText(
|
|
2435
2437
|
node.parent,
|
|
2436
|
-
`${importStringPrefix} * as ${node.local.name} from ${importSourceQuoted}
|
|
2438
|
+
`${importStringPrefix} * as ${node.local.name} from ${importSourceQuoted}${semiColon}`
|
|
2437
2439
|
);
|
|
2438
2440
|
}
|
|
2439
|
-
const sourceCode = context.sourceCode.getText(node.parent);
|
|
2440
2441
|
const specifiers = sourceCode.slice(sourceCode.indexOf("{"), sourceCode.indexOf("}") + 1);
|
|
2441
2442
|
return fixer.replaceText(
|
|
2442
2443
|
node.parent,
|
|
2443
|
-
`${importStringPrefix} * as ${node.local.name} from ${importSourceQuoted}
|
|
2444
|
-
${importStringPrefix} ${specifiers} from ${importSourceQuoted}
|
|
2444
|
+
`${importStringPrefix} * as ${node.local.name} from ${importSourceQuoted}${semiColon}
|
|
2445
|
+
${importStringPrefix} ${specifiers} from ${importSourceQuoted}${semiColon}`
|
|
2445
2446
|
);
|
|
2446
2447
|
}
|
|
2447
2448
|
});
|
package/dist/index.mjs
CHANGED
|
@@ -14,7 +14,7 @@ import { getTypeImmutability, isUnknown, isImmutable, isReadonlyShallow, isReado
|
|
|
14
14
|
|
|
15
15
|
// package.json
|
|
16
16
|
var name = "eslint-plugin-react-x";
|
|
17
|
-
var version = "1.15.1-
|
|
17
|
+
var version = "1.15.1-next.3";
|
|
18
18
|
var createRule = createRuleForPlugin("x");
|
|
19
19
|
|
|
20
20
|
// src/rules/avoid-shorthand-boolean.ts
|
|
@@ -2403,18 +2403,19 @@ var prefer_react_namespace_import_default = createRule({
|
|
|
2403
2403
|
const isTypeImport = node.parent.importKind === "type";
|
|
2404
2404
|
const importStringPrefix = `import${isTypeImport ? " type" : ""}`;
|
|
2405
2405
|
const importSourceQuoted = `${quote}${importSource}${quote}`;
|
|
2406
|
+
const sourceCode = context.sourceCode.getText(node.parent);
|
|
2407
|
+
const semiColon = sourceCode.endsWith(";") ? ";" : "";
|
|
2406
2408
|
if (!hasOtherSpecifiers) {
|
|
2407
2409
|
return fixer.replaceText(
|
|
2408
2410
|
node.parent,
|
|
2409
|
-
`${importStringPrefix} * as ${node.local.name} from ${importSourceQuoted}
|
|
2411
|
+
`${importStringPrefix} * as ${node.local.name} from ${importSourceQuoted}${semiColon}`
|
|
2410
2412
|
);
|
|
2411
2413
|
}
|
|
2412
|
-
const sourceCode = context.sourceCode.getText(node.parent);
|
|
2413
2414
|
const specifiers = sourceCode.slice(sourceCode.indexOf("{"), sourceCode.indexOf("}") + 1);
|
|
2414
2415
|
return fixer.replaceText(
|
|
2415
2416
|
node.parent,
|
|
2416
|
-
`${importStringPrefix} * as ${node.local.name} from ${importSourceQuoted}
|
|
2417
|
-
${importStringPrefix} ${specifiers} from ${importSourceQuoted}
|
|
2417
|
+
`${importStringPrefix} * as ${node.local.name} from ${importSourceQuoted}${semiColon}
|
|
2418
|
+
${importStringPrefix} ${specifiers} from ${importSourceQuoted}${semiColon}`
|
|
2418
2419
|
);
|
|
2419
2420
|
}
|
|
2420
2421
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-react-x",
|
|
3
|
-
"version": "1.15.1-
|
|
3
|
+
"version": "1.15.1-next.3",
|
|
4
4
|
"description": "A set of composable ESLint rules for libraries and frameworks that use React as a UI runtime.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint",
|
|
@@ -48,13 +48,13 @@
|
|
|
48
48
|
"@typescript-eslint/utils": "^8.10.0",
|
|
49
49
|
"is-immutable-type": "5.0.0",
|
|
50
50
|
"ts-pattern": "^5.5.0",
|
|
51
|
-
"@eslint-react/ast": "1.15.1-
|
|
52
|
-
"@eslint-react/jsx": "1.15.1-
|
|
53
|
-
"@eslint-react/core": "1.15.1-
|
|
54
|
-
"@eslint-react/shared": "1.15.1-
|
|
55
|
-
"@eslint-react/
|
|
56
|
-
"@eslint-react/
|
|
57
|
-
"@eslint-react/
|
|
51
|
+
"@eslint-react/ast": "1.15.1-next.3",
|
|
52
|
+
"@eslint-react/jsx": "1.15.1-next.3",
|
|
53
|
+
"@eslint-react/core": "1.15.1-next.3",
|
|
54
|
+
"@eslint-react/shared": "1.15.1-next.3",
|
|
55
|
+
"@eslint-react/types": "1.15.1-next.3",
|
|
56
|
+
"@eslint-react/var": "1.15.1-next.3",
|
|
57
|
+
"@eslint-react/tools": "1.15.1-next.3"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
60
|
"@types/react": "^18.3.11",
|