@lvce-editor/eslint-plugin-tsconfig 5.4.0 → 5.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/index.js +72 -33
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import json from '@eslint/json';
|
|
2
2
|
|
|
3
|
-
const create$
|
|
3
|
+
const create$9 = (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$8 = (context, name, shouldBeValue = true) => {
|
|
|
28
28
|
};
|
|
29
29
|
};
|
|
30
30
|
|
|
31
|
-
const meta$
|
|
31
|
+
const meta$8 = {
|
|
32
32
|
type: 'problem',
|
|
33
33
|
docs: {
|
|
34
34
|
description: 'Ensure that the allowImportingTsExtensions is enabled'
|
|
@@ -37,11 +37,30 @@ const meta$7 = {
|
|
|
37
37
|
allowImportingTsExtensions: 'allowImportingTsExtensions rule should be enabled'
|
|
38
38
|
}
|
|
39
39
|
};
|
|
40
|
-
const create$
|
|
41
|
-
return create$
|
|
40
|
+
const create$8 = context => {
|
|
41
|
+
return create$9(context, 'allowImportingTsExtensions');
|
|
42
42
|
};
|
|
43
43
|
|
|
44
44
|
const tsconfigAllowImportingTsExtensions = {
|
|
45
|
+
__proto__: null,
|
|
46
|
+
create: create$8,
|
|
47
|
+
meta: meta$8
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
const meta$7 = {
|
|
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$7 = context => {
|
|
60
|
+
return create$9(context, 'assumeChangesOnlyAffectDirectDependencies');
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
const tsconfigAssumeChangesOnlyAffectDirectDependencies = {
|
|
45
64
|
__proto__: null,
|
|
46
65
|
create: create$7,
|
|
47
66
|
meta: meta$7
|
|
@@ -50,17 +69,17 @@ const tsconfigAllowImportingTsExtensions = {
|
|
|
50
69
|
const meta$6 = {
|
|
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$6 = context => {
|
|
60
|
-
return create$
|
|
79
|
+
return create$9(context, 'erasableSyntaxOnly');
|
|
61
80
|
};
|
|
62
81
|
|
|
63
|
-
const
|
|
82
|
+
const tsconfigErasableSyntaxOnly = {
|
|
64
83
|
__proto__: null,
|
|
65
84
|
create: create$6,
|
|
66
85
|
meta: meta$6
|
|
@@ -69,17 +88,17 @@ const tsconfigAssumeChangesOnlyAffectDirectDependencies = {
|
|
|
69
88
|
const meta$5 = {
|
|
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$5 = context => {
|
|
79
|
-
return create$
|
|
98
|
+
return create$9(context, 'exactOptionalPropertyTypes');
|
|
80
99
|
};
|
|
81
100
|
|
|
82
|
-
const
|
|
101
|
+
const tsconfigExactOptionalPropertyTypes = {
|
|
83
102
|
__proto__: null,
|
|
84
103
|
create: create$5,
|
|
85
104
|
meta: meta$5
|
|
@@ -88,17 +107,17 @@ const tsconfigErasableSyntaxOnly = {
|
|
|
88
107
|
const meta$4 = {
|
|
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$4 = context => {
|
|
98
|
-
return create$
|
|
117
|
+
return create$9(context, 'forceConsistentCasingInFileNames');
|
|
99
118
|
};
|
|
100
119
|
|
|
101
|
-
const
|
|
120
|
+
const tsconfigForceConsistentCasingInFileNames = {
|
|
102
121
|
__proto__: null,
|
|
103
122
|
create: create$4,
|
|
104
123
|
meta: meta$4
|
|
@@ -107,17 +126,17 @@ const tsconfigExactOptionalPropertyTypes = {
|
|
|
107
126
|
const meta$3 = {
|
|
108
127
|
type: 'problem',
|
|
109
128
|
docs: {
|
|
110
|
-
description: '
|
|
129
|
+
description: 'Disallow implicit any'
|
|
111
130
|
},
|
|
112
131
|
messages: {
|
|
113
|
-
|
|
132
|
+
noImplicitAny: 'noImplicitAny rule should be enabled'
|
|
114
133
|
}
|
|
115
134
|
};
|
|
116
135
|
const create$3 = context => {
|
|
117
|
-
return create$
|
|
136
|
+
return create$9(context, 'noImplicitAny');
|
|
118
137
|
};
|
|
119
138
|
|
|
120
|
-
const
|
|
139
|
+
const tsconfigNoImplicitAny = {
|
|
121
140
|
__proto__: null,
|
|
122
141
|
create: create$3,
|
|
123
142
|
meta: meta$3
|
|
@@ -126,17 +145,17 @@ const tsconfigForceConsistentCasingInFileNames = {
|
|
|
126
145
|
const meta$2 = {
|
|
127
146
|
type: 'problem',
|
|
128
147
|
docs: {
|
|
129
|
-
description: 'Disallow
|
|
148
|
+
description: 'Disallow not allowed keys in JSON objects'
|
|
130
149
|
},
|
|
131
150
|
messages: {
|
|
132
|
-
|
|
151
|
+
noUncheckedSideEffectImports: 'noUncheckedSideEffectImports rule should be enabled'
|
|
133
152
|
}
|
|
134
153
|
};
|
|
135
154
|
const create$2 = context => {
|
|
136
|
-
return create$
|
|
155
|
+
return create$9(context, 'noUncheckedSideEffectImports');
|
|
137
156
|
};
|
|
138
157
|
|
|
139
|
-
const
|
|
158
|
+
const tsconfigNoUncheckedSideEffectImports = {
|
|
140
159
|
__proto__: null,
|
|
141
160
|
create: create$2,
|
|
142
161
|
meta: meta$2
|
|
@@ -145,17 +164,17 @@ const tsconfigNoImplicitAny = {
|
|
|
145
164
|
const meta$1 = {
|
|
146
165
|
type: 'problem',
|
|
147
166
|
docs: {
|
|
148
|
-
description: '
|
|
167
|
+
description: 'Ensure that the strict mode is enabled'
|
|
149
168
|
},
|
|
150
169
|
messages: {
|
|
151
|
-
|
|
170
|
+
strict: 'strict mode should be enabled'
|
|
152
171
|
}
|
|
153
172
|
};
|
|
154
173
|
const create$1 = context => {
|
|
155
|
-
return create$
|
|
174
|
+
return create$9(context, 'strict');
|
|
156
175
|
};
|
|
157
176
|
|
|
158
|
-
const
|
|
177
|
+
const tsconfigStrict = {
|
|
159
178
|
__proto__: null,
|
|
160
179
|
create: create$1,
|
|
161
180
|
meta: meta$1
|
|
@@ -164,17 +183,36 @@ const tsconfigNoUncheckedSideEffectImports = {
|
|
|
164
183
|
const meta = {
|
|
165
184
|
type: 'problem',
|
|
166
185
|
docs: {
|
|
167
|
-
description: '
|
|
186
|
+
description: 'Enforce not skipping libCheck'
|
|
168
187
|
},
|
|
169
188
|
messages: {
|
|
170
|
-
|
|
189
|
+
skipLibCheck: "Don't skip libcheck"
|
|
171
190
|
}
|
|
172
191
|
};
|
|
173
192
|
const create = context => {
|
|
174
|
-
return
|
|
193
|
+
return {
|
|
194
|
+
Member(node) {
|
|
195
|
+
if (node.name.type === 'String' && node.name.value === 'compilerOptions' && node.value.type === 'Object') {
|
|
196
|
+
const members = node.value.members;
|
|
197
|
+
for (const member of members) {
|
|
198
|
+
if (member.name.type === 'String' && member.name.value === 'skipLibCheck') {
|
|
199
|
+
if (member.value.value === true) {
|
|
200
|
+
context.report({
|
|
201
|
+
loc: member.name.loc,
|
|
202
|
+
messageId: 'skipLibCheck'
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
return;
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
// Allow omitting skipLibCheck
|
|
209
|
+
return;
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
};
|
|
175
213
|
};
|
|
176
214
|
|
|
177
|
-
const
|
|
215
|
+
const tsconfigDontSkipLibCheck = {
|
|
178
216
|
__proto__: null,
|
|
179
217
|
create,
|
|
180
218
|
meta
|
|
@@ -193,7 +231,8 @@ const plugin = {
|
|
|
193
231
|
'no-implicit-any': tsconfigNoImplicitAny,
|
|
194
232
|
'assume-changes-only-affect-direct-dependenices': tsconfigAssumeChangesOnlyAffectDirectDependencies,
|
|
195
233
|
'exact-optional-property-types': tsconfigExactOptionalPropertyTypes,
|
|
196
|
-
'erasable-syntax-only': tsconfigErasableSyntaxOnly
|
|
234
|
+
'erasable-syntax-only': tsconfigErasableSyntaxOnly,
|
|
235
|
+
'dont-skip-lib-check': tsconfigDontSkipLibCheck
|
|
197
236
|
},
|
|
198
237
|
configs: {}
|
|
199
238
|
};
|