eslint-plugin-react-x 5.30.0-beta.0 → 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.js +4 -4
- package/package.json +7 -7
package/dist/index.js
CHANGED
|
@@ -8,7 +8,7 @@ import { P, isMatching, match } from "ts-pattern";
|
|
|
8
8
|
import { isAssignmentTargetEqual, isInitializedFromReact, resolveEnclosingAssignmentTarget, resolveObjectType, resolveOrigin } from "@eslint-react/var";
|
|
9
9
|
import { DefinitionType, ScopeType } from "@typescript-eslint/scope-manager";
|
|
10
10
|
import { findVariable, getStaticValue } from "@typescript-eslint/utils/ast-utils";
|
|
11
|
-
import { findParentAttribute, getElementFullType, hasAttribute, isAttribute } from "@eslint-react/jsx";
|
|
11
|
+
import { findParentAttribute, getCreateElementPropsObject, getElementFullType, hasAttribute, isAttribute, isInsideCreateElementProps } from "@eslint-react/jsx";
|
|
12
12
|
import { compare } from "compare-versions";
|
|
13
13
|
import { unionConstituents } from "ts-api-utils";
|
|
14
14
|
import "typescript";
|
|
@@ -130,7 +130,7 @@ const rules$6 = {
|
|
|
130
130
|
};
|
|
131
131
|
// package.json
|
|
132
132
|
var name$6 = "eslint-plugin-react-x";
|
|
133
|
-
var version = "5.30.0-beta.
|
|
133
|
+
var version = "5.30.0-beta.1";
|
|
134
134
|
// src/utils/create-rule.ts
|
|
135
135
|
function getDocsUrl(ruleName) {
|
|
136
136
|
return `https://eslint-react.xyz/docs/rules/${ruleName}`;
|
|
@@ -1750,7 +1750,7 @@ function create$46(context) {
|
|
|
1750
1750
|
}
|
|
1751
1751
|
function getPropsObject(node) {
|
|
1752
1752
|
const props = node.arguments[1];
|
|
1753
|
-
if (core.isCreateElementCall(context, node)) return
|
|
1753
|
+
if (core.isCreateElementCall(context, node)) return getCreateElementPropsObject(context, node);
|
|
1754
1754
|
if (!core.isCloneElementCall(context, node)) return null;
|
|
1755
1755
|
return props?.type === AST_NODE_TYPES.ObjectExpression ? props : null;
|
|
1756
1756
|
}
|
|
@@ -2930,7 +2930,7 @@ function create$22(context) {
|
|
|
2930
2930
|
});
|
|
2931
2931
|
continue;
|
|
2932
2932
|
}
|
|
2933
|
-
if (
|
|
2933
|
+
if (isInsideCreateElementProps(context, component)) {
|
|
2934
2934
|
context.report({
|
|
2935
2935
|
data: { suggestion: "Move it to the top level or pass it as a prop." },
|
|
2936
2936
|
messageId: "default",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-react-x",
|
|
3
|
-
"version": "5.30.0-beta.
|
|
3
|
+
"version": "5.30.0-beta.1",
|
|
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
|
"react",
|
|
@@ -36,12 +36,12 @@
|
|
|
36
36
|
"dist"
|
|
37
37
|
],
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@eslint-react/ast": "5.30.0-beta.
|
|
40
|
-
"@eslint-react/core": "5.30.0-beta.
|
|
41
|
-
"@eslint-react/eslint": "5.30.0-beta.
|
|
42
|
-
"@eslint-react/jsx": "5.30.0-beta.
|
|
43
|
-
"@eslint-react/shared": "5.30.0-beta.
|
|
44
|
-
"@eslint-react/var": "5.30.0-beta.
|
|
39
|
+
"@eslint-react/ast": "5.30.0-beta.1",
|
|
40
|
+
"@eslint-react/core": "5.30.0-beta.1",
|
|
41
|
+
"@eslint-react/eslint": "5.30.0-beta.1",
|
|
42
|
+
"@eslint-react/jsx": "5.30.0-beta.1",
|
|
43
|
+
"@eslint-react/shared": "5.30.0-beta.1",
|
|
44
|
+
"@eslint-react/var": "5.30.0-beta.1",
|
|
45
45
|
"@typescript-eslint/scope-manager": "^8.72.0",
|
|
46
46
|
"@typescript-eslint/types": "^8.72.0",
|
|
47
47
|
"@typescript-eslint/typescript-estree": "^8.72.0",
|