eslint-plugin-react-x 1.29.1-beta.2 → 1.29.1-beta.3
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 +2 -11
- package/dist/index.mjs +2 -11
- package/package.json +7 -8
package/dist/index.js
CHANGED
|
@@ -13,7 +13,6 @@ var typeUtils = require('@typescript-eslint/type-utils');
|
|
|
13
13
|
var utils = require('@typescript-eslint/utils');
|
|
14
14
|
var tsApiUtils = require('ts-api-utils');
|
|
15
15
|
var ts = require('typescript');
|
|
16
|
-
var isImmutableType = require('is-immutable-type');
|
|
17
16
|
|
|
18
17
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
19
18
|
|
|
@@ -137,7 +136,7 @@ var settings3 = {
|
|
|
137
136
|
|
|
138
137
|
// package.json
|
|
139
138
|
var name4 = "eslint-plugin-react-x";
|
|
140
|
-
var version = "1.29.1-beta.
|
|
139
|
+
var version = "1.29.1-beta.3";
|
|
141
140
|
var createRule = shared.createRuleForPlugin("x");
|
|
142
141
|
|
|
143
142
|
// src/rules/avoid-shorthand-boolean.ts
|
|
@@ -3381,14 +3380,6 @@ var RULE_FEATURES48 = [
|
|
|
3381
3380
|
"CHK",
|
|
3382
3381
|
"TSC"
|
|
3383
3382
|
];
|
|
3384
|
-
function isReadonlyType(type, services) {
|
|
3385
|
-
try {
|
|
3386
|
-
const im = isImmutableType.getTypeImmutability(services.program, type);
|
|
3387
|
-
return isImmutableType.isUnknown(im) || isImmutableType.isImmutable(im) || isImmutableType.isReadonlyShallow(im) || isImmutableType.isReadonlyDeep(im);
|
|
3388
|
-
} catch {
|
|
3389
|
-
return true;
|
|
3390
|
-
}
|
|
3391
|
-
}
|
|
3392
3383
|
var prefer_read_only_props_default = createRule({
|
|
3393
3384
|
meta: {
|
|
3394
3385
|
type: "problem",
|
|
@@ -3415,7 +3406,7 @@ var prefer_read_only_props_default = createRule({
|
|
|
3415
3406
|
continue;
|
|
3416
3407
|
}
|
|
3417
3408
|
const propsType = typeUtils.getConstrainedTypeAtLocation(services, props);
|
|
3418
|
-
if (typeUtils.isTypeReadonly(services.program, propsType)
|
|
3409
|
+
if (typeUtils.isTypeReadonly(services.program, propsType)) {
|
|
3419
3410
|
continue;
|
|
3420
3411
|
}
|
|
3421
3412
|
context.report({ messageId: "preferReadOnlyProps", node: props });
|
package/dist/index.mjs
CHANGED
|
@@ -11,7 +11,6 @@ import { getConstrainedTypeAtLocation, isTypeReadonly } from '@typescript-eslint
|
|
|
11
11
|
import { ESLintUtils } from '@typescript-eslint/utils';
|
|
12
12
|
import { unionTypeParts, isTypeFlagSet, isTrueLiteralType, isFalseLiteralType } from 'ts-api-utils';
|
|
13
13
|
import ts from 'typescript';
|
|
14
|
-
import { getTypeImmutability, isUnknown, isImmutable, isReadonlyShallow, isReadonlyDeep } from 'is-immutable-type';
|
|
15
14
|
|
|
16
15
|
var __defProp = Object.defineProperty;
|
|
17
16
|
var __export = (target, all) => {
|
|
@@ -110,7 +109,7 @@ var settings3 = {
|
|
|
110
109
|
|
|
111
110
|
// package.json
|
|
112
111
|
var name4 = "eslint-plugin-react-x";
|
|
113
|
-
var version = "1.29.1-beta.
|
|
112
|
+
var version = "1.29.1-beta.3";
|
|
114
113
|
var createRule = createRuleForPlugin("x");
|
|
115
114
|
|
|
116
115
|
// src/rules/avoid-shorthand-boolean.ts
|
|
@@ -3354,14 +3353,6 @@ var RULE_FEATURES48 = [
|
|
|
3354
3353
|
"CHK",
|
|
3355
3354
|
"TSC"
|
|
3356
3355
|
];
|
|
3357
|
-
function isReadonlyType(type, services) {
|
|
3358
|
-
try {
|
|
3359
|
-
const im = getTypeImmutability(services.program, type);
|
|
3360
|
-
return isUnknown(im) || isImmutable(im) || isReadonlyShallow(im) || isReadonlyDeep(im);
|
|
3361
|
-
} catch {
|
|
3362
|
-
return true;
|
|
3363
|
-
}
|
|
3364
|
-
}
|
|
3365
3356
|
var prefer_read_only_props_default = createRule({
|
|
3366
3357
|
meta: {
|
|
3367
3358
|
type: "problem",
|
|
@@ -3388,7 +3379,7 @@ var prefer_read_only_props_default = createRule({
|
|
|
3388
3379
|
continue;
|
|
3389
3380
|
}
|
|
3390
3381
|
const propsType = getConstrainedTypeAtLocation(services, props);
|
|
3391
|
-
if (isTypeReadonly(services.program, propsType)
|
|
3382
|
+
if (isTypeReadonly(services.program, propsType)) {
|
|
3392
3383
|
continue;
|
|
3393
3384
|
}
|
|
3394
3385
|
context.report({ messageId: "preferReadOnlyProps", node: props });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-react-x",
|
|
3
|
-
"version": "1.29.1-beta.
|
|
3
|
+
"version": "1.29.1-beta.3",
|
|
4
4
|
"description": "A set of composable linting rules for libraries and frameworks that use React as a UI runtime.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -47,15 +47,14 @@
|
|
|
47
47
|
"@typescript-eslint/types": "^8.25.0",
|
|
48
48
|
"@typescript-eslint/utils": "^8.25.0",
|
|
49
49
|
"compare-versions": "^6.1.1",
|
|
50
|
-
"is-immutable-type": "^5.0.1",
|
|
51
50
|
"string-ts": "^2.2.1",
|
|
52
51
|
"ts-pattern": "^5.6.2",
|
|
53
|
-
"@eslint-react/ast": "1.29.1-beta.
|
|
54
|
-
"@eslint-react/core": "1.29.1-beta.
|
|
55
|
-
"@eslint-react/
|
|
56
|
-
"@eslint-react/
|
|
57
|
-
"@eslint-react/
|
|
58
|
-
"@eslint-react/
|
|
52
|
+
"@eslint-react/ast": "1.29.1-beta.3",
|
|
53
|
+
"@eslint-react/core": "1.29.1-beta.3",
|
|
54
|
+
"@eslint-react/eff": "1.29.1-beta.3",
|
|
55
|
+
"@eslint-react/shared": "1.29.1-beta.3",
|
|
56
|
+
"@eslint-react/var": "1.29.1-beta.3",
|
|
57
|
+
"@eslint-react/jsx": "1.29.1-beta.3"
|
|
59
58
|
},
|
|
60
59
|
"devDependencies": {
|
|
61
60
|
"@types/react": "^19.0.10",
|