zirka 0.0.25
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/README.md +76 -0
- package/dist/styleguide.cjs +1319 -0
- package/dist/styleguide.d.cts +30 -0
- package/dist/styleguide.d.ts +30 -0
- package/dist/styleguide.js +1296 -0
- package/package.json +70 -0
- package/types/@next__eslint-plugin-next/index.d.ts +18 -0
- package/types/eslint-plugin-eslint-comments__configs/index.d.ts +5 -0
- package/types/eslint-plugin-import/index.d.ts +7 -0
- package/typescript/base.json +18 -0
|
@@ -0,0 +1,1319 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __esm = (fn, res) => function __init() {
|
|
9
|
+
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
10
|
+
};
|
|
11
|
+
var __export = (target, all) => {
|
|
12
|
+
for (var name in all)
|
|
13
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
14
|
+
};
|
|
15
|
+
var __copyProps = (to, from, except, desc) => {
|
|
16
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
17
|
+
for (let key of __getOwnPropNames(from))
|
|
18
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
19
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
20
|
+
}
|
|
21
|
+
return to;
|
|
22
|
+
};
|
|
23
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
24
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
25
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
26
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
27
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
28
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
29
|
+
mod
|
|
30
|
+
));
|
|
31
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
32
|
+
|
|
33
|
+
// prettier/index.ts
|
|
34
|
+
function getPrettierConfig(options) {
|
|
35
|
+
if (options === true) {
|
|
36
|
+
return basePrettierConfig;
|
|
37
|
+
}
|
|
38
|
+
return {
|
|
39
|
+
...basePrettierConfig,
|
|
40
|
+
plugins: [...basePrettierConfig.plugins ?? [], ...options.tailwind ? ["prettier-plugin-tailwindcss"] : []]
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
var basePrettierConfig;
|
|
44
|
+
var init_prettier = __esm({
|
|
45
|
+
"prettier/index.ts"() {
|
|
46
|
+
"use strict";
|
|
47
|
+
basePrettierConfig = {
|
|
48
|
+
endOfLine: "lf",
|
|
49
|
+
tabWidth: 2,
|
|
50
|
+
printWidth: 120,
|
|
51
|
+
useTabs: false,
|
|
52
|
+
singleQuote: false,
|
|
53
|
+
trailingComma: "all",
|
|
54
|
+
plugins: ["prettier-plugin-packagejson"]
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
// eslint/utils/transform-severity.ts
|
|
60
|
+
var transform_severity_exports = {};
|
|
61
|
+
__export(transform_severity_exports, {
|
|
62
|
+
transformSeverity: () => transformSeverity
|
|
63
|
+
});
|
|
64
|
+
function transformSeverity(configsToProcess, targetSeverity) {
|
|
65
|
+
const transformedConfigs = [];
|
|
66
|
+
for (const singleConfig of configsToProcess) {
|
|
67
|
+
const newConfig = { ...singleConfig };
|
|
68
|
+
if (newConfig.rules) {
|
|
69
|
+
const newRules = {};
|
|
70
|
+
for (const ruleId in newConfig.rules) {
|
|
71
|
+
const ruleConfig = newConfig.rules[ruleId];
|
|
72
|
+
if (!ruleConfig) {
|
|
73
|
+
continue;
|
|
74
|
+
}
|
|
75
|
+
const [currentSeverity, ruleOptions, isOriginalRuleArray] = Array.isArray(ruleConfig) ? (
|
|
76
|
+
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions -- ESLint's 'RuleEntry' is typed with any[]
|
|
77
|
+
[ruleConfig[0], ruleConfig.slice(1), true]
|
|
78
|
+
) : [ruleConfig, [], false];
|
|
79
|
+
let newRuleEntry = ruleConfig;
|
|
80
|
+
if (targetSeverity === "warn" /* Warn */) {
|
|
81
|
+
if (currentSeverity === "error" /* Error */ || currentSeverity === 2 /* Error */) {
|
|
82
|
+
newRuleEntry = isOriginalRuleArray ? ["warn" /* Warn */, ...ruleOptions] : "warn" /* Warn */;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
if (targetSeverity === "error" /* Error */) {
|
|
86
|
+
if (currentSeverity === "warn" /* Warn */ || currentSeverity === 1 /* Warn */) {
|
|
87
|
+
newRuleEntry = isOriginalRuleArray ? ["error" /* Error */, ...ruleOptions] : "error" /* Error */;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
newRules[ruleId] = newRuleEntry;
|
|
91
|
+
}
|
|
92
|
+
newConfig.rules = newRules;
|
|
93
|
+
}
|
|
94
|
+
transformedConfigs.push(newConfig);
|
|
95
|
+
}
|
|
96
|
+
return transformedConfigs;
|
|
97
|
+
}
|
|
98
|
+
var init_transform_severity = __esm({
|
|
99
|
+
"eslint/utils/transform-severity.ts"() {
|
|
100
|
+
"use strict";
|
|
101
|
+
init_styleguide();
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
// eslint/utils/constants.ts
|
|
106
|
+
var ECMA_VERSION, JAVASCRIPT_FILES, TYPESCRIPT_FILES;
|
|
107
|
+
var init_constants = __esm({
|
|
108
|
+
"eslint/utils/constants.ts"() {
|
|
109
|
+
"use strict";
|
|
110
|
+
ECMA_VERSION = "latest";
|
|
111
|
+
JAVASCRIPT_FILES = ["**/*.js", "**/*.cjs", "**/*.mjs", "**/*.jsx"];
|
|
112
|
+
TYPESCRIPT_FILES = ["**/*.ts", "**/*.mts", "**/*.cts", "**/*.tsx"];
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
// eslint/rules/best-practice.ts
|
|
117
|
+
var bestPracticeRules;
|
|
118
|
+
var init_best_practice = __esm({
|
|
119
|
+
"eslint/rules/best-practice.ts"() {
|
|
120
|
+
"use strict";
|
|
121
|
+
bestPracticeRules = {
|
|
122
|
+
/**
|
|
123
|
+
* Require return statements in array methods callbacks.
|
|
124
|
+
* 🚫 Not fixable - https://eslint.org/docs/rules/array-callback-return
|
|
125
|
+
* Source: Vercel Style Guide → https://github.com/vercel/style-guide
|
|
126
|
+
*/
|
|
127
|
+
"array-callback-return": ["error", { allowImplicit: true }],
|
|
128
|
+
/**
|
|
129
|
+
* Treat `var` statements as if they were block scoped.
|
|
130
|
+
* 🚫 Not fixable - https://eslint.org/docs/rules/block-scoped-var
|
|
131
|
+
* Source: Vercel Style Guide → https://github.com/vercel/style-guide
|
|
132
|
+
*/
|
|
133
|
+
"block-scoped-var": "error",
|
|
134
|
+
/**
|
|
135
|
+
* Require curly braces for multiline blocks.
|
|
136
|
+
* 🔧 Fixable - https://eslint.org/docs/rules/curly
|
|
137
|
+
* Source: Vercel Style Guide → https://github.com/vercel/style-guide
|
|
138
|
+
*/
|
|
139
|
+
curly: ["warn", "multi-line"],
|
|
140
|
+
/**
|
|
141
|
+
* Require default clauses in switch statements to be last (if used).
|
|
142
|
+
* 🚫 Not fixable - https://eslint.org/docs/rules/default-case-last
|
|
143
|
+
* Source: Vercel Style Guide → https://github.com/vercel/style-guide
|
|
144
|
+
*/
|
|
145
|
+
"default-case-last": "error",
|
|
146
|
+
/**
|
|
147
|
+
* Require triple equals (`===` and `!==`).
|
|
148
|
+
* 🔧 Fixable - https://eslint.org/docs/rules/eqeqeq
|
|
149
|
+
* Source: Vercel Style Guide → https://github.com/vercel/style-guide
|
|
150
|
+
*/
|
|
151
|
+
eqeqeq: "error",
|
|
152
|
+
/**
|
|
153
|
+
* Require grouped accessor pairs in object literals and classes.
|
|
154
|
+
* 🚫 Not fixable - https://eslint.org/docs/rules/grouped-accessor-pairs
|
|
155
|
+
* Source: Vercel Style Guide → https://github.com/vercel/style-guide
|
|
156
|
+
*/
|
|
157
|
+
"grouped-accessor-pairs": "error",
|
|
158
|
+
/**
|
|
159
|
+
* Disallow use of `alert()`.
|
|
160
|
+
* 🚫 Not fixable - https://eslint.org/docs/rules/no-alert
|
|
161
|
+
* Source: Vercel Style Guide → https://github.com/vercel/style-guide
|
|
162
|
+
*/
|
|
163
|
+
"no-alert": "error",
|
|
164
|
+
/**
|
|
165
|
+
* Disallow use of `caller`/`callee`.
|
|
166
|
+
* 🚫 Not fixable - https://eslint.org/docs/rules/no-caller
|
|
167
|
+
* Source: Vercel Style Guide → https://github.com/vercel/style-guide
|
|
168
|
+
*/
|
|
169
|
+
"no-caller": "error",
|
|
170
|
+
/**
|
|
171
|
+
* Disallow returning value in constructor.
|
|
172
|
+
* 🚫 Not fixable - https://eslint.org/docs/rules/no-constructor-return
|
|
173
|
+
* Source: Vercel Style Guide → https://github.com/vercel/style-guide
|
|
174
|
+
*/
|
|
175
|
+
"no-constructor-return": "error",
|
|
176
|
+
/**
|
|
177
|
+
* Disallow using an `else` if the `if` block contains a return.
|
|
178
|
+
* 🔧 Fixable - https://eslint.org/docs/rules/no-else-return
|
|
179
|
+
* Source: Vercel Style Guide → https://github.com/vercel/style-guide
|
|
180
|
+
*/
|
|
181
|
+
"no-else-return": "warn",
|
|
182
|
+
/**
|
|
183
|
+
* Disallow `eval()`.
|
|
184
|
+
* 🚫 Not fixable - https://eslint.org/docs/rules/no-eval
|
|
185
|
+
* Source: Vercel Style Guide → https://github.com/vercel/style-guide
|
|
186
|
+
*/
|
|
187
|
+
"no-eval": "error",
|
|
188
|
+
/**
|
|
189
|
+
* Disallow extending native objects.
|
|
190
|
+
* 🚫 Not fixable - https://eslint.org/docs/rules/no-extend-native
|
|
191
|
+
* Source: Vercel Style Guide → https://github.com/vercel/style-guide
|
|
192
|
+
*/
|
|
193
|
+
"no-extend-native": "error",
|
|
194
|
+
/**
|
|
195
|
+
* Disallow unnecessary function binding.
|
|
196
|
+
* 🔧 Fixable - https://eslint.org/docs/rules/no-extra-bind
|
|
197
|
+
* Source: Vercel Style Guide → https://github.com/vercel/style-guide
|
|
198
|
+
*/
|
|
199
|
+
"no-extra-bind": "error",
|
|
200
|
+
/**
|
|
201
|
+
* Disallow unnecessary labels.
|
|
202
|
+
* 🔧 Fixable - https://eslint.org/docs/rules/no-extra-label
|
|
203
|
+
* Source: Vercel Style Guide → https://github.com/vercel/style-guide
|
|
204
|
+
*/
|
|
205
|
+
"no-extra-label": "error",
|
|
206
|
+
/**
|
|
207
|
+
* Disallow floating decimals.
|
|
208
|
+
* 🔧 Fixable - https://eslint.org/docs/rules/no-floating-decimal
|
|
209
|
+
* Source: Vercel Style Guide → https://github.com/vercel/style-guide
|
|
210
|
+
*/
|
|
211
|
+
"no-floating-decimal": "error",
|
|
212
|
+
/**
|
|
213
|
+
* Make people convert types explicitly e.g. `Boolean(foo)` instead of `!!foo`.
|
|
214
|
+
* 🔧 Partially Fixable - https://eslint.org/docs/rules/no-implicit-coercion
|
|
215
|
+
* Source: Vercel Style Guide → https://github.com/vercel/style-guide
|
|
216
|
+
*/
|
|
217
|
+
"no-implicit-coercion": "error",
|
|
218
|
+
/**
|
|
219
|
+
* Disallow use of `eval()`-like methods.
|
|
220
|
+
* 🚫 Not fixable - https://eslint.org/docs/rules/no-implied-eval
|
|
221
|
+
* Source: Vercel Style Guide → https://github.com/vercel/style-guide
|
|
222
|
+
*/
|
|
223
|
+
"no-implied-eval": "error",
|
|
224
|
+
/**
|
|
225
|
+
* Disallow usage of `__iterator__` property.
|
|
226
|
+
* 🚫 Not fixable - https://eslint.org/docs/rules/no-iterator
|
|
227
|
+
* Source: Vercel Style Guide → https://github.com/vercel/style-guide
|
|
228
|
+
*/
|
|
229
|
+
"no-iterator": "error",
|
|
230
|
+
/**
|
|
231
|
+
* Disallow use of labels for anything other than loops and switches.
|
|
232
|
+
* 🚫 Not fixable - https://eslint.org/docs/rules/no-labels
|
|
233
|
+
* Source: Vercel Style Guide → https://github.com/vercel/style-guide
|
|
234
|
+
*/
|
|
235
|
+
"no-labels": ["error"],
|
|
236
|
+
/**
|
|
237
|
+
* Disallow unnecessary nested blocks.
|
|
238
|
+
* 🚫 Not fixable - https://eslint.org/docs/rules/no-lone-blocks
|
|
239
|
+
* Source: Vercel Style Guide → https://github.com/vercel/style-guide
|
|
240
|
+
*/
|
|
241
|
+
"no-lone-blocks": "error",
|
|
242
|
+
/**
|
|
243
|
+
* Disallow `new` for side effects.
|
|
244
|
+
* 🚫 Not fixable - https://eslint.org/docs/rules/no-new
|
|
245
|
+
* Source: Vercel Style Guide → https://github.com/vercel/style-guide
|
|
246
|
+
*/
|
|
247
|
+
"no-new": "error",
|
|
248
|
+
/**
|
|
249
|
+
* Disallow function constructors.
|
|
250
|
+
* 🚫 Not fixable - https://eslint.org/docs/rules/no-new-func
|
|
251
|
+
* Source: Vercel Style Guide → https://github.com/vercel/style-guide
|
|
252
|
+
*/
|
|
253
|
+
"no-new-func": "error",
|
|
254
|
+
/**
|
|
255
|
+
* Disallow primitive wrapper instances, such as `new String('foo')`.
|
|
256
|
+
* 🚫 Not fixable - https://eslint.org/docs/rules/no-new-wrappers
|
|
257
|
+
* Source: Vercel Style Guide → https://github.com/vercel/style-guide
|
|
258
|
+
*/
|
|
259
|
+
"no-new-wrappers": "error",
|
|
260
|
+
/**
|
|
261
|
+
* Disallow use of octal escape sequences in string literals.
|
|
262
|
+
* 🚫 Not fixable - https://eslint.org/docs/rules/no-octal-escape
|
|
263
|
+
* Source: Vercel Style Guide → https://github.com/vercel/style-guide
|
|
264
|
+
*/
|
|
265
|
+
"no-octal-escape": "error",
|
|
266
|
+
/**
|
|
267
|
+
* Disallow reassignment of function parameters.
|
|
268
|
+
* 🚫 Not fixable - https://eslint.org/docs/rules/no-param-reassign
|
|
269
|
+
* Source: Vercel Style Guide → https://github.com/vercel/style-guide
|
|
270
|
+
*/
|
|
271
|
+
"no-param-reassign": "error",
|
|
272
|
+
/**
|
|
273
|
+
* Disallow usage of the deprecated `__proto__` property.
|
|
274
|
+
* 🚫 Not fixable - https://eslint.org/docs/rules/no-proto
|
|
275
|
+
* Source: Vercel Style Guide → https://github.com/vercel/style-guide
|
|
276
|
+
*/
|
|
277
|
+
"no-proto": "error",
|
|
278
|
+
/**
|
|
279
|
+
* Disallow assignment in `return` statement.
|
|
280
|
+
* 🚫 Not fixable - https://eslint.org/docs/rules/no-return-assign
|
|
281
|
+
* Source: Vercel Style Guide → https://github.com/vercel/style-guide
|
|
282
|
+
*/
|
|
283
|
+
"no-return-assign": "error",
|
|
284
|
+
/**
|
|
285
|
+
* Disallow use of `javascript:` urls.
|
|
286
|
+
* 🚫 Not fixable - https://eslint.org/docs/rules/no-script-url
|
|
287
|
+
* Source: Vercel Style Guide → https://github.com/vercel/style-guide
|
|
288
|
+
*/
|
|
289
|
+
"no-script-url": "error",
|
|
290
|
+
/**
|
|
291
|
+
* Disallow comparisons where both sides are exactly the same.
|
|
292
|
+
* 🚫 Not fixable - https://eslint.org/docs/rules/no-self-compare
|
|
293
|
+
* Source: Vercel Style Guide → https://github.com/vercel/style-guide
|
|
294
|
+
*/
|
|
295
|
+
"no-self-compare": "error",
|
|
296
|
+
/**
|
|
297
|
+
* Disallow use of comma operator.
|
|
298
|
+
* 🚫 Not fixable - https://eslint.org/docs/rules/no-sequences
|
|
299
|
+
* Source: Vercel Style Guide → https://github.com/vercel/style-guide
|
|
300
|
+
*/
|
|
301
|
+
"no-sequences": "error",
|
|
302
|
+
/**
|
|
303
|
+
* Disallow unnecessary `.call()` and `.apply()`.
|
|
304
|
+
* 🚫 Not fixable - https://eslint.org/docs/rules/no-useless-call
|
|
305
|
+
* Source: Vercel Style Guide → https://github.com/vercel/style-guide
|
|
306
|
+
*/
|
|
307
|
+
"no-useless-call": "error",
|
|
308
|
+
/**
|
|
309
|
+
* Disallow unnecessary concatenation of strings.
|
|
310
|
+
* 🚫 Not fixable - https://eslint.org/docs/rules/no-useless-concat
|
|
311
|
+
* Source: Vercel Style Guide → https://github.com/vercel/style-guide
|
|
312
|
+
*/
|
|
313
|
+
"no-useless-concat": "error",
|
|
314
|
+
/**
|
|
315
|
+
* Disallow redundant return statements.
|
|
316
|
+
* 🔧 Fixable - https://eslint.org/docs/rules/no-useless-return
|
|
317
|
+
* Source: Vercel Style Guide → https://github.com/vercel/style-guide
|
|
318
|
+
*/
|
|
319
|
+
"no-useless-return": "warn",
|
|
320
|
+
/**
|
|
321
|
+
* Require using named capture groups in regular expressions.
|
|
322
|
+
* 🚫 Not fixable - https://eslint.org/docs/rules/prefer-named-capture-group
|
|
323
|
+
* Source: Vercel Style Guide → https://github.com/vercel/style-guide
|
|
324
|
+
*/
|
|
325
|
+
"prefer-named-capture-group": "error",
|
|
326
|
+
/**
|
|
327
|
+
* Require using Error objects as Promise rejection reasons.
|
|
328
|
+
* 🚫 Not fixable - https://eslint.org/docs/rules/prefer-promise-reject-errors
|
|
329
|
+
* Source: Vercel Style Guide → https://github.com/vercel/style-guide
|
|
330
|
+
*/
|
|
331
|
+
"prefer-promise-reject-errors": ["error", { allowEmptyReject: true }],
|
|
332
|
+
/**
|
|
333
|
+
* Disallow use of the RegExp constructor in favor of regular expression literals.
|
|
334
|
+
* 🚫 Not fixable - https://eslint.org/docs/rules/prefer-regex-literals
|
|
335
|
+
* Source: Vercel Style Guide → https://github.com/vercel/style-guide
|
|
336
|
+
*/
|
|
337
|
+
"prefer-regex-literals": "error",
|
|
338
|
+
/**
|
|
339
|
+
* Disallow "Yoda conditions", ensuring the comparison.
|
|
340
|
+
* 🔧 Fixable - https://eslint.org/docs/rules/yoda
|
|
341
|
+
* Source: Vercel Style Guide → https://github.com/vercel/style-guide
|
|
342
|
+
*/
|
|
343
|
+
yoda: "warn"
|
|
344
|
+
};
|
|
345
|
+
}
|
|
346
|
+
});
|
|
347
|
+
|
|
348
|
+
// eslint/rules/es6.ts
|
|
349
|
+
var es6Rules;
|
|
350
|
+
var init_es6 = __esm({
|
|
351
|
+
"eslint/rules/es6.ts"() {
|
|
352
|
+
"use strict";
|
|
353
|
+
es6Rules = {
|
|
354
|
+
/**
|
|
355
|
+
* Disallow useless computed property keys.
|
|
356
|
+
* 🔧 Fixable - https://eslint.org/docs/rules/no-useless-computed-key
|
|
357
|
+
* Source: Vercel Style Guide → https://github.com/vercel/style-guide
|
|
358
|
+
*/
|
|
359
|
+
"no-useless-computed-key": "warn",
|
|
360
|
+
/**
|
|
361
|
+
* Disallow renaming import, export, and destructured assignments to the same name.
|
|
362
|
+
* 🔧 Fixable - https://eslint.org/docs/rules/no-useless-rename
|
|
363
|
+
* Source: Vercel Style Guide → https://github.com/vercel/style-guide
|
|
364
|
+
*/
|
|
365
|
+
"no-useless-rename": "warn",
|
|
366
|
+
/**
|
|
367
|
+
* Require `let` or `const` instead of `var`.
|
|
368
|
+
* 🔧 Fixable - https://eslint.org/docs/rules/no-var
|
|
369
|
+
* Source: Vercel Style Guide → https://github.com/vercel/style-guide
|
|
370
|
+
*/
|
|
371
|
+
"no-var": "error",
|
|
372
|
+
/**
|
|
373
|
+
* Require object literal shorthand syntax.
|
|
374
|
+
* 🔧 Fixable - https://eslint.org/docs/rules/object-shorthand
|
|
375
|
+
* Source: Vercel Style Guide → https://github.com/vercel/style-guide
|
|
376
|
+
*/
|
|
377
|
+
"object-shorthand": "warn",
|
|
378
|
+
/**
|
|
379
|
+
* Require default to `const` instead of `let`.
|
|
380
|
+
* 🔧 Fixable - https://eslint.org/docs/rules/prefer-const
|
|
381
|
+
* Source: Vercel Style Guide → https://github.com/vercel/style-guide
|
|
382
|
+
*/
|
|
383
|
+
"prefer-const": "warn",
|
|
384
|
+
/**
|
|
385
|
+
* Disallow parseInt() in favor of binary, octal, and hexadecimal literals.
|
|
386
|
+
* 🔧 Fixable - https://eslint.org/docs/rules/prefer-numeric-literals
|
|
387
|
+
* Source: Vercel Style Guide → https://github.com/vercel/style-guide
|
|
388
|
+
*/
|
|
389
|
+
"prefer-numeric-literals": "error",
|
|
390
|
+
/**
|
|
391
|
+
* Require using rest parameters instead of `arguments`.
|
|
392
|
+
* 🚫 Not fixable - https://eslint.org/docs/rules/prefer-rest-params
|
|
393
|
+
* Source: Vercel Style Guide → https://github.com/vercel/style-guide
|
|
394
|
+
*/
|
|
395
|
+
"prefer-rest-params": "error",
|
|
396
|
+
/**
|
|
397
|
+
* Require using spread syntax instead of `.apply()`.
|
|
398
|
+
* 🚫 Not fixable - https://eslint.org/docs/rules/prefer-spread
|
|
399
|
+
* Source: Vercel Style Guide → https://github.com/vercel/style-guide
|
|
400
|
+
*/
|
|
401
|
+
"prefer-spread": "error",
|
|
402
|
+
/**
|
|
403
|
+
* Require using template literals instead of string concatenation.
|
|
404
|
+
* 🔧 Fixable - https://eslint.org/docs/rules/prefer-template
|
|
405
|
+
* Source: Vercel Style Guide → https://github.com/vercel/style-guide
|
|
406
|
+
*/
|
|
407
|
+
"prefer-template": "warn",
|
|
408
|
+
/**
|
|
409
|
+
* Require a `Symbol` description.
|
|
410
|
+
* 🚫 Not fixable - https://eslint.org/docs/rules/symbol-description
|
|
411
|
+
* Source: Vercel Style Guide → https://github.com/vercel/style-guide
|
|
412
|
+
*/
|
|
413
|
+
"symbol-description": "error"
|
|
414
|
+
};
|
|
415
|
+
}
|
|
416
|
+
});
|
|
417
|
+
|
|
418
|
+
// eslint/rules/import.ts
|
|
419
|
+
var importRules, importOverrides;
|
|
420
|
+
var init_import = __esm({
|
|
421
|
+
"eslint/rules/import.ts"() {
|
|
422
|
+
"use strict";
|
|
423
|
+
importRules = {
|
|
424
|
+
/**
|
|
425
|
+
* Disallow non-import statements appearing before import statements.
|
|
426
|
+
* 🚫 Not fixable - https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/first.md
|
|
427
|
+
* Source: Vercel Style Guide → https://github.com/vercel/style-guide
|
|
428
|
+
*/
|
|
429
|
+
"import/first": "error",
|
|
430
|
+
/**
|
|
431
|
+
* Require a newline after the last import/require.
|
|
432
|
+
* 🔧 Fixable - https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/newline-after-import.md
|
|
433
|
+
* Source: Vercel Style Guide → https://github.com/vercel/style-guide
|
|
434
|
+
*/
|
|
435
|
+
"import/newline-after-import": "warn",
|
|
436
|
+
/**
|
|
437
|
+
* Disallow import of modules using absolute paths.
|
|
438
|
+
* 🚫 Not fixable - https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-absolute-path.md
|
|
439
|
+
* Source: Vercel Style Guide → https://github.com/vercel/style-guide
|
|
440
|
+
*/
|
|
441
|
+
"import/no-absolute-path": "error",
|
|
442
|
+
/**
|
|
443
|
+
* Disallow cyclical dependencies between modules.
|
|
444
|
+
* 🚫 Not fixable - https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-cycle.md
|
|
445
|
+
* Source: Vercel Style Guide → https://github.com/vercel/style-guide
|
|
446
|
+
*/
|
|
447
|
+
"import/no-cycle": "error",
|
|
448
|
+
/**
|
|
449
|
+
* Disallow duplicate imports from the same module.
|
|
450
|
+
* 🔧 Fixable - https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-duplicates.md
|
|
451
|
+
* Source: Added by bredansky → https://github.com/bredansky
|
|
452
|
+
*/
|
|
453
|
+
"import/no-duplicates": ["error", { "prefer-inline": true }],
|
|
454
|
+
/**
|
|
455
|
+
* Disallow default exports.
|
|
456
|
+
* 🚫 Not fixable - https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-default-export.md
|
|
457
|
+
* Source: Vercel Style Guide → https://github.com/vercel/style-guide
|
|
458
|
+
*/
|
|
459
|
+
"import/no-default-export": "error",
|
|
460
|
+
/**
|
|
461
|
+
* Disallow the use of extraneous packages.
|
|
462
|
+
* 🚫 Not fixable - https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-extraneous-dependencies.md
|
|
463
|
+
* Source: Vercel Style Guide → https://github.com/vercel/style-guide
|
|
464
|
+
*/
|
|
465
|
+
"import/no-extraneous-dependencies": ["error", { includeTypes: true }],
|
|
466
|
+
/**
|
|
467
|
+
* Disallow mutable exports.
|
|
468
|
+
* 🚫 Not fixable - https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-mutable-exports.md
|
|
469
|
+
* Source: Vercel Style Guide → https://github.com/vercel/style-guide
|
|
470
|
+
*/
|
|
471
|
+
"import/no-mutable-exports": "error",
|
|
472
|
+
/**
|
|
473
|
+
* Disallow importing packages through relative paths.
|
|
474
|
+
* 🔧 Fixable - https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-relative-packages.md
|
|
475
|
+
* Source: Vercel Style Guide → https://github.com/vercel/style-guide
|
|
476
|
+
*/
|
|
477
|
+
"import/no-relative-packages": "warn",
|
|
478
|
+
/**
|
|
479
|
+
* Disallow a module from importing itself.
|
|
480
|
+
* 🚫 Not fixable - https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-self-import.md
|
|
481
|
+
* Source: Vercel Style Guide → https://github.com/vercel/style-guide
|
|
482
|
+
*/
|
|
483
|
+
"import/no-self-import": "error",
|
|
484
|
+
/**
|
|
485
|
+
* Ensures that there are no useless path segments.
|
|
486
|
+
* 🚫 Not fixable - https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-useless-path-segments.md
|
|
487
|
+
* Source: Vercel Style Guide → https://github.com/vercel/style-guide
|
|
488
|
+
*/
|
|
489
|
+
"import/no-useless-path-segments": ["error"],
|
|
490
|
+
/**
|
|
491
|
+
* Enforce a module import order convention.
|
|
492
|
+
* 🔧 Fixable - https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/order.md
|
|
493
|
+
* Source: Vercel Style Guide → https://github.com/vercel/style-guide
|
|
494
|
+
*/
|
|
495
|
+
"import/order": [
|
|
496
|
+
"warn",
|
|
497
|
+
{
|
|
498
|
+
groups: [
|
|
499
|
+
"builtin",
|
|
500
|
+
// Node.js built-in modules
|
|
501
|
+
"external",
|
|
502
|
+
// Packages
|
|
503
|
+
"internal",
|
|
504
|
+
// Aliased modules
|
|
505
|
+
"parent",
|
|
506
|
+
// Relative parent
|
|
507
|
+
"sibling",
|
|
508
|
+
// Relative sibling
|
|
509
|
+
"index"
|
|
510
|
+
// Relative index
|
|
511
|
+
],
|
|
512
|
+
"newlines-between": "never"
|
|
513
|
+
}
|
|
514
|
+
]
|
|
515
|
+
};
|
|
516
|
+
importOverrides = {
|
|
517
|
+
files: ["**/*.config.{js,ts}"],
|
|
518
|
+
rules: {
|
|
519
|
+
"import/no-default-export": "off"
|
|
520
|
+
}
|
|
521
|
+
};
|
|
522
|
+
}
|
|
523
|
+
});
|
|
524
|
+
|
|
525
|
+
// eslint/rules/possible-errors.ts
|
|
526
|
+
var possibleErrorsRules;
|
|
527
|
+
var init_possible_errors = __esm({
|
|
528
|
+
"eslint/rules/possible-errors.ts"() {
|
|
529
|
+
"use strict";
|
|
530
|
+
possibleErrorsRules = {
|
|
531
|
+
/**
|
|
532
|
+
* Disallow the use of console.
|
|
533
|
+
* 🚫 Not fixable - https://eslint.org/docs/rules/no-console
|
|
534
|
+
* Source: Vercel Style Guide → https://github.com/vercel/style-guide
|
|
535
|
+
*/
|
|
536
|
+
"no-console": "error",
|
|
537
|
+
/**
|
|
538
|
+
* Disallow expressions where the operation doesn't affect the value.
|
|
539
|
+
* 🚫 Not fixable - https://eslint.org/docs/rules/no-constant-binary-expression
|
|
540
|
+
* Source: Vercel Style Guide → https://github.com/vercel/style-guide
|
|
541
|
+
*/
|
|
542
|
+
"no-constant-binary-expression": "error",
|
|
543
|
+
/**
|
|
544
|
+
* Disallow returning values from Promise executor functions.
|
|
545
|
+
* 🚫 Not fixable - https://eslint.org/docs/rules/no-promise-executor-return
|
|
546
|
+
* Source: Vercel Style Guide → https://github.com/vercel/style-guide
|
|
547
|
+
*/
|
|
548
|
+
"no-promise-executor-return": "error",
|
|
549
|
+
/**
|
|
550
|
+
* Disallow template literal placeholder syntax in regular strings, as
|
|
551
|
+
* these are likely errors.
|
|
552
|
+
* 🚫 Not fixable - https://eslint.org/docs/rules/no-template-curly-in-string
|
|
553
|
+
* Source: Vercel Style Guide → https://github.com/vercel/style-guide
|
|
554
|
+
*/
|
|
555
|
+
"no-template-curly-in-string": "error",
|
|
556
|
+
/**
|
|
557
|
+
* Disallow loops with a body that allows only one iteration.
|
|
558
|
+
* 🚫 Not fixable - https://eslint.org/docs/rules/no-unreachable-loop
|
|
559
|
+
* Source: Vercel Style Guide → https://github.com/vercel/style-guide
|
|
560
|
+
*/
|
|
561
|
+
"no-unreachable-loop": "error"
|
|
562
|
+
};
|
|
563
|
+
}
|
|
564
|
+
});
|
|
565
|
+
|
|
566
|
+
// eslint/rules/stylistic.ts
|
|
567
|
+
var stylisticRules;
|
|
568
|
+
var init_stylistic = __esm({
|
|
569
|
+
"eslint/rules/stylistic.ts"() {
|
|
570
|
+
"use strict";
|
|
571
|
+
stylisticRules = {
|
|
572
|
+
/**
|
|
573
|
+
* Require camel case names.
|
|
574
|
+
* 🚫 Not fixable - https://eslint.org/docs/rules/camelcase
|
|
575
|
+
* Source: Vercel Style Guide → https://github.com/vercel/style-guide
|
|
576
|
+
*/
|
|
577
|
+
camelcase: [
|
|
578
|
+
"error",
|
|
579
|
+
{
|
|
580
|
+
allow: ["^UNSAFE_"],
|
|
581
|
+
ignoreDestructuring: false,
|
|
582
|
+
properties: "never"
|
|
583
|
+
}
|
|
584
|
+
],
|
|
585
|
+
/**
|
|
586
|
+
* Require function expressions to have a name.
|
|
587
|
+
* 🚫 Not fixable - https://eslint.org/docs/rules/func-names
|
|
588
|
+
* Source: Vercel Style Guide → https://github.com/vercel/style-guide
|
|
589
|
+
*/
|
|
590
|
+
"func-names": ["error", "as-needed"],
|
|
591
|
+
/**
|
|
592
|
+
* Require a capital letter for constructors.
|
|
593
|
+
* 🚫 Not fixable - https://eslint.org/docs/rules/new-cap
|
|
594
|
+
* Source: Vercel Style Guide → https://github.com/vercel/style-guide
|
|
595
|
+
*/
|
|
596
|
+
"new-cap": ["error", { capIsNew: false }],
|
|
597
|
+
/**
|
|
598
|
+
* Disallow the omission of parentheses when invoking a constructor with
|
|
599
|
+
* no arguments.
|
|
600
|
+
* 🔧 Fixable - https://eslint.org/docs/rules/new-parens
|
|
601
|
+
* Source: Vercel Style Guide → https://github.com/vercel/style-guide
|
|
602
|
+
*/
|
|
603
|
+
"new-parens": "warn",
|
|
604
|
+
/**
|
|
605
|
+
* Disallow use of the Array constructor.
|
|
606
|
+
* 🚫 Not fixable - https://eslint.org/docs/rules/no-array-constructor
|
|
607
|
+
* Source: Vercel Style Guide → https://github.com/vercel/style-guide
|
|
608
|
+
*/
|
|
609
|
+
"no-array-constructor": "error",
|
|
610
|
+
/**
|
|
611
|
+
* Disallow use of bitwise operators.
|
|
612
|
+
* 🚫 Not fixable - https://eslint.org/docs/rules/no-bitwise
|
|
613
|
+
* Source: Vercel Style Guide → https://github.com/vercel/style-guide
|
|
614
|
+
*/
|
|
615
|
+
"no-bitwise": "error",
|
|
616
|
+
/**
|
|
617
|
+
* Disallow if as the only statement in an else block.
|
|
618
|
+
* 🔧 Fixable - https://eslint.org/docs/rules/no-lonely-if
|
|
619
|
+
* Source: Vercel Style Guide → https://github.com/vercel/style-guide
|
|
620
|
+
*/
|
|
621
|
+
"no-lonely-if": "warn",
|
|
622
|
+
/**
|
|
623
|
+
* Disallow use of chained assignment expressions.
|
|
624
|
+
* 🚫 Not fixable - https://eslint.org/docs/rules/no-multi-assign
|
|
625
|
+
* Source: Vercel Style Guide → https://github.com/vercel/style-guide
|
|
626
|
+
*/
|
|
627
|
+
"no-multi-assign": ["error"],
|
|
628
|
+
/**
|
|
629
|
+
* Disallow nested ternary expressions.
|
|
630
|
+
* 🚫 Not fixable - https://eslint.org/docs/rules/no-nested-ternary
|
|
631
|
+
* Source: Vercel Style Guide → https://github.com/vercel/style-guide
|
|
632
|
+
*/
|
|
633
|
+
"no-nested-ternary": "error",
|
|
634
|
+
/**
|
|
635
|
+
* Disallow ternary operators when simpler alternatives exist.
|
|
636
|
+
* 🚫 Not fixable - https://eslint.org/docs/rules/no-unneeded-ternary
|
|
637
|
+
* Source: Vercel Style Guide → https://github.com/vercel/style-guide
|
|
638
|
+
*/
|
|
639
|
+
"no-unneeded-ternary": "error",
|
|
640
|
+
/**
|
|
641
|
+
* Require use of an object spread over Object.assign.
|
|
642
|
+
* 🔧 Fixable - https://eslint.org/docs/rules/prefer-object-spread
|
|
643
|
+
* Source: Vercel Style Guide → https://github.com/vercel/style-guide
|
|
644
|
+
*/
|
|
645
|
+
"prefer-object-spread": "warn"
|
|
646
|
+
};
|
|
647
|
+
}
|
|
648
|
+
});
|
|
649
|
+
|
|
650
|
+
// eslint/rules/comments.ts
|
|
651
|
+
var import_config, import_configs, commentsConfig;
|
|
652
|
+
var init_comments = __esm({
|
|
653
|
+
"eslint/rules/comments.ts"() {
|
|
654
|
+
"use strict";
|
|
655
|
+
import_config = require("eslint/config");
|
|
656
|
+
import_configs = __toESM(require("@eslint-community/eslint-plugin-eslint-comments/configs"), 1);
|
|
657
|
+
commentsConfig = (0, import_config.defineConfig)([
|
|
658
|
+
import_configs.default.recommended,
|
|
659
|
+
{
|
|
660
|
+
rules: {
|
|
661
|
+
/**
|
|
662
|
+
* Require comments on ESlint disable directives.
|
|
663
|
+
* 🚫 Not fixable - https://mysticatea.github.io/eslint-plugin-eslint-comments/rules/require-description.html
|
|
664
|
+
* Source: Vercel Style Guide → https://github.com/vercel/style-guide
|
|
665
|
+
*/
|
|
666
|
+
"@eslint-community/eslint-comments/require-description": "error"
|
|
667
|
+
}
|
|
668
|
+
}
|
|
669
|
+
]);
|
|
670
|
+
}
|
|
671
|
+
});
|
|
672
|
+
|
|
673
|
+
// eslint/rules/unicorn.ts
|
|
674
|
+
var import_config2, import_eslint_plugin_unicorn, import_globals, unicornConfig;
|
|
675
|
+
var init_unicorn = __esm({
|
|
676
|
+
"eslint/rules/unicorn.ts"() {
|
|
677
|
+
"use strict";
|
|
678
|
+
import_config2 = require("eslint/config");
|
|
679
|
+
import_eslint_plugin_unicorn = __toESM(require("eslint-plugin-unicorn"), 1);
|
|
680
|
+
import_globals = __toESM(require("globals"), 1);
|
|
681
|
+
unicornConfig = (0, import_config2.defineConfig)({
|
|
682
|
+
languageOptions: {
|
|
683
|
+
globals: import_globals.default.builtin
|
|
684
|
+
},
|
|
685
|
+
plugins: {
|
|
686
|
+
unicorn: import_eslint_plugin_unicorn.default
|
|
687
|
+
},
|
|
688
|
+
rules: {
|
|
689
|
+
/**
|
|
690
|
+
* Require consistent filename case for all linted files.
|
|
691
|
+
* 🚫 Not fixable - https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/filename-case.md
|
|
692
|
+
* Source: Vercel Style Guide → https://github.com/vercel/style-guide
|
|
693
|
+
*/
|
|
694
|
+
"unicorn/filename-case": [
|
|
695
|
+
"error",
|
|
696
|
+
{
|
|
697
|
+
case: "kebabCase"
|
|
698
|
+
}
|
|
699
|
+
],
|
|
700
|
+
/**
|
|
701
|
+
* Require using the `node:` protocol when importing Node.js built-in modules.
|
|
702
|
+
* 🔧 Fixable - https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-node-protocol.md
|
|
703
|
+
* Source: Vercel Style Guide → https://github.com/vercel/style-guide
|
|
704
|
+
*/
|
|
705
|
+
"unicorn/prefer-node-protocol": "warn"
|
|
706
|
+
}
|
|
707
|
+
});
|
|
708
|
+
}
|
|
709
|
+
});
|
|
710
|
+
|
|
711
|
+
// eslint/rules/variables.ts
|
|
712
|
+
var noUnusedVarsConfig, variablesRules;
|
|
713
|
+
var init_variables = __esm({
|
|
714
|
+
"eslint/rules/variables.ts"() {
|
|
715
|
+
"use strict";
|
|
716
|
+
noUnusedVarsConfig = [
|
|
717
|
+
"error",
|
|
718
|
+
{
|
|
719
|
+
args: "after-used",
|
|
720
|
+
argsIgnorePattern: "^_",
|
|
721
|
+
ignoreRestSiblings: false,
|
|
722
|
+
vars: "all",
|
|
723
|
+
varsIgnorePattern: "^_"
|
|
724
|
+
}
|
|
725
|
+
];
|
|
726
|
+
variablesRules = {
|
|
727
|
+
/**
|
|
728
|
+
* Disallow labels that share a name with a variable.
|
|
729
|
+
* 🚫 Not fixable - https://eslint.org/docs/rules/no-label-var
|
|
730
|
+
* Source: Vercel Style Guide → https://github.com/vercel/style-guide
|
|
731
|
+
*/
|
|
732
|
+
"no-label-var": "error",
|
|
733
|
+
/**
|
|
734
|
+
* Disallow initializing variables to `undefined`.
|
|
735
|
+
* 🔧 Fixable - https://eslint.org/docs/rules/no-undef-init
|
|
736
|
+
* Source: Vercel Style Guide → https://github.com/vercel/style-guide
|
|
737
|
+
*/
|
|
738
|
+
"no-undef-init": "warn",
|
|
739
|
+
/**
|
|
740
|
+
* Disallow unused variables.
|
|
741
|
+
* 🚫 Not fixable - https://eslint.org/docs/rules/no-unused-vars
|
|
742
|
+
* Source: Vercel Style Guide → https://github.com/vercel/style-guide
|
|
743
|
+
*/
|
|
744
|
+
"no-unused-vars": noUnusedVarsConfig
|
|
745
|
+
};
|
|
746
|
+
}
|
|
747
|
+
});
|
|
748
|
+
|
|
749
|
+
// eslint/_base.ts
|
|
750
|
+
var import_js, importPlugin, import_recommended, import_eslint_parser, import_config3, baseConfig;
|
|
751
|
+
var init_base = __esm({
|
|
752
|
+
"eslint/_base.ts"() {
|
|
753
|
+
"use strict";
|
|
754
|
+
import_js = __toESM(require("@eslint/js"), 1);
|
|
755
|
+
importPlugin = __toESM(require("eslint-plugin-import"), 1);
|
|
756
|
+
import_recommended = __toESM(require("eslint-plugin-prettier/recommended"), 1);
|
|
757
|
+
import_eslint_parser = __toESM(require("@babel/eslint-parser"), 1);
|
|
758
|
+
import_config3 = require("eslint/config");
|
|
759
|
+
init_constants();
|
|
760
|
+
init_best_practice();
|
|
761
|
+
init_es6();
|
|
762
|
+
init_import();
|
|
763
|
+
init_possible_errors();
|
|
764
|
+
init_stylistic();
|
|
765
|
+
init_comments();
|
|
766
|
+
init_unicorn();
|
|
767
|
+
init_variables();
|
|
768
|
+
baseConfig = (0, import_config3.defineConfig)([
|
|
769
|
+
// Core recommended ESLint rules
|
|
770
|
+
import_js.default.configs.recommended,
|
|
771
|
+
// Import plugin recommendations
|
|
772
|
+
importPlugin.flatConfigs.recommended,
|
|
773
|
+
// Prettier formatting integration
|
|
774
|
+
import_recommended.default,
|
|
775
|
+
// Custom and recommended rules for comments
|
|
776
|
+
commentsConfig,
|
|
777
|
+
// Custom and recommended rules for unicorn plugin
|
|
778
|
+
unicornConfig,
|
|
779
|
+
// Custom ESLint configuration for all files
|
|
780
|
+
{
|
|
781
|
+
rules: {
|
|
782
|
+
...bestPracticeRules,
|
|
783
|
+
...es6Rules,
|
|
784
|
+
...importRules,
|
|
785
|
+
...possibleErrorsRules,
|
|
786
|
+
...stylisticRules,
|
|
787
|
+
...variablesRules
|
|
788
|
+
}
|
|
789
|
+
},
|
|
790
|
+
{
|
|
791
|
+
languageOptions: {
|
|
792
|
+
// Enable modern JS syntax
|
|
793
|
+
ecmaVersion: ECMA_VERSION,
|
|
794
|
+
// Use ES modules rather than CommonJS
|
|
795
|
+
sourceType: "module"
|
|
796
|
+
},
|
|
797
|
+
// Import-related configuration
|
|
798
|
+
settings: {
|
|
799
|
+
"import/resolver": {
|
|
800
|
+
node: true
|
|
801
|
+
}
|
|
802
|
+
},
|
|
803
|
+
linterOptions: {
|
|
804
|
+
// Warn if there are unnecessary `eslint-disable` comments
|
|
805
|
+
reportUnusedDisableDirectives: true
|
|
806
|
+
},
|
|
807
|
+
// This un-ignores dotfiles like `.eslintrc.js`, which are usually ignored by default
|
|
808
|
+
ignores: ["!.*.js", "!.*"]
|
|
809
|
+
},
|
|
810
|
+
// Override for JavaScript files (optional but useful)
|
|
811
|
+
// Applies the Babel parser for parsing newer JS syntax (e.g., decorators, top-level await)
|
|
812
|
+
{
|
|
813
|
+
files: JAVASCRIPT_FILES,
|
|
814
|
+
languageOptions: {
|
|
815
|
+
parser: import_eslint_parser.default,
|
|
816
|
+
// Use Babel parser instead of ESLint's default to support modern JS features
|
|
817
|
+
parserOptions: {
|
|
818
|
+
// Don't require a Babel config file like `.babelrc`
|
|
819
|
+
requireConfigFile: false,
|
|
820
|
+
// Inline Babel options for this parser instance
|
|
821
|
+
babelOptions: {
|
|
822
|
+
presets: ["@babel/preset-env"]
|
|
823
|
+
// Transpile to ES5 based on target environments
|
|
824
|
+
}
|
|
825
|
+
}
|
|
826
|
+
}
|
|
827
|
+
},
|
|
828
|
+
// Override for config files that commonly require default exports
|
|
829
|
+
importOverrides
|
|
830
|
+
]);
|
|
831
|
+
}
|
|
832
|
+
});
|
|
833
|
+
|
|
834
|
+
// eslint/browser.ts
|
|
835
|
+
var browser_exports = {};
|
|
836
|
+
__export(browser_exports, {
|
|
837
|
+
browserConfig: () => browserConfig
|
|
838
|
+
});
|
|
839
|
+
var import_config4, import_globals2, browserConfig;
|
|
840
|
+
var init_browser = __esm({
|
|
841
|
+
"eslint/browser.ts"() {
|
|
842
|
+
"use strict";
|
|
843
|
+
import_config4 = require("eslint/config");
|
|
844
|
+
import_globals2 = __toESM(require("globals"), 1);
|
|
845
|
+
init_base();
|
|
846
|
+
browserConfig = (0, import_config4.defineConfig)(
|
|
847
|
+
baseConfig.map((config) => {
|
|
848
|
+
if (!config.languageOptions) return config;
|
|
849
|
+
return {
|
|
850
|
+
...config,
|
|
851
|
+
// Override the `languageOptions` field
|
|
852
|
+
languageOptions: {
|
|
853
|
+
...config.languageOptions,
|
|
854
|
+
// Merge in the browser globals (e.g., `window`, `document`, etc.)
|
|
855
|
+
globals: {
|
|
856
|
+
...config.languageOptions.globals ?? {},
|
|
857
|
+
...import_globals2.default.browser
|
|
858
|
+
}
|
|
859
|
+
}
|
|
860
|
+
};
|
|
861
|
+
})
|
|
862
|
+
);
|
|
863
|
+
}
|
|
864
|
+
});
|
|
865
|
+
|
|
866
|
+
// eslint/node.ts
|
|
867
|
+
var node_exports = {};
|
|
868
|
+
__export(node_exports, {
|
|
869
|
+
nodeConfig: () => nodeConfig
|
|
870
|
+
});
|
|
871
|
+
var import_config5, import_globals3, nodeConfig;
|
|
872
|
+
var init_node = __esm({
|
|
873
|
+
"eslint/node.ts"() {
|
|
874
|
+
"use strict";
|
|
875
|
+
import_config5 = require("eslint/config");
|
|
876
|
+
import_globals3 = __toESM(require("globals"), 1);
|
|
877
|
+
init_base();
|
|
878
|
+
nodeConfig = (0, import_config5.defineConfig)(
|
|
879
|
+
baseConfig.map((config) => {
|
|
880
|
+
if (!config.languageOptions) return config;
|
|
881
|
+
return {
|
|
882
|
+
...config,
|
|
883
|
+
// Override the `languageOptions` field
|
|
884
|
+
languageOptions: {
|
|
885
|
+
...config.languageOptions,
|
|
886
|
+
// Merge in the Node globals
|
|
887
|
+
globals: {
|
|
888
|
+
...config.languageOptions.globals ?? {},
|
|
889
|
+
...import_globals3.default.node
|
|
890
|
+
}
|
|
891
|
+
}
|
|
892
|
+
};
|
|
893
|
+
})
|
|
894
|
+
);
|
|
895
|
+
}
|
|
896
|
+
});
|
|
897
|
+
|
|
898
|
+
// eslint/rules/typescript/import.ts
|
|
899
|
+
var typescriptImportRules;
|
|
900
|
+
var init_import2 = __esm({
|
|
901
|
+
"eslint/rules/typescript/import.ts"() {
|
|
902
|
+
"use strict";
|
|
903
|
+
typescriptImportRules = {
|
|
904
|
+
"import/default": ["off"],
|
|
905
|
+
"import/export": ["off"],
|
|
906
|
+
"import/namespace": ["off"],
|
|
907
|
+
"import/no-unresolved": ["off"]
|
|
908
|
+
};
|
|
909
|
+
}
|
|
910
|
+
});
|
|
911
|
+
|
|
912
|
+
// eslint/rules/typescript/index.ts
|
|
913
|
+
var typescriptRules;
|
|
914
|
+
var init_typescript = __esm({
|
|
915
|
+
"eslint/rules/typescript/index.ts"() {
|
|
916
|
+
"use strict";
|
|
917
|
+
init_variables();
|
|
918
|
+
typescriptRules = {
|
|
919
|
+
/**
|
|
920
|
+
* Require consistent usage of type exports.
|
|
921
|
+
* 🔧 Fixable - https://typescript-eslint.io/rules/consistent-type-exports/
|
|
922
|
+
* Source: Vercel Style Guide → https://github.com/vercel/style-guide
|
|
923
|
+
*/
|
|
924
|
+
"@typescript-eslint/consistent-type-exports": ["warn", { fixMixedExportsWithInlineTypeSpecifier: true }],
|
|
925
|
+
/**
|
|
926
|
+
* Require consistent usage of type imports.
|
|
927
|
+
* 🔧 Fixable - https://typescript-eslint.io/rules/consistent-type-imports/
|
|
928
|
+
* Source: Vercel Style Guide → https://github.com/vercel/style-guide
|
|
929
|
+
*/
|
|
930
|
+
"@typescript-eslint/consistent-type-imports": [
|
|
931
|
+
"warn",
|
|
932
|
+
{
|
|
933
|
+
disallowTypeAnnotations: true,
|
|
934
|
+
fixStyle: "inline-type-imports",
|
|
935
|
+
prefer: "type-imports"
|
|
936
|
+
}
|
|
937
|
+
],
|
|
938
|
+
/**
|
|
939
|
+
* Require explicit return types on functions and class methods.
|
|
940
|
+
* 🚫 Not fixable - https://typescript-eslint.io/rules/explicit-function-return-type/
|
|
941
|
+
* Source: Vercel Style Guide → https://github.com/vercel/style-guide
|
|
942
|
+
*/
|
|
943
|
+
"@typescript-eslint/explicit-function-return-type": ["warn", { allowExpressions: true }],
|
|
944
|
+
/**
|
|
945
|
+
* Require using function property types in method signatures.
|
|
946
|
+
* 🔧 Fixable - https://typescript-eslint.io/rules/method-signature-style/
|
|
947
|
+
* Source: Vercel Style Guide → https://github.com/vercel/style-guide
|
|
948
|
+
*/
|
|
949
|
+
"@typescript-eslint/method-signature-style": "warn",
|
|
950
|
+
/**
|
|
951
|
+
* Require consistent naming conventions.
|
|
952
|
+
* 🚫 Not fixable - https://typescript-eslint.io/rules/naming-convention/
|
|
953
|
+
* Source: Vercel Style Guide → https://github.com/vercel/style-guide
|
|
954
|
+
*/
|
|
955
|
+
"@typescript-eslint/naming-convention": [
|
|
956
|
+
"error",
|
|
957
|
+
{
|
|
958
|
+
format: ["PascalCase"],
|
|
959
|
+
selector: ["typeLike", "enumMember"]
|
|
960
|
+
},
|
|
961
|
+
{
|
|
962
|
+
custom: {
|
|
963
|
+
match: false,
|
|
964
|
+
regex: "^I[A-Z]|^(Interface|Props|State)$"
|
|
965
|
+
},
|
|
966
|
+
format: ["PascalCase"],
|
|
967
|
+
selector: "interface"
|
|
968
|
+
}
|
|
969
|
+
],
|
|
970
|
+
/**
|
|
971
|
+
* Disallow members of unions and intersections that do nothing or override type information.
|
|
972
|
+
* 🚫 Not fixable - https://typescript-eslint.io/rules/no-redundant-type-constituents/
|
|
973
|
+
* Source: Vercel Style Guide → https://github.com/vercel/style-guide
|
|
974
|
+
*/
|
|
975
|
+
"@typescript-eslint/no-redundant-type-constituents": "warn",
|
|
976
|
+
/**
|
|
977
|
+
* Disallow unnecessary namespace qualifiers.
|
|
978
|
+
* 🔧 Fixable - https://typescript-eslint.io/rules/no-unnecessary-qualifier/
|
|
979
|
+
* Source: Vercel Style Guide → https://github.com/vercel/style-guide
|
|
980
|
+
*/
|
|
981
|
+
"@typescript-eslint/no-unnecessary-qualifier": "warn",
|
|
982
|
+
/**
|
|
983
|
+
* Require using `RegExp.exec()` over `String.match()` for consistency.
|
|
984
|
+
* 🔧 Fixable - https://typescript-eslint.io/rules/prefer-regexp-exec/
|
|
985
|
+
* Source: Vercel Style Guide → https://github.com/vercel/style-guide
|
|
986
|
+
*/
|
|
987
|
+
"@typescript-eslint/prefer-regexp-exec": "warn",
|
|
988
|
+
/**
|
|
989
|
+
* Require Array#sort calls to provide a compare function.
|
|
990
|
+
* 🚫 Not fixable - https://typescript-eslint.io/rules/require-array-sort-compare/
|
|
991
|
+
* Source: Vercel Style Guide → https://github.com/vercel/style-guide
|
|
992
|
+
*/
|
|
993
|
+
"@typescript-eslint/require-array-sort-compare": ["error", { ignoreStringArrays: true }],
|
|
994
|
+
/**
|
|
995
|
+
* Require exhaustive checks when using union types in switch statements.
|
|
996
|
+
* 🚫 Not fixable - https://typescript-eslint.io/rules/switch-exhaustiveness-check/
|
|
997
|
+
* Source: Vercel Style Guide → https://github.com/vercel/style-guide
|
|
998
|
+
*/
|
|
999
|
+
"@typescript-eslint/switch-exhaustiveness-check": "error",
|
|
1000
|
+
/**
|
|
1001
|
+
* Require default parameters to be last.
|
|
1002
|
+
* 🚫 Not fixable - https://typescript-eslint.io/rules/default-param-last/
|
|
1003
|
+
* Source: Vercel Style Guide → https://github.com/vercel/style-guide
|
|
1004
|
+
*/
|
|
1005
|
+
"@typescript-eslint/default-param-last": "error",
|
|
1006
|
+
/**
|
|
1007
|
+
* Disallow creation of functions within loops.
|
|
1008
|
+
* 🚫 Not fixable - https://typescript-eslint.io/rules/no-loop-func/
|
|
1009
|
+
* Source: Vercel Style Guide → https://github.com/vercel/style-guide
|
|
1010
|
+
*/
|
|
1011
|
+
"@typescript-eslint/no-loop-func": "error",
|
|
1012
|
+
/**
|
|
1013
|
+
* Disallow variable declarations from shadowing variables in outer scope.
|
|
1014
|
+
* 🚫 Not fixable - https://typescript-eslint.io/rules/no-shadow/
|
|
1015
|
+
* Source: Vercel Style Guide → https://github.com/vercel/style-guide
|
|
1016
|
+
*/
|
|
1017
|
+
"@typescript-eslint/no-shadow": "error",
|
|
1018
|
+
/**
|
|
1019
|
+
* Disallow unused variables.
|
|
1020
|
+
* 🚫 Not fixable - https://typescript-eslint.io/rules/no-unused-vars/
|
|
1021
|
+
* Source: Vercel Style Guide → https://github.com/vercel/style-guide
|
|
1022
|
+
*/
|
|
1023
|
+
"@typescript-eslint/no-unused-vars": noUnusedVarsConfig,
|
|
1024
|
+
/**
|
|
1025
|
+
* Disallow unnecessary constructors.
|
|
1026
|
+
* 🚫 Not fixable - https://typescript-eslint.io/rules/no-useless-constructor/
|
|
1027
|
+
* Source: Vercel Style Guide → https://github.com/vercel/style-guide
|
|
1028
|
+
*/
|
|
1029
|
+
"@typescript-eslint/no-useless-constructor": "error",
|
|
1030
|
+
/**
|
|
1031
|
+
* Enforce consistent usage of type assertions.
|
|
1032
|
+
* 🔧 Fixable - https://typescript-eslint.io/rules/consistent-type-assertions/
|
|
1033
|
+
* Source: Added by bredansky → https://github.com/bredansky
|
|
1034
|
+
*/
|
|
1035
|
+
"@typescript-eslint/consistent-type-assertions": [
|
|
1036
|
+
"error",
|
|
1037
|
+
{
|
|
1038
|
+
assertionStyle: "never"
|
|
1039
|
+
}
|
|
1040
|
+
]
|
|
1041
|
+
};
|
|
1042
|
+
}
|
|
1043
|
+
});
|
|
1044
|
+
|
|
1045
|
+
// eslint/typescript.ts
|
|
1046
|
+
var typescript_exports = {};
|
|
1047
|
+
__export(typescript_exports, {
|
|
1048
|
+
typescriptConfig: () => typescriptConfig
|
|
1049
|
+
});
|
|
1050
|
+
var import_typescript_eslint, typescriptConfig;
|
|
1051
|
+
var init_typescript2 = __esm({
|
|
1052
|
+
"eslint/typescript.ts"() {
|
|
1053
|
+
"use strict";
|
|
1054
|
+
import_typescript_eslint = __toESM(require("typescript-eslint"), 1);
|
|
1055
|
+
init_import2();
|
|
1056
|
+
init_typescript();
|
|
1057
|
+
init_constants();
|
|
1058
|
+
typescriptConfig = import_typescript_eslint.default.config([
|
|
1059
|
+
// These rules enforce strong type safety and identify potential type-related issues.
|
|
1060
|
+
import_typescript_eslint.default.configs.strictTypeChecked,
|
|
1061
|
+
// These rules focus on code style and readability specifically for TypeScript.
|
|
1062
|
+
import_typescript_eslint.default.configs.stylisticTypeChecked,
|
|
1063
|
+
{
|
|
1064
|
+
// TypeScript resolver works better for both '.js' and '.ts' files
|
|
1065
|
+
settings: {
|
|
1066
|
+
"import/resolver": {
|
|
1067
|
+
typescript: true
|
|
1068
|
+
}
|
|
1069
|
+
}
|
|
1070
|
+
},
|
|
1071
|
+
{
|
|
1072
|
+
// This configuration applies specifically to TypeScript files.
|
|
1073
|
+
files: TYPESCRIPT_FILES,
|
|
1074
|
+
languageOptions: {
|
|
1075
|
+
// Set the parser to tseslint.parser, which is the TypeScript parser for ESLint.
|
|
1076
|
+
parser: import_typescript_eslint.default.parser,
|
|
1077
|
+
parserOptions: {
|
|
1078
|
+
// This allows ESLint to leverage TypeScript's language service for better understanding of the project.
|
|
1079
|
+
projectService: true
|
|
1080
|
+
}
|
|
1081
|
+
},
|
|
1082
|
+
// Register the TypeScript ESLint plugin for use in this configuration scope.
|
|
1083
|
+
plugins: {
|
|
1084
|
+
"@typescript-eslint": import_typescript_eslint.default.plugin
|
|
1085
|
+
},
|
|
1086
|
+
// Apply custom TypeScript rules.
|
|
1087
|
+
rules: {
|
|
1088
|
+
...typescriptRules,
|
|
1089
|
+
...typescriptImportRules
|
|
1090
|
+
}
|
|
1091
|
+
},
|
|
1092
|
+
{
|
|
1093
|
+
// This effectively disables all type-checking rules for JavaScript files,
|
|
1094
|
+
// as type-checking is only relevant for TypeScript.
|
|
1095
|
+
files: JAVASCRIPT_FILES,
|
|
1096
|
+
extends: [import_typescript_eslint.default.configs.disableTypeChecked]
|
|
1097
|
+
}
|
|
1098
|
+
]);
|
|
1099
|
+
}
|
|
1100
|
+
});
|
|
1101
|
+
|
|
1102
|
+
// eslint/react.ts
|
|
1103
|
+
var react_exports = {};
|
|
1104
|
+
__export(react_exports, {
|
|
1105
|
+
reactConfig: () => reactConfig
|
|
1106
|
+
});
|
|
1107
|
+
var import_config6, import_eslint_plugin, import_eslint_plugin_jsx_a11y, import_eslint_plugin_react_hooks, reactConfig;
|
|
1108
|
+
var init_react = __esm({
|
|
1109
|
+
"eslint/react.ts"() {
|
|
1110
|
+
"use strict";
|
|
1111
|
+
import_config6 = require("eslint/config");
|
|
1112
|
+
import_eslint_plugin = __toESM(require("@eslint-react/eslint-plugin"), 1);
|
|
1113
|
+
import_eslint_plugin_jsx_a11y = __toESM(require("eslint-plugin-jsx-a11y"), 1);
|
|
1114
|
+
import_eslint_plugin_react_hooks = __toESM(require("eslint-plugin-react-hooks"), 1);
|
|
1115
|
+
init_constants();
|
|
1116
|
+
reactConfig = (0, import_config6.defineConfig)([
|
|
1117
|
+
{
|
|
1118
|
+
// Apply React recommended rules for JavaScript files
|
|
1119
|
+
files: JAVASCRIPT_FILES,
|
|
1120
|
+
extends: [import_eslint_plugin.default.configs.recommended]
|
|
1121
|
+
},
|
|
1122
|
+
{
|
|
1123
|
+
// Apply React + TypeScript recommended rules (with type-checking enabled)
|
|
1124
|
+
files: TYPESCRIPT_FILES,
|
|
1125
|
+
extends: [import_eslint_plugin.default.configs["recommended-type-checked"]]
|
|
1126
|
+
},
|
|
1127
|
+
{
|
|
1128
|
+
// Extend strict accessibility rules and latest React Hooks best practices
|
|
1129
|
+
extends: [
|
|
1130
|
+
import_eslint_plugin_jsx_a11y.default.flatConfigs.strict,
|
|
1131
|
+
// Enforces strong accessibility standards
|
|
1132
|
+
import_eslint_plugin_react_hooks.default.configs["recommended-latest"]
|
|
1133
|
+
// Ensures proper usage of React Hooks
|
|
1134
|
+
]
|
|
1135
|
+
}
|
|
1136
|
+
]);
|
|
1137
|
+
}
|
|
1138
|
+
});
|
|
1139
|
+
|
|
1140
|
+
// eslint/rules/next/imports.ts
|
|
1141
|
+
var NEXT_JS_FILES, nextImportRules;
|
|
1142
|
+
var init_imports = __esm({
|
|
1143
|
+
"eslint/rules/next/imports.ts"() {
|
|
1144
|
+
"use strict";
|
|
1145
|
+
NEXT_JS_FILES = [
|
|
1146
|
+
// Pages Router
|
|
1147
|
+
"**/pages/**/*.{js,jsx,ts,tsx}",
|
|
1148
|
+
"**/src/pages/**/*.{js,jsx,ts,tsx}",
|
|
1149
|
+
// App Router
|
|
1150
|
+
"**/app/**/page.{js,jsx,ts,tsx}",
|
|
1151
|
+
"**/app/**/layout.{js,jsx,ts,tsx}",
|
|
1152
|
+
"**/app/**/loading.{js,jsx,ts,tsx}",
|
|
1153
|
+
"**/app/**/error.{js,jsx,ts,tsx}",
|
|
1154
|
+
"**/app/**/not-found.{js,jsx,ts,tsx}",
|
|
1155
|
+
"**/app/**/global-error.{js,jsx,ts,tsx}",
|
|
1156
|
+
"**/app/**/route.{js,ts}",
|
|
1157
|
+
"**/src/app/**/page.{js,jsx,ts,tsx}",
|
|
1158
|
+
"**/src/app/**/layout.{js,jsx,ts,tsx}",
|
|
1159
|
+
"**/src/app/**/loading.{js,jsx,ts,tsx}",
|
|
1160
|
+
"**/src/app/**/error.{js,jsx,ts,tsx}",
|
|
1161
|
+
"**/src/app/**/not-found.{js,jsx,ts,tsx}",
|
|
1162
|
+
"**/src/app/**/global-error.{js,jsx,ts,tsx}",
|
|
1163
|
+
"**/src/app/**/route.{js,ts}"
|
|
1164
|
+
];
|
|
1165
|
+
nextImportRules = {
|
|
1166
|
+
files: NEXT_JS_FILES,
|
|
1167
|
+
rules: {
|
|
1168
|
+
"import/no-default-export": "off"
|
|
1169
|
+
}
|
|
1170
|
+
};
|
|
1171
|
+
}
|
|
1172
|
+
});
|
|
1173
|
+
|
|
1174
|
+
// eslint/next.ts
|
|
1175
|
+
var next_exports = {};
|
|
1176
|
+
__export(next_exports, {
|
|
1177
|
+
nextConfig: () => nextConfig
|
|
1178
|
+
});
|
|
1179
|
+
var import_config7, import_eslint_plugin_next, babelOptions, nextConfig;
|
|
1180
|
+
var init_next = __esm({
|
|
1181
|
+
"eslint/next.ts"() {
|
|
1182
|
+
"use strict";
|
|
1183
|
+
import_config7 = require("eslint/config");
|
|
1184
|
+
import_eslint_plugin_next = __toESM(require("@next/eslint-plugin-next"), 1);
|
|
1185
|
+
init_constants();
|
|
1186
|
+
init_imports();
|
|
1187
|
+
babelOptions = {
|
|
1188
|
+
presets: (() => {
|
|
1189
|
+
try {
|
|
1190
|
+
require.resolve("next/babel");
|
|
1191
|
+
return ["next/babel"];
|
|
1192
|
+
} catch {
|
|
1193
|
+
return [];
|
|
1194
|
+
}
|
|
1195
|
+
})()
|
|
1196
|
+
};
|
|
1197
|
+
nextConfig = (0, import_config7.defineConfig)([
|
|
1198
|
+
// Applies Next.js specific rules globally.
|
|
1199
|
+
{
|
|
1200
|
+
plugins: {
|
|
1201
|
+
"@next/next": import_eslint_plugin_next.default
|
|
1202
|
+
},
|
|
1203
|
+
// Apply recommended and core-web-vitals rules from the Next.js plugin.
|
|
1204
|
+
rules: {
|
|
1205
|
+
...import_eslint_plugin_next.default.configs.recommended.rules,
|
|
1206
|
+
...import_eslint_plugin_next.default.configs["core-web-vitals"].rules
|
|
1207
|
+
}
|
|
1208
|
+
},
|
|
1209
|
+
{
|
|
1210
|
+
// Target only files matching the JAVASCRIPT_FILES pattern.
|
|
1211
|
+
// This ensures that Babel parsing is applied only where relevant.
|
|
1212
|
+
files: JAVASCRIPT_FILES,
|
|
1213
|
+
languageOptions: {
|
|
1214
|
+
parserOptions: {
|
|
1215
|
+
// Spread the dynamically determined Babel options (presets).
|
|
1216
|
+
...babelOptions,
|
|
1217
|
+
// Disable requireConfigFile to prevent ESLint from looking for a separate Babel configuration file.
|
|
1218
|
+
// This makes the configuration self-contained and relies on the presets defined above.
|
|
1219
|
+
requireConfigFile: false
|
|
1220
|
+
}
|
|
1221
|
+
}
|
|
1222
|
+
},
|
|
1223
|
+
nextImportRules
|
|
1224
|
+
]);
|
|
1225
|
+
}
|
|
1226
|
+
});
|
|
1227
|
+
|
|
1228
|
+
// eslint/playwright.ts
|
|
1229
|
+
var playwright_exports = {};
|
|
1230
|
+
__export(playwright_exports, {
|
|
1231
|
+
playwrightConfig: () => playwrightConfig
|
|
1232
|
+
});
|
|
1233
|
+
var import_config8, import_eslint_plugin_playwright, playwrightConfig;
|
|
1234
|
+
var init_playwright = __esm({
|
|
1235
|
+
"eslint/playwright.ts"() {
|
|
1236
|
+
"use strict";
|
|
1237
|
+
import_config8 = require("eslint/config");
|
|
1238
|
+
import_eslint_plugin_playwright = __toESM(require("eslint-plugin-playwright"), 1);
|
|
1239
|
+
playwrightConfig = (0, import_config8.defineConfig)([
|
|
1240
|
+
{
|
|
1241
|
+
...import_eslint_plugin_playwright.default.configs["flat/recommended"],
|
|
1242
|
+
files: ["**/*.spec.{js,ts}", "**/*.test.{js,ts}", "**/tests/**/*.{js,ts}", "**/e2e/**/*.{js,ts}"],
|
|
1243
|
+
rules: {
|
|
1244
|
+
...import_eslint_plugin_playwright.default.configs["flat/recommended"].rules
|
|
1245
|
+
}
|
|
1246
|
+
}
|
|
1247
|
+
]);
|
|
1248
|
+
}
|
|
1249
|
+
});
|
|
1250
|
+
|
|
1251
|
+
// styleguide.ts
|
|
1252
|
+
var styleguide_exports = {};
|
|
1253
|
+
__export(styleguide_exports, {
|
|
1254
|
+
RuleSeverity: () => RuleSeverity,
|
|
1255
|
+
styleguide: () => styleguide
|
|
1256
|
+
});
|
|
1257
|
+
module.exports = __toCommonJS(styleguide_exports);
|
|
1258
|
+
function styleguide(options) {
|
|
1259
|
+
const { browser, node, typescript, react: react2, next, playwright, prettier } = options;
|
|
1260
|
+
const hasEslintOptions = browser ?? node ?? typescript ?? react2 ?? next ?? playwright;
|
|
1261
|
+
const prettierConfig = prettier ? getPrettierConfig(prettier) : void 0;
|
|
1262
|
+
if (!hasEslintOptions) {
|
|
1263
|
+
return { prettierConfig };
|
|
1264
|
+
}
|
|
1265
|
+
const eslintConfig = loadEslintConfigs(options);
|
|
1266
|
+
return {
|
|
1267
|
+
eslintConfig,
|
|
1268
|
+
prettierConfig
|
|
1269
|
+
};
|
|
1270
|
+
}
|
|
1271
|
+
var RuleSeverity, applySeverity, loadEslintConfigs;
|
|
1272
|
+
var init_styleguide = __esm({
|
|
1273
|
+
"styleguide.ts"() {
|
|
1274
|
+
init_prettier();
|
|
1275
|
+
RuleSeverity = /* @__PURE__ */ ((RuleSeverity2) => {
|
|
1276
|
+
RuleSeverity2["Off"] = "off";
|
|
1277
|
+
RuleSeverity2["Warn"] = "warn";
|
|
1278
|
+
RuleSeverity2["Error"] = "error";
|
|
1279
|
+
RuleSeverity2["Default"] = "default";
|
|
1280
|
+
return RuleSeverity2;
|
|
1281
|
+
})(RuleSeverity || {});
|
|
1282
|
+
applySeverity = async (config, severity) => {
|
|
1283
|
+
if (!severity || severity === "off" /* Off */) return [];
|
|
1284
|
+
if (severity === "default" /* Default */) return config;
|
|
1285
|
+
const { transformSeverity: transformSeverity2 } = await Promise.resolve().then(() => (init_transform_severity(), transform_severity_exports));
|
|
1286
|
+
return transformSeverity2(config, severity);
|
|
1287
|
+
};
|
|
1288
|
+
loadEslintConfigs = async (options) => {
|
|
1289
|
+
const { browser, node, typescript, react: react2, next, playwright, ignores, additionalConfigs = [] } = options;
|
|
1290
|
+
const configLoaders = [
|
|
1291
|
+
{ loader: () => Promise.resolve().then(() => (init_browser(), browser_exports)).then((m) => m.browserConfig), severity: browser },
|
|
1292
|
+
{ loader: () => Promise.resolve().then(() => (init_node(), node_exports)).then((m) => m.nodeConfig), severity: node },
|
|
1293
|
+
{ loader: () => Promise.resolve().then(() => (init_typescript2(), typescript_exports)).then((m) => m.typescriptConfig), severity: typescript },
|
|
1294
|
+
{ loader: () => Promise.resolve().then(() => (init_react(), react_exports)).then((m) => m.reactConfig), severity: react2 },
|
|
1295
|
+
{ loader: () => Promise.resolve().then(() => (init_next(), next_exports)).then((m) => m.nextConfig), severity: next },
|
|
1296
|
+
{ loader: () => Promise.resolve().then(() => (init_playwright(), playwright_exports)).then((m) => m.playwrightConfig), severity: playwright }
|
|
1297
|
+
];
|
|
1298
|
+
const eslintConfigs = [];
|
|
1299
|
+
for (const { loader, severity } of configLoaders) {
|
|
1300
|
+
if (severity && severity !== "off" /* Off */) {
|
|
1301
|
+
const config = await loader();
|
|
1302
|
+
const processedConfig = await applySeverity(config, severity);
|
|
1303
|
+
eslintConfigs.push(...processedConfig);
|
|
1304
|
+
}
|
|
1305
|
+
}
|
|
1306
|
+
if (ignores && ignores.length > 0) {
|
|
1307
|
+
eslintConfigs.push({ ignores });
|
|
1308
|
+
}
|
|
1309
|
+
eslintConfigs.push(...additionalConfigs);
|
|
1310
|
+
return eslintConfigs;
|
|
1311
|
+
};
|
|
1312
|
+
}
|
|
1313
|
+
});
|
|
1314
|
+
init_styleguide();
|
|
1315
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
1316
|
+
0 && (module.exports = {
|
|
1317
|
+
RuleSeverity,
|
|
1318
|
+
styleguide
|
|
1319
|
+
});
|