@lvce-editor/eslint-config 2.0.0 → 2.3.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/index.js +2 -4
- package/package.json +4 -2
- package/rules.js +0 -243
package/index.js
CHANGED
|
@@ -7,9 +7,7 @@ import perfectionist from 'eslint-plugin-perfectionist'
|
|
|
7
7
|
import eslintPluginUnicorn from 'eslint-plugin-unicorn'
|
|
8
8
|
import eslintPluginYml from 'eslint-plugin-yml'
|
|
9
9
|
import tseslint from 'typescript-eslint'
|
|
10
|
-
|
|
11
|
-
const uri = './rules.js'
|
|
12
|
-
const tsconfigPlugin = (await import(uri)).default
|
|
10
|
+
import * as tsconfigPlugin from '@lvce-editor/eslint-plugin-tsconfig'
|
|
13
11
|
|
|
14
12
|
const root = process.cwd()
|
|
15
13
|
|
|
@@ -214,6 +212,6 @@ export const recommendedNode = [
|
|
|
214
212
|
},
|
|
215
213
|
]
|
|
216
214
|
|
|
217
|
-
export const recommendedTsconfig = [...tsconfigPlugin]
|
|
215
|
+
export const recommendedTsconfig = [...tsconfigPlugin.default]
|
|
218
216
|
|
|
219
217
|
export default defaultConfig
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lvce-editor/eslint-config",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.0",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -29,7 +29,9 @@
|
|
|
29
29
|
"eslint-plugin-perfectionist": "4.15.1",
|
|
30
30
|
"eslint-plugin-unicorn": "62.0.0",
|
|
31
31
|
"eslint-plugin-yml": "1.19.0",
|
|
32
|
-
"typescript-eslint": "8.46.3"
|
|
32
|
+
"typescript-eslint": "8.46.3",
|
|
33
|
+
"@lvce-editor/eslint-plugin-tsconfig": "2.3.0",
|
|
34
|
+
"@lvce-editor/eslint-plugin-github-actions": "2.3.0"
|
|
33
35
|
},
|
|
34
36
|
"peerDependencies": {
|
|
35
37
|
"eslint": ">= 9"
|
package/rules.js
DELETED
|
@@ -1,243 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __export = (target, all) => {
|
|
3
|
-
for (var name in all)
|
|
4
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
5
|
-
};
|
|
6
|
-
|
|
7
|
-
// src/index.ts
|
|
8
|
-
import json from "@eslint/json";
|
|
9
|
-
|
|
10
|
-
// src/tsconfig-allow-importing-ts-extensions.ts
|
|
11
|
-
var tsconfig_allow_importing_ts_extensions_exports = {};
|
|
12
|
-
__export(tsconfig_allow_importing_ts_extensions_exports, {
|
|
13
|
-
create: () => create2,
|
|
14
|
-
meta: () => meta
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
// src/tsconfig-compiler-option.ts
|
|
18
|
-
var create = (context, name) => {
|
|
19
|
-
return {
|
|
20
|
-
Member(node) {
|
|
21
|
-
if (node.name.type === "String" && node.name.value === "compilerOptions" && node.value.type === "Object") {
|
|
22
|
-
const members = node.value.members;
|
|
23
|
-
for (const member of members) {
|
|
24
|
-
if (member.name.type === "String" && member.name.value === name) {
|
|
25
|
-
if (member.value.value === true) {
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
if (member.value.value === false) {
|
|
29
|
-
context.report({
|
|
30
|
-
loc: member.name.loc,
|
|
31
|
-
messageId: name
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
return;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
context.report({
|
|
38
|
-
loc: node.name.loc,
|
|
39
|
-
messageId: name
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
// src/tsconfig-allow-importing-ts-extensions.ts
|
|
47
|
-
var meta = {
|
|
48
|
-
type: "problem",
|
|
49
|
-
docs: {
|
|
50
|
-
description: "Ensure that the allowImportingTsExtensions is enabled"
|
|
51
|
-
},
|
|
52
|
-
messages: {
|
|
53
|
-
allowImportingTsExtensions: "allowImportingTsExtensions rule should be enabled"
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
var create2 = (context) => {
|
|
57
|
-
return create(context, "allowImportingTsExtensions");
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
// src/tsconfig-force-consistent-casing-in-file-names.ts
|
|
61
|
-
var tsconfig_force_consistent_casing_in_file_names_exports = {};
|
|
62
|
-
__export(tsconfig_force_consistent_casing_in_file_names_exports, {
|
|
63
|
-
create: () => create3,
|
|
64
|
-
meta: () => meta2
|
|
65
|
-
});
|
|
66
|
-
var meta2 = {
|
|
67
|
-
type: "problem",
|
|
68
|
-
docs: {
|
|
69
|
-
description: "Ensure that the forceConsistentCasingInFileNames rule is enabled"
|
|
70
|
-
},
|
|
71
|
-
messages: {
|
|
72
|
-
forceConsistentCasingInFileNames: "forceConsistentCasingInFileNames rule should be enabled"
|
|
73
|
-
}
|
|
74
|
-
};
|
|
75
|
-
var create3 = (context) => {
|
|
76
|
-
return create(context, "forceConsistentCasingInFileNames");
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
// src/tsconfig-no-unchecked-side-effect-imports.ts
|
|
80
|
-
var tsconfig_no_unchecked_side_effect_imports_exports = {};
|
|
81
|
-
__export(tsconfig_no_unchecked_side_effect_imports_exports, {
|
|
82
|
-
create: () => create4,
|
|
83
|
-
meta: () => meta3
|
|
84
|
-
});
|
|
85
|
-
var meta3 = {
|
|
86
|
-
type: "problem",
|
|
87
|
-
docs: {
|
|
88
|
-
description: "Disallow not allowed keys in JSON objects"
|
|
89
|
-
},
|
|
90
|
-
messages: {
|
|
91
|
-
noUncheckedSideEffectImports: "noUncheckedSideEffectImports rule should be enabled"
|
|
92
|
-
}
|
|
93
|
-
};
|
|
94
|
-
var create4 = (context) => {
|
|
95
|
-
return create(context, "noUncheckedSideEffectImports");
|
|
96
|
-
};
|
|
97
|
-
|
|
98
|
-
// src/tsconfig-no-implicit-any.ts
|
|
99
|
-
var tsconfig_no_implicit_any_exports = {};
|
|
100
|
-
__export(tsconfig_no_implicit_any_exports, {
|
|
101
|
-
create: () => create5,
|
|
102
|
-
meta: () => meta4
|
|
103
|
-
});
|
|
104
|
-
var meta4 = {
|
|
105
|
-
type: "problem",
|
|
106
|
-
docs: {
|
|
107
|
-
description: "Disallow implicit any"
|
|
108
|
-
},
|
|
109
|
-
messages: {
|
|
110
|
-
noImplicitAny: "noImplicitAny rule should be enabled"
|
|
111
|
-
}
|
|
112
|
-
};
|
|
113
|
-
var create5 = (context) => {
|
|
114
|
-
return create(context, "noImplicitAny");
|
|
115
|
-
};
|
|
116
|
-
|
|
117
|
-
// src/tsconfig-strict.ts
|
|
118
|
-
var tsconfig_strict_exports = {};
|
|
119
|
-
__export(tsconfig_strict_exports, {
|
|
120
|
-
create: () => create6,
|
|
121
|
-
meta: () => meta5
|
|
122
|
-
});
|
|
123
|
-
var meta5 = {
|
|
124
|
-
type: "problem",
|
|
125
|
-
docs: {
|
|
126
|
-
description: "Ensure that the strict mode is enabled"
|
|
127
|
-
},
|
|
128
|
-
messages: {
|
|
129
|
-
strict: "strict mode should be enabled"
|
|
130
|
-
}
|
|
131
|
-
};
|
|
132
|
-
var create6 = (context) => {
|
|
133
|
-
return create(context, "strict");
|
|
134
|
-
};
|
|
135
|
-
|
|
136
|
-
// src/tsconfig-assume-changes-only-affect-direct-dependencies.ts
|
|
137
|
-
var tsconfig_assume_changes_only_affect_direct_dependencies_exports = {};
|
|
138
|
-
__export(tsconfig_assume_changes_only_affect_direct_dependencies_exports, {
|
|
139
|
-
create: () => create7,
|
|
140
|
-
meta: () => meta6
|
|
141
|
-
});
|
|
142
|
-
var meta6 = {
|
|
143
|
-
type: "problem",
|
|
144
|
-
docs: {
|
|
145
|
-
description: "Ensure that the assumeChangesOnlyAffectDirectDependencies rule is enabled"
|
|
146
|
-
},
|
|
147
|
-
messages: {
|
|
148
|
-
assumeChangesOnlyAffectDirectDependencies: "assumeChangesOnlyAffectDirectDependencies rule should be enabled"
|
|
149
|
-
}
|
|
150
|
-
};
|
|
151
|
-
var create7 = (context) => {
|
|
152
|
-
return create(context, "assumeChangesOnlyAffectDirectDependencies");
|
|
153
|
-
};
|
|
154
|
-
|
|
155
|
-
// src/tsconfig-exact-optional-property-types.ts
|
|
156
|
-
var tsconfig_exact_optional_property_types_exports = {};
|
|
157
|
-
__export(tsconfig_exact_optional_property_types_exports, {
|
|
158
|
-
create: () => create8,
|
|
159
|
-
meta: () => meta7
|
|
160
|
-
});
|
|
161
|
-
var meta7 = {
|
|
162
|
-
type: "problem",
|
|
163
|
-
docs: {
|
|
164
|
-
description: "Enforce exactOptionalPropertyTypes"
|
|
165
|
-
},
|
|
166
|
-
messages: {
|
|
167
|
-
exactOptionalPropertyTypes: "exactOptionalPropertyTypes rule should be enabled"
|
|
168
|
-
}
|
|
169
|
-
};
|
|
170
|
-
var create8 = (context) => {
|
|
171
|
-
return create(context, "exactOptionalPropertyTypes");
|
|
172
|
-
};
|
|
173
|
-
|
|
174
|
-
// src/tsconfig-erasable-syntax-only.ts
|
|
175
|
-
var tsconfig_erasable_syntax_only_exports = {};
|
|
176
|
-
__export(tsconfig_erasable_syntax_only_exports, {
|
|
177
|
-
create: () => create9,
|
|
178
|
-
meta: () => meta8
|
|
179
|
-
});
|
|
180
|
-
var meta8 = {
|
|
181
|
-
type: "problem",
|
|
182
|
-
docs: {
|
|
183
|
-
description: "Enforce erasableSyntaxOnly"
|
|
184
|
-
},
|
|
185
|
-
messages: {
|
|
186
|
-
erasableSyntaxOnly: "erasableSyntaxOnly rule should be enabled"
|
|
187
|
-
}
|
|
188
|
-
};
|
|
189
|
-
var create9 = (context) => {
|
|
190
|
-
return create(context, "erasableSyntaxOnly");
|
|
191
|
-
};
|
|
192
|
-
|
|
193
|
-
// src/index.ts
|
|
194
|
-
var plugin = {
|
|
195
|
-
meta: {
|
|
196
|
-
name: "tsconfig",
|
|
197
|
-
version: "0.0.1"
|
|
198
|
-
},
|
|
199
|
-
rules: {
|
|
200
|
-
"no-unchecked-side-effect-imports": tsconfig_no_unchecked_side_effect_imports_exports,
|
|
201
|
-
"force-consistent-casing-in-file-names": tsconfig_force_consistent_casing_in_file_names_exports,
|
|
202
|
-
strict: tsconfig_strict_exports,
|
|
203
|
-
"allow-importing-ts-extensions": tsconfig_allow_importing_ts_extensions_exports,
|
|
204
|
-
"no-implicit-any": tsconfig_no_implicit_any_exports,
|
|
205
|
-
"assume-changes-only-affect-direct-dependenices": tsconfig_assume_changes_only_affect_direct_dependencies_exports,
|
|
206
|
-
"exact-optional-property-types": tsconfig_exact_optional_property_types_exports,
|
|
207
|
-
"erasable-syntax-only": tsconfig_erasable_syntax_only_exports
|
|
208
|
-
},
|
|
209
|
-
configs: {}
|
|
210
|
-
};
|
|
211
|
-
var recommended = [
|
|
212
|
-
{
|
|
213
|
-
plugins: {
|
|
214
|
-
json
|
|
215
|
-
}
|
|
216
|
-
},
|
|
217
|
-
{
|
|
218
|
-
files: ["**/*.json"],
|
|
219
|
-
language: "json/json",
|
|
220
|
-
rules: {}
|
|
221
|
-
},
|
|
222
|
-
{
|
|
223
|
-
plugins: {
|
|
224
|
-
tsconfig: plugin
|
|
225
|
-
}
|
|
226
|
-
},
|
|
227
|
-
{
|
|
228
|
-
rules: {
|
|
229
|
-
"tsconfig/no-unchecked-side-effect-imports": "error",
|
|
230
|
-
"tsconfig/force-consistent-casing-in-file-names": "error",
|
|
231
|
-
"tsconfig/strict": "error",
|
|
232
|
-
"tsconfig/erasable-syntax-only": "off",
|
|
233
|
-
"tsconfig/allow-importing-ts-extensions": "error",
|
|
234
|
-
"tsconfig/no-implicit-any": "error",
|
|
235
|
-
"tsconfig/assume-changes-only-affect-direct-dependenices": "error",
|
|
236
|
-
"tsconfig/exact-optional-property-types": "error"
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
];
|
|
240
|
-
var index_default = recommended;
|
|
241
|
-
export {
|
|
242
|
-
index_default as default
|
|
243
|
-
};
|