@lichthagel/eslint-config 1.0.30 → 1.0.32
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.cjs +497 -559
- package/dist/index.d.cts +7077 -7780
- package/dist/index.d.mts +11149 -0
- package/dist/index.mjs +468 -0
- package/package.json +15 -15
- package/dist/index.d.ts +0 -11852
- package/dist/index.js +0 -526
package/dist/index.cjs
CHANGED
|
@@ -1,572 +1,510 @@
|
|
|
1
|
-
|
|
1
|
+
Object.defineProperties(exports, {
|
|
2
|
+
__esModule: { value: true },
|
|
3
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
4
|
+
});
|
|
5
|
+
//#region \0rolldown/runtime.js
|
|
2
6
|
var __create = Object.create;
|
|
3
7
|
var __defProp = Object.defineProperty;
|
|
4
8
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
9
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
10
|
var __getProtoOf = Object.getPrototypeOf;
|
|
7
11
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
12
|
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
14
|
+
key = keys[i];
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
16
|
+
get: ((k) => from[k]).bind(null, key),
|
|
17
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
19
21
|
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
)
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
var
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
22
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
23
|
+
value: mod,
|
|
24
|
+
enumerable: true
|
|
25
|
+
}) : target, mod));
|
|
26
|
+
//#endregion
|
|
27
|
+
let globals = require("globals");
|
|
28
|
+
globals = __toESM(globals);
|
|
29
|
+
let _eslint_js = require("@eslint/js");
|
|
30
|
+
_eslint_js = __toESM(_eslint_js);
|
|
31
|
+
let eslint_plugin_perfectionist = require("eslint-plugin-perfectionist");
|
|
32
|
+
eslint_plugin_perfectionist = __toESM(eslint_plugin_perfectionist);
|
|
33
|
+
let _stylistic_eslint_plugin = require("@stylistic/eslint-plugin");
|
|
34
|
+
_stylistic_eslint_plugin = __toESM(_stylistic_eslint_plugin);
|
|
35
|
+
let typescript_eslint = require("typescript-eslint");
|
|
36
|
+
typescript_eslint = __toESM(typescript_eslint);
|
|
37
|
+
let eslint_plugin_unicorn = require("eslint-plugin-unicorn");
|
|
38
|
+
eslint_plugin_unicorn = __toESM(eslint_plugin_unicorn);
|
|
39
|
+
//#region src/configs/browser.ts
|
|
40
|
+
var browser_default = [{
|
|
41
|
+
name: "lichthagel/browser",
|
|
42
|
+
languageOptions: { globals: {
|
|
43
|
+
...globals.default.browser,
|
|
44
|
+
document: "readonly",
|
|
45
|
+
navigator: "readonly",
|
|
46
|
+
window: "readonly"
|
|
47
|
+
} }
|
|
48
|
+
}];
|
|
49
|
+
//#endregion
|
|
50
|
+
//#region src/configs/javascript.ts
|
|
51
|
+
var javascript_default = [{
|
|
52
|
+
name: "js/recommended",
|
|
53
|
+
..._eslint_js.default.configs.recommended
|
|
54
|
+
}, {
|
|
55
|
+
name: "lichthagel/javascript",
|
|
56
|
+
languageOptions: {
|
|
57
|
+
ecmaVersion: 2022,
|
|
58
|
+
globals: { ...globals.default.es2022 },
|
|
59
|
+
parserOptions: {
|
|
60
|
+
ecmaVersion: 2022,
|
|
61
|
+
sourceType: "module"
|
|
62
|
+
},
|
|
63
|
+
sourceType: "module"
|
|
64
|
+
},
|
|
65
|
+
rules: {
|
|
66
|
+
"accessor-pairs": "error",
|
|
67
|
+
"array-callback-return": "error",
|
|
68
|
+
"arrow-body-style": "error",
|
|
69
|
+
"block-scoped-var": "error",
|
|
70
|
+
"curly": ["error", "all"],
|
|
71
|
+
"default-case-last": "error",
|
|
72
|
+
"dot-notation": "error",
|
|
73
|
+
"eqeqeq": ["error", "smart"],
|
|
74
|
+
"new-cap": ["error", {
|
|
75
|
+
capIsNew: false,
|
|
76
|
+
newIsCap: true,
|
|
77
|
+
properties: true
|
|
78
|
+
}],
|
|
79
|
+
"no-alert": "error",
|
|
80
|
+
"no-array-constructor": "error",
|
|
81
|
+
"no-await-in-loop": "error",
|
|
82
|
+
"no-bitwise": "error",
|
|
83
|
+
"no-caller": "error",
|
|
84
|
+
"no-cond-assign": ["error", "always"],
|
|
85
|
+
"no-console": ["error", { allow: ["warn", "error"] }],
|
|
86
|
+
"no-duplicate-imports": "error",
|
|
87
|
+
"no-eval": "error",
|
|
88
|
+
"no-extend-native": "error",
|
|
89
|
+
"no-extra-bind": "error",
|
|
90
|
+
"no-implied-eval": "error",
|
|
91
|
+
"no-iterator": "error",
|
|
92
|
+
"no-label-var": "error",
|
|
93
|
+
"no-labels": "error",
|
|
94
|
+
"no-lone-blocks": "error",
|
|
95
|
+
"no-multi-assign": "error",
|
|
96
|
+
"no-multi-str": "error",
|
|
97
|
+
"no-new": "error",
|
|
98
|
+
"no-new-func": "error",
|
|
99
|
+
"no-new-wrappers": "error",
|
|
100
|
+
"no-octal-escape": "error",
|
|
101
|
+
"no-promise-executor-return": ["error", { allowVoid: true }],
|
|
102
|
+
"no-proto": "error",
|
|
103
|
+
"no-restricted-globals": [
|
|
104
|
+
"error",
|
|
105
|
+
{
|
|
106
|
+
name: "global",
|
|
107
|
+
message: "Use `globalThis` instead."
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
name: "self",
|
|
111
|
+
message: "Use `globalThis` instead."
|
|
112
|
+
}
|
|
113
|
+
],
|
|
114
|
+
"no-restricted-properties": [
|
|
115
|
+
"error",
|
|
116
|
+
{
|
|
117
|
+
message: "Use `Object.getPrototypeOf` or `Object.setPrototypeOf` instead.",
|
|
118
|
+
property: "__proto__"
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
message: "Use `Object.defineProperty` instead.",
|
|
122
|
+
property: "__defineGetter__"
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
message: "Use `Object.defineProperty` instead.",
|
|
126
|
+
property: "__defineSetter__"
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
message: "Use `Object.getOwnPropertyDescriptor` instead.",
|
|
130
|
+
property: "__lookupGetter__"
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
message: "Use `Object.getOwnPropertyDescriptor` instead.",
|
|
134
|
+
property: "__lookupSetter__"
|
|
135
|
+
}
|
|
136
|
+
],
|
|
137
|
+
"no-restricted-syntax": [
|
|
138
|
+
"error",
|
|
139
|
+
"DebuggerStatement",
|
|
140
|
+
"LabeledStatement",
|
|
141
|
+
"WithStatement",
|
|
142
|
+
"TSEnumDeclaration[const=true]",
|
|
143
|
+
"TSExportAssignment"
|
|
144
|
+
],
|
|
145
|
+
"no-self-compare": "error",
|
|
146
|
+
"no-sequences": "error",
|
|
147
|
+
"no-template-curly-in-string": "error",
|
|
148
|
+
"no-throw-literal": "error",
|
|
149
|
+
"no-undef-init": "error",
|
|
150
|
+
"no-unmodified-loop-condition": "error",
|
|
151
|
+
"no-unneeded-ternary": "error",
|
|
152
|
+
"no-unreachable-loop": "error",
|
|
153
|
+
"no-unused-expressions": ["error", {
|
|
154
|
+
allowShortCircuit: true,
|
|
155
|
+
allowTaggedTemplates: true,
|
|
156
|
+
allowTernary: true
|
|
157
|
+
}],
|
|
158
|
+
"no-useless-call": "error",
|
|
159
|
+
"no-useless-computed-key": "error",
|
|
160
|
+
"no-useless-concat": "error",
|
|
161
|
+
"no-useless-constructor": "error",
|
|
162
|
+
"no-useless-rename": "error",
|
|
163
|
+
"no-useless-return": "error",
|
|
164
|
+
"no-var": "error",
|
|
165
|
+
"object-shorthand": [
|
|
166
|
+
"error",
|
|
167
|
+
"always",
|
|
168
|
+
{ ignoreConstructors: false }
|
|
169
|
+
],
|
|
170
|
+
"prefer-arrow-callback": "error",
|
|
171
|
+
"prefer-const": "error",
|
|
172
|
+
"prefer-destructuring": ["error", { AssignmentExpression: {
|
|
173
|
+
array: false,
|
|
174
|
+
object: false
|
|
175
|
+
} }],
|
|
176
|
+
"prefer-exponentiation-operator": "error",
|
|
177
|
+
"prefer-object-spread": "error",
|
|
178
|
+
"prefer-promise-reject-errors": "error",
|
|
179
|
+
"prefer-regex-literals": ["error", { disallowRedundantWrapping: true }],
|
|
180
|
+
"prefer-rest-params": "error",
|
|
181
|
+
"prefer-spread": "error",
|
|
182
|
+
"prefer-template": "error",
|
|
183
|
+
"require-await": "error",
|
|
184
|
+
"sort-imports": ["error", {
|
|
185
|
+
allowSeparatedGroups: true,
|
|
186
|
+
ignoreCase: false,
|
|
187
|
+
ignoreDeclarationSort: true
|
|
188
|
+
}],
|
|
189
|
+
"symbol-description": "error",
|
|
190
|
+
"use-isnan": ["error", {
|
|
191
|
+
enforceForIndexOf: true,
|
|
192
|
+
enforceForSwitchCase: true
|
|
193
|
+
}],
|
|
194
|
+
"valid-typeof": ["error", { requireStringLiterals: true }],
|
|
195
|
+
"yoda": "error"
|
|
196
|
+
}
|
|
197
|
+
}];
|
|
198
|
+
//#endregion
|
|
199
|
+
//#region src/configs/node.ts
|
|
200
|
+
const node = async () => {
|
|
201
|
+
return [(await import("eslint-plugin-n").then((mod) => mod.default)).configs["flat/recommended-module"], {
|
|
202
|
+
name: "lichthagel/node",
|
|
203
|
+
languageOptions: { globals: { ...globals.default.node } },
|
|
204
|
+
rules: {
|
|
205
|
+
"n/handle-callback-err": ["error", "^.*(e|E)rr(or)?$"],
|
|
206
|
+
"n/no-new-require": "error",
|
|
207
|
+
"n/no-path-concat": "error",
|
|
208
|
+
"n/no-process-env": "error",
|
|
209
|
+
"n/no-missing-import": "off",
|
|
210
|
+
"n/no-missing-require": "off"
|
|
211
|
+
}
|
|
212
|
+
}];
|
|
206
213
|
};
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
"unknown",
|
|
257
|
-
"nullish"
|
|
258
|
-
]
|
|
259
|
-
}
|
|
260
|
-
],
|
|
261
|
-
"sort-imports": "off"
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
];
|
|
265
|
-
|
|
266
|
-
// src/configs/solid.ts
|
|
267
|
-
var solid = async (options = {}) => {
|
|
268
|
-
const {
|
|
269
|
-
withTypescript = false
|
|
270
|
-
} = options;
|
|
271
|
-
const configSolid = await import("eslint-plugin-solid/configs/recommended").then((mod) => mod.default);
|
|
272
|
-
return [
|
|
273
|
-
{
|
|
274
|
-
name: "solid/recommended",
|
|
275
|
-
files: ["**/*.jsx", ...withTypescript ? ["**/*.tsx"] : []],
|
|
276
|
-
...configSolid
|
|
277
|
-
}
|
|
278
|
-
];
|
|
214
|
+
//#endregion
|
|
215
|
+
//#region src/configs/perfectionist.ts
|
|
216
|
+
var perfectionist_default = [{
|
|
217
|
+
name: "perfectionist/recommended-natural",
|
|
218
|
+
...eslint_plugin_perfectionist.default.configs["recommended-natural"]
|
|
219
|
+
}, {
|
|
220
|
+
name: "lichthagel/perfectionist",
|
|
221
|
+
rules: {
|
|
222
|
+
"perfectionist/sort-imports": ["error", {
|
|
223
|
+
type: "natural",
|
|
224
|
+
internalPattern: [
|
|
225
|
+
"^@/.*",
|
|
226
|
+
"^~.*",
|
|
227
|
+
"^$.*",
|
|
228
|
+
"^#.*"
|
|
229
|
+
]
|
|
230
|
+
}],
|
|
231
|
+
"perfectionist/sort-object-types": "off",
|
|
232
|
+
"perfectionist/sort-objects": ["off", {
|
|
233
|
+
customGroups: [{
|
|
234
|
+
groupName: "id",
|
|
235
|
+
elementNamePattern: "^(?:id|uuid|key|index|slug)$"
|
|
236
|
+
}, {
|
|
237
|
+
groupName: "name",
|
|
238
|
+
elementNamePattern: "^(?:name|title|label)$"
|
|
239
|
+
}],
|
|
240
|
+
groups: ["id", "unknown"],
|
|
241
|
+
partitionByComment: true,
|
|
242
|
+
partitionByNewLine: true
|
|
243
|
+
}],
|
|
244
|
+
"perfectionist/sort-union-types": ["error", { groups: [
|
|
245
|
+
"named",
|
|
246
|
+
["intersection", "union"],
|
|
247
|
+
"unknown",
|
|
248
|
+
"nullish"
|
|
249
|
+
] }],
|
|
250
|
+
"sort-imports": "off"
|
|
251
|
+
}
|
|
252
|
+
}];
|
|
253
|
+
//#endregion
|
|
254
|
+
//#region src/configs/solid.ts
|
|
255
|
+
const solid = async (options = {}) => {
|
|
256
|
+
const { withTypescript = false } = options;
|
|
257
|
+
const configSolid = await import("eslint-plugin-solid/configs/recommended").then((mod) => mod.default);
|
|
258
|
+
return [{
|
|
259
|
+
name: "solid/recommended",
|
|
260
|
+
files: ["**/*.jsx", ...withTypescript ? ["**/*.tsx"] : []],
|
|
261
|
+
...configSolid
|
|
262
|
+
}];
|
|
279
263
|
};
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
]
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
"svelte/no-spaces-around-equal-signs-in-attribute": "error",
|
|
425
|
-
"svelte/no-target-blank": "error",
|
|
426
|
-
"svelte/no-trailing-spaces": "error",
|
|
427
|
-
"svelte/no-useless-mustaches": "error",
|
|
428
|
-
"svelte/require-store-callbacks-use-set-param": "error",
|
|
429
|
-
"svelte/spaced-html-comment": ["error", "always"],
|
|
430
|
-
"svelte/valid-each-key": "error",
|
|
431
|
-
...disableStylistic ? {
|
|
432
|
-
"@stylistic/indent": "off",
|
|
433
|
-
// superseded by svelte/indent
|
|
434
|
-
"@stylistic/indent-binary-ops": "off",
|
|
435
|
-
// superseded by svelte/indent
|
|
436
|
-
"@stylistic/no-trailing-spaces": "off"
|
|
437
|
-
// superseded by svelte/no-trailing-spaces
|
|
438
|
-
} : {}
|
|
439
|
-
}
|
|
440
|
-
}
|
|
441
|
-
];
|
|
442
|
-
return configs;
|
|
264
|
+
//#endregion
|
|
265
|
+
//#region src/configs/stylistic.ts
|
|
266
|
+
var stylistic_default = [{
|
|
267
|
+
name: "stylistic/custom",
|
|
268
|
+
..._stylistic_eslint_plugin.default.configs.customize({
|
|
269
|
+
arrowParens: true,
|
|
270
|
+
braceStyle: "1tbs",
|
|
271
|
+
commaDangle: "always-multiline",
|
|
272
|
+
indent: 2,
|
|
273
|
+
jsx: true,
|
|
274
|
+
quoteProps: "consistent-as-needed",
|
|
275
|
+
quotes: "double",
|
|
276
|
+
semi: true
|
|
277
|
+
})
|
|
278
|
+
}, {
|
|
279
|
+
name: "lichthagel/stylistic",
|
|
280
|
+
rules: {
|
|
281
|
+
"@stylistic/array-bracket-newline": ["error", {
|
|
282
|
+
minItems: 4,
|
|
283
|
+
multiline: true
|
|
284
|
+
}],
|
|
285
|
+
"@stylistic/array-element-newline": ["error", {
|
|
286
|
+
minItems: 4,
|
|
287
|
+
multiline: true
|
|
288
|
+
}],
|
|
289
|
+
"@stylistic/curly-newline": ["error", { consistent: true }],
|
|
290
|
+
"@stylistic/function-call-argument-newline": ["error", "consistent"],
|
|
291
|
+
"@stylistic/function-call-spacing": ["error", "never"],
|
|
292
|
+
"@stylistic/function-paren-newline": ["error", "multiline-arguments"],
|
|
293
|
+
"@stylistic/generator-star-spacing": ["error", {
|
|
294
|
+
after: false,
|
|
295
|
+
before: true
|
|
296
|
+
}],
|
|
297
|
+
"@stylistic/implicit-arrow-linebreak": ["off", "beside"],
|
|
298
|
+
"@stylistic/lines-around-comment": ["error", {
|
|
299
|
+
afterHashbangComment: true,
|
|
300
|
+
allowArrayStart: true,
|
|
301
|
+
allowBlockStart: true,
|
|
302
|
+
allowClassStart: true,
|
|
303
|
+
allowEnumStart: true,
|
|
304
|
+
allowInterfaceStart: true,
|
|
305
|
+
allowModuleStart: true,
|
|
306
|
+
allowObjectStart: true,
|
|
307
|
+
allowTypeStart: true,
|
|
308
|
+
applyDefaultIgnorePatterns: true,
|
|
309
|
+
beforeBlockComment: true
|
|
310
|
+
}],
|
|
311
|
+
"@stylistic/lines-between-class-members": [
|
|
312
|
+
"error",
|
|
313
|
+
"always",
|
|
314
|
+
{ exceptAfterSingleLine: false }
|
|
315
|
+
],
|
|
316
|
+
"@stylistic/multiline-ternary": ["error", "always-multiline"],
|
|
317
|
+
"@stylistic/newline-per-chained-call": ["error", { ignoreChainWithDepth: 2 }],
|
|
318
|
+
"@stylistic/no-extra-semi": "error",
|
|
319
|
+
"@stylistic/no-multi-spaces": "error",
|
|
320
|
+
"@stylistic/nonblock-statement-body-position": ["error", "beside"],
|
|
321
|
+
"@stylistic/object-curly-newline": ["error", {
|
|
322
|
+
consistent: true,
|
|
323
|
+
minProperties: 4,
|
|
324
|
+
multiline: true
|
|
325
|
+
}],
|
|
326
|
+
"@stylistic/object-property-newline": ["error", { allowAllPropertiesOnSameLine: true }],
|
|
327
|
+
"@stylistic/one-var-declaration-per-line": ["error", "always"],
|
|
328
|
+
"@stylistic/operator-linebreak": ["error", "before"],
|
|
329
|
+
"@stylistic/semi-style": ["error", "last"],
|
|
330
|
+
"@stylistic/switch-colon-spacing": ["error", {
|
|
331
|
+
after: true,
|
|
332
|
+
before: false
|
|
333
|
+
}],
|
|
334
|
+
"@stylistic/jsx-closing-bracket-location": ["error", "line-aligned"],
|
|
335
|
+
"@stylistic/jsx-curly-brace-presence": ["error", {
|
|
336
|
+
children: "never",
|
|
337
|
+
propElementValues: "always",
|
|
338
|
+
props: "never"
|
|
339
|
+
}],
|
|
340
|
+
"@stylistic/jsx-pascal-case": "error",
|
|
341
|
+
"@stylistic/jsx-self-closing-comp": "error"
|
|
342
|
+
}
|
|
343
|
+
}];
|
|
344
|
+
//#endregion
|
|
345
|
+
//#region src/configs/svelte.ts
|
|
346
|
+
const SVELTE_FILES = ["**/*.svelte"];
|
|
347
|
+
const svelte = async (options = {}) => {
|
|
348
|
+
const { disableStylistic = false, withTypescript = false } = options;
|
|
349
|
+
return [...(await import("eslint-plugin-svelte").then((mod) => mod.default)).configs["flat/recommended"].map((configItem) => ({
|
|
350
|
+
name: "svelte/recommended",
|
|
351
|
+
...configItem
|
|
352
|
+
})), {
|
|
353
|
+
name: "lichthagel/svelte",
|
|
354
|
+
files: SVELTE_FILES,
|
|
355
|
+
languageOptions: { parserOptions: {
|
|
356
|
+
extraFileExtensions: [".svelte"],
|
|
357
|
+
parser: withTypescript ? "@typescript-eslint/parser" : null,
|
|
358
|
+
project: true
|
|
359
|
+
} },
|
|
360
|
+
rules: {
|
|
361
|
+
"svelte/block-lang": ["error", {
|
|
362
|
+
enforceScriptPresent: false,
|
|
363
|
+
enforceStylePresent: false,
|
|
364
|
+
script: [withTypescript ? "ts" : null]
|
|
365
|
+
}],
|
|
366
|
+
"svelte/first-attribute-linebreak": ["error", {
|
|
367
|
+
multiline: "below",
|
|
368
|
+
singleline: "beside"
|
|
369
|
+
}],
|
|
370
|
+
"svelte/html-closing-bracket-spacing": ["error", {
|
|
371
|
+
endTag: "never",
|
|
372
|
+
selfClosingTag: "always",
|
|
373
|
+
startTag: "never"
|
|
374
|
+
}],
|
|
375
|
+
"svelte/html-quotes": ["error", { prefer: "double" }],
|
|
376
|
+
"svelte/indent": ["error", {
|
|
377
|
+
alignAttributesVertically: true,
|
|
378
|
+
indent: 2
|
|
379
|
+
}],
|
|
380
|
+
"svelte/infinite-reactive-loop": "error",
|
|
381
|
+
"svelte/max-attributes-per-line": ["error", {
|
|
382
|
+
multiline: 1,
|
|
383
|
+
singleline: 3
|
|
384
|
+
}],
|
|
385
|
+
"svelte/mustache-spacing": "error",
|
|
386
|
+
"svelte/no-dupe-on-directives": "error",
|
|
387
|
+
"svelte/no-dupe-use-directives": "error",
|
|
388
|
+
"svelte/no-export-load-in-svelte-module-in-kit-pages": "error",
|
|
389
|
+
"svelte/no-goto-without-base": "error",
|
|
390
|
+
"svelte/no-ignored-unsubscribe": "error",
|
|
391
|
+
"svelte/no-immutable-reactive-statements": "error",
|
|
392
|
+
"svelte/no-reactive-functions": "error",
|
|
393
|
+
"svelte/no-reactive-literals": "error",
|
|
394
|
+
"svelte/no-spaces-around-equal-signs-in-attribute": "error",
|
|
395
|
+
"svelte/no-target-blank": "error",
|
|
396
|
+
"svelte/no-trailing-spaces": "error",
|
|
397
|
+
"svelte/no-useless-mustaches": "error",
|
|
398
|
+
"svelte/require-store-callbacks-use-set-param": "error",
|
|
399
|
+
"svelte/spaced-html-comment": ["error", "always"],
|
|
400
|
+
"svelte/valid-each-key": "error",
|
|
401
|
+
...disableStylistic ? {
|
|
402
|
+
"@stylistic/indent": "off",
|
|
403
|
+
"@stylistic/indent-binary-ops": "off",
|
|
404
|
+
"@stylistic/no-trailing-spaces": "off"
|
|
405
|
+
} : {}
|
|
406
|
+
}
|
|
407
|
+
}];
|
|
443
408
|
};
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
}
|
|
464
|
-
];
|
|
409
|
+
//#endregion
|
|
410
|
+
//#region src/configs/tailwindcss.ts
|
|
411
|
+
const tailwindcss = async () => {
|
|
412
|
+
return [...(await import("eslint-plugin-tailwindcss").then((mod) => mod.default)).configs["flat/recommended"].map((config) => {
|
|
413
|
+
var _config$name;
|
|
414
|
+
return {
|
|
415
|
+
...config,
|
|
416
|
+
name: (_config$name = config.name) === null || _config$name === void 0 ? void 0 : _config$name.replaceAll(":", "/")
|
|
417
|
+
};
|
|
418
|
+
}), {
|
|
419
|
+
name: "lichthagel/tailwindcss",
|
|
420
|
+
rules: {
|
|
421
|
+
"tailwindcss/classnames-order": "error",
|
|
422
|
+
"tailwindcss/enforces-negative-arbitrary-values": "error",
|
|
423
|
+
"tailwindcss/enforces-shorthand": "error",
|
|
424
|
+
"tailwindcss/no-contradicting-classname": "error",
|
|
425
|
+
"tailwindcss/no-unnecessary-arbitrary-value": "error"
|
|
426
|
+
}
|
|
427
|
+
}];
|
|
465
428
|
};
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
const config = [...javascript_default, ...unicorn_default, ...perfectionist_default];
|
|
536
|
-
if (stylistic2) {
|
|
537
|
-
config.push(...stylistic_default);
|
|
538
|
-
}
|
|
539
|
-
if (browser) {
|
|
540
|
-
config.push(...browser_default);
|
|
541
|
-
}
|
|
542
|
-
if (node2) {
|
|
543
|
-
config.push(...await node_default());
|
|
544
|
-
}
|
|
545
|
-
if (typescript) {
|
|
546
|
-
config.push(...typescript_default);
|
|
547
|
-
}
|
|
548
|
-
if (solid2) {
|
|
549
|
-
config.push(...await solid_default({ withTypescript: typescript }));
|
|
550
|
-
}
|
|
551
|
-
if (svelte2) {
|
|
552
|
-
config.push(...await svelte_default({ disableStylistic: stylistic2, withTypescript: typescript }));
|
|
553
|
-
}
|
|
554
|
-
if (tailwindcss2) {
|
|
555
|
-
config.push(...await tailwindcss_default());
|
|
556
|
-
}
|
|
557
|
-
return config;
|
|
429
|
+
//#endregion
|
|
430
|
+
//#region src/configs/typescript.ts
|
|
431
|
+
var typescript_default = [...typescript_eslint.default.configs.recommendedTypeChecked, {
|
|
432
|
+
name: "lichthagel/typescript",
|
|
433
|
+
rules: {
|
|
434
|
+
"@typescript-eslint/array-type": "error",
|
|
435
|
+
"@typescript-eslint/consistent-indexed-object-style": ["warn", "index-signature"],
|
|
436
|
+
"@typescript-eslint/consistent-type-assertions": ["warn", {
|
|
437
|
+
assertionStyle: "as",
|
|
438
|
+
objectLiteralTypeAssertions: "allow"
|
|
439
|
+
}],
|
|
440
|
+
"@typescript-eslint/consistent-type-definitions": ["warn", "type"],
|
|
441
|
+
"@typescript-eslint/consistent-type-exports": "error",
|
|
442
|
+
"@typescript-eslint/consistent-type-imports": ["error", { fixStyle: "inline-type-imports" }],
|
|
443
|
+
"@typescript-eslint/default-param-last": "warn",
|
|
444
|
+
"@typescript-eslint/explicit-member-accessibility": "error",
|
|
445
|
+
"@typescript-eslint/method-signature-style": "warn",
|
|
446
|
+
"@typescript-eslint/no-array-constructor": "error",
|
|
447
|
+
"@typescript-eslint/no-useless-empty-export": "error",
|
|
448
|
+
"default-param-last": "off"
|
|
449
|
+
}
|
|
450
|
+
}];
|
|
451
|
+
//#endregion
|
|
452
|
+
//#region src/configs/unicorn.ts
|
|
453
|
+
var unicorn_default = [{
|
|
454
|
+
name: "unicorn/flat/recommended",
|
|
455
|
+
...eslint_plugin_unicorn.default.configs["flat/recommended"]
|
|
456
|
+
}, {
|
|
457
|
+
name: "lichthagel/unicorn",
|
|
458
|
+
rules: {
|
|
459
|
+
"unicorn/consistent-destructuring": "error",
|
|
460
|
+
"unicorn/filename-case": ["error", { cases: {
|
|
461
|
+
camelCase: true,
|
|
462
|
+
kebabCase: true,
|
|
463
|
+
pascalCase: true
|
|
464
|
+
} }],
|
|
465
|
+
"unicorn/import-style": "off",
|
|
466
|
+
"unicorn/no-null": "off",
|
|
467
|
+
"unicorn/no-useless-undefined": ["error", { checkArguments: false }],
|
|
468
|
+
"unicorn/prevent-abbreviations": "off"
|
|
469
|
+
}
|
|
470
|
+
}];
|
|
471
|
+
//#endregion
|
|
472
|
+
//#region src/factory.ts
|
|
473
|
+
/**
|
|
474
|
+
* Constructs an array of ESLint flat config items based on the provided options.
|
|
475
|
+
*
|
|
476
|
+
* @param options The options for generating the ESLint configurations. See {@linkcode OptionsConfig}.
|
|
477
|
+
* @returns An array of ESLint flat config items.
|
|
478
|
+
*/
|
|
479
|
+
const lichthagel = async (options = {}) => {
|
|
480
|
+
const { browser = false, node: node$1 = false, solid: solid$1 = false, stylistic = true, svelte: svelte$1 = false, tailwindcss: tailwindcss$1 = false, typescript = true, ...rest } = options;
|
|
481
|
+
if (Object.keys(rest).length > 0) throw new Error(`Unknown options: ${Object.keys(rest).join(", ")}`);
|
|
482
|
+
const config = [
|
|
483
|
+
...javascript_default,
|
|
484
|
+
...unicorn_default,
|
|
485
|
+
...perfectionist_default
|
|
486
|
+
];
|
|
487
|
+
if (stylistic) config.push(...stylistic_default);
|
|
488
|
+
if (browser) config.push(...browser_default);
|
|
489
|
+
if (node$1) config.push(...await node());
|
|
490
|
+
if (typescript) config.push(...typescript_default);
|
|
491
|
+
if (solid$1) config.push(...await solid({ withTypescript: typescript }));
|
|
492
|
+
if (svelte$1) config.push(...await svelte({
|
|
493
|
+
disableStylistic: stylistic,
|
|
494
|
+
withTypescript: typescript
|
|
495
|
+
}));
|
|
496
|
+
if (tailwindcss$1) config.push(...await tailwindcss());
|
|
497
|
+
return config;
|
|
558
498
|
};
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
unicorn
|
|
572
|
-
});
|
|
499
|
+
//#endregion
|
|
500
|
+
exports.browser = browser_default;
|
|
501
|
+
exports.default = lichthagel;
|
|
502
|
+
exports.javascript = javascript_default;
|
|
503
|
+
exports.node = node;
|
|
504
|
+
exports.perfectionist = perfectionist_default;
|
|
505
|
+
exports.solid = solid;
|
|
506
|
+
exports.stylistic = stylistic_default;
|
|
507
|
+
exports.svelte = svelte;
|
|
508
|
+
exports.tailwindcss = tailwindcss;
|
|
509
|
+
exports.typescript = typescript_default;
|
|
510
|
+
exports.unicorn = unicorn_default;
|