@typescript-eslint/type-utils 8.5.1-alpha.8 → 8.6.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/TypeOrValueSpecifier.d.ts +81 -2
- package/dist/TypeOrValueSpecifier.d.ts.map +1 -1
- package/dist/TypeOrValueSpecifier.js +84 -79
- package/dist/TypeOrValueSpecifier.js.map +1 -1
- package/dist/isTypeReadonly.d.ts +78 -3
- package/dist/isTypeReadonly.d.ts.map +1 -1
- package/dist/isTypeReadonly.js +2 -5
- package/dist/isTypeReadonly.js.map +1 -1
- package/package.json +4 -4
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { JSONSchema4 } from '@typescript-eslint/utils/json-schema';
|
|
2
1
|
import type * as ts from 'typescript';
|
|
3
2
|
/**
|
|
4
3
|
* Describes specific types or values declared in local files.
|
|
@@ -46,6 +45,86 @@ export interface PackageSpecifier {
|
|
|
46
45
|
* See [TypeOrValueSpecifier](/packages/type-utils/type-or-value-specifier).
|
|
47
46
|
*/
|
|
48
47
|
export type TypeOrValueSpecifier = FileSpecifier | LibSpecifier | PackageSpecifier | string;
|
|
49
|
-
export declare const
|
|
48
|
+
export declare const typeOrValueSpecifiersSchema: {
|
|
49
|
+
readonly type: "array";
|
|
50
|
+
readonly items: {
|
|
51
|
+
readonly oneOf: [{
|
|
52
|
+
readonly type: "string";
|
|
53
|
+
}, {
|
|
54
|
+
readonly type: "object";
|
|
55
|
+
readonly additionalProperties: false;
|
|
56
|
+
readonly properties: {
|
|
57
|
+
readonly from: {
|
|
58
|
+
readonly type: "string";
|
|
59
|
+
readonly enum: ["file"];
|
|
60
|
+
};
|
|
61
|
+
readonly name: {
|
|
62
|
+
readonly oneOf: [{
|
|
63
|
+
readonly type: "string";
|
|
64
|
+
}, {
|
|
65
|
+
readonly type: "array";
|
|
66
|
+
readonly minItems: 1;
|
|
67
|
+
readonly uniqueItems: true;
|
|
68
|
+
readonly items: {
|
|
69
|
+
readonly type: "string";
|
|
70
|
+
};
|
|
71
|
+
}];
|
|
72
|
+
};
|
|
73
|
+
readonly path: {
|
|
74
|
+
readonly type: "string";
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
readonly required: ["from", "name"];
|
|
78
|
+
}, {
|
|
79
|
+
readonly type: "object";
|
|
80
|
+
readonly additionalProperties: false;
|
|
81
|
+
readonly properties: {
|
|
82
|
+
readonly from: {
|
|
83
|
+
readonly type: "string";
|
|
84
|
+
readonly enum: ["lib"];
|
|
85
|
+
};
|
|
86
|
+
readonly name: {
|
|
87
|
+
readonly oneOf: [{
|
|
88
|
+
readonly type: "string";
|
|
89
|
+
}, {
|
|
90
|
+
readonly type: "array";
|
|
91
|
+
readonly minItems: 1;
|
|
92
|
+
readonly uniqueItems: true;
|
|
93
|
+
readonly items: {
|
|
94
|
+
readonly type: "string";
|
|
95
|
+
};
|
|
96
|
+
}];
|
|
97
|
+
};
|
|
98
|
+
};
|
|
99
|
+
readonly required: ["from", "name"];
|
|
100
|
+
}, {
|
|
101
|
+
readonly type: "object";
|
|
102
|
+
readonly additionalProperties: false;
|
|
103
|
+
readonly properties: {
|
|
104
|
+
readonly from: {
|
|
105
|
+
readonly type: "string";
|
|
106
|
+
readonly enum: ["package"];
|
|
107
|
+
};
|
|
108
|
+
readonly name: {
|
|
109
|
+
readonly oneOf: [{
|
|
110
|
+
readonly type: "string";
|
|
111
|
+
}, {
|
|
112
|
+
readonly type: "array";
|
|
113
|
+
readonly minItems: 1;
|
|
114
|
+
readonly uniqueItems: true;
|
|
115
|
+
readonly items: {
|
|
116
|
+
readonly type: "string";
|
|
117
|
+
};
|
|
118
|
+
}];
|
|
119
|
+
};
|
|
120
|
+
readonly package: {
|
|
121
|
+
readonly type: "string";
|
|
122
|
+
};
|
|
123
|
+
};
|
|
124
|
+
readonly required: ["from", "name", "package"];
|
|
125
|
+
}];
|
|
126
|
+
};
|
|
127
|
+
};
|
|
50
128
|
export declare function typeMatchesSpecifier(type: ts.Type, specifier: TypeOrValueSpecifier, program: ts.Program): boolean;
|
|
129
|
+
export declare const typeMatchesSomeSpecifier: (type: ts.Type, specifiers: TypeOrValueSpecifier[] | undefined, program: ts.Program) => boolean;
|
|
51
130
|
//# sourceMappingURL=TypeOrValueSpecifier.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TypeOrValueSpecifier.d.ts","sourceRoot":"","sources":["../src/TypeOrValueSpecifier.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TypeOrValueSpecifier.d.ts","sourceRoot":"","sources":["../src/TypeOrValueSpecifier.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,EAAE,MAAM,YAAY,CAAC;AAOtC;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;IAExB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,KAAK,CAAC;IAEZ;;OAEG;IACH,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;CACzB;AAED;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,SAAS,CAAC;IAEhB;;OAEG;IACH,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;IAExB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;GAGG;AACH,MAAM,MAAM,oBAAoB,GAC5B,aAAa,GACb,YAAY,GACZ,gBAAgB,GAChB,MAAM,CAAC;AAEX,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6FR,CAAC;AAEjC,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,EAAE,CAAC,IAAI,EACb,SAAS,EAAE,oBAAoB,EAC/B,OAAO,EAAE,EAAE,CAAC,OAAO,GAClB,OAAO,CA4BT;AAED,eAAO,MAAM,wBAAwB,SAC7B,EAAE,CAAC,IAAI,cACD,oBAAoB,EAAE,uBACzB,EAAE,CAAC,OAAO,KAClB,OAC2E,CAAC"}
|
|
@@ -23,103 +23,106 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.
|
|
26
|
+
exports.typeMatchesSomeSpecifier = exports.typeOrValueSpecifiersSchema = void 0;
|
|
27
27
|
exports.typeMatchesSpecifier = typeMatchesSpecifier;
|
|
28
28
|
const tsutils = __importStar(require("ts-api-utils"));
|
|
29
29
|
const specifierNameMatches_1 = require("./typeOrValueSpecifiers/specifierNameMatches");
|
|
30
30
|
const typeDeclaredInFile_1 = require("./typeOrValueSpecifiers/typeDeclaredInFile");
|
|
31
31
|
const typeDeclaredInLib_1 = require("./typeOrValueSpecifiers/typeDeclaredInLib");
|
|
32
32
|
const typeDeclaredInPackageDeclarationFile_1 = require("./typeOrValueSpecifiers/typeDeclaredInPackageDeclarationFile");
|
|
33
|
-
exports.
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
{
|
|
52
|
-
type: 'array',
|
|
53
|
-
minItems: 1,
|
|
54
|
-
uniqueItems: true,
|
|
55
|
-
items: {
|
|
33
|
+
exports.typeOrValueSpecifiersSchema = {
|
|
34
|
+
type: 'array',
|
|
35
|
+
items: {
|
|
36
|
+
oneOf: [
|
|
37
|
+
{
|
|
38
|
+
type: 'string',
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
type: 'object',
|
|
42
|
+
additionalProperties: false,
|
|
43
|
+
properties: {
|
|
44
|
+
from: {
|
|
45
|
+
type: 'string',
|
|
46
|
+
enum: ['file'],
|
|
47
|
+
},
|
|
48
|
+
name: {
|
|
49
|
+
oneOf: [
|
|
50
|
+
{
|
|
56
51
|
type: 'string',
|
|
57
52
|
},
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
53
|
+
{
|
|
54
|
+
type: 'array',
|
|
55
|
+
minItems: 1,
|
|
56
|
+
uniqueItems: true,
|
|
57
|
+
items: {
|
|
58
|
+
type: 'string',
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
],
|
|
62
|
+
},
|
|
63
|
+
path: {
|
|
64
|
+
type: 'string',
|
|
65
|
+
},
|
|
63
66
|
},
|
|
67
|
+
required: ['from', 'name'],
|
|
64
68
|
},
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
oneOf: [
|
|
77
|
-
{
|
|
78
|
-
type: 'string',
|
|
79
|
-
},
|
|
80
|
-
{
|
|
81
|
-
type: 'array',
|
|
82
|
-
minItems: 1,
|
|
83
|
-
uniqueItems: true,
|
|
84
|
-
items: {
|
|
69
|
+
{
|
|
70
|
+
type: 'object',
|
|
71
|
+
additionalProperties: false,
|
|
72
|
+
properties: {
|
|
73
|
+
from: {
|
|
74
|
+
type: 'string',
|
|
75
|
+
enum: ['lib'],
|
|
76
|
+
},
|
|
77
|
+
name: {
|
|
78
|
+
oneOf: [
|
|
79
|
+
{
|
|
85
80
|
type: 'string',
|
|
86
81
|
},
|
|
87
|
-
|
|
88
|
-
|
|
82
|
+
{
|
|
83
|
+
type: 'array',
|
|
84
|
+
minItems: 1,
|
|
85
|
+
uniqueItems: true,
|
|
86
|
+
items: {
|
|
87
|
+
type: 'string',
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
],
|
|
91
|
+
},
|
|
89
92
|
},
|
|
93
|
+
required: ['from', 'name'],
|
|
90
94
|
},
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
oneOf: [
|
|
103
|
-
{
|
|
104
|
-
type: 'string',
|
|
105
|
-
},
|
|
106
|
-
{
|
|
107
|
-
type: 'array',
|
|
108
|
-
minItems: 1,
|
|
109
|
-
uniqueItems: true,
|
|
110
|
-
items: {
|
|
95
|
+
{
|
|
96
|
+
type: 'object',
|
|
97
|
+
additionalProperties: false,
|
|
98
|
+
properties: {
|
|
99
|
+
from: {
|
|
100
|
+
type: 'string',
|
|
101
|
+
enum: ['package'],
|
|
102
|
+
},
|
|
103
|
+
name: {
|
|
104
|
+
oneOf: [
|
|
105
|
+
{
|
|
111
106
|
type: 'string',
|
|
112
107
|
},
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
108
|
+
{
|
|
109
|
+
type: 'array',
|
|
110
|
+
minItems: 1,
|
|
111
|
+
uniqueItems: true,
|
|
112
|
+
items: {
|
|
113
|
+
type: 'string',
|
|
114
|
+
},
|
|
115
|
+
},
|
|
116
|
+
],
|
|
117
|
+
},
|
|
118
|
+
package: {
|
|
119
|
+
type: 'string',
|
|
120
|
+
},
|
|
118
121
|
},
|
|
122
|
+
required: ['from', 'name', 'package'],
|
|
119
123
|
},
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
],
|
|
124
|
+
],
|
|
125
|
+
},
|
|
123
126
|
};
|
|
124
127
|
function typeMatchesSpecifier(type, specifier, program) {
|
|
125
128
|
if (tsutils.isIntrinsicErrorType(type)) {
|
|
@@ -143,4 +146,6 @@ function typeMatchesSpecifier(type, specifier, program) {
|
|
|
143
146
|
return (0, typeDeclaredInPackageDeclarationFile_1.typeDeclaredInPackageDeclarationFile)(specifier.package, declarations, declarationFiles, program);
|
|
144
147
|
}
|
|
145
148
|
}
|
|
149
|
+
const typeMatchesSomeSpecifier = (type, specifiers = [], program) => specifiers.some(specifier => typeMatchesSpecifier(type, specifier, program));
|
|
150
|
+
exports.typeMatchesSomeSpecifier = typeMatchesSomeSpecifier;
|
|
146
151
|
//# sourceMappingURL=TypeOrValueSpecifier.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TypeOrValueSpecifier.js","sourceRoot":"","sources":["../src/TypeOrValueSpecifier.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"TypeOrValueSpecifier.js","sourceRoot":"","sources":["../src/TypeOrValueSpecifier.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAmKA,oDAgCC;AAlMD,sDAAwC;AAGxC,uFAAoF;AACpF,mFAAgF;AAChF,iFAA8E;AAC9E,uHAAoH;AA6DvG,QAAA,2BAA2B,GAAG;IACzC,IAAI,EAAE,OAAO;IACb,KAAK,EAAE;QACL,KAAK,EAAE;YACL;gBACE,IAAI,EAAE,QAAQ;aACf;YACD;gBACE,IAAI,EAAE,QAAQ;gBACd,oBAAoB,EAAE,KAAK;gBAC3B,UAAU,EAAE;oBACV,IAAI,EAAE;wBACJ,IAAI,EAAE,QAAQ;wBACd,IAAI,EAAE,CAAC,MAAM,CAAC;qBACf;oBACD,IAAI,EAAE;wBACJ,KAAK,EAAE;4BACL;gCACE,IAAI,EAAE,QAAQ;6BACf;4BACD;gCACE,IAAI,EAAE,OAAO;gCACb,QAAQ,EAAE,CAAC;gCACX,WAAW,EAAE,IAAI;gCACjB,KAAK,EAAE;oCACL,IAAI,EAAE,QAAQ;iCACf;6BACF;yBACF;qBACF;oBACD,IAAI,EAAE;wBACJ,IAAI,EAAE,QAAQ;q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KAAK,QAAQ,EAAE,CAAC;QAClC,OAAO,IAAA,2CAAoB,EAAC,IAAI,EAAE,SAAS,CAAC,CAAC;IAC/C,CAAC;IACD,IAAI,CAAC,IAAA,2CAAoB,EAAC,IAAI,EAAE,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC;QAChD,OAAO,KAAK,CAAC;IACf,CAAC;IACD,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,EAAE,IAAI,IAAI,CAAC,WAAW,CAAC;IACpD,MAAM,YAAY,GAAG,MAAM,EAAE,eAAe,EAAE,IAAI,EAAE,CAAC;IACrD,MAAM,gBAAgB,GAAG,YAAY,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE,CACtD,WAAW,CAAC,aAAa,EAAE,CAC5B,CAAC;IACF,QAAQ,SAAS,CAAC,IAAI,EAAE,CAAC;QACvB,KAAK,MAAM;YACT,OAAO,IAAA,uCAAkB,EAAC,SAAS,CAAC,IAAI,EAAE,gBAAgB,EAAE,OAAO,CAAC,CAAC;QACvE,KAAK,KAAK;YACR,OAAO,IAAA,qCAAiB,EAAC,gBAAgB,EAAE,OAAO,CAAC,CAAC;QACtD,KAAK,SAAS;YACZ,OAAO,IAAA,2EAAoC,EACzC,SAAS,CAAC,OAAO,EACjB,YAAY,EACZ,gBAAgB,EAChB,OAAO,CACR,CAAC;IACN,CAAC;AACH,CAAC;AAEM,MAAM,wBAAwB,GAAG,CACtC,IAAa,EACb,aAAqC,EAAE,EACvC,OAAmB,EACV,EAAE,CACX,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,oBAAoB,CAAC,IAAI,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC,CAAC;AALlE,QAAA,wBAAwB,4BAK0C"}
|
package/dist/isTypeReadonly.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { JSONSchema4 } from '@typescript-eslint/utils/json-schema';
|
|
2
1
|
import * as ts from 'typescript';
|
|
3
2
|
import type { TypeOrValueSpecifier } from './TypeOrValueSpecifier';
|
|
4
3
|
export interface ReadonlynessOptions {
|
|
@@ -13,8 +12,84 @@ export declare const readonlynessOptionsSchema: {
|
|
|
13
12
|
type: "boolean";
|
|
14
13
|
};
|
|
15
14
|
allow: {
|
|
16
|
-
type: "array";
|
|
17
|
-
items:
|
|
15
|
+
readonly type: "array";
|
|
16
|
+
readonly items: {
|
|
17
|
+
readonly oneOf: [{
|
|
18
|
+
readonly type: "string";
|
|
19
|
+
}, {
|
|
20
|
+
readonly type: "object";
|
|
21
|
+
readonly additionalProperties: false;
|
|
22
|
+
readonly properties: {
|
|
23
|
+
readonly from: {
|
|
24
|
+
readonly type: "string";
|
|
25
|
+
readonly enum: ["file"];
|
|
26
|
+
};
|
|
27
|
+
readonly name: {
|
|
28
|
+
readonly oneOf: [{
|
|
29
|
+
readonly type: "string";
|
|
30
|
+
}, {
|
|
31
|
+
readonly type: "array";
|
|
32
|
+
readonly minItems: 1;
|
|
33
|
+
readonly uniqueItems: true;
|
|
34
|
+
readonly items: {
|
|
35
|
+
readonly type: "string";
|
|
36
|
+
};
|
|
37
|
+
}];
|
|
38
|
+
};
|
|
39
|
+
readonly path: {
|
|
40
|
+
readonly type: "string";
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
readonly required: ["from", "name"];
|
|
44
|
+
}, {
|
|
45
|
+
readonly type: "object";
|
|
46
|
+
readonly additionalProperties: false;
|
|
47
|
+
readonly properties: {
|
|
48
|
+
readonly from: {
|
|
49
|
+
readonly type: "string";
|
|
50
|
+
readonly enum: ["lib"];
|
|
51
|
+
};
|
|
52
|
+
readonly name: {
|
|
53
|
+
readonly oneOf: [{
|
|
54
|
+
readonly type: "string";
|
|
55
|
+
}, {
|
|
56
|
+
readonly type: "array";
|
|
57
|
+
readonly minItems: 1;
|
|
58
|
+
readonly uniqueItems: true;
|
|
59
|
+
readonly items: {
|
|
60
|
+
readonly type: "string";
|
|
61
|
+
};
|
|
62
|
+
}];
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
readonly required: ["from", "name"];
|
|
66
|
+
}, {
|
|
67
|
+
readonly type: "object";
|
|
68
|
+
readonly additionalProperties: false;
|
|
69
|
+
readonly properties: {
|
|
70
|
+
readonly from: {
|
|
71
|
+
readonly type: "string";
|
|
72
|
+
readonly enum: ["package"];
|
|
73
|
+
};
|
|
74
|
+
readonly name: {
|
|
75
|
+
readonly oneOf: [{
|
|
76
|
+
readonly type: "string";
|
|
77
|
+
}, {
|
|
78
|
+
readonly type: "array";
|
|
79
|
+
readonly minItems: 1;
|
|
80
|
+
readonly uniqueItems: true;
|
|
81
|
+
readonly items: {
|
|
82
|
+
readonly type: "string";
|
|
83
|
+
};
|
|
84
|
+
}];
|
|
85
|
+
};
|
|
86
|
+
readonly package: {
|
|
87
|
+
readonly type: "string";
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
readonly required: ["from", "name", "package"];
|
|
91
|
+
}];
|
|
92
|
+
};
|
|
18
93
|
};
|
|
19
94
|
};
|
|
20
95
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isTypeReadonly.d.ts","sourceRoot":"","sources":["../src/isTypeReadonly.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"isTypeReadonly.d.ts","sourceRoot":"","sources":["../src/isTypeReadonly.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AAGjC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAenE,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,sBAAsB,CAAC,EAAE,OAAO,CAAC;IAC1C,QAAQ,CAAC,KAAK,CAAC,EAAE,oBAAoB,EAAE,CAAC;CACzC;AAED,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CASf,CAAC;AAExB,eAAO,MAAM,2BAA2B,EAAE,mBAGzC,CAAC;AAgSF;;GAEG;AACH,iBAAS,cAAc,CACrB,OAAO,EAAE,EAAE,CAAC,OAAO,EACnB,IAAI,EAAE,EAAE,CAAC,IAAI,EACb,OAAO,GAAE,mBAAiD,GACzD,OAAO,CAKT;AAED,OAAO,EAAE,cAAc,EAAE,CAAC"}
|
package/dist/isTypeReadonly.js
CHANGED
|
@@ -37,10 +37,7 @@ exports.readonlynessOptionsSchema = {
|
|
|
37
37
|
treatMethodsAsReadonly: {
|
|
38
38
|
type: 'boolean',
|
|
39
39
|
},
|
|
40
|
-
allow:
|
|
41
|
-
type: 'array',
|
|
42
|
-
items: TypeOrValueSpecifier_1.typeOrValueSpecifierSchema,
|
|
43
|
-
},
|
|
40
|
+
allow: TypeOrValueSpecifier_1.typeOrValueSpecifiersSchema,
|
|
44
41
|
},
|
|
45
42
|
};
|
|
46
43
|
exports.readonlynessOptionsDefaults = {
|
|
@@ -160,7 +157,7 @@ function isTypeReadonlyObject(program, type, options, seenTypes) {
|
|
|
160
157
|
function isTypeReadonlyRecurser(program, type, options, seenTypes) {
|
|
161
158
|
const checker = program.getTypeChecker();
|
|
162
159
|
seenTypes.add(type);
|
|
163
|
-
if (
|
|
160
|
+
if ((0, TypeOrValueSpecifier_1.typeMatchesSomeSpecifier)(type, options.allow, program)) {
|
|
164
161
|
return 3 /* Readonlyness.Readonly */;
|
|
165
162
|
}
|
|
166
163
|
if (tsutils.isUnionType(type)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isTypeReadonly.js","sourceRoot":"","sources":["../src/isTypeReadonly.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"isTypeReadonly.js","sourceRoot":"","sources":["../src/isTypeReadonly.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAsVS,wCAAc;AAtVvB,oDAAuD;AAEvD,sDAAwC;AACxC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
|
+
"version": "8.6.0",
|
|
4
4
|
"description": "Type utilities for working with TypeScript + ESLint together",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
@@ -46,14 +46,14 @@
|
|
|
46
46
|
"typecheck": "tsc --noEmit"
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@typescript-eslint/typescript-estree": "8.
|
|
50
|
-
"@typescript-eslint/utils": "8.
|
|
49
|
+
"@typescript-eslint/typescript-estree": "8.6.0",
|
|
50
|
+
"@typescript-eslint/utils": "8.6.0",
|
|
51
51
|
"debug": "^4.3.4",
|
|
52
52
|
"ts-api-utils": "^1.3.0"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
55
|
"@jest/types": "29.6.3",
|
|
56
|
-
"@typescript-eslint/parser": "8.
|
|
56
|
+
"@typescript-eslint/parser": "8.6.0",
|
|
57
57
|
"ajv": "^6.12.6",
|
|
58
58
|
"downlevel-dts": "*",
|
|
59
59
|
"jest": "29.7.0",
|