eslint-plugin-react-x 2.12.4-next.2 → 2.12.4
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 +7 -2
- package/package.json +10 -10
package/dist/index.js
CHANGED
|
@@ -67,7 +67,7 @@ const rules$7 = {
|
|
|
67
67
|
//#endregion
|
|
68
68
|
//#region package.json
|
|
69
69
|
var name$6 = "eslint-plugin-react-x";
|
|
70
|
-
var version = "2.12.4
|
|
70
|
+
var version = "2.12.4";
|
|
71
71
|
|
|
72
72
|
//#endregion
|
|
73
73
|
//#region src/utils/create-rule.ts
|
|
@@ -137,6 +137,7 @@ function getFullyQualifiedNameEx(checker, symbol) {
|
|
|
137
137
|
let name = symbol.name;
|
|
138
138
|
let parent = symbol.declarations?.at(0)?.parent;
|
|
139
139
|
if (parent == null) return checker.getFullyQualifiedName(symbol);
|
|
140
|
+
const namespace = parent.getSourceFile().statements.find((n) => ts.isNamespaceExportDeclaration(n));
|
|
140
141
|
while (parent.kind !== ts.SyntaxKind.SourceFile) {
|
|
141
142
|
switch (true) {
|
|
142
143
|
case ts.isInterfaceDeclaration(parent):
|
|
@@ -160,6 +161,9 @@ function getFullyQualifiedNameEx(checker, symbol) {
|
|
|
160
161
|
case ts.isNamespaceExport(parent):
|
|
161
162
|
name = `${parent.name.text}.${name}`;
|
|
162
163
|
break;
|
|
164
|
+
case ts.isNamespaceExportDeclaration(parent):
|
|
165
|
+
name = `${parent.name.text}.${name}`;
|
|
166
|
+
break;
|
|
163
167
|
case ts.isEnumMember(parent):
|
|
164
168
|
name = `${parent.name.getText()}.${name}`;
|
|
165
169
|
break;
|
|
@@ -192,6 +196,7 @@ function getFullyQualifiedNameEx(checker, symbol) {
|
|
|
192
196
|
}
|
|
193
197
|
parent = parent.parent;
|
|
194
198
|
}
|
|
199
|
+
if (namespace != null) return `${namespace.name.text}.${name}`;
|
|
195
200
|
return name;
|
|
196
201
|
}
|
|
197
202
|
|
|
@@ -1429,7 +1434,7 @@ function create$35(context) {
|
|
|
1429
1434
|
for (const type of unionConstituents(getConstrainedTypeAtLocation(services, node.argument))) {
|
|
1430
1435
|
const key = type.getProperty("key");
|
|
1431
1436
|
if (key == null) continue;
|
|
1432
|
-
if (getFullyQualifiedNameEx(checker, key)
|
|
1437
|
+
if (getFullyQualifiedNameEx(checker, key).toLowerCase().endsWith("react.attributes.key")) continue;
|
|
1433
1438
|
context.report({
|
|
1434
1439
|
messageId: "default",
|
|
1435
1440
|
node
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-react-x",
|
|
3
|
-
"version": "2.12.4
|
|
3
|
+
"version": "2.12.4",
|
|
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",
|
|
@@ -37,19 +37,19 @@
|
|
|
37
37
|
"./package.json"
|
|
38
38
|
],
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@typescript-eslint/scope-manager": "^8.
|
|
41
|
-
"@typescript-eslint/type-utils": "^8.
|
|
42
|
-
"@typescript-eslint/types": "^8.
|
|
43
|
-
"@typescript-eslint/utils": "^8.
|
|
40
|
+
"@typescript-eslint/scope-manager": "^8.55.0",
|
|
41
|
+
"@typescript-eslint/type-utils": "^8.55.0",
|
|
42
|
+
"@typescript-eslint/types": "^8.55.0",
|
|
43
|
+
"@typescript-eslint/utils": "^8.55.0",
|
|
44
44
|
"compare-versions": "^6.1.1",
|
|
45
45
|
"is-immutable-type": "^5.0.1",
|
|
46
46
|
"ts-api-utils": "^2.4.0",
|
|
47
47
|
"ts-pattern": "^5.9.0",
|
|
48
|
-
"@eslint-react/ast": "2.12.4
|
|
49
|
-
"@eslint-react/core": "2.12.4
|
|
50
|
-
"@eslint-react/eff": "2.12.4
|
|
51
|
-
"@eslint-react/shared": "2.12.4
|
|
52
|
-
"@eslint-react/var": "2.12.4
|
|
48
|
+
"@eslint-react/ast": "2.12.4",
|
|
49
|
+
"@eslint-react/core": "2.12.4",
|
|
50
|
+
"@eslint-react/eff": "2.12.4",
|
|
51
|
+
"@eslint-react/shared": "2.12.4",
|
|
52
|
+
"@eslint-react/var": "2.12.4"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
55
|
"@types/react": "^19.2.13",
|