@lvce-editor/eslint-plugin-tsconfig 2.0.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.
Files changed (2) hide show
  1. package/dist/index.js +225 -0
  2. package/package.json +10 -0
package/dist/index.js ADDED
@@ -0,0 +1,225 @@
1
+ import json from '@eslint/json';
2
+
3
+ const create$8 = (context, name) => {
4
+ return {
5
+ Member(node) {
6
+ if (node.name.type === 'String' && node.name.value === 'compilerOptions' && node.value.type === 'Object') {
7
+ const members = node.value.members;
8
+ for (const member of members) {
9
+ if (member.name.type === 'String' && member.name.value === name) {
10
+ if (member.value.value === true) {
11
+ return;
12
+ }
13
+ if (member.value.value === false) {
14
+ context.report({
15
+ loc: member.name.loc,
16
+ messageId: name
17
+ });
18
+ }
19
+ return;
20
+ }
21
+ }
22
+ context.report({
23
+ loc: node.name.loc,
24
+ messageId: name
25
+ });
26
+ }
27
+ }
28
+ };
29
+ };
30
+
31
+ const meta$7 = {
32
+ type: 'problem',
33
+ docs: {
34
+ description: 'Ensure that the allowImportingTsExtensions is enabled'
35
+ },
36
+ messages: {
37
+ allowImportingTsExtensions: 'allowImportingTsExtensions rule should be enabled'
38
+ }
39
+ };
40
+ const create$7 = context => {
41
+ return create$8(context, 'allowImportingTsExtensions');
42
+ };
43
+
44
+ const tsconfigAllowImportingTsExtensions = {
45
+ __proto__: null,
46
+ create: create$7,
47
+ meta: meta$7
48
+ };
49
+
50
+ const meta$6 = {
51
+ type: 'problem',
52
+ docs: {
53
+ description: 'Ensure that the forceConsistentCasingInFileNames rule is enabled'
54
+ },
55
+ messages: {
56
+ forceConsistentCasingInFileNames: 'forceConsistentCasingInFileNames rule should be enabled'
57
+ }
58
+ };
59
+ const create$6 = context => {
60
+ return create$8(context, 'forceConsistentCasingInFileNames');
61
+ };
62
+
63
+ const tsconfigForceConsistentCasingInFileNames = {
64
+ __proto__: null,
65
+ create: create$6,
66
+ meta: meta$6
67
+ };
68
+
69
+ const meta$5 = {
70
+ type: 'problem',
71
+ docs: {
72
+ description: 'Disallow not allowed keys in JSON objects'
73
+ },
74
+ messages: {
75
+ noUncheckedSideEffectImports: 'noUncheckedSideEffectImports rule should be enabled'
76
+ }
77
+ };
78
+ const create$5 = context => {
79
+ return create$8(context, 'noUncheckedSideEffectImports');
80
+ };
81
+
82
+ const tsconfigNoUncheckedSideEffectImports = {
83
+ __proto__: null,
84
+ create: create$5,
85
+ meta: meta$5
86
+ };
87
+
88
+ const meta$4 = {
89
+ type: 'problem',
90
+ docs: {
91
+ description: 'Disallow implicit any'
92
+ },
93
+ messages: {
94
+ noImplicitAny: 'noImplicitAny rule should be enabled'
95
+ }
96
+ };
97
+ const create$4 = context => {
98
+ return create$8(context, 'noImplicitAny');
99
+ };
100
+
101
+ const tsconfigNoImplicitAny = {
102
+ __proto__: null,
103
+ create: create$4,
104
+ meta: meta$4
105
+ };
106
+
107
+ const meta$3 = {
108
+ type: 'problem',
109
+ docs: {
110
+ description: 'Ensure that the strict mode is enabled'
111
+ },
112
+ messages: {
113
+ strict: 'strict mode should be enabled'
114
+ }
115
+ };
116
+ const create$3 = context => {
117
+ return create$8(context, 'strict');
118
+ };
119
+
120
+ const tsconfigStrict = {
121
+ __proto__: null,
122
+ create: create$3,
123
+ meta: meta$3
124
+ };
125
+
126
+ const meta$2 = {
127
+ type: 'problem',
128
+ docs: {
129
+ description: 'Ensure that the assumeChangesOnlyAffectDirectDependencies rule is enabled'
130
+ },
131
+ messages: {
132
+ assumeChangesOnlyAffectDirectDependencies: 'assumeChangesOnlyAffectDirectDependencies rule should be enabled'
133
+ }
134
+ };
135
+ const create$2 = context => {
136
+ return create$8(context, 'assumeChangesOnlyAffectDirectDependencies');
137
+ };
138
+
139
+ const tsconfigAssumeChangesOnlyAffectDirectDependencies = {
140
+ __proto__: null,
141
+ create: create$2,
142
+ meta: meta$2
143
+ };
144
+
145
+ const meta$1 = {
146
+ type: 'problem',
147
+ docs: {
148
+ description: 'Enforce exactOptionalPropertyTypes'
149
+ },
150
+ messages: {
151
+ exactOptionalPropertyTypes: 'exactOptionalPropertyTypes rule should be enabled'
152
+ }
153
+ };
154
+ const create$1 = context => {
155
+ return create$8(context, 'exactOptionalPropertyTypes');
156
+ };
157
+
158
+ const tsconfigExactOptionalPropertyTypes = {
159
+ __proto__: null,
160
+ create: create$1,
161
+ meta: meta$1
162
+ };
163
+
164
+ const meta = {
165
+ type: 'problem',
166
+ docs: {
167
+ description: 'Enforce erasableSyntaxOnly'
168
+ },
169
+ messages: {
170
+ erasableSyntaxOnly: 'erasableSyntaxOnly rule should be enabled'
171
+ }
172
+ };
173
+ const create = context => {
174
+ return create$8(context, 'erasableSyntaxOnly');
175
+ };
176
+
177
+ const tsconfigErasableSyntaxOnly = {
178
+ __proto__: null,
179
+ create,
180
+ meta
181
+ };
182
+
183
+ const plugin = {
184
+ meta: {
185
+ name: 'tsconfig',
186
+ version: '0.0.1'
187
+ },
188
+ rules: {
189
+ 'no-unchecked-side-effect-imports': tsconfigNoUncheckedSideEffectImports,
190
+ 'force-consistent-casing-in-file-names': tsconfigForceConsistentCasingInFileNames,
191
+ strict: tsconfigStrict,
192
+ 'allow-importing-ts-extensions': tsconfigAllowImportingTsExtensions,
193
+ 'no-implicit-any': tsconfigNoImplicitAny,
194
+ 'assume-changes-only-affect-direct-dependenices': tsconfigAssumeChangesOnlyAffectDirectDependencies,
195
+ 'exact-optional-property-types': tsconfigExactOptionalPropertyTypes,
196
+ 'erasable-syntax-only': tsconfigErasableSyntaxOnly
197
+ },
198
+ configs: {}
199
+ };
200
+ const recommended = [{
201
+ plugins: {
202
+ json
203
+ }
204
+ }, {
205
+ files: ['**/*.json'],
206
+ language: 'json/json',
207
+ rules: {}
208
+ }, {
209
+ plugins: {
210
+ tsconfig: plugin
211
+ }
212
+ }, {
213
+ rules: {
214
+ 'tsconfig/no-unchecked-side-effect-imports': 'error',
215
+ 'tsconfig/force-consistent-casing-in-file-names': 'error',
216
+ 'tsconfig/strict': 'error',
217
+ 'tsconfig/erasable-syntax-only': 'off',
218
+ 'tsconfig/allow-importing-ts-extensions': 'error',
219
+ 'tsconfig/no-implicit-any': 'error',
220
+ 'tsconfig/assume-changes-only-affect-direct-dependenices': 'error',
221
+ 'tsconfig/exact-optional-property-types': 'error'
222
+ }
223
+ }];
224
+
225
+ export { recommended as default };
package/package.json ADDED
@@ -0,0 +1,10 @@
1
+ {
2
+ "name": "@lvce-editor/eslint-plugin-tsconfig",
3
+ "version": "2.0.0",
4
+ "main": "dist/index.js",
5
+ "type": "module",
6
+ "keywords": [],
7
+ "license": "MIT",
8
+ "description": "",
9
+ "dependencies": {}
10
+ }