eslint-plugin-react-x 1.37.2-beta.1 → 1.37.2-next.0
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 -12
- package/dist/index.mjs +2 -12
- 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
|
|
|
@@ -136,7 +135,7 @@ var settings3 = {
|
|
|
136
135
|
|
|
137
136
|
// package.json
|
|
138
137
|
var name4 = "eslint-plugin-react-x";
|
|
139
|
-
var version = "1.37.2-
|
|
138
|
+
var version = "1.37.2-next.0";
|
|
140
139
|
var createRule = shared.createRuleForPlugin("x");
|
|
141
140
|
|
|
142
141
|
// src/rules/avoid-shorthand-boolean.ts
|
|
@@ -3253,7 +3252,7 @@ function create49(context) {
|
|
|
3253
3252
|
continue;
|
|
3254
3253
|
}
|
|
3255
3254
|
const propsType = typeUtils.getConstrainedTypeAtLocation(services, props);
|
|
3256
|
-
if (
|
|
3255
|
+
if (typeUtils.isTypeReadonly(services.program, propsType)) {
|
|
3257
3256
|
continue;
|
|
3258
3257
|
}
|
|
3259
3258
|
context.report({ messageId: "preferReadOnlyProps", node: props });
|
|
@@ -3261,15 +3260,6 @@ function create49(context) {
|
|
|
3261
3260
|
}
|
|
3262
3261
|
};
|
|
3263
3262
|
}
|
|
3264
|
-
function isTypeReadonlyLoose(services, type) {
|
|
3265
|
-
if (typeUtils.isTypeReadonly(services.program, type)) return true;
|
|
3266
|
-
try {
|
|
3267
|
-
const im = isImmutableType.getTypeImmutability(services.program, type);
|
|
3268
|
-
return isImmutableType.isUnknown(im) || isImmutableType.isImmutable(im) || isImmutableType.isReadonlyShallow(im) || isImmutableType.isReadonlyDeep(im);
|
|
3269
|
-
} catch {
|
|
3270
|
-
return true;
|
|
3271
|
-
}
|
|
3272
|
-
}
|
|
3273
3263
|
var RULE_NAME50 = "prefer-shorthand-boolean";
|
|
3274
3264
|
var RULE_FEATURES49 = [
|
|
3275
3265
|
"FIX"
|
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 { unionConstituents, 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) => {
|
|
@@ -109,7 +108,7 @@ var settings3 = {
|
|
|
109
108
|
|
|
110
109
|
// package.json
|
|
111
110
|
var name4 = "eslint-plugin-react-x";
|
|
112
|
-
var version = "1.37.2-
|
|
111
|
+
var version = "1.37.2-next.0";
|
|
113
112
|
var createRule = createRuleForPlugin("x");
|
|
114
113
|
|
|
115
114
|
// src/rules/avoid-shorthand-boolean.ts
|
|
@@ -3226,7 +3225,7 @@ function create49(context) {
|
|
|
3226
3225
|
continue;
|
|
3227
3226
|
}
|
|
3228
3227
|
const propsType = getConstrainedTypeAtLocation(services, props);
|
|
3229
|
-
if (
|
|
3228
|
+
if (isTypeReadonly(services.program, propsType)) {
|
|
3230
3229
|
continue;
|
|
3231
3230
|
}
|
|
3232
3231
|
context.report({ messageId: "preferReadOnlyProps", node: props });
|
|
@@ -3234,15 +3233,6 @@ function create49(context) {
|
|
|
3234
3233
|
}
|
|
3235
3234
|
};
|
|
3236
3235
|
}
|
|
3237
|
-
function isTypeReadonlyLoose(services, type) {
|
|
3238
|
-
if (isTypeReadonly(services.program, type)) return true;
|
|
3239
|
-
try {
|
|
3240
|
-
const im = getTypeImmutability(services.program, type);
|
|
3241
|
-
return isUnknown(im) || isImmutable(im) || isReadonlyShallow(im) || isReadonlyDeep(im);
|
|
3242
|
-
} catch {
|
|
3243
|
-
return true;
|
|
3244
|
-
}
|
|
3245
|
-
}
|
|
3246
3236
|
var RULE_NAME50 = "prefer-shorthand-boolean";
|
|
3247
3237
|
var RULE_FEATURES49 = [
|
|
3248
3238
|
"FIX"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-react-x",
|
|
3
|
-
"version": "1.37.2-
|
|
3
|
+
"version": "1.37.2-next.0",
|
|
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.27.0",
|
|
48
48
|
"@typescript-eslint/utils": "^8.27.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.37.2-
|
|
54
|
-
"@eslint-react/
|
|
55
|
-
"@eslint-react/
|
|
56
|
-
"@eslint-react/jsx": "1.37.2-
|
|
57
|
-
"@eslint-react/shared": "1.37.2-
|
|
58
|
-
"@eslint-react/var": "1.37.2-
|
|
52
|
+
"@eslint-react/ast": "1.37.2-next.0",
|
|
53
|
+
"@eslint-react/eff": "1.37.2-next.0",
|
|
54
|
+
"@eslint-react/core": "1.37.2-next.0",
|
|
55
|
+
"@eslint-react/jsx": "1.37.2-next.0",
|
|
56
|
+
"@eslint-react/shared": "1.37.2-next.0",
|
|
57
|
+
"@eslint-react/var": "1.37.2-next.0"
|
|
59
58
|
},
|
|
60
59
|
"devDependencies": {
|
|
61
60
|
"@types/react": "^19.0.12",
|