eslint-plugin-react-x 2.3.10-next.3 → 2.3.10-next.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 +10 -13
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -34,7 +34,7 @@ var __export = (all, symbols) => {
|
|
|
34
34
|
//#endregion
|
|
35
35
|
//#region package.json
|
|
36
36
|
var name$6 = "eslint-plugin-react-x";
|
|
37
|
-
var version = "2.3.10-next.
|
|
37
|
+
var version = "2.3.10-next.4";
|
|
38
38
|
|
|
39
39
|
//#endregion
|
|
40
40
|
//#region src/utils/create-rule.ts
|
|
@@ -3458,9 +3458,8 @@ function create$2(context) {
|
|
|
3458
3458
|
"Program:exit"(program) {
|
|
3459
3459
|
const components = ctx.getAllComponents(program);
|
|
3460
3460
|
for (const [, component] of components) {
|
|
3461
|
-
if (component.id == null) continue;
|
|
3462
|
-
if (component.name == null) continue;
|
|
3463
3461
|
const [props] = component.node.params;
|
|
3462
|
+
if (component.id == null || component.name == null) continue;
|
|
3464
3463
|
if (props == null) continue;
|
|
3465
3464
|
const propsType = getConstrainedTypeAtLocation(services, props);
|
|
3466
3465
|
if (isTypeReadonly(services.program, propsType)) continue;
|
|
@@ -3483,16 +3482,14 @@ function isTypeReadonlyLoose(services, type) {
|
|
|
3483
3482
|
}
|
|
3484
3483
|
}
|
|
3485
3484
|
function isClassOrInterfaceReadonlyLoose(checker, type) {
|
|
3486
|
-
const
|
|
3487
|
-
const
|
|
3488
|
-
if (
|
|
3489
|
-
if (
|
|
3490
|
-
|
|
3491
|
-
|
|
3492
|
-
|
|
3493
|
-
|
|
3494
|
-
}
|
|
3495
|
-
return true;
|
|
3485
|
+
const props = type.getProperties();
|
|
3486
|
+
const types = type.getBaseTypes() ?? [];
|
|
3487
|
+
if (props.length === 0) return true;
|
|
3488
|
+
if (types.length === 0) return props.every((p) => isPropertyReadonlyInType(type, p.getEscapedName(), checker));
|
|
3489
|
+
return props.every((p) => {
|
|
3490
|
+
if (isPropertyReadonlyInType(type, p.getEscapedName(), checker)) return true;
|
|
3491
|
+
return types.every((t) => isPropertyReadonlyInType(t, p.getEscapedName(), checker));
|
|
3492
|
+
});
|
|
3496
3493
|
}
|
|
3497
3494
|
|
|
3498
3495
|
//#endregion
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-react-x",
|
|
3
|
-
"version": "2.3.10-next.
|
|
3
|
+
"version": "2.3.10-next.4",
|
|
4
4
|
"description": "A set of composable ESLint rules for for libraries and frameworks that use React as a UI runtime.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -46,11 +46,11 @@
|
|
|
46
46
|
"string-ts": "^2.3.1",
|
|
47
47
|
"ts-api-utils": "^2.1.0",
|
|
48
48
|
"ts-pattern": "^5.9.0",
|
|
49
|
-
"@eslint-react/ast": "2.3.10-next.
|
|
50
|
-
"@eslint-react/
|
|
51
|
-
"@eslint-react/
|
|
52
|
-
"@eslint-react/
|
|
53
|
-
"@eslint-react/
|
|
49
|
+
"@eslint-react/ast": "2.3.10-next.4",
|
|
50
|
+
"@eslint-react/core": "2.3.10-next.4",
|
|
51
|
+
"@eslint-react/shared": "2.3.10-next.4",
|
|
52
|
+
"@eslint-react/eff": "2.3.10-next.4",
|
|
53
|
+
"@eslint-react/var": "2.3.10-next.4"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@types/react": "^19.2.7",
|