eslint-plugin-react-x 3.0.0-next.18 → 3.0.0-next.19
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 +5 -3
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -69,7 +69,7 @@ const rules$7 = {
|
|
|
69
69
|
//#endregion
|
|
70
70
|
//#region package.json
|
|
71
71
|
var name$6 = "eslint-plugin-react-x";
|
|
72
|
-
var version = "3.0.0-next.
|
|
72
|
+
var version = "3.0.0-next.19";
|
|
73
73
|
|
|
74
74
|
//#endregion
|
|
75
75
|
//#region src/utils/create-rule.ts
|
|
@@ -3018,9 +3018,9 @@ var no_unused_props_default = createRule({
|
|
|
3018
3018
|
});
|
|
3019
3019
|
function create$14(context) {
|
|
3020
3020
|
const services = ESLintUtils.getParserServices(context, false);
|
|
3021
|
+
const checker = services.program.getTypeChecker();
|
|
3021
3022
|
const { ctx, visitor } = core.useComponentCollector(context);
|
|
3022
3023
|
return defineRuleListener(visitor, { "Program:exit"(program) {
|
|
3023
|
-
const checker = services.program.getTypeChecker();
|
|
3024
3024
|
const totalDeclaredProps = /* @__PURE__ */ new Set();
|
|
3025
3025
|
const totalUsedProps = /* @__PURE__ */ new Set();
|
|
3026
3026
|
for (const component of ctx.getAllComponents(program)) {
|
|
@@ -3095,7 +3095,9 @@ function collectUsedPropKeysOfReference(context, usedPropKeys, identifier, ref)
|
|
|
3095
3095
|
function getKeyOfExpression(expr) {
|
|
3096
3096
|
switch (expr.type) {
|
|
3097
3097
|
case AST_NODE_TYPES.Identifier: return expr.name;
|
|
3098
|
-
case AST_NODE_TYPES.Literal:
|
|
3098
|
+
case AST_NODE_TYPES.Literal:
|
|
3099
|
+
if (typeof expr.value === "string") return expr.value;
|
|
3100
|
+
break;
|
|
3099
3101
|
}
|
|
3100
3102
|
return null;
|
|
3101
3103
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-react-x",
|
|
3
|
-
"version": "3.0.0-next.
|
|
3
|
+
"version": "3.0.0-next.19",
|
|
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",
|
|
@@ -45,11 +45,11 @@
|
|
|
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": "3.0.0-next.
|
|
49
|
-
"@eslint-react/core": "3.0.0-next.
|
|
50
|
-
"@eslint-react/eff": "3.0.0-next.
|
|
51
|
-
"@eslint-react/
|
|
52
|
-
"@eslint-react/
|
|
48
|
+
"@eslint-react/ast": "3.0.0-next.19",
|
|
49
|
+
"@eslint-react/core": "3.0.0-next.19",
|
|
50
|
+
"@eslint-react/eff": "3.0.0-next.19",
|
|
51
|
+
"@eslint-react/shared": "3.0.0-next.19",
|
|
52
|
+
"@eslint-react/var": "3.0.0-next.19"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
55
|
"@types/react": "^19.2.14",
|