eslint-plugin-react-dom 2.0.0-next.166 → 2.0.0-next.168
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 +9 -15
- package/package.json +8 -8
package/dist/index.js
CHANGED
|
@@ -47,7 +47,7 @@ const settings = { "react-x": DEFAULT_ESLINT_REACT_SETTINGS };
|
|
|
47
47
|
//#endregion
|
|
48
48
|
//#region package.json
|
|
49
49
|
var name = "eslint-plugin-react-dom";
|
|
50
|
-
var version = "2.0.0-next.
|
|
50
|
+
var version = "2.0.0-next.168";
|
|
51
51
|
|
|
52
52
|
//#endregion
|
|
53
53
|
//#region src/utils/create-jsx-element-resolver.ts
|
|
@@ -686,25 +686,19 @@ var no_string_style_prop_default = createRule({
|
|
|
686
686
|
defaultOptions: []
|
|
687
687
|
});
|
|
688
688
|
function create$5(context) {
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
const
|
|
692
|
-
|
|
689
|
+
const resolver = createJsxElementResolver(context);
|
|
690
|
+
return { JSXElement(node) {
|
|
691
|
+
const { attributes } = resolver.resolve(node);
|
|
692
|
+
const { attribute, attributeName, attributeValue, attributeValueString } = resolveAttribute(context, attributes, node, "style");
|
|
693
|
+
if (attributeName !== "style") return;
|
|
694
|
+
if (attribute == null || attributeValue?.node == null) return;
|
|
695
|
+
if (attributeValueString == null) return;
|
|
693
696
|
context.report({
|
|
694
697
|
messageId: "noStringStyleProp",
|
|
695
|
-
node
|
|
698
|
+
node: attributeValue.node
|
|
696
699
|
});
|
|
697
700
|
} };
|
|
698
701
|
}
|
|
699
|
-
function getAttributeValueText(context, node) {
|
|
700
|
-
if (node == null) return null;
|
|
701
|
-
switch (true) {
|
|
702
|
-
case node.type === AST_NODE_TYPES.Literal && typeof node.value === "string": return context.sourceCode.getText(node);
|
|
703
|
-
case node.type === AST_NODE_TYPES.JSXExpressionContainer && node.expression.type === AST_NODE_TYPES.Literal && typeof node.expression.value === "string": return context.sourceCode.getText(node.expression);
|
|
704
|
-
case node.type === AST_NODE_TYPES.JSXExpressionContainer && node.expression.type === AST_NODE_TYPES.TemplateLiteral: return context.sourceCode.getText(node.expression);
|
|
705
|
-
default: return null;
|
|
706
|
-
}
|
|
707
|
-
}
|
|
708
702
|
|
|
709
703
|
//#endregion
|
|
710
704
|
//#region src/rules/no-unknown-property.ts
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-react-dom",
|
|
3
|
-
"version": "2.0.0-next.
|
|
3
|
+
"version": "2.0.0-next.168",
|
|
4
4
|
"description": "ESLint React's ESLint plugin for React DOM related rules.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -41,12 +41,12 @@
|
|
|
41
41
|
"compare-versions": "^6.1.1",
|
|
42
42
|
"string-ts": "^2.2.1",
|
|
43
43
|
"ts-pattern": "^5.8.0",
|
|
44
|
-
"@eslint-react/ast": "2.0.0-next.
|
|
45
|
-
"@eslint-react/
|
|
46
|
-
"@eslint-react/eff": "2.0.0-next.
|
|
47
|
-
"@eslint-react/
|
|
48
|
-
"@eslint-react/kit": "2.0.0-next.
|
|
49
|
-
"@eslint-react/
|
|
44
|
+
"@eslint-react/ast": "2.0.0-next.168",
|
|
45
|
+
"@eslint-react/core": "2.0.0-next.168",
|
|
46
|
+
"@eslint-react/eff": "2.0.0-next.168",
|
|
47
|
+
"@eslint-react/shared": "2.0.0-next.168",
|
|
48
|
+
"@eslint-react/kit": "2.0.0-next.168",
|
|
49
|
+
"@eslint-react/var": "2.0.0-next.168"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"@types/react": "^19.1.12",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"@local/configs": "0.0.0"
|
|
56
56
|
},
|
|
57
57
|
"peerDependencies": {
|
|
58
|
-
"eslint": "^9.
|
|
58
|
+
"eslint": "^9.35.0",
|
|
59
59
|
"typescript": "^4.9.5 || ^5.4.5"
|
|
60
60
|
},
|
|
61
61
|
"peerDependenciesMeta": {
|