@lvce-editor/eslint-plugin-tsconfig 7.5.0 → 7.7.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 +73 -25
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import json from '@eslint/json';
|
|
2
2
|
|
|
3
|
-
const create$
|
|
3
|
+
const create$a = (context, name, shouldBeValue = true) => {
|
|
4
4
|
return {
|
|
5
5
|
Member(node) {
|
|
6
6
|
if (node.name.type === 'String' && node.name.value === 'compilerOptions' && node.value.type === 'Object') {
|
|
@@ -28,7 +28,7 @@ const create$9 = (context, name, shouldBeValue = true) => {
|
|
|
28
28
|
};
|
|
29
29
|
};
|
|
30
30
|
|
|
31
|
-
const meta$
|
|
31
|
+
const meta$9 = {
|
|
32
32
|
type: 'problem',
|
|
33
33
|
docs: {
|
|
34
34
|
description: 'Ensure that the allowImportingTsExtensions is enabled'
|
|
@@ -37,11 +37,30 @@ const meta$8 = {
|
|
|
37
37
|
allowImportingTsExtensions: 'allowImportingTsExtensions rule should be enabled'
|
|
38
38
|
}
|
|
39
39
|
};
|
|
40
|
-
const create$
|
|
41
|
-
return create$
|
|
40
|
+
const create$9 = context => {
|
|
41
|
+
return create$a(context, 'allowImportingTsExtensions');
|
|
42
42
|
};
|
|
43
43
|
|
|
44
44
|
const tsconfigAllowImportingTsExtensions = {
|
|
45
|
+
__proto__: null,
|
|
46
|
+
create: create$9,
|
|
47
|
+
meta: meta$9
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
const meta$8 = {
|
|
51
|
+
type: 'problem',
|
|
52
|
+
docs: {
|
|
53
|
+
description: 'Ensure that the assumeChangesOnlyAffectDirectDependencies rule is enabled'
|
|
54
|
+
},
|
|
55
|
+
messages: {
|
|
56
|
+
assumeChangesOnlyAffectDirectDependencies: 'assumeChangesOnlyAffectDirectDependencies rule should be enabled'
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
const create$8 = context => {
|
|
60
|
+
return create$a(context, 'assumeChangesOnlyAffectDirectDependencies');
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
const tsconfigAssumeChangesOnlyAffectDirectDependencies = {
|
|
45
64
|
__proto__: null,
|
|
46
65
|
create: create$8,
|
|
47
66
|
meta: meta$8
|
|
@@ -50,17 +69,17 @@ const tsconfigAllowImportingTsExtensions = {
|
|
|
50
69
|
const meta$7 = {
|
|
51
70
|
type: 'problem',
|
|
52
71
|
docs: {
|
|
53
|
-
description: '
|
|
72
|
+
description: 'Enforce erasableSyntaxOnly'
|
|
54
73
|
},
|
|
55
74
|
messages: {
|
|
56
|
-
|
|
75
|
+
erasableSyntaxOnly: 'erasableSyntaxOnly rule should be enabled'
|
|
57
76
|
}
|
|
58
77
|
};
|
|
59
78
|
const create$7 = context => {
|
|
60
|
-
return create$
|
|
79
|
+
return create$a(context, 'erasableSyntaxOnly');
|
|
61
80
|
};
|
|
62
81
|
|
|
63
|
-
const
|
|
82
|
+
const tsconfigErasableSyntaxOnly = {
|
|
64
83
|
__proto__: null,
|
|
65
84
|
create: create$7,
|
|
66
85
|
meta: meta$7
|
|
@@ -69,17 +88,17 @@ const tsconfigAssumeChangesOnlyAffectDirectDependencies = {
|
|
|
69
88
|
const meta$6 = {
|
|
70
89
|
type: 'problem',
|
|
71
90
|
docs: {
|
|
72
|
-
description: 'Enforce
|
|
91
|
+
description: 'Enforce exactOptionalPropertyTypes'
|
|
73
92
|
},
|
|
74
93
|
messages: {
|
|
75
|
-
|
|
94
|
+
exactOptionalPropertyTypes: 'exactOptionalPropertyTypes rule should be enabled'
|
|
76
95
|
}
|
|
77
96
|
};
|
|
78
97
|
const create$6 = context => {
|
|
79
|
-
return create$
|
|
98
|
+
return create$a(context, 'exactOptionalPropertyTypes');
|
|
80
99
|
};
|
|
81
100
|
|
|
82
|
-
const
|
|
101
|
+
const tsconfigExactOptionalPropertyTypes = {
|
|
83
102
|
__proto__: null,
|
|
84
103
|
create: create$6,
|
|
85
104
|
meta: meta$6
|
|
@@ -88,17 +107,17 @@ const tsconfigErasableSyntaxOnly = {
|
|
|
88
107
|
const meta$5 = {
|
|
89
108
|
type: 'problem',
|
|
90
109
|
docs: {
|
|
91
|
-
description: '
|
|
110
|
+
description: 'Ensure that the forceConsistentCasingInFileNames rule is enabled'
|
|
92
111
|
},
|
|
93
112
|
messages: {
|
|
94
|
-
|
|
113
|
+
forceConsistentCasingInFileNames: 'forceConsistentCasingInFileNames rule should be enabled'
|
|
95
114
|
}
|
|
96
115
|
};
|
|
97
116
|
const create$5 = context => {
|
|
98
|
-
return create$
|
|
117
|
+
return create$a(context, 'forceConsistentCasingInFileNames');
|
|
99
118
|
};
|
|
100
119
|
|
|
101
|
-
const
|
|
120
|
+
const tsconfigForceConsistentCasingInFileNames = {
|
|
102
121
|
__proto__: null,
|
|
103
122
|
create: create$5,
|
|
104
123
|
meta: meta$5
|
|
@@ -107,17 +126,44 @@ const tsconfigExactOptionalPropertyTypes = {
|
|
|
107
126
|
const meta$4 = {
|
|
108
127
|
type: 'problem',
|
|
109
128
|
docs: {
|
|
110
|
-
description: '
|
|
129
|
+
description: 'Validate moduleResolution values'
|
|
111
130
|
},
|
|
112
131
|
messages: {
|
|
113
|
-
|
|
132
|
+
moduleResolution: 'moduleResolution must be set to bundle or nodenext'
|
|
114
133
|
}
|
|
115
134
|
};
|
|
135
|
+
const allowedValues = new Set(['bundle', 'nodenext']);
|
|
116
136
|
const create$4 = context => {
|
|
117
|
-
return
|
|
137
|
+
return {
|
|
138
|
+
Member(node) {
|
|
139
|
+
if (node.name.type !== 'String' || node.name.value !== 'compilerOptions' || node.value.type !== 'Object') {
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
for (const member of node.value.members) {
|
|
143
|
+
if (member.name.type !== 'String' || member.name.value !== 'moduleResolution') {
|
|
144
|
+
continue;
|
|
145
|
+
}
|
|
146
|
+
if (member.value.type !== 'String') {
|
|
147
|
+
context.report({
|
|
148
|
+
loc: member.name.loc,
|
|
149
|
+
messageId: 'moduleResolution'
|
|
150
|
+
});
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
const value = member.value.value.toLowerCase();
|
|
154
|
+
if (!allowedValues.has(value)) {
|
|
155
|
+
context.report({
|
|
156
|
+
loc: member.name.loc,
|
|
157
|
+
messageId: 'moduleResolution'
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
};
|
|
118
164
|
};
|
|
119
165
|
|
|
120
|
-
const
|
|
166
|
+
const tsconfigModuleResolution = {
|
|
121
167
|
__proto__: null,
|
|
122
168
|
create: create$4,
|
|
123
169
|
meta: meta$4
|
|
@@ -133,7 +179,7 @@ const meta$3 = {
|
|
|
133
179
|
}
|
|
134
180
|
};
|
|
135
181
|
const create$3 = context => {
|
|
136
|
-
return create$
|
|
182
|
+
return create$a(context, 'noImplicitAny');
|
|
137
183
|
};
|
|
138
184
|
|
|
139
185
|
const tsconfigNoImplicitAny = {
|
|
@@ -152,7 +198,7 @@ const meta$2 = {
|
|
|
152
198
|
}
|
|
153
199
|
};
|
|
154
200
|
const create$2 = context => {
|
|
155
|
-
return create$
|
|
201
|
+
return create$a(context, 'noUncheckedSideEffectImports');
|
|
156
202
|
};
|
|
157
203
|
|
|
158
204
|
const tsconfigNoUncheckedSideEffectImports = {
|
|
@@ -171,7 +217,7 @@ const meta$1 = {
|
|
|
171
217
|
}
|
|
172
218
|
};
|
|
173
219
|
const create$1 = context => {
|
|
174
|
-
return create$
|
|
220
|
+
return create$a(context, 'strict');
|
|
175
221
|
};
|
|
176
222
|
|
|
177
223
|
const tsconfigStrict = {
|
|
@@ -232,7 +278,8 @@ const plugin = {
|
|
|
232
278
|
'assume-changes-only-affect-direct-dependenices': tsconfigAssumeChangesOnlyAffectDirectDependencies,
|
|
233
279
|
'exact-optional-property-types': tsconfigExactOptionalPropertyTypes,
|
|
234
280
|
'erasable-syntax-only': tsconfigErasableSyntaxOnly,
|
|
235
|
-
'dont-skip-lib-check': tsconfigDontSkipLibCheck
|
|
281
|
+
'dont-skip-lib-check': tsconfigDontSkipLibCheck,
|
|
282
|
+
'module-resolution': tsconfigModuleResolution
|
|
236
283
|
},
|
|
237
284
|
configs: {}
|
|
238
285
|
};
|
|
@@ -256,7 +303,8 @@ const recommended = [{
|
|
|
256
303
|
'tsconfig/no-implicit-any': 'error',
|
|
257
304
|
'tsconfig/assume-changes-only-affect-direct-dependenices': 'error',
|
|
258
305
|
'tsconfig/exact-optional-property-types': 'error',
|
|
259
|
-
'tsconfig/dont-skip-lib-check': 'error'
|
|
306
|
+
'tsconfig/dont-skip-lib-check': 'error',
|
|
307
|
+
'tsconfig/module-resolution': 'error'
|
|
260
308
|
}
|
|
261
309
|
}];
|
|
262
310
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lvce-editor/eslint-plugin-tsconfig",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.7.0",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -11,6 +11,6 @@
|
|
|
11
11
|
"license": "MIT",
|
|
12
12
|
"description": "",
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@eslint/json": "1.0
|
|
14
|
+
"@eslint/json": "1.1.0"
|
|
15
15
|
}
|
|
16
16
|
}
|