eslint-plugin-react-x 1.28.1-next.1 → 1.28.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 +12 -5
- package/dist/index.mjs +12 -5
- package/package.json +7 -7
package/dist/index.js
CHANGED
|
@@ -137,7 +137,7 @@ var settings3 = {
|
|
|
137
137
|
|
|
138
138
|
// package.json
|
|
139
139
|
var name4 = "eslint-plugin-react-x";
|
|
140
|
-
var version = "1.28.1-next.
|
|
140
|
+
var version = "1.28.1-next.3";
|
|
141
141
|
var createRule = shared.createRuleForPlugin("x");
|
|
142
142
|
|
|
143
143
|
// src/utils/get-associated-tokens.ts
|
|
@@ -1760,10 +1760,10 @@ var no_missing_component_display_name_default = createRule({
|
|
|
1760
1760
|
listeners
|
|
1761
1761
|
} = core.useComponentCollector(
|
|
1762
1762
|
context,
|
|
1763
|
-
core.DEFAULT_COMPONENT_HINT,
|
|
1764
1763
|
{
|
|
1765
1764
|
collectDisplayName: true,
|
|
1766
|
-
collectHookCalls: false
|
|
1765
|
+
collectHookCalls: false,
|
|
1766
|
+
hint: core.DEFAULT_COMPONENT_HINT
|
|
1767
1767
|
}
|
|
1768
1768
|
);
|
|
1769
1769
|
return {
|
|
@@ -2011,7 +2011,7 @@ var no_nested_components_default = createRule({
|
|
|
2011
2011
|
name: RULE_NAME31,
|
|
2012
2012
|
create(context) {
|
|
2013
2013
|
const hint = core.ERComponentHint.SkipMapCallback | core.ERComponentHint.SkipNullLiteral | core.ERComponentHint.SkipUndefined | core.ERComponentHint.SkipBooleanLiteral | core.ERComponentHint.SkipStringLiteral | core.ERComponentHint.SkipNumberLiteral | core.ERComponentHint.StrictLogical | core.ERComponentHint.StrictConditional;
|
|
2014
|
-
const collector = core.useComponentCollector(context, hint);
|
|
2014
|
+
const collector = core.useComponentCollector(context, { hint });
|
|
2015
2015
|
const collectorLegacy = core.useComponentCollectorLegacy();
|
|
2016
2016
|
return {
|
|
2017
2017
|
...collector.listeners,
|
|
@@ -2050,7 +2050,7 @@ var no_nested_components_default = createRule({
|
|
|
2050
2050
|
}
|
|
2051
2051
|
continue;
|
|
2052
2052
|
}
|
|
2053
|
-
if (
|
|
2053
|
+
if (isInsideCreateElementProps(context, component)) {
|
|
2054
2054
|
context.report({
|
|
2055
2055
|
messageId: "nestedComponentInProps",
|
|
2056
2056
|
node: component,
|
|
@@ -2099,6 +2099,13 @@ var no_nested_components_default = createRule({
|
|
|
2099
2099
|
},
|
|
2100
2100
|
defaultOptions: []
|
|
2101
2101
|
});
|
|
2102
|
+
function isInsideCreateElementProps(context, node) {
|
|
2103
|
+
const call = AST11__namespace.findParentNode(node, core.isCreateElementCall(context));
|
|
2104
|
+
if (call == null) return false;
|
|
2105
|
+
const prop = AST11__namespace.findParentNode(node, AST11__namespace.is(types.AST_NODE_TYPES.ObjectExpression));
|
|
2106
|
+
if (prop == null) return false;
|
|
2107
|
+
return prop === call.arguments[1];
|
|
2108
|
+
}
|
|
2102
2109
|
var RULE_NAME32 = "no-prop-types";
|
|
2103
2110
|
var RULE_FEATURES32 = [
|
|
2104
2111
|
"CHK"
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRuleForPlugin, getSettingsFromContext, unsafeDecodeSettings, DEFAULT_ESLINT_REACT_SETTINGS } from '@eslint-react/shared';
|
|
2
2
|
import * as JSX7 from '@eslint-react/jsx';
|
|
3
3
|
import * as AST11 from '@eslint-react/ast';
|
|
4
|
-
import { isForwardRefCall, isClassComponent, isThisSetState, isChildrenCount, isChildrenForEach, isChildrenMap, isChildrenOnly, isChildrenToArray, useComponentCollectorLegacy, isComponentDidCatch, isGetDerivedStateFromError, isCloneElementCall, isCreateRefCall, isComponentName, useComponentCollector, DEFAULT_COMPONENT_HINT, ERComponentFlag, DISPLAY_NAME_ASSIGNMENT_SELECTOR, isCreateContextCall, isChildrenToArrayCall, ERComponentHint, isDirectValueOfRenderPropertyLoose, isDeclaredInRenderPropLoose,
|
|
4
|
+
import { isForwardRefCall, isClassComponent, isThisSetState, isChildrenCount, isChildrenForEach, isChildrenMap, isChildrenOnly, isChildrenToArray, useComponentCollectorLegacy, isComponentDidCatch, isGetDerivedStateFromError, isCloneElementCall, isCreateRefCall, isComponentName, useComponentCollector, DEFAULT_COMPONENT_HINT, ERComponentFlag, DISPLAY_NAME_ASSIGNMENT_SELECTOR, isCreateContextCall, isChildrenToArrayCall, ERComponentHint, isDirectValueOfRenderPropertyLoose, isDeclaredInRenderPropLoose, isInsideRenderMethod, isCreateElementCall, isReactHookCall, isReactHookCallWithNameAlias, isGetDerivedStateFromProps, isInitializedFromReact } from '@eslint-react/core';
|
|
5
5
|
import { _, getOrUpdate, identity } from '@eslint-react/eff';
|
|
6
6
|
import { AST_NODE_TYPES } from '@typescript-eslint/types';
|
|
7
7
|
import { isMatching, match, P } from 'ts-pattern';
|
|
@@ -110,7 +110,7 @@ var settings3 = {
|
|
|
110
110
|
|
|
111
111
|
// package.json
|
|
112
112
|
var name4 = "eslint-plugin-react-x";
|
|
113
|
-
var version = "1.28.1-next.
|
|
113
|
+
var version = "1.28.1-next.3";
|
|
114
114
|
var createRule = createRuleForPlugin("x");
|
|
115
115
|
|
|
116
116
|
// src/utils/get-associated-tokens.ts
|
|
@@ -1733,10 +1733,10 @@ var no_missing_component_display_name_default = createRule({
|
|
|
1733
1733
|
listeners
|
|
1734
1734
|
} = useComponentCollector(
|
|
1735
1735
|
context,
|
|
1736
|
-
DEFAULT_COMPONENT_HINT,
|
|
1737
1736
|
{
|
|
1738
1737
|
collectDisplayName: true,
|
|
1739
|
-
collectHookCalls: false
|
|
1738
|
+
collectHookCalls: false,
|
|
1739
|
+
hint: DEFAULT_COMPONENT_HINT
|
|
1740
1740
|
}
|
|
1741
1741
|
);
|
|
1742
1742
|
return {
|
|
@@ -1984,7 +1984,7 @@ var no_nested_components_default = createRule({
|
|
|
1984
1984
|
name: RULE_NAME31,
|
|
1985
1985
|
create(context) {
|
|
1986
1986
|
const hint = ERComponentHint.SkipMapCallback | ERComponentHint.SkipNullLiteral | ERComponentHint.SkipUndefined | ERComponentHint.SkipBooleanLiteral | ERComponentHint.SkipStringLiteral | ERComponentHint.SkipNumberLiteral | ERComponentHint.StrictLogical | ERComponentHint.StrictConditional;
|
|
1987
|
-
const collector = useComponentCollector(context, hint);
|
|
1987
|
+
const collector = useComponentCollector(context, { hint });
|
|
1988
1988
|
const collectorLegacy = useComponentCollectorLegacy();
|
|
1989
1989
|
return {
|
|
1990
1990
|
...collector.listeners,
|
|
@@ -2072,6 +2072,13 @@ var no_nested_components_default = createRule({
|
|
|
2072
2072
|
},
|
|
2073
2073
|
defaultOptions: []
|
|
2074
2074
|
});
|
|
2075
|
+
function isInsideCreateElementProps(context, node) {
|
|
2076
|
+
const call = AST11.findParentNode(node, isCreateElementCall(context));
|
|
2077
|
+
if (call == null) return false;
|
|
2078
|
+
const prop = AST11.findParentNode(node, AST11.is(AST_NODE_TYPES.ObjectExpression));
|
|
2079
|
+
if (prop == null) return false;
|
|
2080
|
+
return prop === call.arguments[1];
|
|
2081
|
+
}
|
|
2075
2082
|
var RULE_NAME32 = "no-prop-types";
|
|
2076
2083
|
var RULE_FEATURES32 = [
|
|
2077
2084
|
"CHK"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-react-x",
|
|
3
|
-
"version": "1.28.1-next.
|
|
3
|
+
"version": "1.28.1-next.3",
|
|
4
4
|
"description": "A set of composable linting rules for libraries and frameworks that use React as a UI runtime.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -50,12 +50,12 @@
|
|
|
50
50
|
"is-immutable-type": "^5.0.1",
|
|
51
51
|
"string-ts": "^2.2.1",
|
|
52
52
|
"ts-pattern": "^5.6.2",
|
|
53
|
-
"@eslint-react/ast": "1.28.1-next.
|
|
54
|
-
"@eslint-react/eff": "1.28.1-next.
|
|
55
|
-
"@eslint-react/core": "1.28.1-next.
|
|
56
|
-
"@eslint-react/jsx": "1.28.1-next.
|
|
57
|
-
"@eslint-react/shared": "1.28.1-next.
|
|
58
|
-
"@eslint-react/var": "1.28.1-next.
|
|
53
|
+
"@eslint-react/ast": "1.28.1-next.3",
|
|
54
|
+
"@eslint-react/eff": "1.28.1-next.3",
|
|
55
|
+
"@eslint-react/core": "1.28.1-next.3",
|
|
56
|
+
"@eslint-react/jsx": "1.28.1-next.3",
|
|
57
|
+
"@eslint-react/shared": "1.28.1-next.3",
|
|
58
|
+
"@eslint-react/var": "1.28.1-next.3"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
61
|
"@types/react": "^19.0.10",
|