eslint-plugin-react-x 1.47.3-next.0 → 1.47.4-beta.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/index.js +11 -10
- package/dist/index.mjs +12 -11
- package/package.json +12 -12
package/dist/index.js
CHANGED
|
@@ -141,7 +141,7 @@ var settings3 = {
|
|
|
141
141
|
|
|
142
142
|
// package.json
|
|
143
143
|
var name4 = "eslint-plugin-react-x";
|
|
144
|
-
var version = "1.47.
|
|
144
|
+
var version = "1.47.4-beta.0";
|
|
145
145
|
var createRule = utils.ESLintUtils.RuleCreator(shared.getDocsUrl("x"));
|
|
146
146
|
|
|
147
147
|
// src/rules/avoid-shorthand-boolean.ts
|
|
@@ -575,7 +575,7 @@ var no_array_index_key_default = createRule({
|
|
|
575
575
|
defaultOptions: []
|
|
576
576
|
});
|
|
577
577
|
function create8(context) {
|
|
578
|
-
const report = kit.
|
|
578
|
+
const report = kit.Reporter.make(context);
|
|
579
579
|
const indexParamNames = [];
|
|
580
580
|
function isArrayIndex(node) {
|
|
581
581
|
return node.type === types.AST_NODE_TYPES.Identifier && indexParamNames.some((name5) => name5 != null && name5 === node.name);
|
|
@@ -1662,7 +1662,7 @@ var no_leaked_conditional_rendering_default = createRule({
|
|
|
1662
1662
|
defaultOptions: []
|
|
1663
1663
|
});
|
|
1664
1664
|
function create29(context) {
|
|
1665
|
-
if (!context.sourceCode.text.includes("&&")
|
|
1665
|
+
if (!context.sourceCode.text.includes("&&")) return {};
|
|
1666
1666
|
const { version: version2 } = shared.getSettingsFromContext(context);
|
|
1667
1667
|
const allowedVariants = [
|
|
1668
1668
|
"any",
|
|
@@ -1679,7 +1679,10 @@ function create29(context) {
|
|
|
1679
1679
|
const services = utils.ESLintUtils.getParserServices(context, false);
|
|
1680
1680
|
function getReportDescriptor(node) {
|
|
1681
1681
|
if (node == null) return eff._;
|
|
1682
|
-
|
|
1682
|
+
if (AST8__namespace.is(types.AST_NODE_TYPES.JSXExpressionContainer)(node)) return getReportDescriptor(node.expression);
|
|
1683
|
+
if (AST8__namespace.isJSX(node)) return eff._;
|
|
1684
|
+
if (AST8__namespace.isTypeExpression(node)) return getReportDescriptor(node.expression);
|
|
1685
|
+
return tsPattern.match(node).with({ type: types.AST_NODE_TYPES.LogicalExpression, operator: "&&" }, ({ left, right }) => {
|
|
1683
1686
|
const isLeftUnaryNot = left.type === types.AST_NODE_TYPES.UnaryExpression && left.operator === "!";
|
|
1684
1687
|
if (isLeftUnaryNot) {
|
|
1685
1688
|
return getReportDescriptor(right);
|
|
@@ -1712,10 +1715,8 @@ function create29(context) {
|
|
|
1712
1715
|
return tsPattern.match(variableDefNode).with({ init: tsPattern.P.select({ type: tsPattern.P.not(types.AST_NODE_TYPES.VariableDeclaration) }) }, getReportDescriptor).otherwise(() => eff._);
|
|
1713
1716
|
}).otherwise(() => eff._);
|
|
1714
1717
|
}
|
|
1715
|
-
const visitorFunction = eff.flow(getReportDescriptor, kit.Report.make(context).send);
|
|
1716
1718
|
return {
|
|
1717
|
-
|
|
1718
|
-
"JSXExpressionContainer > LogicalExpression": visitorFunction
|
|
1719
|
+
JSXExpressionContainer: eff.flow(getReportDescriptor, kit.Reporter.make(context).send)
|
|
1719
1720
|
};
|
|
1720
1721
|
}
|
|
1721
1722
|
var RULE_NAME30 = "no-missing-component-display-name";
|
|
@@ -1823,7 +1824,7 @@ function create31(context) {
|
|
|
1823
1824
|
}
|
|
1824
1825
|
}
|
|
1825
1826
|
},
|
|
1826
|
-
[kit.
|
|
1827
|
+
[kit.Selector.DISPLAY_NAME_ASSIGNMENT_EXPRESSION](node) {
|
|
1827
1828
|
displayNameAssignments.push(node);
|
|
1828
1829
|
}
|
|
1829
1830
|
};
|
|
@@ -1848,7 +1849,7 @@ var no_missing_key_default = createRule({
|
|
|
1848
1849
|
defaultOptions: []
|
|
1849
1850
|
});
|
|
1850
1851
|
function create32(context) {
|
|
1851
|
-
const report = kit.
|
|
1852
|
+
const report = kit.Reporter.make(context);
|
|
1852
1853
|
const state = { isWithinChildrenToArray: false };
|
|
1853
1854
|
function checkIteratorElement(node) {
|
|
1854
1855
|
switch (node.type) {
|
|
@@ -2731,7 +2732,7 @@ function create46(context) {
|
|
|
2731
2732
|
}
|
|
2732
2733
|
}
|
|
2733
2734
|
},
|
|
2734
|
-
[kit.
|
|
2735
|
+
[kit.Selector.OBJECT_DESTRUCTURING_VARIABLE_DECLARATOR](node) {
|
|
2735
2736
|
const functionEntry = ctx.getCurrentEntry();
|
|
2736
2737
|
if (functionEntry == null) return;
|
|
2737
2738
|
eff.getOrElseUpdate(
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getDocsUrl, getSettingsFromContext, unsafeDecodeSettings, DEFAULT_ESLINT_REACT_SETTINGS } from '@eslint-react/shared';
|
|
2
2
|
import * as ER25 from '@eslint-react/core';
|
|
3
3
|
import { ESLintUtils } from '@typescript-eslint/utils';
|
|
4
|
-
import { JsxConfig,
|
|
4
|
+
import { JsxConfig, Reporter, Selector } from '@eslint-react/kit';
|
|
5
5
|
import { AST_NODE_TYPES } from '@typescript-eslint/types';
|
|
6
6
|
import * as VAR2 from '@eslint-react/var';
|
|
7
7
|
import { match, isMatching, P } from 'ts-pattern';
|
|
@@ -114,7 +114,7 @@ var settings3 = {
|
|
|
114
114
|
|
|
115
115
|
// package.json
|
|
116
116
|
var name4 = "eslint-plugin-react-x";
|
|
117
|
-
var version = "1.47.
|
|
117
|
+
var version = "1.47.4-beta.0";
|
|
118
118
|
var createRule = ESLintUtils.RuleCreator(getDocsUrl("x"));
|
|
119
119
|
|
|
120
120
|
// src/rules/avoid-shorthand-boolean.ts
|
|
@@ -548,7 +548,7 @@ var no_array_index_key_default = createRule({
|
|
|
548
548
|
defaultOptions: []
|
|
549
549
|
});
|
|
550
550
|
function create8(context) {
|
|
551
|
-
const report =
|
|
551
|
+
const report = Reporter.make(context);
|
|
552
552
|
const indexParamNames = [];
|
|
553
553
|
function isArrayIndex(node) {
|
|
554
554
|
return node.type === AST_NODE_TYPES.Identifier && indexParamNames.some((name5) => name5 != null && name5 === node.name);
|
|
@@ -1635,7 +1635,7 @@ var no_leaked_conditional_rendering_default = createRule({
|
|
|
1635
1635
|
defaultOptions: []
|
|
1636
1636
|
});
|
|
1637
1637
|
function create29(context) {
|
|
1638
|
-
if (!context.sourceCode.text.includes("&&")
|
|
1638
|
+
if (!context.sourceCode.text.includes("&&")) return {};
|
|
1639
1639
|
const { version: version2 } = getSettingsFromContext(context);
|
|
1640
1640
|
const allowedVariants = [
|
|
1641
1641
|
"any",
|
|
@@ -1652,7 +1652,10 @@ function create29(context) {
|
|
|
1652
1652
|
const services = ESLintUtils.getParserServices(context, false);
|
|
1653
1653
|
function getReportDescriptor(node) {
|
|
1654
1654
|
if (node == null) return _;
|
|
1655
|
-
|
|
1655
|
+
if (AST8.is(AST_NODE_TYPES.JSXExpressionContainer)(node)) return getReportDescriptor(node.expression);
|
|
1656
|
+
if (AST8.isJSX(node)) return _;
|
|
1657
|
+
if (AST8.isTypeExpression(node)) return getReportDescriptor(node.expression);
|
|
1658
|
+
return match(node).with({ type: AST_NODE_TYPES.LogicalExpression, operator: "&&" }, ({ left, right }) => {
|
|
1656
1659
|
const isLeftUnaryNot = left.type === AST_NODE_TYPES.UnaryExpression && left.operator === "!";
|
|
1657
1660
|
if (isLeftUnaryNot) {
|
|
1658
1661
|
return getReportDescriptor(right);
|
|
@@ -1685,10 +1688,8 @@ function create29(context) {
|
|
|
1685
1688
|
return match(variableDefNode).with({ init: P.select({ type: P.not(AST_NODE_TYPES.VariableDeclaration) }) }, getReportDescriptor).otherwise(() => _);
|
|
1686
1689
|
}).otherwise(() => _);
|
|
1687
1690
|
}
|
|
1688
|
-
const visitorFunction = flow(getReportDescriptor, Report.make(context).send);
|
|
1689
1691
|
return {
|
|
1690
|
-
|
|
1691
|
-
"JSXExpressionContainer > LogicalExpression": visitorFunction
|
|
1692
|
+
JSXExpressionContainer: flow(getReportDescriptor, Reporter.make(context).send)
|
|
1692
1693
|
};
|
|
1693
1694
|
}
|
|
1694
1695
|
var RULE_NAME30 = "no-missing-component-display-name";
|
|
@@ -1796,7 +1797,7 @@ function create31(context) {
|
|
|
1796
1797
|
}
|
|
1797
1798
|
}
|
|
1798
1799
|
},
|
|
1799
|
-
[
|
|
1800
|
+
[Selector.DISPLAY_NAME_ASSIGNMENT_EXPRESSION](node) {
|
|
1800
1801
|
displayNameAssignments.push(node);
|
|
1801
1802
|
}
|
|
1802
1803
|
};
|
|
@@ -1821,7 +1822,7 @@ var no_missing_key_default = createRule({
|
|
|
1821
1822
|
defaultOptions: []
|
|
1822
1823
|
});
|
|
1823
1824
|
function create32(context) {
|
|
1824
|
-
const report =
|
|
1825
|
+
const report = Reporter.make(context);
|
|
1825
1826
|
const state = { isWithinChildrenToArray: false };
|
|
1826
1827
|
function checkIteratorElement(node) {
|
|
1827
1828
|
switch (node.type) {
|
|
@@ -2704,7 +2705,7 @@ function create46(context) {
|
|
|
2704
2705
|
}
|
|
2705
2706
|
}
|
|
2706
2707
|
},
|
|
2707
|
-
[
|
|
2708
|
+
[Selector.OBJECT_DESTRUCTURING_VARIABLE_DECLARATOR](node) {
|
|
2708
2709
|
const functionEntry = ctx.getCurrentEntry();
|
|
2709
2710
|
if (functionEntry == null) return;
|
|
2710
2711
|
getOrElseUpdate(
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-react-x",
|
|
3
|
-
"version": "1.47.
|
|
3
|
+
"version": "1.47.4-beta.0",
|
|
4
4
|
"description": "A set of composable ESLint rules for for libraries and frameworks that use React as a UI runtime.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -42,23 +42,23 @@
|
|
|
42
42
|
"./package.json"
|
|
43
43
|
],
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@typescript-eslint/scope-manager": "^8.
|
|
46
|
-
"@typescript-eslint/type-utils": "^8.
|
|
47
|
-
"@typescript-eslint/types": "^8.
|
|
48
|
-
"@typescript-eslint/utils": "^8.
|
|
45
|
+
"@typescript-eslint/scope-manager": "^8.30.1",
|
|
46
|
+
"@typescript-eslint/type-utils": "^8.30.1",
|
|
47
|
+
"@typescript-eslint/types": "^8.30.1",
|
|
48
|
+
"@typescript-eslint/utils": "^8.30.1",
|
|
49
49
|
"compare-versions": "^6.1.1",
|
|
50
50
|
"is-immutable-type": "^5.0.1",
|
|
51
51
|
"string-ts": "^2.2.1",
|
|
52
52
|
"ts-pattern": "^5.7.0",
|
|
53
|
-
"@eslint-react/ast": "1.47.
|
|
54
|
-
"@eslint-react/core": "1.47.
|
|
55
|
-
"@eslint-react/eff": "1.47.
|
|
56
|
-
"@eslint-react/kit": "1.47.
|
|
57
|
-
"@eslint-react/shared": "1.47.
|
|
58
|
-
"@eslint-react/var": "1.47.
|
|
53
|
+
"@eslint-react/ast": "1.47.4-beta.0",
|
|
54
|
+
"@eslint-react/core": "1.47.4-beta.0",
|
|
55
|
+
"@eslint-react/eff": "1.47.4-beta.0",
|
|
56
|
+
"@eslint-react/kit": "1.47.4-beta.0",
|
|
57
|
+
"@eslint-react/shared": "1.47.4-beta.0",
|
|
58
|
+
"@eslint-react/var": "1.47.4-beta.0"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
|
-
"@types/react": "^19.1.
|
|
61
|
+
"@types/react": "^19.1.2",
|
|
62
62
|
"@types/react-dom": "^19.1.2",
|
|
63
63
|
"ts-api-utils": "^2.1.0",
|
|
64
64
|
"tsup": "^8.4.0",
|