@exbotanical/eslint-config 1.1.4 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/index.d.ts +290 -20
  2. package/dist/index.js +1968 -2426
  3. package/package.json +39 -17
package/dist/index.js CHANGED
@@ -1,833 +1,31 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
8
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
9
- }) : x)(function(x) {
10
- if (typeof require !== "undefined") return require.apply(this, arguments);
11
- throw Error('Dynamic require of "' + x + '" is not supported');
12
- });
13
- var __esm = (fn, res) => function __init() {
14
- return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
15
- };
16
- var __commonJS = (cb, mod) => function __require2() {
17
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
18
- };
19
- var __copyProps = (to, from, except, desc) => {
20
- if (from && typeof from === "object" || typeof from === "function") {
21
- for (let key of __getOwnPropNames(from))
22
- if (!__hasOwnProp.call(to, key) && key !== except)
23
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
24
- }
25
- return to;
26
- };
27
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
28
- // If the importer is in node compatibility mode or this is not an ESM
29
- // file that has been converted to a CommonJS file using a Babel-
30
- // compatible transform (i.e. "__esModule" has not been set), then set
31
- // "default" to the CommonJS "module.exports" for node compatibility.
32
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
33
- mod
34
- ));
35
-
36
- // node_modules/tsup/assets/esm_shims.js
37
- import { fileURLToPath } from "url";
38
- import path from "path";
39
- var getFilename, getDirname, __dirname;
40
- var init_esm_shims = __esm({
41
- "node_modules/tsup/assets/esm_shims.js"() {
42
- "use strict";
43
- getFilename = () => fileURLToPath(import.meta.url);
44
- getDirname = () => path.dirname(getFilename());
45
- __dirname = /* @__PURE__ */ getDirname();
46
- }
47
- });
48
-
49
- // node_modules/eslint-plugin-cypress/package.json
50
- var require_package = __commonJS({
51
- "node_modules/eslint-plugin-cypress/package.json"(exports, module) {
52
- module.exports = {
53
- name: "eslint-plugin-cypress",
54
- version: "4.2.0",
55
- description: "An ESLint plugin for projects using Cypress",
56
- main: "legacy.js",
57
- exports: {
58
- ".": "./legacy.js",
59
- "./flat": "./lib/flat.js"
60
- },
61
- author: "Cypress-io",
62
- license: "MIT",
63
- keywords: [
64
- "eslint",
65
- "eslintplugin",
66
- "cypress"
67
- ],
68
- repository: {
69
- type: "git",
70
- url: "git+https://github.com/cypress-io/eslint-plugin-cypress.git"
71
- },
72
- bugs: {
73
- url: "https://github.com/cypress-io/eslint-plugin-cypress/issues"
74
- },
75
- homepage: "https://github.com/cypress-io/eslint-plugin-cypress#readme",
76
- peerDependencies: {
77
- eslint: ">=9"
78
- },
79
- dependencies: {
80
- globals: "^15.11.0"
81
- },
82
- devDependencies: {
83
- eslint: "^9.13.0",
84
- "eslint-plugin-eslint-plugin": "^6.3.1",
85
- "eslint-plugin-mocha": "^10.5.0",
86
- husky: "^9.1.6",
87
- jest: "^29.7.0",
88
- "semantic-release": "24.2.0"
89
- },
90
- scripts: {
91
- lint: 'eslint "*.js" "**/**/*.js"',
92
- "lint-fix": "npm run lint -- --fix",
93
- "semantic-release": "semantic-release",
94
- start: "npm run test-watch",
95
- test: "jest",
96
- "test:legacy": "jest --config jest.config-legacy.js",
97
- "test-watch": "jest --watchAll",
98
- prepare: "husky"
99
- }
100
- };
101
- }
102
- });
103
-
104
- // node_modules/eslint-plugin-cypress/lib/rules/no-assigning-return-values.js
105
- var require_no_assigning_return_values = __commonJS({
106
- "node_modules/eslint-plugin-cypress/lib/rules/no-assigning-return-values.js"(exports, module) {
107
- "use strict";
108
- init_esm_shims();
109
- function get(obj, propertyString = "") {
110
- const properties = propertyString.split(".");
111
- for (let i = 0; i < properties.length; i++) {
112
- const value = (obj || {})[properties[i]];
113
- if (value == null) return value;
114
- obj = value;
115
- }
116
- return obj;
117
- }
118
- module.exports = {
119
- meta: {
120
- type: "problem",
121
- docs: {
122
- description: "disallow assigning return values of `cy` calls",
123
- category: "Possible Errors",
124
- recommended: true,
125
- url: "https://github.com/cypress-io/eslint-plugin-cypress/blob/master/docs/rules/no-assigning-return-values.md"
126
- },
127
- schema: [],
128
- messages: {
129
- unexpected: "Do not assign the return value of a Cypress command"
130
- }
131
- },
132
- create(context) {
133
- return {
134
- VariableDeclaration(node2) {
135
- if (node2.declarations.some(isCypressCommandDeclaration)) {
136
- context.report({ node: node2, messageId: "unexpected" });
137
- }
138
- }
139
- };
140
- }
141
- };
142
- var allowedCommands = {
143
- now: true,
144
- spy: true,
145
- state: true,
146
- stub: true
147
- };
148
- function isCypressCommandDeclaration(declarator) {
149
- let object = get(declarator, "init.callee.object");
150
- if (!object) return;
151
- while (object.callee) {
152
- object = object.callee.object;
153
- if (!object) return;
154
- }
155
- const commandName = get(declarator, "init.callee.property.name");
156
- const parent = get(object, "parent.property.name") || get(declarator, "id.name");
157
- if (commandName && (allowedCommands[commandName] || allowedCommands[parent])) return;
158
- return object.name === "cy";
159
- }
160
- }
161
- });
162
-
163
- // node_modules/eslint-plugin-cypress/lib/rules/unsafe-to-chain-command.js
164
- var require_unsafe_to_chain_command = __commonJS({
165
- "node_modules/eslint-plugin-cypress/lib/rules/unsafe-to-chain-command.js"(exports, module) {
166
- "use strict";
167
- init_esm_shims();
168
- var { basename } = __require("path");
169
- var NAME = basename(__dirname);
170
- var DESCRIPTION = "disallow actions within chains";
171
- var unsafeToChainActions = [
172
- "blur",
173
- "clear",
174
- "click",
175
- "check",
176
- "dblclick",
177
- "each",
178
- "focus",
179
- "rightclick",
180
- "screenshot",
181
- "scrollIntoView",
182
- "scrollTo",
183
- "select",
184
- "selectFile",
185
- "spread",
186
- "submit",
187
- "type",
188
- "trigger",
189
- "uncheck",
190
- "within"
191
- ];
192
- var schema = {
193
- title: NAME,
194
- description: DESCRIPTION,
195
- type: "object",
196
- properties: {
197
- methods: {
198
- type: "array",
199
- description: "An additional list of methods to check for unsafe chaining.",
200
- default: []
201
- }
202
- }
203
- };
204
- var getDefaultOptions = (context) => {
205
- return Object.entries(schema.properties).reduce((acc, [key, value]) => {
206
- if (!(value.default in value)) return acc;
207
- return {
208
- ...acc,
209
- [key]: value.default
210
- };
211
- }, context.options[0] || {});
212
- };
213
- module.exports = {
214
- meta: {
215
- type: "problem",
216
- docs: {
217
- description: DESCRIPTION,
218
- category: "Possible Errors",
219
- recommended: true,
220
- url: "https://github.com/cypress-io/eslint-plugin-cypress/blob/master/docs/rules/unsafe-to-chain-command.md"
221
- },
222
- schema: [schema],
223
- messages: {
224
- unexpected: "It is unsafe to chain further commands that rely on the subject after this command. It is best to split the chain, chaining again from `cy.` in a next command line."
225
- }
226
- },
227
- create(context) {
228
- const { methods } = getDefaultOptions(context);
229
- return {
230
- CallExpression(node2) {
231
- if (isRootCypress(node2) && isActionUnsafeToChain(node2, methods) && node2.parent.type === "MemberExpression") {
232
- context.report({
233
- node: node2,
234
- messageId: "unexpected"
235
- });
236
- }
237
- }
238
- };
239
- }
240
- };
241
- var isRootCypress = (node2) => {
242
- if (node2.type !== "CallExpression" || node2.callee.type !== "MemberExpression") {
243
- return false;
244
- }
245
- if (node2.callee.object.type === "Identifier" && node2.callee.object.name === "cy") {
246
- return true;
247
- }
248
- return isRootCypress(node2.callee.object);
249
- };
250
- var isActionUnsafeToChain = (node2, additionalMethods = []) => {
251
- const unsafeActionsRegex = new RegExp([
252
- ...unsafeToChainActions.map((action) => `^${action}$`),
253
- ...additionalMethods.map((method) => method instanceof RegExp ? method.source : method)
254
- ].join("|"));
255
- return node2.callee && node2.callee.property && node2.callee.property.type === "Identifier" && unsafeActionsRegex.test(node2.callee.property.name);
256
- };
257
- }
258
- });
259
-
260
- // node_modules/eslint-plugin-cypress/lib/rules/no-unnecessary-waiting.js
261
- var require_no_unnecessary_waiting = __commonJS({
262
- "node_modules/eslint-plugin-cypress/lib/rules/no-unnecessary-waiting.js"(exports, module) {
263
- "use strict";
264
- init_esm_shims();
265
- module.exports = {
266
- meta: {
267
- type: "problem",
268
- docs: {
269
- description: "disallow waiting for arbitrary time periods",
270
- category: "Possible Errors",
271
- recommended: true,
272
- url: "https://github.com/cypress-io/eslint-plugin-cypress/blob/master/docs/rules/no-unnecessary-waiting.md"
273
- },
274
- schema: [],
275
- messages: {
276
- unexpected: "Do not wait for arbitrary time periods"
277
- }
278
- },
279
- create(context) {
280
- const sourceCode = context.sourceCode ?? context.getSourceCode();
281
- return {
282
- CallExpression(node2) {
283
- if (isCallingCyWait(node2)) {
284
- const scope = sourceCode.getScope ? sourceCode.getScope(node2) : context.getScope();
285
- if (isIdentifierNumberConstArgument(node2, scope) || isNumberArgument(node2)) {
286
- context.report({ node: node2, messageId: "unexpected" });
287
- }
288
- }
289
- }
290
- };
291
- }
292
- };
293
- function nodeIsCalledByCy(node2) {
294
- if (node2.type === "Identifier" && node2.name === "cy") return true;
295
- if (typeof node2.callee === "undefined" || typeof node2.callee.object === "undefined") {
296
- return false;
297
- }
298
- return nodeIsCalledByCy(node2.callee.object);
299
- }
300
- function isCallingCyWait(node2) {
301
- return node2.callee.type === "MemberExpression" && nodeIsCalledByCy(node2) && node2.callee.property.type === "Identifier" && node2.callee.property.name === "wait";
302
- }
303
- function isNumberArgument(node2) {
304
- return node2.arguments.length > 0 && node2.arguments[0].type === "Literal" && typeof node2.arguments[0].value === "number";
305
- }
306
- function isIdentifierNumberConstArgument(node2, scope) {
307
- if (node2.arguments.length === 0) return false;
308
- if (node2.arguments[0].type !== "Identifier") return false;
309
- const identifier = node2.arguments[0];
310
- const resolvedIdentifier = scope.references.find((ref) => ref.identifier === identifier).resolved;
311
- const definition = resolvedIdentifier.defs[0];
312
- const isVariable = definition.type === "Variable";
313
- if (isVariable) {
314
- if (!definition.node.init) return false;
315
- return typeof definition.node.init.value === "number";
316
- }
317
- if (definition.type === "ImportBinding") return false;
318
- const param = definition.node.params[definition.index];
319
- if (!param || param.type !== "AssignmentPattern") return false;
320
- return typeof param.right.value === "number";
321
- }
322
- }
323
- });
324
-
325
- // node_modules/eslint-plugin-cypress/lib/rules/no-async-before.js
326
- var require_no_async_before = __commonJS({
327
- "node_modules/eslint-plugin-cypress/lib/rules/no-async-before.js"(exports, module) {
328
- "use strict";
329
- init_esm_shims();
330
- module.exports = {
331
- meta: {
332
- type: "problem",
333
- docs: {
334
- description: "disallow using `async`/`await` in Cypress `before` methods",
335
- category: "Possible Errors",
336
- recommended: true,
337
- url: "https://github.com/cypress-io/eslint-plugin-cypress/blob/master/docs/rules/no-async-before.md"
338
- },
339
- schema: [],
340
- messages: {
341
- unexpected: "Avoid using async functions with Cypress before / beforeEach functions"
342
- }
343
- },
344
- create(context) {
345
- function isBeforeBlock(callExpressionNode) {
346
- const { type, name } = callExpressionNode.callee;
347
- return type === "Identifier" && name === "before" || name === "beforeEach";
348
- }
349
- function isBeforeAsync(node2) {
350
- return node2.arguments && node2.arguments.length >= 2 && node2.arguments[1].async === true;
351
- }
352
- const sourceCode = context.sourceCode ?? context.getSourceCode();
353
- return {
354
- Identifier(node2) {
355
- if (node2.name === "cy" || node2.name === "Cypress") {
356
- const ancestors = sourceCode.getAncestors ? sourceCode.getAncestors(node2) : context.getAncestors();
357
- const asyncTestBlocks = ancestors.filter((n) => n.type === "CallExpression").filter(isBeforeBlock).filter(isBeforeAsync);
358
- if (asyncTestBlocks.length >= 1) {
359
- asyncTestBlocks.forEach((node3) => {
360
- context.report({ node: node3, messageId: "unexpected" });
361
- });
362
- }
363
- }
364
- }
365
- };
366
- }
367
- };
368
- }
369
- });
370
-
371
- // node_modules/eslint-plugin-cypress/lib/rules/no-async-tests.js
372
- var require_no_async_tests = __commonJS({
373
- "node_modules/eslint-plugin-cypress/lib/rules/no-async-tests.js"(exports, module) {
374
- "use strict";
375
- init_esm_shims();
376
- module.exports = {
377
- meta: {
378
- type: "problem",
379
- docs: {
380
- description: "disallow using `async`/`await` in Cypress test cases",
381
- category: "Possible Errors",
382
- recommended: true,
383
- url: "https://github.com/cypress-io/eslint-plugin-cypress/blob/master/docs/rules/no-async-tests.md"
384
- },
385
- schema: [],
386
- messages: {
387
- unexpected: "Avoid using async functions with Cypress tests"
388
- }
389
- },
390
- create(context) {
391
- function isTestBlock(callExpressionNode) {
392
- const { type, name } = callExpressionNode.callee;
393
- return type === "Identifier" && name === "it" || name === "test";
394
- }
395
- function isTestAsync(node2) {
396
- return node2.arguments && node2.arguments.length >= 2 && node2.arguments[1].async === true;
397
- }
398
- const sourceCode = context.sourceCode ?? context.getSourceCode();
399
- return {
400
- Identifier(node2) {
401
- if (node2.name === "cy" || node2.name === "Cypress") {
402
- const ancestors = sourceCode.getAncestors ? sourceCode.getAncestors(node2) : context.getAncestors();
403
- const asyncTestBlocks = ancestors.filter((n) => n.type === "CallExpression").filter(isTestBlock).filter(isTestAsync);
404
- if (asyncTestBlocks.length >= 1) {
405
- asyncTestBlocks.forEach((node3) => {
406
- context.report({ node: node3, messageId: "unexpected" });
407
- });
408
- }
409
- }
410
- }
411
- };
412
- }
413
- };
414
- }
415
- });
416
-
417
- // node_modules/eslint-plugin-cypress/lib/rules/assertion-before-screenshot.js
418
- var require_assertion_before_screenshot = __commonJS({
419
- "node_modules/eslint-plugin-cypress/lib/rules/assertion-before-screenshot.js"(exports, module) {
420
- "use strict";
421
- init_esm_shims();
422
- var assertionCommands = [
423
- // assertions
424
- "should",
425
- "and",
426
- "contains",
427
- // retries until it gets something
428
- "get",
429
- // not an assertion, but unlikely to require waiting for render
430
- "scrollIntoView",
431
- "scrollTo"
432
- ];
433
- module.exports = {
434
- meta: {
435
- type: "problem",
436
- docs: {
437
- description: "require screenshots to be preceded by an assertion",
438
- category: "Possible Errors",
439
- recommended: false,
440
- url: "https://github.com/cypress-io/eslint-plugin-cypress/blob/master/docs/rules/assertion-before-screenshot.md"
441
- },
442
- schema: [],
443
- messages: {
444
- unexpected: "Make an assertion on the page state before taking a screenshot"
445
- }
446
- },
447
- create(context) {
448
- return {
449
- CallExpression(node2) {
450
- if (isCallingCyScreenshot(node2) && !isPreviousAnAssertion(node2)) {
451
- context.report({ node: node2, messageId: "unexpected" });
452
- }
453
- }
454
- };
455
- }
456
- };
457
- function isRootCypress(node2) {
458
- while (node2.type === "CallExpression") {
459
- if (node2.callee.type !== "MemberExpression") return false;
460
- if (node2.callee.object.type === "Identifier" && node2.callee.object.name === "cy") {
461
- return true;
462
- }
463
- node2 = node2.callee.object;
464
- }
465
- return false;
466
- }
467
- function getPreviousInChain(node2) {
468
- return node2.type === "CallExpression" && node2.callee.type === "MemberExpression" && node2.callee.object.type === "CallExpression" && node2.callee.object.callee.type === "MemberExpression" && node2.callee.object.callee.property.type === "Identifier" && node2.callee.object.callee.property.name;
469
- }
470
- function getCallExpressionCypressCommand(node2) {
471
- return isRootCypress(node2) && node2.callee.property.type === "Identifier" && node2.callee.property.name;
472
- }
473
- function isCallingCyScreenshot(node2) {
474
- return getCallExpressionCypressCommand(node2) === "screenshot";
475
- }
476
- function getPreviousCypressCommand(node2) {
477
- const previousInChain = getPreviousInChain(node2);
478
- if (previousInChain) {
479
- return previousInChain;
480
- }
481
- while (node2.parent && !node2.parent.body) {
482
- node2 = node2.parent;
483
- }
484
- if (!node2.parent || !node2.parent.body) return null;
485
- const body = node2.parent.body.type === "BlockStatement" ? node2.parent.body.body : node2.parent.body;
486
- const index = body.indexOf(node2);
487
- if (index < 0) return null;
488
- if (index === 0) return getPreviousCypressCommand(node2.parent);
489
- const previousStatement = body[index - 1];
490
- if (previousStatement.type !== "ExpressionStatement" || previousStatement.expression.type !== "CallExpression") {
491
- return null;
492
- }
493
- return getCallExpressionCypressCommand(previousStatement.expression);
494
- }
495
- function isPreviousAnAssertion(node2) {
496
- const previousCypressCommand = getPreviousCypressCommand(node2);
497
- return assertionCommands.indexOf(previousCypressCommand) >= 0;
498
- }
499
- }
500
- });
501
-
502
- // node_modules/eslint-plugin-cypress/lib/rules/require-data-selectors.js
503
- var require_require_data_selectors = __commonJS({
504
- "node_modules/eslint-plugin-cypress/lib/rules/require-data-selectors.js"(exports, module) {
505
- "use strict";
506
- init_esm_shims();
507
- module.exports = {
508
- meta: {
509
- type: "suggestion",
510
- docs: {
511
- description: "require `data-*` attribute selectors",
512
- category: "Possible Errors",
513
- recommended: false,
514
- url: "https://github.com/cypress-io/eslint-plugin-cypress/blob/master/docs/rules/require-data-selectors.md"
515
- },
516
- schema: [],
517
- messages: {
518
- unexpected: "use data-* attribute selectors instead of classes or tag names"
519
- }
520
- },
521
- create(context) {
522
- return {
523
- CallExpression(node2) {
524
- if (isCallingCyGet(node2) && !isDataArgument(node2)) {
525
- context.report({ node: node2, messageId: "unexpected" });
526
- }
527
- }
528
- };
529
- }
530
- };
531
- function isCallingCyGet(node2) {
532
- return node2.callee.type === "MemberExpression" && node2.callee.object.type === "Identifier" && node2.callee.object.name === "cy" && node2.callee.property.type === "Identifier" && node2.callee.property.name === "get";
533
- }
534
- function isDataArgument(node2) {
535
- return node2.arguments.length > 0 && (node2.arguments[0].type === "Literal" && isAliasOrDataSelector(String(node2.arguments[0].value)) || node2.arguments[0].type === "TemplateLiteral" && isAliasOrDataSelector(String(node2.arguments[0].quasis[0].value.cooked)));
536
- }
537
- function isAliasOrDataSelector(selector) {
538
- return ["[data-", "@"].some(function(validValue) {
539
- return selector.startsWith(validValue);
540
- });
541
- }
542
- }
543
- });
544
-
545
- // node_modules/eslint-plugin-cypress/lib/rules/no-force.js
546
- var require_no_force = __commonJS({
547
- "node_modules/eslint-plugin-cypress/lib/rules/no-force.js"(exports, module) {
548
- "use strict";
549
- init_esm_shims();
550
- module.exports = {
551
- meta: {
552
- type: "suggestion",
553
- docs: {
554
- description: "disallow using `force: true` with action commands",
555
- category: "Possible Errors",
556
- recommended: false,
557
- url: "https://github.com/cypress-io/eslint-plugin-cypress/blob/master/docs/rules/no-force.md"
558
- },
559
- fixable: null,
560
- // or "code" or "whitespace"
561
- schema: [],
562
- messages: {
563
- unexpected: "Do not use force on click and type calls"
564
- }
565
- },
566
- create(context) {
567
- function isCallingClickOrType(node2) {
568
- const allowedMethods = ["click", "dblclick", "type", "trigger", "check", "rightclick", "focus", "select"];
569
- return node2.property && node2.property.type === "Identifier" && allowedMethods.includes(node2.property.name);
570
- }
571
- function isCypressCall(node2) {
572
- return node2.callee.type === "MemberExpression" && node2.callee.object.type === "Identifier" && node2.callee.object.name === "cy";
573
- }
574
- function hasOptionForce(node2) {
575
- return node2.arguments && node2.arguments.length && node2.arguments.some((arg) => {
576
- return arg.type === "ObjectExpression" && arg.properties.some((propNode) => propNode.key && propNode.key.name === "force");
577
- });
578
- }
579
- function deepCheck(node2, checkFunc) {
580
- let currentNode = node2;
581
- while (currentNode.parent) {
582
- if (checkFunc(currentNode.parent)) {
583
- return true;
584
- }
585
- currentNode = currentNode.parent;
586
- }
587
- return false;
588
- }
589
- return {
590
- CallExpression(node2) {
591
- if (isCypressCall(node2) && deepCheck(node2, isCallingClickOrType) && deepCheck(node2, hasOptionForce)) {
592
- context.report({ node: node2, messageId: "unexpected" });
593
- }
594
- }
595
- };
596
- }
597
- };
598
- }
599
- });
1
+ // src/factory.ts
2
+ import { isPackageExists as isPackageExists3 } from "local-pkg";
600
3
 
601
- // node_modules/eslint-plugin-cypress/lib/rules/no-pause.js
602
- var require_no_pause = __commonJS({
603
- "node_modules/eslint-plugin-cypress/lib/rules/no-pause.js"(exports, module) {
604
- "use strict";
605
- init_esm_shims();
606
- module.exports = {
607
- meta: {
608
- type: "suggestion",
609
- docs: {
610
- description: "disallow using `cy.pause()` calls",
611
- category: "Possible Errors",
612
- recommended: false,
613
- url: "https://github.com/cypress-io/eslint-plugin-cypress/blob/master/docs/rules/no-pause.md"
614
- },
615
- fixable: null,
616
- // or "code" or "whitespace"
617
- schema: [],
618
- messages: {
619
- unexpected: "Do not use cy.pause command"
620
- }
621
- },
622
- create(context) {
623
- function isCallingPause(node2) {
624
- return node2.callee && node2.callee.property && node2.callee.property.type === "Identifier" && node2.callee.property.name === "pause";
625
- }
626
- function isCypressCall(node2) {
627
- if (!node2.callee || node2.callee.type !== "MemberExpression") {
628
- return false;
629
- }
630
- if (node2.callee.object.type === "Identifier" && node2.callee.object.name === "cy") {
631
- return true;
632
- }
633
- return isCypressCall(node2.callee.object);
634
- }
635
- return {
636
- CallExpression(node2) {
637
- if (isCypressCall(node2) && isCallingPause(node2)) {
638
- context.report({ node: node2, messageId: "unexpected" });
639
- }
640
- }
641
- };
642
- }
643
- };
644
- }
645
- });
4
+ // src/configs/comments.ts
5
+ import plugin from "@eslint-community/eslint-plugin-eslint-comments";
646
6
 
647
- // node_modules/eslint-plugin-cypress/lib/rules/no-debug.js
648
- var require_no_debug = __commonJS({
649
- "node_modules/eslint-plugin-cypress/lib/rules/no-debug.js"(exports, module) {
650
- "use strict";
651
- init_esm_shims();
652
- module.exports = {
653
- meta: {
654
- type: "suggestion",
655
- docs: {
656
- description: "disallow using `cy.debug()` calls",
657
- category: "Possible Errors",
658
- recommended: false,
659
- url: "https://github.com/cypress-io/eslint-plugin-cypress/blob/master/docs/rules/no-debug.md"
660
- },
661
- fixable: null,
662
- // or "code" or "whitespace"
663
- schema: [],
664
- messages: {
665
- unexpected: "Do not use cy.debug command"
666
- }
667
- },
668
- create(context) {
669
- function isCallingDebug(node2) {
670
- return node2.callee && node2.callee.property && node2.callee.property.type === "Identifier" && node2.callee.property.name === "debug";
671
- }
672
- function isCypressCall(node2) {
673
- if (!node2.callee || node2.callee.type !== "MemberExpression") {
674
- return false;
675
- }
676
- if (node2.callee.object.type === "Identifier" && node2.callee.object.name === "cy") {
677
- return true;
678
- }
679
- return isCypressCall(node2.callee.object);
680
- }
681
- return {
682
- CallExpression(node2) {
683
- if (isCypressCall(node2) && isCallingDebug(node2)) {
684
- context.report({ node: node2, messageId: "unexpected" });
685
- }
686
- }
687
- };
688
- }
7
+ // src/base-config.ts
8
+ var CustomConfig = class {
9
+ options;
10
+ constructor({ type = "app", overrides = {}, ...rest }) {
11
+ this.options = {
12
+ type,
13
+ overrides,
14
+ ...rest
689
15
  };
690
16
  }
691
- });
692
-
693
- // node_modules/eslint-plugin-cypress/lib/rules/no-xpath.js
694
- var require_no_xpath = __commonJS({
695
- "node_modules/eslint-plugin-cypress/lib/rules/no-xpath.js"(exports, module) {
696
- "use strict";
697
- init_esm_shims();
698
- module.exports = {
699
- meta: {
700
- type: "suggestion",
701
- docs: {
702
- description: "disallow using `cy.xpath()` calls",
703
- recommended: false,
704
- url: "https://github.com/cypress-io/eslint-plugin-cypress/blob/master/docs/rules/no-xpath.md"
705
- },
706
- fixable: null,
707
- // Or `code` or `whitespace`
708
- schema: [],
709
- // Add a schema if the rule has options
710
- messages: {
711
- unexpected: "Avoid using cy.xpath command"
712
- }
713
- },
714
- create(context) {
715
- return {
716
- CallExpression(node2) {
717
- if (isCallingCyXpath(node2)) {
718
- context.report({ node: node2, messageId: "unexpected" });
719
- }
720
- }
721
- };
722
- }
17
+ createRuleConfig(feature, config) {
18
+ return {
19
+ name: `exbotanical/${this.namespace}/${feature}`,
20
+ ...config
723
21
  };
724
- function isCallingCyXpath(node2) {
725
- return node2.callee.type === "MemberExpression" && node2.callee.object.type === "Identifier" && node2.callee.object.name === "cy" && node2.callee.property.type === "Identifier" && node2.callee.property.name === "xpath";
726
- }
727
22
  }
728
- });
729
-
730
- // node_modules/eslint-plugin-cypress/lib/flat.js
731
- var require_flat = __commonJS({
732
- "node_modules/eslint-plugin-cypress/lib/flat.js"(exports, module) {
733
- "use strict";
734
- init_esm_shims();
735
- var globals2 = __require("globals");
736
- var { name, version } = require_package();
737
- var plugin4 = {
738
- meta: { name, version },
739
- configs: {},
740
- rules: {
741
- "no-assigning-return-values": require_no_assigning_return_values(),
742
- "unsafe-to-chain-command": require_unsafe_to_chain_command(),
743
- "no-unnecessary-waiting": require_no_unnecessary_waiting(),
744
- "no-async-before": require_no_async_before(),
745
- "no-async-tests": require_no_async_tests(),
746
- "assertion-before-screenshot": require_assertion_before_screenshot(),
747
- "require-data-selectors": require_require_data_selectors(),
748
- "no-force": require_no_force(),
749
- "no-pause": require_no_pause(),
750
- "no-debug": require_no_debug(),
751
- "no-xpath": require_no_xpath()
752
- }
753
- };
754
- var commonGlobals = Object.assign({
755
- cy: false,
756
- Cypress: false,
757
- expect: false,
758
- assert: false,
759
- chai: false
760
- }, globals2.browser, globals2.mocha);
761
- Object.assign(plugin4.configs, {
762
- globals: {
763
- name: "cypress/globals",
764
- plugins: {
765
- cypress: plugin4
766
- },
767
- languageOptions: {
768
- globals: commonGlobals
769
- }
770
- }
771
- });
772
- Object.assign(plugin4.configs, {
773
- recommended: {
774
- name: "cypress/recommended",
775
- plugins: {
776
- cypress: plugin4
777
- },
778
- rules: {
779
- "cypress/no-assigning-return-values": "error",
780
- "cypress/no-unnecessary-waiting": "error",
781
- "cypress/no-async-tests": "error",
782
- "cypress/unsafe-to-chain-command": "error"
783
- },
784
- languageOptions: {
785
- globals: commonGlobals
786
- }
787
- }
788
- });
789
- module.exports = plugin4;
23
+ async rules() {
24
+ return [...await this._rules()];
790
25
  }
791
- });
792
-
793
- // src/index.ts
794
- init_esm_shims();
795
-
796
- // src/factory.ts
797
- init_esm_shims();
798
- import { isPackageExists as isPackageExists3 } from "local-pkg";
799
-
800
- // src/configs/index.ts
801
- init_esm_shims();
802
-
803
- // src/configs/comments.ts
804
- init_esm_shims();
805
- import plugin from "@eslint-community/eslint-plugin-eslint-comments";
806
- var NAMESPACE = "exbotanical/comments";
807
- async function comments() {
808
- return [
809
- {
810
- name: `${NAMESPACE}/rules`,
811
- plugins: {
812
- comments: plugin
813
- },
814
- rules: {
815
- "comments/no-aggregating-enable": ["error"],
816
- "comments/no-duplicate-disable": ["error"],
817
- "comments/no-unlimited-disable": ["error"],
818
- "comments/no-unused-enable": ["error"],
819
- "comments/no-unused-disable": ["error"],
820
- "comments/require-description": ["warn"]
821
- }
822
- }
823
- ];
824
- }
825
-
826
- // src/configs/disables.ts
827
- init_esm_shims();
26
+ };
828
27
 
829
28
  // src/filepaths.ts
830
- init_esm_shims();
831
29
  var GLOB_JS = "**/*.?([cm])js";
832
30
  var GLOB_JSX = "**/*.?([cm])jsx";
833
31
  var GLOB_TS = "**/*.?([cm])ts";
@@ -845,12 +43,14 @@ var GLOB_XML = "**/*.xml";
845
43
  var GLOB_SVG = "**/*.svg";
846
44
  var GLOB_HTML = "**/*.htm?(l)";
847
45
  var GLOB_GRAPHQL = "**/*.{g,graph}ql";
46
+ var GLOB_GITHUB_WORKFLOW = "**/.github/workflows/*.y?(a)ml";
848
47
  var GLOB_STYLE = "**/*.{c,le,sc}ss";
849
48
  var GLOB_CSS = "**/*.css";
850
49
  var GLOB_POSTCSS = "**/*.{p,post}css";
851
50
  var GLOB_LESS = "**/*.less";
852
51
  var GLOB_SCSS = "**/*.scss";
853
52
  var GLOB_MARKDOWN_CODE = `${GLOB_MARKDOWN}/${GLOB_SRC}`;
53
+ var GLOB_SCRIPTS = [GLOB_SRC, GLOB_VUE, GLOB_MARKDOWN_CODE];
854
54
  var GLOB_TESTS = [
855
55
  `**/__tests__/**/*.${GLOB_SRC_EXT}`,
856
56
  `**/*.spec.${GLOB_SRC_EXT}`,
@@ -886,77 +86,38 @@ var GLOB_EXCLUDES = [
886
86
  "**/__snapshots__"
887
87
  ];
888
88
 
889
- // src/configs/disables.ts
890
- var NAMESPACE2 = "exbotanical/disables";
891
- async function disables() {
892
- return [
893
- {
894
- name: `${NAMESPACE2}/scripts`,
895
- files: [
896
- `**/scripts/${GLOB_SRC}`,
897
- "**/bin/**/*",
898
- `**/bin.${GLOB_SRC_EXT}`
899
- ],
900
- rules: {
901
- "no-console": "off",
902
- "ts/explicit-function-return-type": "off"
903
- }
904
- },
905
- {
906
- name: `${NAMESPACE2}/dts`,
907
- files: ["**/*.d.?([cm])ts"],
908
- rules: {
909
- "eslint-comments/no-unlimited-disable": "off",
910
- "import/no-duplicates": "off",
911
- "no-restricted-syntax": "off",
912
- "unused-imports/no-unused-vars": "off"
913
- }
914
- },
915
- {
916
- name: `${NAMESPACE2}/cjs`,
917
- files: ["**/*.js", "**/*.cjs"],
918
- rules: {
919
- "ts/no-require-imports": "off"
920
- }
921
- },
922
- {
923
- name: `${NAMESPACE2}/config-files`,
924
- files: [`**/*.config.${GLOB_SRC_EXT}`, `**/*.config.*.${GLOB_SRC_EXT}`],
925
- rules: {
926
- "no-console": "off",
927
- "ts/explicit-function-return-type": "off"
928
- }
929
- }
930
- ];
931
- }
932
-
933
- // src/configs/graphql.ts
934
- init_esm_shims();
89
+ // src/configs/comments.ts
90
+ var COMMENTS_RULES = {
91
+ "comments/no-aggregating-enable": ["error"],
92
+ "comments/no-duplicate-disable": ["error"],
93
+ "comments/no-unlimited-disable": ["error"],
94
+ "comments/no-unused-enable": ["error"],
95
+ "comments/no-unused-disable": ["error"],
96
+ "comments/require-description": ["warn"]
97
+ };
98
+ var CommentsConfig = class extends CustomConfig {
99
+ namespace = "comments";
100
+ constructor(options = {}) {
101
+ super(options);
102
+ }
103
+ async _rules() {
104
+ return [
105
+ this.createRuleConfig("rules", {
106
+ files: GLOB_SCRIPTS,
107
+ plugins: {
108
+ comments: plugin
109
+ },
110
+ rules: {
111
+ ...COMMENTS_RULES
112
+ }
113
+ })
114
+ ];
115
+ }
116
+ };
935
117
 
936
118
  // src/utils.ts
937
- init_esm_shims();
938
- import { fileURLToPath as fileURLToPath2 } from "node:url";
119
+ import { fileURLToPath } from "node:url";
939
120
  import { isPackageExists } from "local-pkg";
940
- var parserPlain = {
941
- meta: {
942
- name: "parser-plain"
943
- },
944
- parseForESLint: (code) => ({
945
- ast: {
946
- body: [],
947
- comments: [],
948
- loc: { end: code.length, start: 0 },
949
- range: [0, code.length],
950
- tokens: [],
951
- type: "Program"
952
- },
953
- scopeManager: null,
954
- services: { isPlain: true },
955
- visitorKeys: {
956
- Program: []
957
- }
958
- })
959
- };
960
121
  async function interopDefault(module) {
961
122
  const resolved = await module;
962
123
  return resolved.default || resolved;
@@ -965,8 +126,7 @@ function renameRules(rules, map) {
965
126
  return Object.fromEntries(
966
127
  Object.entries(rules).map(([key, value]) => {
967
128
  for (const [from, to] of Object.entries(map)) {
968
- if (key.startsWith(`${from}/`))
969
- return [to + key.slice(from.length), value];
129
+ if (key.startsWith(`${from}/`)) return [to + key.slice(from.length), value];
970
130
  }
971
131
  return [key, value];
972
132
  })
@@ -1011,429 +171,606 @@ var processorPassThrough = {
1011
171
  return messages[0];
1012
172
  }
1013
173
  };
1014
- var scopeUrl = fileURLToPath2(new URL(".", import.meta.url));
174
+ var scopeUrl = fileURLToPath(new URL(".", import.meta.url));
1015
175
 
1016
- // src/configs/graphql.ts
1017
- async function graphql() {
1018
- const graphqlPlugin = await interopDefault(import("@graphql-eslint/eslint-plugin"));
1019
- const rules = {
1020
- ...graphqlPlugin.configs["flat/operations-recommended"].rules,
1021
- ...graphqlPlugin.configs["flat/schema-recommended"].rules
1022
- };
1023
- return [
1024
- {
1025
- files: [GLOB_JS, GLOB_JSX, GLOB_TS, GLOB_TSX],
1026
- processor: graphqlPlugin.processor
1027
- },
1028
- {
1029
- files: [GLOB_GRAPHQL],
1030
- languageOptions: {
1031
- parser: graphqlPlugin.parser
1032
- },
1033
- plugins: {
1034
- "@graphql-eslint": graphqlPlugin
1035
- },
1036
- // @ts-expect-error weird rule types in gql plugin
1037
- rules
1038
- }
1039
- ];
1040
- }
176
+ // src/configs/css.ts
177
+ var CssConfig = class extends CustomConfig {
178
+ namespace = "css";
179
+ constructor({ files = [GLOB_CSS], ...rest } = {}) {
180
+ super({
181
+ files,
182
+ ...rest
183
+ });
184
+ }
185
+ async _rules() {
186
+ const { files, overrides = {} } = this.options;
187
+ const plugin4 = await interopDefault(import("@eslint/css"));
188
+ return [
189
+ this.createRuleConfig("rules", {
190
+ files,
191
+ language: "css/css",
192
+ plugins: {
193
+ css: plugin4
194
+ },
195
+ rules: {
196
+ ...plugin4.configs.recommended.rules,
197
+ ...overrides
198
+ }
199
+ })
200
+ ];
201
+ }
202
+ };
1041
203
 
1042
- // src/configs/ignores.ts
1043
- init_esm_shims();
1044
- var NAMESPACE3 = "exbotanical/ignores";
1045
- async function ignores(files = []) {
1046
- return [
1047
- {
1048
- name: NAMESPACE3,
1049
- ignores: [...GLOB_EXCLUDES, ...files]
1050
- }
1051
- ];
1052
- }
204
+ // src/configs/data-files.ts
205
+ import pluginComments from "@eslint-community/eslint-plugin-eslint-comments";
206
+ import pluginUnicorn from "eslint-plugin-unicorn";
207
+ var DataFilesConfig = class extends CustomConfig {
208
+ namespace = "data-files";
209
+ constructor(options = {}) {
210
+ super(options);
211
+ }
212
+ async _rules() {
213
+ const { files = [] } = this.options;
214
+ if (files.length === 0) return [];
215
+ return [
216
+ this.createRuleConfig("rules", {
217
+ files,
218
+ linterOptions: {
219
+ reportUnusedDisableDirectives: "error",
220
+ reportUnusedInlineConfigs: "error"
221
+ },
222
+ plugins: {
223
+ comments: pluginComments,
224
+ unicorn: pluginUnicorn
225
+ },
226
+ rules: {
227
+ ...COMMENTS_RULES,
228
+ "unicode-bom": ["error", "never"],
229
+ "unicorn/no-abusive-eslint-disable": "error"
230
+ }
231
+ })
232
+ ];
233
+ }
234
+ };
1053
235
 
1054
- // src/configs/imports.ts
1055
- init_esm_shims();
1056
- import plugin2 from "eslint-plugin-import";
1057
- var NAMESPACE4 = "exbotanical/imports";
1058
- async function imports() {
1059
- return [
1060
- {
1061
- name: `${NAMESPACE4}/rules`,
1062
- plugins: {
1063
- import: plugin2
1064
- },
1065
- rules: {
1066
- "import/consistent-type-specifier-style": ["error", "prefer-top-level"],
1067
- "import/first": "error",
1068
- "import/no-duplicates": "error",
1069
- "import/no-mutable-exports": "error",
1070
- "import/no-named-default": "error",
1071
- "import/no-self-import": "error",
1072
- "import/no-webpack-loader-syntax": "error",
1073
- "import/newline-after-import": ["error", { count: 1 }],
1074
- "import/no-unresolved": "off",
1075
- "import/order": [
1076
- "error",
1077
- {
1078
- "alphabetize": {
1079
- caseInsensitive: true,
1080
- order: "asc"
1081
- },
1082
- "groups": [
1083
- "builtin",
1084
- "external",
1085
- "internal",
1086
- "parent",
1087
- "sibling",
1088
- "index",
1089
- "object",
1090
- "type"
1091
- ],
1092
- "newlines-between": "always",
1093
- "pathGroups": [
1094
- {
1095
- group: "external",
1096
- pattern: "{vue,@vue/**}",
1097
- position: "before"
1098
- },
1099
- {
1100
- group: "external",
1101
- pattern: "{react,@react/**}",
1102
- position: "before"
1103
- },
1104
- {
1105
- group: "internal",
1106
- pattern: "@/**",
1107
- position: "before"
236
+ // src/configs/disables.ts
237
+ var DisablesConfig = class extends CustomConfig {
238
+ namespace = "disables";
239
+ constructor(options = {}) {
240
+ super(options);
241
+ }
242
+ async _rules() {
243
+ return [
244
+ this.createRuleConfig("scripts", {
245
+ files: [`**/scripts/${GLOB_SRC}`, "**/bin/**/*", `**/bin.${GLOB_SRC_EXT}`],
246
+ rules: {
247
+ "no-console": "off",
248
+ "ts/explicit-function-return-type": "off"
249
+ }
250
+ }),
251
+ this.createRuleConfig("dts", {
252
+ files: ["**/*.d.?([cm])ts"],
253
+ rules: {
254
+ "eslint-comments/no-unlimited-disable": "off",
255
+ "import/no-duplicates": "off",
256
+ "no-restricted-syntax": "off",
257
+ "unused-imports/no-unused-vars": "off"
258
+ }
259
+ }),
260
+ this.createRuleConfig("cjs", {
261
+ files: ["**/*.js", "**/*.cjs"],
262
+ rules: {
263
+ "ts/no-require-imports": "off"
264
+ }
265
+ }),
266
+ this.createRuleConfig("config-files", {
267
+ files: [`**/*.config.${GLOB_SRC_EXT}`, `**/*.config.*.${GLOB_SRC_EXT}`],
268
+ rules: {
269
+ "no-console": "off",
270
+ "ts/explicit-function-return-type": "off"
271
+ }
272
+ })
273
+ ];
274
+ }
275
+ };
276
+
277
+ // src/configs/github-action.ts
278
+ var GithubActionConfig = class extends CustomConfig {
279
+ namespace = "github-action";
280
+ constructor({ files = [GLOB_GITHUB_WORKFLOW], ...rest } = {}) {
281
+ super({
282
+ files,
283
+ ...rest
284
+ });
285
+ }
286
+ async _rules() {
287
+ const { files, overrides = {} } = this.options;
288
+ const plugin4 = await interopDefault(import("eslint-plugin-github-action"));
289
+ const [recommended] = plugin4.configs.recommended;
290
+ return [
291
+ this.createRuleConfig("rules", {
292
+ ...recommended,
293
+ files,
294
+ rules: {
295
+ ...recommended.rules,
296
+ ...overrides
297
+ }
298
+ })
299
+ ];
300
+ }
301
+ };
302
+
303
+ // src/configs/graphql.ts
304
+ var GraphqlConfig = class extends CustomConfig {
305
+ namespace = "graphql";
306
+ constructor(options = {}) {
307
+ super(options);
308
+ }
309
+ async _rules() {
310
+ const graphqlPlugin = await interopDefault(import("@graphql-eslint/eslint-plugin"));
311
+ const rules = {
312
+ ...graphqlPlugin.configs["flat/operations-recommended"].rules,
313
+ ...graphqlPlugin.configs["flat/schema-recommended"].rules
314
+ };
315
+ return [
316
+ this.createRuleConfig("setup", {
317
+ files: [GLOB_JS, GLOB_JSX, GLOB_TS, GLOB_TSX],
318
+ processor: graphqlPlugin.processor
319
+ }),
320
+ this.createRuleConfig("rules", {
321
+ files: [GLOB_GRAPHQL],
322
+ languageOptions: {
323
+ parser: graphqlPlugin.parser
324
+ },
325
+ plugins: {
326
+ "@graphql-eslint": graphqlPlugin
327
+ },
328
+ // @ts-expect-error weird rule types in gql plugin
329
+ rules
330
+ })
331
+ ];
332
+ }
333
+ };
334
+
335
+ // src/configs/ignores.ts
336
+ var IgnoresConfig = class extends CustomConfig {
337
+ namespace = "ignores";
338
+ constructor(options = {}) {
339
+ super(options);
340
+ }
341
+ async _rules() {
342
+ return [
343
+ this.createRuleConfig("setup", {
344
+ ignores: [...GLOB_EXCLUDES, ...this.options.files ?? []]
345
+ })
346
+ ];
347
+ }
348
+ };
349
+
350
+ // src/configs/imports.ts
351
+ import plugin2 from "eslint-plugin-import";
352
+ var ImportsConfig = class extends CustomConfig {
353
+ namespace = "imports";
354
+ constructor(options = {}) {
355
+ super(options);
356
+ }
357
+ async _rules() {
358
+ return [
359
+ this.createRuleConfig("rules", {
360
+ files: GLOB_SCRIPTS,
361
+ plugins: {
362
+ import: plugin2
363
+ },
364
+ rules: {
365
+ "import/consistent-type-specifier-style": ["error", "prefer-top-level"],
366
+ "import/first": "error",
367
+ "import/no-duplicates": "error",
368
+ "import/no-mutable-exports": "error",
369
+ "import/no-named-default": "error",
370
+ "import/no-self-import": "error",
371
+ "import/no-webpack-loader-syntax": "error",
372
+ "import/no-absolute-path": "error",
373
+ "import/no-empty-named-blocks": "error",
374
+ "import/no-useless-path-segments": "error",
375
+ "import/newline-after-import": ["error", { count: 1 }],
376
+ "import/no-unresolved": "off",
377
+ "import/order": [
378
+ "error",
379
+ {
380
+ "alphabetize": {
381
+ caseInsensitive: true,
382
+ order: "asc"
1108
383
  },
1109
- {
1110
- group: "internal",
1111
- pattern: "@@/**",
1112
- position: "before"
1113
- }
1114
- ]
1115
- }
1116
- ]
1117
- }
1118
- }
1119
- ];
1120
- }
384
+ "groups": [
385
+ "builtin",
386
+ "external",
387
+ "internal",
388
+ "parent",
389
+ "sibling",
390
+ "index",
391
+ "object",
392
+ "type"
393
+ ],
394
+ "newlines-between": "always",
395
+ "pathGroups": [
396
+ {
397
+ group: "external",
398
+ pattern: "{vue,@vue/**}",
399
+ position: "before"
400
+ },
401
+ {
402
+ group: "external",
403
+ pattern: "{react,@react/**}",
404
+ position: "before"
405
+ },
406
+ {
407
+ group: "internal",
408
+ pattern: "@/**",
409
+ position: "before"
410
+ },
411
+ {
412
+ group: "internal",
413
+ pattern: "@@/**",
414
+ position: "before"
415
+ }
416
+ ]
417
+ }
418
+ ]
419
+ }
420
+ })
421
+ ];
422
+ }
423
+ };
1121
424
 
1122
425
  // src/configs/javascript.ts
1123
- init_esm_shims();
1124
426
  import pluginUnusedImports from "eslint-plugin-unused-imports";
1125
427
  import globals from "globals";
1126
428
 
1127
429
  // src/common.ts
1128
- init_esm_shims();
1129
430
  var VAR_IGNORE_PATTERN = "^_";
1130
431
 
1131
432
  // src/configs/javascript.ts
1132
- var NAMESPACE5 = "exbotanical/javascript";
1133
- async function javascript({ overrides = {} } = {}) {
1134
- return [
1135
- {
1136
- name: `${NAMESPACE5}/setup`,
1137
- languageOptions: {
1138
- ecmaVersion: "latest",
1139
- globals: {
1140
- ...globals.browser,
1141
- ...globals.node,
1142
- ...globals.es2021,
1143
- document: "readonly",
1144
- navigator: "readonly",
1145
- window: "readonly"
1146
- },
1147
- parserOptions: {
1148
- ecmaFeatures: { jsx: true, impliedStrict: true },
433
+ var JavascriptConfig = class extends CustomConfig {
434
+ namespace = "javascript";
435
+ constructor(options = {}) {
436
+ super(options);
437
+ }
438
+ async _rules() {
439
+ const { files = GLOB_SCRIPTS } = this.options;
440
+ return [
441
+ this.createRuleConfig("setup", {
442
+ files,
443
+ languageOptions: {
1149
444
  ecmaVersion: "latest",
1150
- sourceType: "module"
1151
- },
1152
- sourceType: "module"
1153
- },
1154
- linterOptions: {
1155
- reportUnusedDisableDirectives: "error",
1156
- reportUnusedInlineConfigs: "error"
1157
- }
1158
- },
1159
- {
1160
- name: `${NAMESPACE5}/rules`,
1161
- plugins: {
1162
- "unused-imports": pluginUnusedImports
1163
- },
1164
- rules: {
1165
- "array-callback-return": ["error"],
1166
- "constructor-super": ["error"],
1167
- "for-direction": ["error"],
1168
- "getter-return": ["error"],
1169
- "no-async-promise-executor": ["error"],
1170
- "no-class-assign": ["error"],
1171
- "no-compare-neg-zero": ["error"],
1172
- "no-cond-assign": ["error", "except-parens"],
1173
- "no-const-assign": ["error"],
1174
- "no-constant-binary-expression": ["error"],
1175
- "no-constant-condition": ["error"],
1176
- "no-constructor-return": ["error"],
1177
- "no-control-regex": ["error"],
1178
- "no-debugger": ["error"],
1179
- "no-dupe-args": ["error"],
1180
- "no-dupe-class-members": ["error"],
1181
- "no-dupe-else-if": ["error"],
1182
- "no-dupe-keys": ["error"],
1183
- "no-duplicate-case": ["error"],
1184
- // See `import` ruleset
1185
- "no-duplicate-imports": ["off"],
1186
- "no-empty-character-class": ["error"],
1187
- "no-empty-pattern": ["error"],
1188
- "no-unsafe-finally": ["error"],
1189
- "no-unreachable-loop": ["error"],
1190
- "no-unreachable": ["error"],
1191
- "no-unmodified-loop-condition": ["error"],
1192
- "no-unexpected-multiline": ["error"],
1193
- "no-undef": ["error"],
1194
- "no-this-before-super": ["error"],
1195
- "no-template-curly-in-string": ["error"],
1196
- "no-sparse-arrays": ["error"],
1197
- "no-setter-return": ["error"],
1198
- "no-self-compare": ["error"],
1199
- "no-self-assign": ["error", { props: true }],
1200
- "no-prototype-builtins": ["error"],
1201
- "no-promise-executor-return": ["error"],
1202
- "no-obj-calls": ["error"],
1203
- "no-new-native-nonconstructor": ["error"],
1204
- "no-misleading-character-class": ["error"],
1205
- "no-loss-of-precision": ["error"],
1206
- "no-irregular-whitespace": ["error"],
1207
- "no-invalid-regexp": ["error"],
1208
- "no-import-assign": ["error"],
1209
- "no-func-assign": ["error"],
1210
- "no-fallthrough": ["warn"],
1211
- "no-ex-assign": ["error"],
1212
- "no-unsafe-negation": ["error"],
1213
- "no-unsafe-optional-chaining": ["error"],
1214
- "no-unused-private-class-members": ["error"],
1215
- "no-unused-vars": [
1216
- "error",
1217
- {
1218
- vars: "all",
1219
- args: "all",
1220
- argsIgnorePattern: VAR_IGNORE_PATTERN,
1221
- caughtErrorsIgnorePattern: VAR_IGNORE_PATTERN,
1222
- destructuredArrayIgnorePattern: VAR_IGNORE_PATTERN,
1223
- reportUsedIgnorePattern: true
1224
- }
1225
- ],
1226
- "no-use-before-define": [
1227
- "error",
1228
- { classes: false, functions: false, variables: true }
1229
- ],
1230
- "no-useless-assignment": ["error"],
1231
- "no-useless-backreference": ["error"],
1232
- "require-atomic-updates": ["error"],
1233
- "use-isnan": [
1234
- "error",
1235
- { enforceForIndexOf: true, enforceForSwitchCase: true }
1236
- ],
1237
- "valid-typeof": ["error", { requireStringLiterals: true }],
1238
- "class-methods-use-this": ["warn"],
1239
- "consistent-return": ["error"],
1240
- "curly": ["error", "multi-line"],
1241
- "default-case": [
1242
- "error",
1243
- {
1244
- commentPattern: String.raw`^skip\sdefault`
1245
- }
1246
- ],
1247
- "default-case-last": ["error"],
1248
- "dot-notation": ["error", { allowKeywords: true }],
1249
- "eqeqeq": ["error", "smart"],
1250
- "func-names": ["error", "as-needed"],
1251
- "accessor-pairs": [
1252
- "error",
1253
- { enforceForClassMembers: true, setWithoutGet: true }
1254
- ],
1255
- "arrow-body-style": ["error", "as-needed"],
1256
- "block-scoped-var": ["error"],
1257
- "camelcase": [
1258
- "error",
1259
- {
1260
- ignoreImports: true
1261
- }
1262
- ],
1263
- "capitalized-comments": [
1264
- "error",
1265
- "always",
1266
- {
1267
- ignoreInlineComments: true,
1268
- ignoreConsecutiveComments: true
1269
- }
1270
- ],
1271
- "grouped-accessor-pairs": ["error", "getBeforeSet"],
1272
- "max-params": ["warn", { max: 5 }],
1273
- "new-cap": [
1274
- "error",
1275
- { capIsNew: false, newIsCap: true, properties: true }
1276
- ],
1277
- "no-alert": ["error"],
1278
- "no-array-constructor": ["error"],
1279
- "no-caller": ["error"],
1280
- "no-case-declarations": ["warn"],
1281
- "no-console": ["error", { allow: ["warn", "error"] }],
1282
- "no-delete-var": ["error"],
1283
- "no-else-return": ["error"],
1284
- "no-empty": ["error", { allowEmptyCatch: true }],
1285
- "no-eval": ["error"],
1286
- "no-extra-bind": ["error"],
1287
- "no-extend-native": ["error"],
1288
- "no-extra-boolean-cast": ["error"],
1289
- "no-global-assign": ["error"],
1290
- "no-implied-eval": ["error"],
1291
- "no-invalid-this": ["error"],
1292
- "no-iterator": ["error"],
1293
- "no-labels": ["error", { allowLoop: false, allowSwitch: false }],
1294
- "no-lone-blocks": ["error"],
1295
- "no-multi-str": ["error"],
1296
- "no-new": ["error"],
1297
- "no-new-func": ["error"],
1298
- "no-new-wrappers": ["error"],
1299
- "no-octal": ["error"],
1300
- "no-octal-escape": ["error"],
1301
- "no-param-reassign": ["error"],
1302
- "no-proto": ["error"],
1303
- "no-redeclare": ["error", { builtinGlobals: false }],
1304
- "no-regex-spaces": ["error"],
1305
- "no-restricted-globals": [
1306
- "error",
1307
- { message: "Use `globalThis` instead.", name: "global" },
1308
- { message: "Use `globalThis` instead.", name: "self" }
1309
- ],
1310
- "no-restricted-properties": [
1311
- "error",
1312
- {
1313
- message: "Use `Object.getPrototypeOf` or `Object.setPrototypeOf` instead.",
1314
- property: "__proto__"
1315
- },
1316
- {
1317
- message: "Use `Object.defineProperty` instead.",
1318
- property: "__defineGetter__"
1319
- },
1320
- {
1321
- message: "Use `Object.defineProperty` instead.",
1322
- property: "__defineSetter__"
445
+ globals: {
446
+ ...globals.browser,
447
+ ...globals.node,
448
+ ...globals.es2021,
449
+ document: "readonly",
450
+ navigator: "readonly",
451
+ window: "readonly"
1323
452
  },
1324
- {
1325
- message: "Use `Object.getOwnPropertyDescriptor` instead.",
1326
- property: "__lookupGetter__"
453
+ parserOptions: {
454
+ ecmaFeatures: { jsx: true, impliedStrict: true },
455
+ ecmaVersion: "latest",
456
+ sourceType: "module"
1327
457
  },
1328
- {
1329
- message: "Use `Object.getOwnPropertyDescriptor` instead.",
1330
- property: "__lookupSetter__"
1331
- }
1332
- ],
1333
- "no-restricted-syntax": [
1334
- "error",
1335
- "TSEnumDeclaration[const=true]",
1336
- "TSExportAssignment"
1337
- ],
1338
- "no-sequences": ["error"],
1339
- "no-shadow-restricted-names": ["error"],
1340
- "no-throw-literal": ["warn"],
1341
- "no-undef-init": ["error"],
1342
- "no-unneeded-ternary": ["error", { defaultAssignment: false }],
1343
- "no-unused-expressions": [
1344
- "error",
1345
- {
1346
- allowShortCircuit: true,
1347
- allowTaggedTemplates: true,
1348
- allowTernary: true
1349
- }
1350
- ],
1351
- "no-useless-call": ["error"],
1352
- "no-useless-catch": ["error"],
1353
- "no-useless-computed-key": ["error"],
1354
- "no-useless-constructor": ["error"],
1355
- "no-useless-return": ["error"],
1356
- "no-var": ["error"],
1357
- "no-with": ["error"],
1358
- "no-useless-escape": ["error"],
1359
- "object-shorthand": [
1360
- "error",
1361
- "always",
1362
- {
1363
- avoidQuotes: true,
1364
- ignoreConstructors: false
1365
- }
1366
- ],
1367
- "one-var": ["error", { initialized: "never", uninitialized: "never" }],
1368
- "prefer-arrow-callback": [
1369
- "error",
1370
- {
1371
- allowNamedFunctions: false,
1372
- allowUnboundThis: true
1373
- }
1374
- ],
1375
- "prefer-const": [
1376
- "error",
1377
- {
1378
- destructuring: "all",
1379
- ignoreReadBeforeAssign: true
1380
- }
1381
- ],
1382
- "prefer-exponentiation-operator": ["error"],
1383
- "prefer-promise-reject-errors": ["error"],
1384
- "prefer-regex-literals": ["error", { disallowRedundantWrapping: true }],
1385
- "prefer-rest-params": ["error"],
1386
- "prefer-spread": ["error"],
1387
- "prefer-template": ["error"],
1388
- "radix": ["error"],
1389
- "symbol-description": ["error"],
1390
- "vars-on-top": ["error"],
1391
- "yoda": ["error", "never"],
1392
- "unicode-bom": ["error", "never"]
1393
- },
1394
- ...overrides
1395
- }
1396
- ];
1397
- }
458
+ sourceType: "module"
459
+ },
460
+ linterOptions: {
461
+ reportUnusedDisableDirectives: "error",
462
+ reportUnusedInlineConfigs: "error"
463
+ }
464
+ }),
465
+ this.createRuleConfig("rules", {
466
+ files,
467
+ plugins: {
468
+ "unused-imports": pluginUnusedImports
469
+ },
470
+ rules: {
471
+ "array-callback-return": ["error"],
472
+ "constructor-super": ["error"],
473
+ "for-direction": ["error"],
474
+ "getter-return": ["error"],
475
+ "no-async-promise-executor": ["error"],
476
+ "no-class-assign": ["error"],
477
+ "no-compare-neg-zero": ["error"],
478
+ "no-cond-assign": ["error", "except-parens"],
479
+ "no-const-assign": ["error"],
480
+ "no-constant-binary-expression": ["error"],
481
+ "no-constant-condition": ["error"],
482
+ "no-constructor-return": ["error"],
483
+ "no-control-regex": ["error"],
484
+ "no-debugger": ["error"],
485
+ "no-dupe-args": ["error"],
486
+ "no-dupe-class-members": ["error"],
487
+ "no-dupe-else-if": ["error"],
488
+ "no-dupe-keys": ["error"],
489
+ "no-duplicate-case": ["error"],
490
+ // See `import` ruleset
491
+ "no-duplicate-imports": ["off"],
492
+ "no-empty-character-class": ["error"],
493
+ "no-empty-pattern": ["error"],
494
+ "no-unsafe-finally": ["error"],
495
+ "no-unreachable-loop": ["error"],
496
+ "no-unreachable": ["error"],
497
+ "no-unmodified-loop-condition": ["error"],
498
+ "no-unexpected-multiline": ["error"],
499
+ "no-undef": ["error"],
500
+ "no-this-before-super": ["error"],
501
+ "no-template-curly-in-string": ["error"],
502
+ "no-sparse-arrays": ["error"],
503
+ "no-setter-return": ["error"],
504
+ "no-self-compare": ["error"],
505
+ "no-self-assign": ["error", { props: true }],
506
+ "no-prototype-builtins": ["error"],
507
+ "no-promise-executor-return": ["error"],
508
+ "no-obj-calls": ["error"],
509
+ "no-new-native-nonconstructor": ["error"],
510
+ "no-misleading-character-class": ["error"],
511
+ "no-loss-of-precision": ["error"],
512
+ "no-irregular-whitespace": ["error"],
513
+ "no-invalid-regexp": ["error"],
514
+ "no-import-assign": ["error"],
515
+ "no-func-assign": ["error"],
516
+ "no-fallthrough": ["warn"],
517
+ "no-ex-assign": ["error"],
518
+ "no-unsafe-negation": ["error"],
519
+ "no-unsafe-optional-chaining": ["error"],
520
+ "no-unused-private-class-members": ["error"],
521
+ "no-unused-vars": "off",
522
+ "unused-imports/no-unused-imports": "error",
523
+ "unused-imports/no-unused-vars": [
524
+ "error",
525
+ {
526
+ vars: "all",
527
+ args: "all",
528
+ argsIgnorePattern: VAR_IGNORE_PATTERN,
529
+ caughtErrorsIgnorePattern: VAR_IGNORE_PATTERN,
530
+ destructuredArrayIgnorePattern: VAR_IGNORE_PATTERN,
531
+ reportUsedIgnorePattern: true
532
+ }
533
+ ],
534
+ "no-use-before-define": [
535
+ "error",
536
+ { classes: false, functions: false, variables: true }
537
+ ],
538
+ "no-useless-assignment": ["error"],
539
+ "no-useless-backreference": ["error"],
540
+ "require-atomic-updates": ["error"],
541
+ "use-isnan": ["error", { enforceForIndexOf: true, enforceForSwitchCase: true }],
542
+ "valid-typeof": ["error", { requireStringLiterals: true }],
543
+ "class-methods-use-this": ["warn"],
544
+ "consistent-return": ["error"],
545
+ "curly": ["error", "multi-line"],
546
+ "default-case": [
547
+ "error",
548
+ {
549
+ commentPattern: String.raw`^skip\sdefault`
550
+ }
551
+ ],
552
+ "default-case-last": ["error"],
553
+ "dot-notation": ["error", { allowKeywords: true }],
554
+ "eqeqeq": ["error", "smart"],
555
+ "func-names": ["error", "as-needed"],
556
+ "accessor-pairs": [
557
+ "error",
558
+ { enforceForClassMembers: true, setWithoutGet: true }
559
+ ],
560
+ "arrow-body-style": ["error", "as-needed"],
561
+ "block-scoped-var": ["error"],
562
+ "camelcase": [
563
+ "error",
564
+ {
565
+ ignoreImports: true
566
+ }
567
+ ],
568
+ "capitalized-comments": [
569
+ "error",
570
+ "always",
571
+ {
572
+ ignoreInlineComments: true,
573
+ ignoreConsecutiveComments: true
574
+ }
575
+ ],
576
+ "grouped-accessor-pairs": ["error", "getBeforeSet"],
577
+ "max-params": ["warn", { max: 5 }],
578
+ "new-cap": ["error", { capIsNew: false, newIsCap: true, properties: true }],
579
+ "no-alert": ["error"],
580
+ "no-array-constructor": ["error"],
581
+ "no-caller": ["error"],
582
+ "no-case-declarations": ["warn"],
583
+ "no-console": ["error", { allow: ["warn", "error"] }],
584
+ "no-delete-var": ["error"],
585
+ "no-else-return": ["error"],
586
+ "no-empty": ["error", { allowEmptyCatch: true }],
587
+ "no-eval": ["error"],
588
+ "no-extra-bind": ["error"],
589
+ "no-extend-native": ["error"],
590
+ "no-extra-boolean-cast": ["error"],
591
+ "no-global-assign": ["error"],
592
+ "no-implied-eval": ["error"],
593
+ "no-invalid-this": ["error"],
594
+ "no-iterator": ["error"],
595
+ "no-labels": ["error", { allowLoop: false, allowSwitch: false }],
596
+ "no-lone-blocks": ["error"],
597
+ "no-multi-str": ["error"],
598
+ "no-new": ["error"],
599
+ "no-new-func": ["error"],
600
+ "no-new-wrappers": ["error"],
601
+ "no-octal": ["error"],
602
+ "no-octal-escape": ["error"],
603
+ "no-param-reassign": ["error"],
604
+ "no-proto": ["error"],
605
+ "no-redeclare": ["error", { builtinGlobals: false }],
606
+ "no-regex-spaces": ["error"],
607
+ "no-restricted-globals": [
608
+ "error",
609
+ { message: "Use `globalThis` instead.", name: "global" },
610
+ { message: "Use `globalThis` instead.", name: "self" }
611
+ ],
612
+ "no-restricted-properties": [
613
+ "error",
614
+ {
615
+ message: "Use `Object.getPrototypeOf` or `Object.setPrototypeOf` instead.",
616
+ property: "__proto__"
617
+ },
618
+ {
619
+ message: "Use `Object.defineProperty` instead.",
620
+ property: "__defineGetter__"
621
+ },
622
+ {
623
+ message: "Use `Object.defineProperty` instead.",
624
+ property: "__defineSetter__"
625
+ },
626
+ {
627
+ message: "Use `Object.getOwnPropertyDescriptor` instead.",
628
+ property: "__lookupGetter__"
629
+ },
630
+ {
631
+ message: "Use `Object.getOwnPropertyDescriptor` instead.",
632
+ property: "__lookupSetter__"
633
+ }
634
+ ],
635
+ "no-restricted-syntax": [
636
+ "error",
637
+ "TSEnumDeclaration[const=true]",
638
+ "TSExportAssignment"
639
+ ],
640
+ "no-sequences": ["error"],
641
+ "no-shadow-restricted-names": ["error"],
642
+ "no-throw-literal": ["warn"],
643
+ "no-undef-init": ["error"],
644
+ "no-unneeded-ternary": ["error", { defaultAssignment: false }],
645
+ "no-unused-expressions": [
646
+ "error",
647
+ {
648
+ allowShortCircuit: true,
649
+ allowTaggedTemplates: true,
650
+ allowTernary: true
651
+ }
652
+ ],
653
+ "no-useless-call": ["error"],
654
+ "no-useless-catch": ["error"],
655
+ "no-useless-computed-key": ["error"],
656
+ "no-useless-constructor": ["error"],
657
+ "no-useless-return": ["error"],
658
+ "no-var": ["error"],
659
+ "no-with": ["error"],
660
+ "no-useless-escape": ["error"],
661
+ "object-shorthand": [
662
+ "error",
663
+ "always",
664
+ {
665
+ avoidQuotes: true,
666
+ ignoreConstructors: false
667
+ }
668
+ ],
669
+ "one-var": ["error", { initialized: "never", uninitialized: "never" }],
670
+ "prefer-arrow-callback": [
671
+ "error",
672
+ {
673
+ allowNamedFunctions: false,
674
+ allowUnboundThis: true
675
+ }
676
+ ],
677
+ "prefer-const": [
678
+ "error",
679
+ {
680
+ destructuring: "all",
681
+ ignoreReadBeforeAssign: true
682
+ }
683
+ ],
684
+ "prefer-exponentiation-operator": ["error"],
685
+ "prefer-promise-reject-errors": ["error"],
686
+ "prefer-regex-literals": ["error", { disallowRedundantWrapping: true }],
687
+ "prefer-rest-params": ["error"],
688
+ "prefer-spread": ["error"],
689
+ "prefer-template": ["error"],
690
+ "radix": ["error"],
691
+ "symbol-description": ["error"],
692
+ "vars-on-top": ["error"],
693
+ "yoda": ["error", "never"],
694
+ "unicode-bom": ["error", "never"]
695
+ },
696
+ ...this.options.overrides
697
+ })
698
+ ];
699
+ }
700
+ };
1398
701
 
1399
702
  // src/configs/jsdoc.ts
1400
- init_esm_shims();
1401
- var NAMESPACE6 = "exbotanical/jsdoc";
1402
- async function jsdoc() {
1403
- return [
1404
- {
1405
- name: `${NAMESPACE6}/rules`,
1406
- plugins: {
1407
- jsdoc: await interopDefault(import("eslint-plugin-jsdoc"))
1408
- },
1409
- rules: {
1410
- "jsdoc/check-access": ["warn"],
1411
- "jsdoc/check-param-names": ["warn"],
1412
- "jsdoc/check-property-names": ["warn"],
1413
- "jsdoc/check-types": ["warn"],
1414
- "jsdoc/empty-tags": ["warn"],
1415
- "jsdoc/implements-on-classes": ["warn"],
1416
- "jsdoc/no-defaults": ["warn"],
1417
- "jsdoc/no-multi-asterisks": ["warn"],
1418
- "jsdoc/require-param-name": ["warn"],
1419
- "jsdoc/require-property": ["warn"],
1420
- "jsdoc/require-property-description": ["warn"],
1421
- "jsdoc/require-property-name": ["warn"],
1422
- "jsdoc/require-returns-check": ["warn"],
1423
- "jsdoc/require-returns-description": ["warn"],
1424
- "jsdoc/require-yields-check": ["warn"],
1425
- "jsdoc/check-alignment": ["warn"],
1426
- "jsdoc/multiline-blocks": ["warn"]
1427
- }
1428
- }
1429
- ];
1430
- }
703
+ var JsdocConfig = class extends CustomConfig {
704
+ namespace = "jsdoc";
705
+ constructor(options = {}) {
706
+ super(options);
707
+ }
708
+ async _rules() {
709
+ return [
710
+ this.createRuleConfig("rules", {
711
+ files: GLOB_SCRIPTS,
712
+ plugins: {
713
+ jsdoc: await interopDefault(import("eslint-plugin-jsdoc"))
714
+ },
715
+ rules: {
716
+ "jsdoc/check-access": ["warn"],
717
+ "jsdoc/check-param-names": ["warn"],
718
+ "jsdoc/check-property-names": ["warn"],
719
+ "jsdoc/check-types": ["warn"],
720
+ "jsdoc/empty-tags": ["warn"],
721
+ "jsdoc/implements-on-classes": ["warn"],
722
+ "jsdoc/no-defaults": ["warn"],
723
+ "jsdoc/no-multi-asterisks": ["warn"],
724
+ "jsdoc/require-param-name": ["warn"],
725
+ "jsdoc/require-property": ["warn"],
726
+ "jsdoc/require-property-description": ["warn"],
727
+ "jsdoc/require-property-name": ["warn"],
728
+ "jsdoc/require-returns-check": ["warn"],
729
+ "jsdoc/require-returns-description": ["warn"],
730
+ "jsdoc/require-yields-check": ["warn"],
731
+ "jsdoc/check-alignment": ["warn"],
732
+ "jsdoc/multiline-blocks": ["warn"],
733
+ "jsdoc/check-line-alignment": ["warn"],
734
+ "jsdoc/no-blank-block-descriptions": ["warn"],
735
+ "jsdoc/no-blank-blocks": ["warn"],
736
+ "jsdoc/sort-tags": ["warn"]
737
+ }
738
+ })
739
+ ];
740
+ }
741
+ };
1431
742
 
1432
- // src/configs/jsonc.ts
1433
- init_esm_shims();
743
+ // src/configs/json-schema.ts
744
+ var JsonSchemaConfig = class extends CustomConfig {
745
+ namespace = "json-schema";
746
+ constructor({
747
+ files = [GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_YAML, GLOB_TOML],
748
+ ...rest
749
+ } = {}) {
750
+ super({
751
+ files,
752
+ ...rest
753
+ });
754
+ }
755
+ async _rules() {
756
+ const { files, overrides = {} } = this.options;
757
+ const plugin4 = await interopDefault(import("eslint-plugin-json-schema-validator"));
758
+ return [
759
+ this.createRuleConfig("rules", {
760
+ files,
761
+ plugins: {
762
+ "json-schema-validator": plugin4
763
+ },
764
+ rules: {
765
+ "json-schema-validator/no-invalid": "error",
766
+ ...overrides
767
+ }
768
+ })
769
+ ];
770
+ }
771
+ };
1434
772
 
1435
773
  // src/defaults.ts
1436
- init_esm_shims();
1437
774
  var STYLE_DEFAULTS = {
1438
775
  indent: 2,
1439
776
  jsx: true,
@@ -1442,376 +779,428 @@ var STYLE_DEFAULTS = {
1442
779
  };
1443
780
 
1444
781
  // src/configs/jsonc.ts
1445
- var NAMESPACE7 = "exbotanical/jsonc";
1446
- async function jsonc({
1447
- files = [GLOB_JSON, GLOB_JSON5, GLOB_JSONC],
1448
- overrides = {}
1449
- } = {}, { indent } = STYLE_DEFAULTS) {
1450
- const [plugin4, parser] = await Promise.all([
1451
- interopDefault(import("eslint-plugin-jsonc")),
1452
- interopDefault(import("jsonc-eslint-parser"))
1453
- ]);
1454
- return [
1455
- {
1456
- name: `${NAMESPACE7}/setup`,
1457
- plugins: {
1458
- jsonc: plugin4
1459
- }
1460
- },
1461
- {
782
+ var JsoncConfig = class extends CustomConfig {
783
+ namespace = "jsonc";
784
+ constructor({
785
+ files = [GLOB_JSON, GLOB_JSON5, GLOB_JSONC],
786
+ indent = STYLE_DEFAULTS.indent,
787
+ ...rest
788
+ } = {}) {
789
+ super({
1462
790
  files,
1463
- languageOptions: {
1464
- parser
1465
- },
1466
- name: `${NAMESPACE7}/rules`,
1467
- rules: {
1468
- "jsonc/no-bigint-literals": "error",
1469
- "jsonc/no-binary-expression": "error",
1470
- "jsonc/no-binary-numeric-literals": "error",
1471
- "jsonc/no-dupe-keys": "error",
1472
- "jsonc/no-escape-sequence-in-identifier": "error",
1473
- "jsonc/no-floating-decimal": "error",
1474
- "jsonc/no-hexadecimal-numeric-literals": "error",
1475
- "jsonc/no-infinity": "error",
1476
- "jsonc/no-multi-str": "error",
1477
- "jsonc/no-nan": "error",
1478
- "jsonc/no-number-props": "error",
1479
- "jsonc/no-numeric-separators": "error",
1480
- "jsonc/no-octal": "error",
1481
- "jsonc/no-octal-escape": "error",
1482
- "jsonc/no-octal-numeric-literals": "error",
1483
- "jsonc/no-parenthesized": "error",
1484
- "jsonc/no-plus-sign": "error",
1485
- "jsonc/no-regexp-literals": "error",
1486
- "jsonc/no-sparse-arrays": "error",
1487
- "jsonc/no-template-literals": "error",
1488
- "jsonc/no-undefined-value": "error",
1489
- "jsonc/no-unicode-codepoint-escapes": "error",
1490
- "jsonc/no-useless-escape": "error",
1491
- "jsonc/space-unary-ops": "error",
1492
- "jsonc/valid-json-number": "error",
1493
- "jsonc/vue-custom-block/no-parsing-error": "error",
1494
- "jsonc/array-bracket-spacing": ["error", "never"],
1495
- "jsonc/comma-dangle": ["error", "never"],
1496
- "jsonc/comma-style": ["error", "last"],
1497
- "jsonc/indent": ["error", indent],
1498
- "jsonc/key-spacing": [
1499
- "error",
1500
- { afterColon: true, beforeColon: false }
1501
- ],
1502
- "jsonc/object-curly-newline": [
1503
- "error",
1504
- { consistent: true, multiline: true }
1505
- ],
1506
- "jsonc/object-curly-spacing": ["error", "always"],
1507
- "jsonc/object-property-newline": [
1508
- "error",
1509
- { allowMultiplePropertiesPerLine: true }
1510
- ],
1511
- "jsonc/quote-props": "error",
1512
- "jsonc/quotes": "error",
1513
- ...overrides
1514
- }
1515
- }
1516
- ];
1517
- }
791
+ indent,
792
+ ...rest
793
+ });
794
+ }
795
+ async _rules() {
796
+ const {
797
+ files = [GLOB_JSON, GLOB_JSON5, GLOB_JSONC],
798
+ overrides = {},
799
+ indent = STYLE_DEFAULTS.indent,
800
+ sortKeys = []
801
+ } = this.options;
802
+ const [plugin4, parser] = await Promise.all([
803
+ interopDefault(import("eslint-plugin-jsonc")),
804
+ interopDefault(import("jsonc-eslint-parser"))
805
+ ]);
806
+ return [
807
+ this.createRuleConfig("setup", {
808
+ plugins: {
809
+ jsonc: plugin4
810
+ }
811
+ }),
812
+ this.createRuleConfig("rules", {
813
+ files,
814
+ languageOptions: {
815
+ parser
816
+ },
817
+ rules: {
818
+ "jsonc/no-bigint-literals": "error",
819
+ "jsonc/no-binary-expression": "error",
820
+ "jsonc/no-binary-numeric-literals": "error",
821
+ "jsonc/no-dupe-keys": "error",
822
+ "jsonc/no-escape-sequence-in-identifier": "error",
823
+ "jsonc/no-floating-decimal": "error",
824
+ "jsonc/no-hexadecimal-numeric-literals": "error",
825
+ "jsonc/no-infinity": "error",
826
+ "jsonc/no-irregular-whitespace": "error",
827
+ "jsonc/no-multi-str": "error",
828
+ "jsonc/no-nan": "error",
829
+ "jsonc/no-number-props": "error",
830
+ "jsonc/no-numeric-separators": "error",
831
+ "jsonc/no-octal": "error",
832
+ "jsonc/no-octal-escape": "error",
833
+ "jsonc/no-octal-numeric-literals": "error",
834
+ "jsonc/no-parenthesized": "error",
835
+ "jsonc/no-plus-sign": "error",
836
+ "jsonc/no-regexp-literals": "error",
837
+ "jsonc/no-sparse-arrays": "error",
838
+ "jsonc/no-template-literals": "error",
839
+ "jsonc/no-undefined-value": "error",
840
+ "jsonc/no-unicode-codepoint-escapes": "error",
841
+ "jsonc/no-useless-escape": "error",
842
+ "jsonc/space-unary-ops": "error",
843
+ "jsonc/valid-json-number": "error",
844
+ "jsonc/vue-custom-block/no-parsing-error": "error",
845
+ "jsonc/array-bracket-spacing": ["error", "never"],
846
+ "jsonc/comma-dangle": ["error", "never"],
847
+ "jsonc/comma-style": ["error", "last"],
848
+ "jsonc/indent": ["error", indent],
849
+ "jsonc/key-spacing": ["error", { afterColon: true, beforeColon: false }],
850
+ "jsonc/object-curly-newline": ["error", { consistent: true, multiline: true }],
851
+ "jsonc/object-curly-spacing": ["error", "always"],
852
+ "jsonc/object-property-newline": [
853
+ "error",
854
+ { allowMultiplePropertiesPerLine: true }
855
+ ],
856
+ "jsonc/quote-props": "error",
857
+ "jsonc/quotes": "error",
858
+ ...overrides
859
+ }
860
+ }),
861
+ ...sortKeys.length > 0 ? [
862
+ this.createRuleConfig("sort-keys", {
863
+ files: sortKeys,
864
+ ignores: ["**/package.json", "**/tsconfig.json", "**/tsconfig.*.json"],
865
+ languageOptions: {
866
+ parser
867
+ },
868
+ rules: {
869
+ "jsonc/sort-keys": [
870
+ "error",
871
+ "asc",
872
+ { allowLineSeparatedGroups: true, natural: true }
873
+ ]
874
+ }
875
+ })
876
+ ] : []
877
+ ];
878
+ }
879
+ };
1518
880
 
1519
881
  // src/configs/jsx.ts
1520
- init_esm_shims();
1521
- var NAMESPACE8 = "exbotanical/jsx";
1522
- async function jsx() {
1523
- return [
1524
- {
1525
- name: `${NAMESPACE8}/setup`,
1526
- files: [GLOB_JSX, GLOB_TSX],
1527
- languageOptions: {
1528
- parserOptions: {
1529
- ecmaFeatures: {
1530
- jsx: true
882
+ var JsxConfig = class extends CustomConfig {
883
+ namespace = "jsx";
884
+ constructor(options = {}) {
885
+ super(options);
886
+ }
887
+ async _rules() {
888
+ return [
889
+ this.createRuleConfig("setup", {
890
+ files: [GLOB_JSX, GLOB_TSX],
891
+ languageOptions: {
892
+ parserOptions: {
893
+ ecmaFeatures: {
894
+ jsx: true
895
+ }
1531
896
  }
1532
897
  }
1533
- }
1534
- }
1535
- ];
1536
- }
898
+ })
899
+ ];
900
+ }
901
+ };
1537
902
 
1538
903
  // src/configs/markdown.ts
1539
- init_esm_shims();
1540
- var NAMESPACE9 = "exbotanical/markdown";
1541
- async function markdown({
1542
- files = [GLOB_MARKDOWN],
1543
- overrides = {}
1544
- } = {}) {
1545
- const markdown2 = await interopDefault(import("@eslint/markdown"));
1546
- return [
1547
- {
1548
- name: `${NAMESPACE9}/setup`,
1549
- plugins: { markdown: markdown2 }
1550
- },
1551
- {
1552
- name: `${NAMESPACE9}/processor`,
1553
- files,
1554
- ignores: ["**/*.md/*.md"],
1555
- // `eslint-plugin-markdown` only creates virtual files for code blocks,
1556
- // but not the markdown file itself (we use passthrough for this).
1557
- processor: mergeProcessors([
1558
- markdown2.processors.markdown,
1559
- processorPassThrough
1560
- ])
1561
- },
1562
- {
1563
- name: `${NAMESPACE9}/parser`,
904
+ var MarkdownConfig = class extends CustomConfig {
905
+ namespace = "markdown";
906
+ constructor({ files = [GLOB_MARKDOWN], ...rest } = {}) {
907
+ super({
1564
908
  files,
1565
- languageOptions: {
1566
- parser: parserPlain
1567
- }
1568
- },
1569
- {
1570
- name: `${NAMESPACE9}/disables`,
1571
- files: [GLOB_MARKDOWN_CODE],
1572
- languageOptions: {
1573
- parserOptions: {
1574
- ecmaFeatures: { impliedStrict: true }
909
+ ...rest
910
+ });
911
+ }
912
+ async _rules() {
913
+ const { files = [GLOB_MARKDOWN], overrides = {} } = this.options;
914
+ const markdown = await interopDefault(import("@eslint/markdown"));
915
+ return [
916
+ this.createRuleConfig("setup", {
917
+ plugins: { markdown }
918
+ }),
919
+ this.createRuleConfig("processor", {
920
+ files,
921
+ ignores: ["**/*.md/*.md"],
922
+ // `eslint-plugin-markdown` only creates virtual files for code blocks,
923
+ // but not the markdown file itself (we use passthrough for this).
924
+ processor: mergeProcessors([markdown.processors.markdown, processorPassThrough])
925
+ }),
926
+ this.createRuleConfig("rules", {
927
+ files,
928
+ language: "markdown/gfm",
929
+ rules: {
930
+ ...markdown.configs.recommended[0].rules
1575
931
  }
1576
- },
1577
- rules: {
1578
- "import/newline-after-import": "off",
1579
- "no-alert": "off",
1580
- "no-console": "off",
1581
- "no-labels": "off",
1582
- "no-lone-blocks": "off",
1583
- "no-restricted-syntax": "off",
1584
- "no-undef": "off",
1585
- "no-unused-expressions": "off",
1586
- "no-unused-labels": "off",
1587
- "no-unused-vars": "off",
1588
- "node/prefer-global/process": "off",
1589
- "style/comma-dangle": "off",
1590
- "style/eol-last": "off",
1591
- "ts/consistent-type-imports": "off",
1592
- "ts/explicit-function-return-type": "off",
1593
- "ts/no-namespace": "off",
1594
- "ts/no-redeclare": "off",
1595
- "ts/no-require-imports": "off",
1596
- "ts/no-unused-expressions": "off",
1597
- "ts/no-unused-vars": "off",
1598
- "ts/no-use-before-define": "off",
1599
- "unicode-bom": "off",
1600
- "unused-imports/no-unused-imports": "off",
1601
- "unused-imports/no-unused-vars": "off",
1602
- ...overrides
1603
- }
1604
- }
1605
- ];
1606
- }
1607
-
1608
- // src/configs/misc/index.ts
1609
- init_esm_shims();
932
+ }),
933
+ this.createRuleConfig("disables", {
934
+ files: [GLOB_MARKDOWN_CODE],
935
+ languageOptions: {
936
+ parserOptions: {
937
+ ecmaFeatures: { impliedStrict: true }
938
+ }
939
+ },
940
+ rules: {
941
+ "import/newline-after-import": "off",
942
+ "no-alert": "off",
943
+ "no-console": "off",
944
+ "no-labels": "off",
945
+ "no-lone-blocks": "off",
946
+ "no-restricted-syntax": "off",
947
+ "no-undef": "off",
948
+ "no-unused-expressions": "off",
949
+ "no-unused-labels": "off",
950
+ "no-unused-vars": "off",
951
+ "node/prefer-global/process": "off",
952
+ "style/comma-dangle": "off",
953
+ "style/eol-last": "off",
954
+ "ts/consistent-type-imports": "off",
955
+ "ts/explicit-function-return-type": "off",
956
+ "ts/no-namespace": "off",
957
+ "ts/no-redeclare": "off",
958
+ "ts/no-require-imports": "off",
959
+ "ts/no-unused-expressions": "off",
960
+ "ts/no-unused-vars": "off",
961
+ "ts/no-use-before-define": "off",
962
+ "unicode-bom": "off",
963
+ "unused-imports/no-unused-imports": "off",
964
+ "unused-imports/no-unused-vars": "off",
965
+ ...overrides
966
+ }
967
+ })
968
+ ];
969
+ }
970
+ };
1610
971
 
1611
972
  // src/configs/misc/perfectionist.ts
1612
- init_esm_shims();
1613
973
  import pluginPerfectionist from "eslint-plugin-perfectionist";
1614
- var NAMESPACE10 = "exbotanical/misc/perfectionist";
1615
- async function perfectionist() {
1616
- return [
1617
- {
1618
- name: `${NAMESPACE10}/setup`,
1619
- plugins: {
1620
- perfectionist: pluginPerfectionist
1621
- },
1622
- rules: {
1623
- "perfectionist/sort-exports": [
1624
- "error",
1625
- { order: "asc", type: "natural" }
1626
- ],
1627
- // 'perfectionist/sort-imports': [
1628
- // 'error',
1629
- // {
1630
- // groups: [
1631
- // 'type',
1632
- // ['parent-type', 'sibling-type', 'index-type', 'internal-type'],
1633
- // 'builtin',
1634
- // 'external',
1635
- // 'internal',
1636
- // ['parent', 'sibling', 'index'],
1637
- // 'side-effect',
1638
- // 'object',
1639
- // 'unknown',
1640
- // ],
1641
- // newlinesBetween: 'ignore',
1642
- // order: 'asc',
1643
- // type: 'natural',
1644
- // },
1645
- // ],
1646
- "perfectionist/sort-named-exports": [
1647
- "error",
1648
- { order: "asc", type: "natural" }
1649
- ]
1650
- // 'perfectionist/sort-named-imports': [
1651
- // 'error',
1652
- // { order: 'asc', type: 'natural' },
1653
- // ],
1654
- }
1655
- }
1656
- ];
1657
- }
974
+ var SORT_OPTIONS = { order: "asc", type: "natural" };
975
+ var PerfectionistConfig = class extends CustomConfig {
976
+ namespace = "misc/perfectionist";
977
+ constructor({ sortDeclarations = false, ...rest } = {}) {
978
+ super({
979
+ sortDeclarations,
980
+ ...rest
981
+ });
982
+ }
983
+ async _rules() {
984
+ const { sortDeclarations = false } = this.options;
985
+ return [
986
+ this.createRuleConfig("setup", {
987
+ files: GLOB_SCRIPTS,
988
+ plugins: {
989
+ perfectionist: pluginPerfectionist
990
+ },
991
+ rules: {
992
+ "perfectionist/sort-array-includes": ["error", SORT_OPTIONS],
993
+ "perfectionist/sort-exports": ["error", SORT_OPTIONS],
994
+ "perfectionist/sort-heritage-clauses": ["error", SORT_OPTIONS],
995
+ "perfectionist/sort-named-exports": ["error", SORT_OPTIONS],
996
+ "perfectionist/sort-named-imports": ["error", SORT_OPTIONS],
997
+ "perfectionist/sort-union-types": ["error", SORT_OPTIONS]
998
+ }
999
+ }),
1000
+ ...sortDeclarations ? [
1001
+ this.createRuleConfig("declarations", {
1002
+ files: GLOB_SCRIPTS,
1003
+ rules: {
1004
+ "perfectionist/sort-classes": ["error", SORT_OPTIONS],
1005
+ "perfectionist/sort-enums": ["error", SORT_OPTIONS],
1006
+ "perfectionist/sort-interfaces": ["error", SORT_OPTIONS],
1007
+ "perfectionist/sort-intersection-types": ["error", SORT_OPTIONS],
1008
+ "perfectionist/sort-modules": ["error", SORT_OPTIONS],
1009
+ "perfectionist/sort-object-types": ["error", SORT_OPTIONS],
1010
+ "perfectionist/sort-sets": ["error", SORT_OPTIONS]
1011
+ }
1012
+ })
1013
+ ] : []
1014
+ ];
1015
+ }
1016
+ };
1658
1017
 
1659
1018
  // src/configs/misc/unicorn.ts
1660
- init_esm_shims();
1661
- import pluginUnicorn from "eslint-plugin-unicorn";
1662
- var NAMESPACE11 = "exbotanical/misc/unicorn";
1663
- async function unicorn() {
1664
- return [
1665
- {
1666
- name: `${NAMESPACE11}/rules`,
1667
- plugins: {
1668
- unicorn: pluginUnicorn
1669
- },
1670
- rules: {
1671
- ...pluginUnicorn.configs.recommended.rules,
1672
- "unicorn/prevent-abbreviations": "off",
1673
- "unicorn/no-null": "off",
1674
- "unicorn/prefer-top-level-await": "off",
1675
- "unicorn/filename-case": "off",
1676
- "unicorn/no-await-expression-member": "off",
1677
- "unicorn/throw-new-error": "off",
1678
- "unicorn/no-array-callback-reference": "off",
1679
- "unicorn/no-new-array": "off"
1680
- }
1681
- }
1682
- ];
1683
- }
1019
+ import pluginUnicorn2 from "eslint-plugin-unicorn";
1020
+ var UnicornConfig = class extends CustomConfig {
1021
+ namespace = "misc/unicorn";
1022
+ constructor(options = {}) {
1023
+ super(options);
1024
+ }
1025
+ async _rules() {
1026
+ return [
1027
+ this.createRuleConfig("rules", {
1028
+ files: GLOB_SCRIPTS,
1029
+ plugins: {
1030
+ unicorn: pluginUnicorn2
1031
+ },
1032
+ rules: {
1033
+ ...pluginUnicorn2.configs.recommended.rules,
1034
+ "unicorn/prevent-abbreviations": "off",
1035
+ "unicorn/no-null": "off",
1036
+ "unicorn/prefer-top-level-await": "off",
1037
+ "unicorn/filename-case": "off",
1038
+ "unicorn/no-await-expression-member": "off",
1039
+ "unicorn/throw-new-error": "off",
1040
+ "unicorn/no-array-callback-reference": "off",
1041
+ "unicorn/no-new-array": "off"
1042
+ }
1043
+ })
1044
+ ];
1045
+ }
1046
+ };
1684
1047
 
1685
1048
  // src/configs/node.ts
1686
- init_esm_shims();
1687
1049
  import plugin3 from "eslint-plugin-n";
1688
- var NAMESPACE12 = "exbotanical/node";
1689
- async function node() {
1690
- return [
1691
- {
1692
- name: `${NAMESPACE12}/rules`,
1693
- plugins: {
1694
- node: plugin3
1695
- },
1696
- rules: {
1697
- "node/handle-callback-err": ["error", "^(err|error)$"],
1698
- "node/no-deprecated-api": "error",
1699
- "node/no-exports-assign": "error",
1700
- "node/no-new-require": "error",
1701
- "node/no-path-concat": "error",
1702
- "node/prefer-global/buffer": ["error", "never"],
1703
- "node/process-exit-as-throw": "error"
1704
- }
1705
- }
1706
- ];
1707
- }
1050
+ var NodeConfig = class extends CustomConfig {
1051
+ namespace = "node";
1052
+ constructor(options = {}) {
1053
+ super(options);
1054
+ }
1055
+ async _rules() {
1056
+ return [
1057
+ this.createRuleConfig("rules", {
1058
+ files: GLOB_SCRIPTS,
1059
+ plugins: {
1060
+ node: plugin3
1061
+ },
1062
+ rules: {
1063
+ "node/handle-callback-err": ["error", "^(err|error)$"],
1064
+ "node/no-deprecated-api": "error",
1065
+ "node/no-exports-assign": "error",
1066
+ "node/no-new-require": "error",
1067
+ "node/no-path-concat": "error",
1068
+ "node/prefer-global/buffer": ["error", "never"],
1069
+ "node/process-exit-as-throw": "error",
1070
+ "node/hashbang": "error",
1071
+ ...this.options.overrides
1072
+ }
1073
+ })
1074
+ ];
1075
+ }
1076
+ };
1708
1077
 
1709
1078
  // src/configs/package.json.ts
1710
- init_esm_shims();
1711
- var NAMESPACE13 = "exbotanical/package.json";
1712
- async function packageJson() {
1713
- return [
1714
- {
1715
- name: `${NAMESPACE13}/rules`,
1716
- files: ["**/package.json"],
1717
- rules: {
1718
- "jsonc/sort-array-values": [
1719
- "error",
1720
- {
1721
- order: { type: "asc" },
1722
- pathPattern: "^files$"
1723
- }
1724
- ],
1725
- "jsonc/sort-keys": [
1726
- "error",
1727
- {
1728
- order: [
1729
- "publisher",
1730
- "name",
1731
- "displayName",
1732
- "type",
1733
- "version",
1734
- "private",
1735
- "packageManager",
1736
- "description",
1737
- "author",
1738
- "contributors",
1739
- "license",
1740
- "funding",
1741
- "homepage",
1742
- "repository",
1743
- "bugs",
1744
- "keywords",
1745
- "categories",
1746
- "sideEffects",
1747
- "exports",
1748
- "main",
1749
- "module",
1750
- "unpkg",
1751
- "jsdelivr",
1752
- "types",
1753
- "typesVersions",
1754
- "bin",
1755
- "icon",
1756
- "files",
1757
- "engines",
1758
- "activationEvents",
1759
- "contributes",
1760
- "scripts",
1761
- "peerDependencies",
1762
- "peerDependenciesMeta",
1763
- "dependencies",
1764
- "optionalDependencies",
1765
- "devDependencies",
1766
- "pnpm",
1767
- "overrides",
1768
- "resolutions",
1769
- "husky",
1770
- "simple-git-hooks",
1771
- "lint-staged",
1772
- "eslintConfig"
1773
- ],
1774
- pathPattern: "^$"
1775
- },
1776
- {
1777
- order: { type: "asc" },
1778
- pathPattern: "^(?:dev|peer|optional|bundled)?[Dd]ependencies(Meta)?$"
1779
- },
1780
- {
1781
- order: { type: "asc" },
1782
- pathPattern: "^(?:resolutions|overrides|pnpm.overrides)$"
1783
- },
1784
- {
1785
- order: ["types", "import", "require", "default"],
1786
- pathPattern: "^exports.*$"
1787
- },
1788
- {
1789
- order: [
1790
- // Client hooks only
1791
- "pre-commit",
1792
- "prepare-commit-msg",
1793
- "commit-msg",
1794
- "post-commit",
1795
- "pre-rebase",
1796
- "post-rewrite",
1797
- "post-checkout",
1798
- "post-merge",
1799
- "pre-push",
1800
- "pre-auto-gc"
1801
- ],
1802
- pathPattern: "^(?:gitHooks|husky|simple-git-hooks)$"
1803
- }
1804
- ]
1805
- }
1806
- }
1807
- ];
1808
- }
1809
-
1810
- // src/configs/prettier.ts
1811
- init_esm_shims();
1079
+ var PackageJsonConfig = class extends CustomConfig {
1080
+ namespace = "package.json";
1081
+ constructor(options = {}) {
1082
+ super(options);
1083
+ }
1084
+ async _rules() {
1085
+ return [
1086
+ this.createRuleConfig("rules", {
1087
+ files: ["**/package.json"],
1088
+ rules: {
1089
+ "jsonc/sort-array-values": [
1090
+ "error",
1091
+ {
1092
+ order: { type: "asc" },
1093
+ pathPattern: "^files$"
1094
+ }
1095
+ ],
1096
+ "jsonc/sort-keys": [
1097
+ "error",
1098
+ {
1099
+ order: [
1100
+ "publisher",
1101
+ "name",
1102
+ "displayName",
1103
+ "type",
1104
+ "version",
1105
+ "private",
1106
+ "packageManager",
1107
+ "description",
1108
+ "author",
1109
+ "contributors",
1110
+ "license",
1111
+ "funding",
1112
+ "homepage",
1113
+ "repository",
1114
+ "bugs",
1115
+ "keywords",
1116
+ "categories",
1117
+ "sideEffects",
1118
+ "exports",
1119
+ "main",
1120
+ "module",
1121
+ "unpkg",
1122
+ "jsdelivr",
1123
+ "types",
1124
+ "typesVersions",
1125
+ "bin",
1126
+ "icon",
1127
+ "files",
1128
+ "engines",
1129
+ "activationEvents",
1130
+ "contributes",
1131
+ "scripts",
1132
+ "peerDependencies",
1133
+ "peerDependenciesMeta",
1134
+ "dependencies",
1135
+ "optionalDependencies",
1136
+ "devDependencies",
1137
+ "pnpm",
1138
+ "overrides",
1139
+ "resolutions",
1140
+ "husky",
1141
+ "simple-git-hooks",
1142
+ "lint-staged",
1143
+ "eslintConfig"
1144
+ ],
1145
+ pathPattern: "^$"
1146
+ },
1147
+ {
1148
+ order: { type: "asc" },
1149
+ pathPattern: "^(?:dev|peer|optional|bundled)?[Dd]ependencies(Meta)?$"
1150
+ },
1151
+ {
1152
+ order: { type: "asc" },
1153
+ pathPattern: "^(?:resolutions|overrides|pnpm.overrides)$"
1154
+ },
1155
+ {
1156
+ order: ["types", "import", "require", "default"],
1157
+ pathPattern: "^exports.*$"
1158
+ },
1159
+ {
1160
+ order: [
1161
+ // Client hooks only
1162
+ "pre-commit",
1163
+ "prepare-commit-msg",
1164
+ "commit-msg",
1165
+ "post-commit",
1166
+ "pre-rebase",
1167
+ "post-rewrite",
1168
+ "post-checkout",
1169
+ "post-merge",
1170
+ "pre-push",
1171
+ "pre-auto-gc"
1172
+ ],
1173
+ pathPattern: "^(?:gitHooks|husky|simple-git-hooks)$"
1174
+ }
1175
+ ],
1176
+ ...this.options.overrides
1177
+ }
1178
+ })
1179
+ ];
1180
+ }
1181
+ };
1182
+ var PackageJsonPluginConfig = class extends CustomConfig {
1183
+ namespace = "package.json/plugin";
1184
+ constructor(options = {}) {
1185
+ super(options);
1186
+ }
1187
+ async _rules() {
1188
+ const plugin4 = await interopDefault(import("eslint-plugin-package-json"));
1189
+ const { recommended, stylistic } = plugin4.configs;
1190
+ return [
1191
+ this.createRuleConfig("rules", {
1192
+ ...recommended,
1193
+ rules: {
1194
+ ...recommended.rules,
1195
+ ...stylistic.rules,
1196
+ ...this.options.overrides
1197
+ }
1198
+ })
1199
+ ];
1200
+ }
1201
+ };
1812
1202
 
1813
1203
  // src/vendor/plugins/eslint-config-prettier.ts
1814
- init_esm_shims();
1815
1204
  var specialRule = 0;
1816
1205
  var eslint_config_prettier_default = {
1817
1206
  rules: {
@@ -2102,12 +1491,25 @@ var eslint_config_prettier_default = {
2102
1491
  };
2103
1492
 
2104
1493
  // src/configs/prettier.ts
2105
- async function prettier() {
2106
- return [eslint_config_prettier_default];
2107
- }
1494
+ var PrettierConfig = class extends CustomConfig {
1495
+ namespace = "prettier";
1496
+ constructor(options = {}) {
1497
+ super(options);
1498
+ }
1499
+ async _rules() {
1500
+ return [
1501
+ this.createRuleConfig("rules", {
1502
+ ...eslint_config_prettier_default,
1503
+ rules: {
1504
+ ...eslint_config_prettier_default.rules,
1505
+ ...this.options.overrides
1506
+ }
1507
+ })
1508
+ ];
1509
+ }
1510
+ };
2108
1511
 
2109
1512
  // src/configs/react.ts
2110
- init_esm_shims();
2111
1513
  import { isPackageExists as isPackageExists2 } from "local-pkg";
2112
1514
  var REACT_REFRESH_ALLOW_CONSTANT_EXPORT_PACKAGES = ["vite"];
2113
1515
  var REACT_ROUTER_PACKAGES = [
@@ -2116,172 +1518,195 @@ var REACT_ROUTER_PACKAGES = [
2116
1518
  "@react-router/serve",
2117
1519
  "@react-router/dev"
2118
1520
  ];
2119
- var NAMESPACE14 = "exbotanical/react";
2120
- async function react({
2121
- files = [GLOB_SRC],
2122
- filesTypeAware = [GLOB_TS, GLOB_TSX],
2123
- ignoresTypeAware = [],
2124
- overrides = {},
2125
- tsconfigPath
2126
- }) {
2127
- const isTypeAware = !!tsconfigPath;
2128
- const typeAwareRules = {
2129
- "react/no-leaked-conditional-rendering": "warn"
2130
- };
2131
- const [pluginReact, pluginReactHooks, pluginReactRefresh] = await Promise.all(
2132
- [
1521
+ var ReactConfig = class extends CustomConfig {
1522
+ namespace = "react";
1523
+ constructor({
1524
+ files = [GLOB_SRC],
1525
+ filesTypeAware = [GLOB_TS, GLOB_TSX],
1526
+ ignoresTypeAware = [],
1527
+ tsconfigPath,
1528
+ ...rest
1529
+ } = {}) {
1530
+ super({
1531
+ files,
1532
+ filesTypeAware,
1533
+ ignoresTypeAware,
1534
+ tsconfigPath,
1535
+ ...rest
1536
+ });
1537
+ }
1538
+ async _rules() {
1539
+ const {
1540
+ files = [GLOB_SRC],
1541
+ filesTypeAware = [GLOB_TS, GLOB_TSX],
1542
+ ignoresTypeAware = [],
1543
+ tsconfigPath,
1544
+ overrides = {}
1545
+ } = this.options;
1546
+ const isTypeAware = !!tsconfigPath;
1547
+ const typeAwareRules = {
1548
+ "react/no-leaked-conditional-rendering": "warn"
1549
+ };
1550
+ const [pluginReact, pluginReactHooks, pluginReactRefresh] = await Promise.all([
2133
1551
  interopDefault(import("@eslint-react/eslint-plugin")),
2134
1552
  interopDefault(import("eslint-plugin-react-hooks")),
2135
1553
  interopDefault(import("eslint-plugin-react-refresh"))
2136
- ]
2137
- );
2138
- const isAllowConstantExport = REACT_REFRESH_ALLOW_CONSTANT_EXPORT_PACKAGES.some((index) => isPackageExists2(index));
2139
- const isUsingReactRouter = REACT_ROUTER_PACKAGES.some((index) => isPackageExists2(index));
2140
- const plugins = pluginReact.configs.all.plugins;
2141
- return [
2142
- {
2143
- name: `${NAMESPACE14}/setup`,
2144
- plugins: {
2145
- "react": plugins["@eslint-react"],
2146
- "react-dom": plugins["@eslint-react/dom"],
2147
- "react-hooks": pluginReactHooks,
2148
- "react-hooks-extra": plugins["@eslint-react/hooks-extra"],
2149
- "react-naming-convention": plugins["@eslint-react/naming-convention"],
2150
- "react-refresh": pluginReactRefresh,
2151
- "react-web-api": plugins["@eslint-react/web-api"]
2152
- }
2153
- },
2154
- {
2155
- name: `${NAMESPACE14}/rules`,
2156
- files,
2157
- languageOptions: {
2158
- parserOptions: {
2159
- ecmaFeatures: {
2160
- jsx: true
2161
- }
1554
+ ]);
1555
+ const isAllowConstantExport = REACT_REFRESH_ALLOW_CONSTANT_EXPORT_PACKAGES.some(
1556
+ (index) => isPackageExists2(index)
1557
+ );
1558
+ const isUsingReactRouter = REACT_ROUTER_PACKAGES.some((index) => isPackageExists2(index));
1559
+ const plugins = pluginReact.configs.all.plugins;
1560
+ return [
1561
+ this.createRuleConfig("setup", {
1562
+ plugins: {
1563
+ "react": plugins["@eslint-react"],
1564
+ "react-dom": plugins["@eslint-react/dom"],
1565
+ "react-hooks": pluginReactHooks,
1566
+ "react-hooks-extra": plugins["@eslint-react/hooks-extra"],
1567
+ "react-naming-convention": plugins["@eslint-react/naming-convention"],
1568
+ "react-refresh": pluginReactRefresh,
1569
+ "react-web-api": plugins["@eslint-react/web-api"]
1570
+ }
1571
+ }),
1572
+ this.createRuleConfig("rules", {
1573
+ files,
1574
+ languageOptions: {
1575
+ parserOptions: {
1576
+ ecmaFeatures: {
1577
+ jsx: true
1578
+ }
1579
+ },
1580
+ sourceType: "module"
2162
1581
  },
2163
- sourceType: "module"
2164
- },
2165
- rules: {
2166
- // Recommended rules from @eslint-react/dom
2167
- "react-dom/no-children-in-void-dom-elements": "warn",
2168
- "react-dom/no-dangerously-set-innerhtml": "warn",
2169
- "react-dom/no-dangerously-set-innerhtml-with-children": "error",
2170
- "react-dom/no-find-dom-node": "error",
2171
- "react-dom/no-missing-button-type": "warn",
2172
- "react-dom/no-missing-iframe-sandbox": "warn",
2173
- "react-dom/no-namespace": "error",
2174
- "react-dom/no-render-return-value": "error",
2175
- "react-dom/no-script-url": "warn",
2176
- "react-dom/no-unsafe-iframe-sandbox": "warn",
2177
- "react-dom/no-unsafe-target-blank": "warn",
2178
- // Recommended rules react-hooks
2179
- "react-hooks/exhaustive-deps": "warn",
2180
- "react-hooks/rules-of-hooks": "error",
2181
- // React refresh
2182
- "react-refresh/only-export-components": [
2183
- "warn",
2184
- {
2185
- allowConstantExport: isAllowConstantExport,
2186
- allowExportNames: [
2187
- ...isUsingReactRouter ? ["meta", "links", "headers", "loader", "action"] : []
2188
- ]
2189
- }
2190
- ],
2191
- // Recommended rules from @eslint-react/web-api
2192
- "react-web-api/no-leaked-event-listener": "warn",
2193
- "react-web-api/no-leaked-interval": "warn",
2194
- "react-web-api/no-leaked-resize-observer": "warn",
2195
- "react-web-api/no-leaked-timeout": "warn",
2196
- // Recommended rules from @eslint-react
2197
- "react/ensure-forward-ref-using-ref": "warn",
2198
- "react/jsx-no-duplicate-props": "warn",
2199
- "react/jsx-uses-vars": "warn",
2200
- "react/no-access-state-in-setstate": "error",
2201
- "react/no-array-index-key": "warn",
2202
- "react/no-children-count": "warn",
2203
- "react/no-children-for-each": "warn",
2204
- "react/no-children-map": "warn",
2205
- "react/no-children-only": "warn",
2206
- "react/no-children-to-array": "warn",
2207
- "react/no-clone-element": "warn",
2208
- "react/no-comment-textnodes": "warn",
2209
- "react/no-component-will-mount": "error",
2210
- "react/no-component-will-receive-props": "error",
2211
- "react/no-component-will-update": "error",
2212
- "react/no-context-provider": "warn",
2213
- "react/no-create-ref": "error",
2214
- "react/no-default-props": "error",
2215
- "react/no-direct-mutation-state": "error",
2216
- "react/no-duplicate-key": "error",
2217
- "react/no-forward-ref": "warn",
2218
- "react/no-implicit-key": "warn",
2219
- "react/no-missing-key": "error",
2220
- "react/no-nested-components": "error",
2221
- "react/no-prop-types": "error",
2222
- "react/no-redundant-should-component-update": "error",
2223
- "react/no-set-state-in-component-did-mount": "warn",
2224
- "react/no-set-state-in-component-did-update": "warn",
2225
- "react/no-set-state-in-component-will-update": "warn",
2226
- "react/no-string-refs": "error",
2227
- "react/no-unsafe-component-will-mount": "warn",
2228
- "react/no-unsafe-component-will-receive-props": "warn",
2229
- "react/no-unsafe-component-will-update": "warn",
2230
- "react/no-unstable-context-value": "warn",
2231
- "react/no-unstable-default-props": "warn",
2232
- "react/no-unused-class-component-members": "warn",
2233
- "react/no-unused-state": "warn",
2234
- "react/prefer-destructuring-assignment": "warn",
2235
- "react/prefer-shorthand-boolean": "warn",
2236
- "react/prefer-shorthand-fragment": "warn",
2237
- ...overrides
2238
- }
2239
- },
2240
- ...isTypeAware ? [
2241
- {
2242
- name: `${NAMESPACE14}/type-aware-rules`,
2243
- files: filesTypeAware,
2244
- ignores: ignoresTypeAware,
2245
1582
  rules: {
2246
- ...typeAwareRules
1583
+ // Recommended rules from @eslint-react/dom
1584
+ "react-dom/no-children-in-void-dom-elements": "warn",
1585
+ "react-dom/no-dangerously-set-innerhtml": "warn",
1586
+ "react-dom/no-dangerously-set-innerhtml-with-children": "error",
1587
+ "react-dom/no-find-dom-node": "error",
1588
+ "react-dom/no-missing-button-type": "warn",
1589
+ "react-dom/no-missing-iframe-sandbox": "warn",
1590
+ "react-dom/no-namespace": "error",
1591
+ "react-dom/no-render-return-value": "error",
1592
+ "react-dom/no-script-url": "warn",
1593
+ "react-dom/no-unsafe-iframe-sandbox": "warn",
1594
+ "react-dom/no-unsafe-target-blank": "warn",
1595
+ // Recommended rules react-hooks
1596
+ "react-hooks/exhaustive-deps": "warn",
1597
+ "react-hooks/rules-of-hooks": "error",
1598
+ // React refresh
1599
+ "react-refresh/only-export-components": [
1600
+ "warn",
1601
+ {
1602
+ allowConstantExport: isAllowConstantExport,
1603
+ allowExportNames: [
1604
+ ...isUsingReactRouter ? ["meta", "links", "headers", "loader", "action"] : []
1605
+ ]
1606
+ }
1607
+ ],
1608
+ // Recommended rules from @eslint-react/web-api
1609
+ "react-web-api/no-leaked-event-listener": "warn",
1610
+ "react-web-api/no-leaked-interval": "warn",
1611
+ "react-web-api/no-leaked-resize-observer": "warn",
1612
+ "react-web-api/no-leaked-timeout": "warn",
1613
+ // Recommended rules from @eslint-react
1614
+ "react/ensure-forward-ref-using-ref": "warn",
1615
+ "react/jsx-no-duplicate-props": "warn",
1616
+ "react/jsx-uses-vars": "warn",
1617
+ "react/no-access-state-in-setstate": "error",
1618
+ "react/no-array-index-key": "warn",
1619
+ "react/no-children-count": "warn",
1620
+ "react/no-children-for-each": "warn",
1621
+ "react/no-children-map": "warn",
1622
+ "react/no-children-only": "warn",
1623
+ "react/no-children-to-array": "warn",
1624
+ "react/no-clone-element": "warn",
1625
+ "react/no-comment-textnodes": "warn",
1626
+ "react/no-component-will-mount": "error",
1627
+ "react/no-component-will-receive-props": "error",
1628
+ "react/no-component-will-update": "error",
1629
+ "react/no-context-provider": "warn",
1630
+ "react/no-create-ref": "error",
1631
+ "react/no-default-props": "error",
1632
+ "react/no-direct-mutation-state": "error",
1633
+ "react/no-duplicate-key": "error",
1634
+ "react/no-forward-ref": "warn",
1635
+ "react/no-implicit-key": "warn",
1636
+ "react/no-missing-key": "error",
1637
+ "react/no-nested-components": "error",
1638
+ "react/no-prop-types": "error",
1639
+ "react/no-redundant-should-component-update": "error",
1640
+ "react/no-set-state-in-component-did-mount": "warn",
1641
+ "react/no-set-state-in-component-did-update": "warn",
1642
+ "react/no-set-state-in-component-will-update": "warn",
1643
+ "react/no-string-refs": "error",
1644
+ "react/no-unsafe-component-will-mount": "warn",
1645
+ "react/no-unsafe-component-will-receive-props": "warn",
1646
+ "react/no-unsafe-component-will-update": "warn",
1647
+ "react/no-unstable-context-value": "warn",
1648
+ "react/no-unstable-default-props": "warn",
1649
+ "react/no-unused-class-component-members": "warn",
1650
+ "react/no-unused-state": "warn",
1651
+ "react/prefer-destructuring-assignment": "warn",
1652
+ "react/prefer-shorthand-boolean": "warn",
1653
+ "react/prefer-shorthand-fragment": "warn",
1654
+ ...overrides
2247
1655
  }
2248
- }
2249
- ] : []
2250
- ];
2251
- }
1656
+ }),
1657
+ ...isTypeAware ? [
1658
+ this.createRuleConfig("type-aware-rules", {
1659
+ files: filesTypeAware,
1660
+ ignores: ignoresTypeAware,
1661
+ rules: {
1662
+ ...typeAwareRules
1663
+ }
1664
+ })
1665
+ ] : []
1666
+ ];
1667
+ }
1668
+ };
2252
1669
 
2253
1670
  // src/configs/regexpr.ts
2254
- init_esm_shims();
2255
1671
  import { configs } from "eslint-plugin-regexp";
2256
- var NAMESPACE15 = "exbotanical/regexpr";
2257
- async function regexpr({
2258
- level = "error",
2259
- overrides = {}
2260
- } = {}) {
2261
- const config = configs["flat/recommended"];
2262
- const rules = {
2263
- ...config.rules
2264
- };
2265
- if (level === "warn") {
2266
- for (const key in rules) {
2267
- if (rules[key] === "error") rules[key] = "warn";
2268
- }
1672
+ var RegexprConfig = class extends CustomConfig {
1673
+ namespace = "regexpr";
1674
+ constructor({ level = "error", ...rest } = {}) {
1675
+ super({
1676
+ level,
1677
+ ...rest
1678
+ });
2269
1679
  }
2270
- return [
2271
- {
2272
- ...config,
2273
- name: `${NAMESPACE15}/rules`,
2274
- rules: {
2275
- ...rules,
2276
- ...overrides
1680
+ async _rules() {
1681
+ const { level = "error", overrides = {} } = this.options;
1682
+ const config = configs["flat/recommended"];
1683
+ const rules = {
1684
+ ...config.rules
1685
+ };
1686
+ if (level === "warn") {
1687
+ for (const key in rules) {
1688
+ if (rules[key] === "error") rules[key] = "warn";
2277
1689
  }
2278
1690
  }
2279
- ];
2280
- }
1691
+ return [
1692
+ this.createRuleConfig("rules", {
1693
+ ...config,
1694
+ files: GLOB_SCRIPTS,
1695
+ rules: {
1696
+ ...rules,
1697
+ "regexp/prefer-quantifier": level,
1698
+ "regexp/prefer-regexp-test": level,
1699
+ "regexp/sort-alternatives": level,
1700
+ "regexp/sort-character-class-elements": level,
1701
+ "regexp/unicode-property": level,
1702
+ ...overrides
1703
+ }
1704
+ })
1705
+ ];
1706
+ }
1707
+ };
2281
1708
 
2282
1709
  // src/configs/test.ts
2283
- init_esm_shims();
2284
- var import_flat = __toESM(require_flat(), 1);
2285
1710
  var PLUGIN_RUNNER_MAP = {
2286
1711
  tap: [
2287
1712
  "eslint-plugin-tap",
@@ -2316,634 +1741,714 @@ var PLUGIN_RUNNER_MAP = {
2316
1741
  })
2317
1742
  ]
2318
1743
  };
2319
- var NAMESPACE16 = "exbotanical/test";
2320
- async function test({
2321
- runner = "vitest",
2322
- cypress = false,
2323
- files = GLOB_TESTS,
2324
- overrides = {}
2325
- }) {
2326
- const [plugin4, rules] = PLUGIN_RUNNER_MAP[runner];
2327
- const [pluginRunner, pluginNoOnlyTests] = await Promise.all([
2328
- interopDefault(import(plugin4)),
2329
- // @ts-expect-error no types
2330
- interopDefault(import("eslint-plugin-no-only-tests"))
2331
- ]);
2332
- const extraConfigs = [];
2333
- if (cypress) {
2334
- extraConfigs.push({
2335
- name: `${NAMESPACE16}/cypress/rules`,
2336
- ...import_flat.default.configs.recommended,
2337
- ...typeof cypress === "boolean" ? {} : cypress
1744
+ var TestConfig = class extends CustomConfig {
1745
+ namespace = "test";
1746
+ constructor({
1747
+ runner = "vitest",
1748
+ cypress = false,
1749
+ files = GLOB_TESTS,
1750
+ ...rest
1751
+ } = {}) {
1752
+ super({
1753
+ runner,
1754
+ cypress,
1755
+ files,
1756
+ ...rest
2338
1757
  });
2339
1758
  }
2340
- return [
2341
- {
2342
- name: `${NAMESPACE16}/setup`,
2343
- plugins: {
2344
- test: {
2345
- ...pluginRunner,
1759
+ async _rules() {
1760
+ const {
1761
+ runner = "vitest",
1762
+ cypress = false,
1763
+ files = GLOB_TESTS,
1764
+ overrides = {}
1765
+ } = this.options;
1766
+ const [plugin4, rules] = PLUGIN_RUNNER_MAP[runner];
1767
+ const [pluginRunner, pluginNoOnlyTests] = await Promise.all([
1768
+ interopDefault(import(plugin4)),
1769
+ // @ts-expect-error no types
1770
+ interopDefault(import("eslint-plugin-no-only-tests"))
1771
+ ]);
1772
+ const extraConfigs = [];
1773
+ if (cypress) {
1774
+ const pluginCypress = await interopDefault(import("eslint-plugin-cypress/flat"));
1775
+ extraConfigs.push(
1776
+ this.createRuleConfig("cypress/rules", {
1777
+ ...pluginCypress.configs.recommended,
1778
+ ...typeof cypress === "boolean" ? {} : cypress
1779
+ })
1780
+ );
1781
+ }
1782
+ return [
1783
+ this.createRuleConfig("setup", {
1784
+ plugins: {
1785
+ test: {
1786
+ ...pluginRunner,
1787
+ rules: {
1788
+ ...pluginNoOnlyTests.rules,
1789
+ ...rules(pluginRunner)
1790
+ }
1791
+ }
1792
+ }
1793
+ }),
1794
+ ...runner === "jest" ? [
1795
+ this.createRuleConfig("jest", {
1796
+ ...cypress && typeof cypress !== "boolean" ? { ignores: [...cypress.files ?? []] } : {},
1797
+ ...pluginRunner.configs["flat/recommended"],
2346
1798
  rules: {
2347
- ...pluginNoOnlyTests.rules,
2348
- ...rules(pluginRunner)
1799
+ ...pluginRunner.configs["flat/recommended"].rules
2349
1800
  }
1801
+ })
1802
+ ] : [],
1803
+ this.createRuleConfig("rules", {
1804
+ files,
1805
+ rules: {
1806
+ "test/no-only-tests": "error",
1807
+ ...overrides
2350
1808
  }
2351
- }
2352
- },
2353
- runner === "jest" ? {
2354
- name: `${NAMESPACE16}/jest`,
2355
- ...cypress && typeof cypress !== "boolean" ? { ignores: [...cypress.files ?? []] } : {},
2356
- ...pluginRunner.configs["flat/recommended"],
2357
- rules: {
2358
- ...pluginRunner.configs["flat/recommended"].rules
2359
- }
2360
- } : {},
2361
- {
2362
- name: `${NAMESPACE16}/rules`,
2363
- files,
2364
- rules: {
2365
- ...overrides
2366
- }
2367
- },
2368
- ...extraConfigs
2369
- ];
2370
- }
1809
+ }),
1810
+ ...extraConfigs
1811
+ ];
1812
+ }
1813
+ };
2371
1814
 
2372
1815
  // src/configs/toml.ts
2373
- init_esm_shims();
2374
- var NAMESPACE17 = "exbotanical/toml";
2375
- async function toml({ files = [GLOB_TOML], overrides = {} } = {}, { indent } = STYLE_DEFAULTS) {
2376
- const [plugin4, parser] = await Promise.all([
2377
- interopDefault(import("eslint-plugin-toml")),
2378
- interopDefault(import("toml-eslint-parser"))
2379
- ]);
2380
- return [
2381
- {
2382
- name: `${NAMESPACE17}/setup`,
2383
- plugins: {
2384
- toml: plugin4
2385
- }
2386
- },
2387
- {
2388
- name: `${NAMESPACE17}/rules`,
1816
+ var TomlConfig = class extends CustomConfig {
1817
+ namespace = "toml";
1818
+ constructor({
1819
+ files = [GLOB_TOML],
1820
+ indent = STYLE_DEFAULTS.indent,
1821
+ ...rest
1822
+ } = {}) {
1823
+ super({
2389
1824
  files,
2390
- languageOptions: {
2391
- parser
2392
- },
2393
- rules: {
2394
- "style/spaced-comment": "off",
2395
- "toml/comma-style": "error",
2396
- "toml/keys-order": "error",
2397
- "toml/no-space-dots": "error",
2398
- "toml/no-unreadable-number-separator": "error",
2399
- "toml/precision-of-fractional-seconds": "error",
2400
- "toml/precision-of-integer": "error",
2401
- "toml/tables-order": "error",
2402
- "toml/vue-custom-block/no-parsing-error": "error",
2403
- "toml/array-bracket-newline": "error",
2404
- "toml/array-bracket-spacing": "error",
2405
- "toml/array-element-newline": "error",
2406
- "toml/indent": ["error", indent === "tab" ? 2 : indent],
2407
- "toml/inline-table-curly-spacing": "error",
2408
- "toml/key-spacing": "error",
2409
- "toml/padding-line-between-pairs": "error",
2410
- "toml/padding-line-between-tables": "error",
2411
- "toml/quoted-keys": "error",
2412
- "toml/spaced-comment": "error",
2413
- "toml/table-bracket-spacing": "error",
2414
- ...overrides
2415
- }
2416
- }
2417
- ];
2418
- }
1825
+ indent,
1826
+ ...rest
1827
+ });
1828
+ }
1829
+ async _rules() {
1830
+ const {
1831
+ files = [GLOB_TOML],
1832
+ overrides = {},
1833
+ indent = STYLE_DEFAULTS.indent
1834
+ } = this.options;
1835
+ const [plugin4, parser] = await Promise.all([
1836
+ interopDefault(import("eslint-plugin-toml")),
1837
+ interopDefault(import("toml-eslint-parser"))
1838
+ ]);
1839
+ return [
1840
+ this.createRuleConfig("setup", {
1841
+ plugins: {
1842
+ toml: plugin4
1843
+ }
1844
+ }),
1845
+ this.createRuleConfig("rules", {
1846
+ files,
1847
+ languageOptions: {
1848
+ parser
1849
+ },
1850
+ rules: {
1851
+ "style/spaced-comment": "off",
1852
+ "toml/comma-style": "error",
1853
+ "toml/keys-order": "error",
1854
+ "toml/no-space-dots": "error",
1855
+ "toml/no-unreadable-number-separator": "error",
1856
+ "toml/precision-of-fractional-seconds": "error",
1857
+ "toml/precision-of-integer": "error",
1858
+ "toml/tables-order": "error",
1859
+ "toml/vue-custom-block/no-parsing-error": "error",
1860
+ "toml/array-bracket-newline": "error",
1861
+ "toml/array-bracket-spacing": "error",
1862
+ "toml/array-element-newline": "error",
1863
+ "toml/indent": ["error", indent === "tab" ? 2 : indent],
1864
+ "toml/inline-table-curly-spacing": "error",
1865
+ "toml/key-spacing": "error",
1866
+ "toml/padding-line-between-pairs": "error",
1867
+ "toml/padding-line-between-tables": "error",
1868
+ "toml/quoted-keys": "error",
1869
+ "toml/spaced-comment": "error",
1870
+ "toml/table-bracket-spacing": "error",
1871
+ ...overrides
1872
+ }
1873
+ })
1874
+ ];
1875
+ }
1876
+ };
2419
1877
 
2420
1878
  // src/configs/tsconfig.ts
2421
- init_esm_shims();
2422
- var NAMESPACE18 = "exbotanical/tsconfig";
2423
- async function tsconfig() {
2424
- return [
2425
- {
2426
- name: `${NAMESPACE18}/rules`,
2427
- files: ["**/tsconfig.json", "**/tsconfig.*.json"],
2428
- rules: {
2429
- "jsonc/sort-keys": [
2430
- "error",
2431
- {
2432
- order: [
2433
- "extends",
2434
- "compilerOptions",
2435
- "references",
2436
- "files",
2437
- "include",
2438
- "exclude"
2439
- ],
2440
- pathPattern: "^$"
2441
- },
2442
- {
2443
- order: [
2444
- /* Projects */
2445
- "incremental",
2446
- "composite",
2447
- "tsBuildInfoFile",
2448
- "disableSourceOfProjectReferenceRedirect",
2449
- "disableSolutionSearching",
2450
- "disableReferencedProjectLoad",
2451
- /* Language and Environment */
2452
- "target",
2453
- "jsx",
2454
- "jsxFactory",
2455
- "jsxFragmentFactory",
2456
- "jsxImportSource",
2457
- "lib",
2458
- "moduleDetection",
2459
- "noLib",
2460
- "reactNamespace",
2461
- "useDefineForClassFields",
2462
- "emitDecoratorMetadata",
2463
- "experimentalDecorators",
2464
- /* Modules */
2465
- "baseUrl",
2466
- "rootDir",
2467
- "rootDirs",
2468
- "customConditions",
2469
- "module",
2470
- "moduleResolution",
2471
- "moduleSuffixes",
2472
- "noResolve",
2473
- "paths",
2474
- "resolveJsonModule",
2475
- "resolvePackageJsonExports",
2476
- "resolvePackageJsonImports",
2477
- "typeRoots",
2478
- "types",
2479
- "allowArbitraryExtensions",
2480
- "allowImportingTsExtensions",
2481
- "allowUmdGlobalAccess",
2482
- /* JavaScript Support */
2483
- "allowJs",
2484
- "checkJs",
2485
- "maxNodeModuleJsDepth",
2486
- /* Type Checking */
2487
- "strict",
2488
- "strictBindCallApply",
2489
- "strictFunctionTypes",
2490
- "strictNullChecks",
2491
- "strictPropertyInitialization",
2492
- "allowUnreachableCode",
2493
- "allowUnusedLabels",
2494
- "alwaysStrict",
2495
- "exactOptionalPropertyTypes",
2496
- "noFallthroughCasesInSwitch",
2497
- "noImplicitAny",
2498
- "noImplicitOverride",
2499
- "noImplicitReturns",
2500
- "noImplicitThis",
2501
- "noPropertyAccessFromIndexSignature",
2502
- "noUncheckedIndexedAccess",
2503
- "noUnusedLocals",
2504
- "noUnusedParameters",
2505
- "useUnknownInCatchVariables",
2506
- /* Emit */
2507
- "declaration",
2508
- "declarationDir",
2509
- "declarationMap",
2510
- "downlevelIteration",
2511
- "emitBOM",
2512
- "emitDeclarationOnly",
2513
- "importHelpers",
2514
- "importsNotUsedAsValues",
2515
- "inlineSourceMap",
2516
- "inlineSources",
2517
- "mapRoot",
2518
- "newLine",
2519
- "noEmit",
2520
- "noEmitHelpers",
2521
- "noEmitOnError",
2522
- "outDir",
2523
- "outFile",
2524
- "preserveConstEnums",
2525
- "preserveValueImports",
2526
- "removeComments",
2527
- "sourceMap",
2528
- "sourceRoot",
2529
- "stripInternal",
2530
- /* Interop Constraints */
2531
- "allowSyntheticDefaultImports",
2532
- "esModuleInterop",
2533
- "forceConsistentCasingInFileNames",
2534
- "isolatedDeclarations",
2535
- "isolatedModules",
2536
- "preserveSymlinks",
2537
- "verbatimModuleSyntax",
2538
- /* Completeness */
2539
- "skipDefaultLibCheck",
2540
- "skipLibCheck"
2541
- ],
2542
- pathPattern: "^compilerOptions$"
2543
- }
2544
- ]
2545
- }
2546
- }
2547
- ];
2548
- }
1879
+ var TsconfigConfig = class extends CustomConfig {
1880
+ namespace = "tsconfig";
1881
+ constructor(options = {}) {
1882
+ super(options);
1883
+ }
1884
+ async _rules() {
1885
+ return [
1886
+ this.createRuleConfig("rules", {
1887
+ files: ["**/tsconfig.json", "**/tsconfig.*.json"],
1888
+ rules: {
1889
+ "jsonc/sort-keys": [
1890
+ "error",
1891
+ {
1892
+ order: [
1893
+ "extends",
1894
+ "compilerOptions",
1895
+ "references",
1896
+ "files",
1897
+ "include",
1898
+ "exclude"
1899
+ ],
1900
+ pathPattern: "^$"
1901
+ },
1902
+ {
1903
+ order: [
1904
+ /* Projects */
1905
+ "incremental",
1906
+ "composite",
1907
+ "tsBuildInfoFile",
1908
+ "disableSourceOfProjectReferenceRedirect",
1909
+ "disableSolutionSearching",
1910
+ "disableReferencedProjectLoad",
1911
+ /* Language and Environment */
1912
+ "target",
1913
+ "jsx",
1914
+ "jsxFactory",
1915
+ "jsxFragmentFactory",
1916
+ "jsxImportSource",
1917
+ "lib",
1918
+ "moduleDetection",
1919
+ "noLib",
1920
+ "reactNamespace",
1921
+ "useDefineForClassFields",
1922
+ "emitDecoratorMetadata",
1923
+ "experimentalDecorators",
1924
+ /* Modules */
1925
+ "baseUrl",
1926
+ "rootDir",
1927
+ "rootDirs",
1928
+ "customConditions",
1929
+ "module",
1930
+ "moduleResolution",
1931
+ "moduleSuffixes",
1932
+ "noResolve",
1933
+ "paths",
1934
+ "resolveJsonModule",
1935
+ "resolvePackageJsonExports",
1936
+ "resolvePackageJsonImports",
1937
+ "typeRoots",
1938
+ "types",
1939
+ "allowArbitraryExtensions",
1940
+ "allowImportingTsExtensions",
1941
+ "allowUmdGlobalAccess",
1942
+ /* JavaScript Support */
1943
+ "allowJs",
1944
+ "checkJs",
1945
+ "maxNodeModuleJsDepth",
1946
+ /* Type Checking */
1947
+ "strict",
1948
+ "strictBindCallApply",
1949
+ "strictFunctionTypes",
1950
+ "strictNullChecks",
1951
+ "strictPropertyInitialization",
1952
+ "allowUnreachableCode",
1953
+ "allowUnusedLabels",
1954
+ "alwaysStrict",
1955
+ "exactOptionalPropertyTypes",
1956
+ "noFallthroughCasesInSwitch",
1957
+ "noImplicitAny",
1958
+ "noImplicitOverride",
1959
+ "noImplicitReturns",
1960
+ "noImplicitThis",
1961
+ "noPropertyAccessFromIndexSignature",
1962
+ "noUncheckedIndexedAccess",
1963
+ "noUnusedLocals",
1964
+ "noUnusedParameters",
1965
+ "useUnknownInCatchVariables",
1966
+ /* Emit */
1967
+ "declaration",
1968
+ "declarationDir",
1969
+ "declarationMap",
1970
+ "downlevelIteration",
1971
+ "emitBOM",
1972
+ "emitDeclarationOnly",
1973
+ "importHelpers",
1974
+ "importsNotUsedAsValues",
1975
+ "inlineSourceMap",
1976
+ "inlineSources",
1977
+ "mapRoot",
1978
+ "newLine",
1979
+ "noEmit",
1980
+ "noEmitHelpers",
1981
+ "noEmitOnError",
1982
+ "outDir",
1983
+ "outFile",
1984
+ "preserveConstEnums",
1985
+ "preserveValueImports",
1986
+ "removeComments",
1987
+ "sourceMap",
1988
+ "sourceRoot",
1989
+ "stripInternal",
1990
+ /* Interop Constraints */
1991
+ "allowSyntheticDefaultImports",
1992
+ "esModuleInterop",
1993
+ "forceConsistentCasingInFileNames",
1994
+ "isolatedDeclarations",
1995
+ "isolatedModules",
1996
+ "preserveSymlinks",
1997
+ "verbatimModuleSyntax",
1998
+ /* Completeness */
1999
+ "skipDefaultLibCheck",
2000
+ "skipLibCheck"
2001
+ ],
2002
+ pathPattern: "^compilerOptions$"
2003
+ }
2004
+ ],
2005
+ ...this.options.overrides
2006
+ }
2007
+ })
2008
+ ];
2009
+ }
2010
+ };
2549
2011
 
2550
2012
  // src/configs/typescript.ts
2551
- init_esm_shims();
2552
- var NAMESPACE19 = "exbotanical/typescript";
2553
- async function typescript(options = {}) {
2554
- const {
2555
- type = "app",
2013
+ var TypescriptConfig = class extends CustomConfig {
2014
+ namespace = "typescript";
2015
+ constructor({
2556
2016
  parserOptions = {},
2557
- overrides = {},
2558
2017
  typeAwareOverrides = {},
2559
- ignoresTypeAware = []
2560
- } = options;
2561
- const files = options.files ?? [GLOB_TS, GLOB_TSX];
2562
- const filesTypeAware = options.filesTypeAware ?? [GLOB_TS, GLOB_TSX];
2563
- const tsconfigPath = options?.tsconfigPath;
2564
- const isTypeAware = !!tsconfigPath;
2565
- const typeAwareRules = {
2566
- "dot-notation": ["off"],
2567
- "no-implied-eval": ["off"],
2568
- "ts/await-thenable": ["error"],
2569
- "ts/dot-notation": ["error", { allowKeywords: true }],
2570
- "ts/no-floating-promises": ["error"],
2571
- "ts/no-for-in-array": ["error"],
2572
- "ts/no-implied-eval": ["error"],
2573
- "ts/no-misused-promises": ["error"],
2574
- "ts/no-unnecessary-type-assertion": ["error"],
2575
- "ts/no-unsafe-argument": ["error"],
2576
- "ts/no-unsafe-assignment": ["error"],
2577
- "ts/no-unsafe-call": ["error"],
2578
- "ts/no-unsafe-member-access": ["error"],
2579
- "ts/no-unsafe-return": ["error"],
2580
- "ts/promise-function-async": ["error"],
2581
- "ts/restrict-plus-operands": ["error"],
2582
- "ts/restrict-template-expressions": ["error"],
2583
- "ts/return-await": ["error", "in-try-catch"],
2584
- "ts/strict-boolean-expressions": [
2585
- "error",
2586
- { allowNullableBoolean: true, allowNullableObject: true }
2587
- ],
2588
- "ts/switch-exhaustiveness-check": ["error"],
2589
- "ts/unbound-method": ["error"]
2590
- };
2591
- const [plugin4, parser] = await Promise.all([
2592
- interopDefault(import("@typescript-eslint/eslint-plugin")),
2593
- interopDefault(import("@typescript-eslint/parser"))
2594
- ]);
2595
- function makeParser(typeAware, files2, ignores2 = []) {
2596
- return {
2597
- name: `${NAMESPACE19}/${typeAware ? "type-aware-parser" : "parser"}`,
2598
- files: files2,
2599
- ignores: ignores2,
2600
- languageOptions: {
2601
- parser,
2602
- parserOptions: {
2603
- sourceType: "module",
2604
- ...typeAware ? {
2605
- projectService: {
2606
- allowDefaultProject: ["./*.js"],
2607
- defaultProject: tsconfigPath
2608
- },
2609
- tsconfigRootDir: process.cwd()
2610
- } : {},
2611
- ...parserOptions
2612
- }
2613
- }
2614
- };
2018
+ ignoresTypeAware = [],
2019
+ ...rest
2020
+ } = {}) {
2021
+ super({
2022
+ parserOptions,
2023
+ typeAwareOverrides,
2024
+ ignoresTypeAware,
2025
+ ...rest
2026
+ });
2615
2027
  }
2616
- return [
2617
- {
2618
- name: `${NAMESPACE19}/setup`,
2619
- plugins: {
2620
- ts: plugin4
2621
- }
2622
- },
2623
- makeParser(false, files),
2624
- ...isTypeAware ? [makeParser(true, filesTypeAware, ignoresTypeAware)] : [],
2625
- {
2626
- name: `${NAMESPACE19}/rules`,
2627
- files,
2628
- rules: {
2629
- ...renameRules(
2630
- plugin4.configs["eslint-recommended"].overrides[0].rules,
2631
- { "@typescript-eslint": "ts" }
2632
- ),
2633
- ...renameRules(plugin4.configs.strict.rules, {
2634
- "@typescript-eslint": "ts"
2635
- }),
2636
- "no-dupe-class-members": ["off"],
2637
- "no-redeclare": ["off"],
2638
- "no-use-before-define": ["off"],
2639
- "no-useless-constructor": ["off"],
2640
- "ts/ban-ts-comment": [
2641
- "error",
2642
- { "ts-expect-error": "allow-with-description" }
2643
- ],
2644
- "ts/consistent-type-definitions": ["error", "interface"],
2645
- "ts/consistent-type-imports": [
2646
- "error",
2647
- {
2648
- disallowTypeAnnotations: false,
2649
- fixStyle: "separate-type-imports",
2650
- prefer: "type-imports"
2651
- }
2652
- ],
2653
- // See: https://www.totaltypescript.com/method-shorthand-syntax-considered-harmful
2654
- "ts/method-signature-style": ["error", "property"],
2655
- "ts/no-dupe-class-members": ["error"],
2656
- "ts/no-dynamic-delete": ["off"],
2657
- "ts/no-empty-object-type": ["error", { allowInterfaces: "always" }],
2658
- "ts/no-explicit-any": ["warn"],
2659
- "ts/no-extraneous-class": ["off"],
2660
- "ts/no-import-type-side-effects": ["error"],
2661
- "ts/no-invalid-void-type": ["error"],
2662
- "ts/no-non-null-assertion": ["error"],
2663
- "ts/no-redeclare": ["error", { builtinGlobals: false }],
2664
- "ts/no-require-imports": ["error"],
2665
- "ts/no-unused-expressions": [
2666
- "error",
2667
- {
2668
- allowShortCircuit: true,
2669
- allowTaggedTemplates: true,
2670
- allowTernary: true
2671
- }
2672
- ],
2673
- "ts/no-unused-vars": [
2674
- "error",
2675
- {
2676
- vars: "all",
2677
- args: "all",
2678
- argsIgnorePattern: VAR_IGNORE_PATTERN,
2679
- caughtErrorsIgnorePattern: VAR_IGNORE_PATTERN,
2680
- destructuredArrayIgnorePattern: VAR_IGNORE_PATTERN,
2681
- reportUsedIgnorePattern: true
2028
+ async _rules() {
2029
+ const files = this.options.files ?? [GLOB_TS, GLOB_TSX];
2030
+ const filesTypeAware = this.options.filesTypeAware ?? [GLOB_TS, GLOB_TSX];
2031
+ const tsconfigPath = this.options?.tsconfigPath;
2032
+ const isTypeAware = !!tsconfigPath;
2033
+ const typeAwareRules = {
2034
+ "dot-notation": ["off"],
2035
+ "no-implied-eval": ["off"],
2036
+ "ts/await-thenable": ["error"],
2037
+ "ts/dot-notation": ["error", { allowKeywords: true }],
2038
+ "ts/no-floating-promises": ["error"],
2039
+ "ts/no-for-in-array": ["error"],
2040
+ "ts/no-implied-eval": ["error"],
2041
+ "ts/no-misused-promises": ["error"],
2042
+ "ts/no-unnecessary-type-assertion": ["error"],
2043
+ "ts/no-unsafe-argument": ["error"],
2044
+ "ts/no-unsafe-assignment": ["error"],
2045
+ "ts/no-unsafe-call": ["error"],
2046
+ "ts/no-unsafe-member-access": ["error"],
2047
+ "ts/no-unsafe-return": ["error"],
2048
+ "ts/promise-function-async": ["error"],
2049
+ "ts/restrict-plus-operands": ["error"],
2050
+ "ts/restrict-template-expressions": ["error"],
2051
+ "ts/return-await": ["error", "in-try-catch"],
2052
+ "ts/strict-boolean-expressions": [
2053
+ "error",
2054
+ { allowNullableBoolean: true, allowNullableObject: true }
2055
+ ],
2056
+ "ts/switch-exhaustiveness-check": ["error"],
2057
+ "ts/unbound-method": ["error"]
2058
+ };
2059
+ const [plugin4, parser] = await Promise.all([
2060
+ interopDefault(import("@typescript-eslint/eslint-plugin")),
2061
+ interopDefault(import("@typescript-eslint/parser"))
2062
+ ]);
2063
+ const { parserOptions } = this.options;
2064
+ const boundCreateRuleConfig = this.createRuleConfig.bind(this);
2065
+ function makeParser(typeAware, files2, ignores = []) {
2066
+ return boundCreateRuleConfig(typeAware ? "parser-type-aware" : "parser", {
2067
+ files: files2,
2068
+ ignores,
2069
+ languageOptions: {
2070
+ parser,
2071
+ parserOptions: {
2072
+ sourceType: "module",
2073
+ ...typeAware ? {
2074
+ projectService: {
2075
+ allowDefaultProject: ["./*.js"],
2076
+ defaultProject: tsconfigPath
2077
+ },
2078
+ tsconfigRootDir: process.cwd()
2079
+ } : {},
2080
+ ...parserOptions
2682
2081
  }
2683
- ],
2684
- "ts/no-use-before-define": [
2685
- "error",
2686
- { classes: false, functions: false, variables: true }
2687
- ],
2688
- "ts/no-useless-constructor": ["error"],
2689
- "ts/no-wrapper-object-types": ["error"],
2690
- "ts/triple-slash-reference": ["off"],
2691
- "ts/unified-signatures": ["off"],
2692
- ...type === "lib" ? {
2693
- "ts/explicit-function-return-type": [
2082
+ }
2083
+ });
2084
+ }
2085
+ return [
2086
+ this.createRuleConfig("setup", {
2087
+ plugins: {
2088
+ ts: plugin4
2089
+ }
2090
+ }),
2091
+ makeParser(false, files),
2092
+ ...isTypeAware ? [makeParser(true, filesTypeAware, this.options.ignoresTypeAware)] : [],
2093
+ this.createRuleConfig("rules", {
2094
+ files,
2095
+ rules: {
2096
+ ...renameRules(plugin4.configs["eslint-recommended"].overrides[0].rules, {
2097
+ "@typescript-eslint": "ts"
2098
+ }),
2099
+ ...renameRules(plugin4.configs.strict.rules, {
2100
+ "@typescript-eslint": "ts"
2101
+ }),
2102
+ "no-dupe-class-members": ["off"],
2103
+ "no-redeclare": ["off"],
2104
+ "no-use-before-define": ["off"],
2105
+ "no-useless-constructor": ["off"],
2106
+ "ts/ban-ts-comment": ["error", { "ts-expect-error": "allow-with-description" }],
2107
+ "ts/consistent-type-definitions": ["error", "interface"],
2108
+ "ts/consistent-type-imports": [
2694
2109
  "error",
2695
2110
  {
2696
- allowExpressions: true,
2697
- allowHigherOrderFunctions: true,
2698
- allowIIFEs: true
2111
+ disallowTypeAnnotations: false,
2112
+ fixStyle: "separate-type-imports",
2113
+ prefer: "type-imports"
2699
2114
  }
2700
- ]
2701
- } : {},
2702
- ...overrides
2703
- }
2704
- },
2705
- ...isTypeAware ? [
2706
- {
2707
- name: `${NAMESPACE19}/rules-type-aware`,
2708
- files: filesTypeAware,
2709
- ignores: ignoresTypeAware,
2710
- rules: {
2711
- ...typeAwareRules,
2712
- ...typeAwareOverrides
2115
+ ],
2116
+ // See: https://www.totaltypescript.com/method-shorthand-syntax-considered-harmful
2117
+ "ts/method-signature-style": ["error", "property"],
2118
+ "ts/no-dupe-class-members": ["error"],
2119
+ "ts/no-dynamic-delete": ["off"],
2120
+ "ts/no-empty-object-type": ["error", { allowInterfaces: "always" }],
2121
+ "ts/no-explicit-any": ["warn"],
2122
+ "ts/no-extraneous-class": ["off"],
2123
+ "ts/no-import-type-side-effects": ["error"],
2124
+ "ts/no-invalid-void-type": ["error"],
2125
+ "ts/no-non-null-assertion": ["error"],
2126
+ "ts/no-redeclare": ["error", { builtinGlobals: false }],
2127
+ "ts/no-require-imports": ["error"],
2128
+ "ts/no-unused-expressions": [
2129
+ "error",
2130
+ {
2131
+ allowShortCircuit: true,
2132
+ allowTaggedTemplates: true,
2133
+ allowTernary: true
2134
+ }
2135
+ ],
2136
+ "ts/no-unused-vars": "off",
2137
+ "ts/no-use-before-define": [
2138
+ "error",
2139
+ { classes: false, functions: false, variables: true }
2140
+ ],
2141
+ "ts/no-useless-constructor": ["error"],
2142
+ "ts/no-wrapper-object-types": ["error"],
2143
+ "ts/triple-slash-reference": ["off"],
2144
+ "ts/unified-signatures": ["off"],
2145
+ ...this.options.type === "lib" ? {
2146
+ "ts/explicit-function-return-type": [
2147
+ "error",
2148
+ {
2149
+ allowExpressions: true,
2150
+ allowHigherOrderFunctions: true,
2151
+ allowIIFEs: true
2152
+ }
2153
+ ]
2154
+ } : {},
2155
+ ...this.options.overrides
2713
2156
  }
2714
- }
2715
- ] : []
2716
- ];
2717
- }
2157
+ }),
2158
+ ...isTypeAware ? [
2159
+ this.createRuleConfig("rules-type-aware", {
2160
+ files: filesTypeAware,
2161
+ ignores: this.options.ignoresTypeAware,
2162
+ rules: {
2163
+ ...typeAwareRules,
2164
+ ...this.options.typeAwareOverrides
2165
+ }
2166
+ })
2167
+ ] : []
2168
+ ];
2169
+ }
2170
+ };
2718
2171
 
2719
2172
  // src/configs/vue.ts
2720
- init_esm_shims();
2721
- var NAMESPACE20 = "exbotanical/vue";
2722
- async function vue({
2723
- files = [GLOB_VUE],
2724
- overrides = {},
2725
- typescript: typescript2 = true,
2726
- vueVersion = 3,
2727
- graphql: graphql2 = false
2728
- }, { indent } = STYLE_DEFAULTS) {
2729
- const [pluginVue, parserVue, processorVueBlocks] = await Promise.all([
2730
- interopDefault(import("eslint-plugin-vue")),
2731
- interopDefault(import("vue-eslint-parser")),
2732
- interopDefault(import("eslint-processor-vue-blocks"))
2733
- ]);
2734
- return [
2735
- {
2736
- name: `${NAMESPACE20}/setup`,
2737
- plugins: {
2738
- vue: pluginVue
2739
- },
2740
- languageOptions: {
2741
- globals: {
2742
- computed: "readonly",
2743
- defineEmits: "readonly",
2744
- defineExpose: "readonly",
2745
- defineProps: "readonly",
2746
- onMounted: "readonly",
2747
- onUnmounted: "readonly",
2748
- reactive: "readonly",
2749
- ref: "readonly",
2750
- shallowReactive: "readonly",
2751
- shallowRef: "readonly",
2752
- toRef: "readonly",
2753
- toRefs: "readonly",
2754
- watch: "readonly",
2755
- watchEffect: "readonly"
2756
- }
2757
- }
2758
- },
2759
- {
2760
- name: `${NAMESPACE20}/rules`,
2173
+ var VueConfig = class extends CustomConfig {
2174
+ namespace = "vue";
2175
+ constructor({
2176
+ files = [GLOB_VUE],
2177
+ typescript = true,
2178
+ vueVersion = 3,
2179
+ graphql = false,
2180
+ indent = STYLE_DEFAULTS.indent,
2181
+ ...rest
2182
+ } = {}) {
2183
+ super({
2761
2184
  files,
2762
- languageOptions: {
2763
- parser: parserVue,
2764
- parserOptions: {
2765
- ecmaFeatures: {
2766
- jsx: true
2767
- },
2768
- extraFileExtensions: [".vue"],
2769
- parser: typescript2 ? await interopDefault(import("@typescript-eslint/parser")) : null,
2770
- sourceType: "module"
2771
- }
2772
- },
2773
- processor: graphql2 === false ? pluginVue.processors[".vue"] : mergeProcessors([
2774
- pluginVue.processors[".vue"],
2775
- processorVueBlocks({
2776
- blocks: {
2777
- script: true,
2778
- scriptSetup: true,
2779
- customBlocks: true
2780
- }
2781
- })
2782
- ]),
2783
- rules: {
2784
- ...pluginVue.configs.base.rules,
2785
- ...vueVersion === 2 ? {
2786
- ...pluginVue.configs.essential.rules,
2787
- ...pluginVue.configs["strongly-recommended"].rules,
2788
- ...pluginVue.configs.recommended.rules
2789
- } : {
2790
- ...pluginVue.configs["vue3-essential"].rules,
2791
- ...pluginVue.configs["vue3-strongly-recommended"].rules,
2792
- ...pluginVue.configs["vue3-recommended"].rules
2185
+ typescript,
2186
+ vueVersion,
2187
+ graphql,
2188
+ indent,
2189
+ ...rest
2190
+ });
2191
+ }
2192
+ async _rules() {
2193
+ const {
2194
+ files = [GLOB_VUE],
2195
+ overrides = {},
2196
+ typescript = true,
2197
+ vueVersion = 3,
2198
+ graphql = false,
2199
+ indent = STYLE_DEFAULTS.indent
2200
+ } = this.options;
2201
+ const [pluginVue, parserVue, processorVueBlocks] = await Promise.all([
2202
+ interopDefault(import("eslint-plugin-vue")),
2203
+ interopDefault(import("vue-eslint-parser")),
2204
+ interopDefault(import("eslint-processor-vue-blocks"))
2205
+ ]);
2206
+ return [
2207
+ this.createRuleConfig("setup", {
2208
+ plugins: {
2209
+ vue: pluginVue
2793
2210
  },
2794
- "node/prefer-global/process": "off",
2795
- "ts/explicit-function-return-type": "off",
2796
- "vue/block-order": [
2797
- "error",
2798
- {
2799
- order: ["script", "template", "style"]
2800
- }
2801
- ],
2802
- "vue/component-name-in-template-casing": ["error", "PascalCase"],
2803
- "vue/component-options-name-casing": ["error", "PascalCase"],
2804
- "vue/component-tags-order": "off",
2805
- "vue/custom-event-name-casing": ["error", "camelCase"],
2806
- "vue/define-macros-order": [
2807
- "error",
2808
- {
2809
- order: ["defineOptions", "defineProps", "defineEmits", "defineSlots"]
2810
- }
2811
- ],
2812
- "vue/dot-location": ["error", "property"],
2813
- "vue/dot-notation": ["error", { allowKeywords: true }],
2814
- "vue/eqeqeq": ["error", "smart"],
2815
- "vue/html-indent": ["error", indent],
2816
- "vue/html-quotes": ["error", "double"],
2817
- "vue/max-attributes-per-line": "off",
2818
- "vue/multi-word-component-names": "off",
2819
- "vue/no-dupe-keys": "off",
2820
- "vue/no-empty-pattern": "error",
2821
- "vue/no-irregular-whitespace": "error",
2822
- "vue/no-loss-of-precision": "error",
2823
- "vue/no-restricted-syntax": [
2824
- "error",
2825
- "DebuggerStatement",
2826
- "LabeledStatement",
2827
- "WithStatement"
2828
- ],
2829
- "vue/no-restricted-v-bind": ["error", "/^v-/"],
2830
- "vue/no-setup-props-reactivity-loss": "off",
2831
- "vue/no-sparse-arrays": "error",
2832
- "vue/no-unused-refs": "error",
2833
- "vue/no-useless-v-bind": "error",
2834
- "vue/no-v-html": "off",
2835
- "vue/object-shorthand": [
2836
- "error",
2837
- "always",
2838
- {
2839
- avoidQuotes: true,
2840
- ignoreConstructors: false
2841
- }
2842
- ],
2843
- "vue/prefer-separate-static-class": "error",
2844
- "vue/prefer-template": "error",
2845
- "vue/prop-name-casing": ["error", "camelCase"],
2846
- "vue/require-default-prop": "off",
2847
- "vue/require-prop-types": "off",
2848
- "vue/space-infix-ops": "error",
2849
- "vue/space-unary-ops": ["error", { nonwords: false, words: true }],
2850
- "vue/array-bracket-spacing": ["error", "never"],
2851
- "vue/arrow-spacing": ["error", { after: true, before: true }],
2852
- "vue/block-spacing": ["error", "always"],
2853
- "vue/block-tag-newline": [
2854
- "error",
2855
- {
2856
- multiline: "always",
2857
- singleline: "always"
2211
+ languageOptions: {
2212
+ globals: {
2213
+ computed: "readonly",
2214
+ defineEmits: "readonly",
2215
+ defineExpose: "readonly",
2216
+ defineProps: "readonly",
2217
+ onMounted: "readonly",
2218
+ onUnmounted: "readonly",
2219
+ reactive: "readonly",
2220
+ ref: "readonly",
2221
+ shallowReactive: "readonly",
2222
+ shallowRef: "readonly",
2223
+ toRef: "readonly",
2224
+ toRefs: "readonly",
2225
+ watch: "readonly",
2226
+ watchEffect: "readonly"
2858
2227
  }
2859
- ],
2860
- "vue/brace-style": ["error", "stroustrup", { allowSingleLine: true }],
2861
- "vue/comma-dangle": ["error", "always-multiline"],
2862
- "vue/comma-spacing": ["error", { after: true, before: false }],
2863
- "vue/comma-style": ["error", "last"],
2864
- "vue/html-comment-content-spacing": [
2865
- "error",
2866
- "always",
2867
- {
2868
- exceptions: ["-"]
2228
+ }
2229
+ }),
2230
+ this.createRuleConfig("rules", {
2231
+ files,
2232
+ languageOptions: {
2233
+ parser: parserVue,
2234
+ parserOptions: {
2235
+ ecmaFeatures: {
2236
+ jsx: true
2237
+ },
2238
+ extraFileExtensions: [".vue"],
2239
+ parser: typescript ? await interopDefault(import("@typescript-eslint/parser")) : null,
2240
+ sourceType: "module"
2869
2241
  }
2870
- ],
2871
- "vue/key-spacing": ["error", { afterColon: true, beforeColon: false }],
2872
- "vue/keyword-spacing": ["error", { after: true, before: true }],
2873
- "vue/object-curly-newline": "off",
2874
- "vue/object-curly-spacing": ["error", "always"],
2875
- "vue/object-property-newline": [
2876
- "error",
2877
- { allowMultiplePropertiesPerLine: true }
2878
- ],
2879
- "vue/operator-linebreak": ["error", "before"],
2880
- "vue/padding-line-between-blocks": ["error", "always"],
2881
- "vue/quote-props": ["error", "consistent-as-needed"],
2882
- "vue/space-in-parens": ["error", "never"],
2883
- "vue/template-curly-spacing": "error",
2884
- ...overrides
2885
- }
2886
- }
2887
- ];
2888
- }
2242
+ },
2243
+ processor: graphql === false ? pluginVue.processors[".vue"] : mergeProcessors([
2244
+ pluginVue.processors[".vue"],
2245
+ processorVueBlocks({
2246
+ blocks: {
2247
+ script: true,
2248
+ scriptSetup: true,
2249
+ customBlocks: true
2250
+ }
2251
+ })
2252
+ ]),
2253
+ rules: {
2254
+ ...pluginVue.configs.base.rules,
2255
+ ...vueVersion === 2 ? {
2256
+ ...pluginVue.configs.essential.rules,
2257
+ ...pluginVue.configs["strongly-recommended"].rules,
2258
+ ...pluginVue.configs.recommended.rules
2259
+ } : {
2260
+ ...pluginVue.configs["vue3-essential"].rules,
2261
+ ...pluginVue.configs["vue3-strongly-recommended"].rules,
2262
+ ...pluginVue.configs["vue3-recommended"].rules
2263
+ },
2264
+ "node/prefer-global/process": "off",
2265
+ "ts/explicit-function-return-type": "off",
2266
+ "vue/block-order": [
2267
+ "error",
2268
+ {
2269
+ order: ["script", "template", "style"]
2270
+ }
2271
+ ],
2272
+ "vue/component-name-in-template-casing": ["error", "PascalCase"],
2273
+ "vue/component-options-name-casing": ["error", "PascalCase"],
2274
+ "vue/component-tags-order": "off",
2275
+ "vue/custom-event-name-casing": ["error", "camelCase"],
2276
+ "vue/define-macros-order": [
2277
+ "error",
2278
+ {
2279
+ order: ["defineOptions", "defineProps", "defineEmits", "defineSlots"]
2280
+ }
2281
+ ],
2282
+ "vue/dot-location": ["error", "property"],
2283
+ "vue/dot-notation": ["error", { allowKeywords: true }],
2284
+ "vue/eqeqeq": ["error", "smart"],
2285
+ "vue/html-indent": ["error", indent],
2286
+ "vue/html-quotes": ["error", "double"],
2287
+ "vue/max-attributes-per-line": "off",
2288
+ "vue/multi-word-component-names": "off",
2289
+ "vue/no-dupe-keys": "off",
2290
+ "vue/no-empty-pattern": "error",
2291
+ "vue/no-irregular-whitespace": "error",
2292
+ "vue/no-loss-of-precision": "error",
2293
+ "vue/no-restricted-syntax": [
2294
+ "error",
2295
+ "DebuggerStatement",
2296
+ "LabeledStatement",
2297
+ "WithStatement"
2298
+ ],
2299
+ "vue/no-restricted-v-bind": ["error", "/^v-/"],
2300
+ "vue/no-setup-props-reactivity-loss": "off",
2301
+ "vue/no-sparse-arrays": "error",
2302
+ "vue/no-unused-refs": "error",
2303
+ "vue/no-useless-v-bind": "error",
2304
+ "vue/no-v-html": "off",
2305
+ "vue/object-shorthand": [
2306
+ "error",
2307
+ "always",
2308
+ {
2309
+ avoidQuotes: true,
2310
+ ignoreConstructors: false
2311
+ }
2312
+ ],
2313
+ "vue/prefer-separate-static-class": "error",
2314
+ "vue/prefer-template": "error",
2315
+ "vue/prop-name-casing": ["error", "camelCase"],
2316
+ "vue/require-default-prop": "off",
2317
+ "vue/require-prop-types": "off",
2318
+ "vue/space-infix-ops": "error",
2319
+ "vue/space-unary-ops": ["error", { nonwords: false, words: true }],
2320
+ "vue/array-bracket-spacing": ["error", "never"],
2321
+ "vue/arrow-spacing": ["error", { after: true, before: true }],
2322
+ "vue/block-spacing": ["error", "always"],
2323
+ "vue/block-tag-newline": [
2324
+ "error",
2325
+ {
2326
+ multiline: "always",
2327
+ singleline: "always"
2328
+ }
2329
+ ],
2330
+ "vue/brace-style": ["error", "stroustrup", { allowSingleLine: true }],
2331
+ "vue/comma-dangle": ["error", "always-multiline"],
2332
+ "vue/comma-spacing": ["error", { after: true, before: false }],
2333
+ "vue/comma-style": ["error", "last"],
2334
+ "vue/html-comment-content-spacing": [
2335
+ "error",
2336
+ "always",
2337
+ {
2338
+ exceptions: ["-"]
2339
+ }
2340
+ ],
2341
+ "vue/key-spacing": ["error", { afterColon: true, beforeColon: false }],
2342
+ "vue/keyword-spacing": ["error", { after: true, before: true }],
2343
+ "vue/object-curly-newline": "off",
2344
+ "vue/object-curly-spacing": ["error", "always"],
2345
+ "vue/object-property-newline": [
2346
+ "error",
2347
+ { allowMultiplePropertiesPerLine: true }
2348
+ ],
2349
+ "vue/operator-linebreak": ["error", "before"],
2350
+ "vue/padding-line-between-blocks": ["error", "always"],
2351
+ "vue/quote-props": ["error", "consistent-as-needed"],
2352
+ "vue/space-in-parens": ["error", "never"],
2353
+ "vue/template-curly-spacing": "error",
2354
+ ...overrides
2355
+ }
2356
+ })
2357
+ ];
2358
+ }
2359
+ };
2889
2360
 
2890
2361
  // src/configs/yaml.ts
2891
- init_esm_shims();
2892
- var NAMESPACE21 = "exbotanical/yaml";
2893
- async function yaml({ files = [GLOB_YAML], overrides = {} } = {}, { indent, quotes } = STYLE_DEFAULTS) {
2894
- const [plugin4, parser] = await Promise.all([
2895
- interopDefault(import("eslint-plugin-yml")),
2896
- interopDefault(import("yaml-eslint-parser"))
2897
- ]);
2898
- return [
2899
- {
2900
- name: `${NAMESPACE21}/setup`,
2901
- plugins: {
2902
- yaml: plugin4
2903
- }
2904
- },
2905
- {
2906
- name: `${NAMESPACE21}/rules`,
2362
+ var YamlConfig = class extends CustomConfig {
2363
+ namespace = "yaml";
2364
+ constructor({
2365
+ files = [GLOB_YAML],
2366
+ indent = STYLE_DEFAULTS.indent,
2367
+ quotes = STYLE_DEFAULTS.quotes,
2368
+ ...rest
2369
+ } = {}) {
2370
+ super({
2907
2371
  files,
2908
- languageOptions: {
2909
- parser
2910
- },
2911
- rules: {
2912
- "style/spaced-comment": "off",
2913
- "yaml/block-mapping-colon-indicator-newline": "error",
2914
- "yaml/block-mapping-question-indicator-newline": "error",
2915
- "yaml/block-mapping": "error",
2916
- "yaml/block-sequence": "error",
2917
- "yaml/no-empty-key": "error",
2918
- "yaml/no-empty-sequence-entry": "error",
2919
- "yaml/no-irregular-whitespace": "error",
2920
- "yaml/plain-scalar": "error",
2921
- "yaml/vue-custom-block/no-parsing-error": "error",
2922
- "yaml/block-sequence-hyphen-indicator-newline": "error",
2923
- "yaml/flow-mapping-curly-newline": "error",
2924
- "yaml/flow-mapping-curly-spacing": "error",
2925
- "yaml/flow-sequence-bracket-newline": "error",
2926
- "yaml/flow-sequence-bracket-spacing": "error",
2927
- "yaml/indent": ["error", indent === "tab" ? 2 : indent],
2928
- "yaml/key-spacing": "error",
2929
- "yaml/no-tab-indent": "error",
2930
- "yaml/quotes": [
2931
- "error",
2932
- {
2933
- avoidEscape: true,
2934
- prefer: quotes === "backtick" ? "single" : quotes
2372
+ indent,
2373
+ quotes,
2374
+ ...rest
2375
+ });
2376
+ }
2377
+ async _rules() {
2378
+ const {
2379
+ files = [GLOB_YAML],
2380
+ overrides = {},
2381
+ indent = STYLE_DEFAULTS.indent,
2382
+ quotes = STYLE_DEFAULTS.quotes,
2383
+ sortKeys = []
2384
+ } = this.options;
2385
+ const [plugin4, parser] = await Promise.all([
2386
+ interopDefault(import("eslint-plugin-yml")),
2387
+ interopDefault(import("yaml-eslint-parser"))
2388
+ ]);
2389
+ return [
2390
+ this.createRuleConfig("setup", {
2391
+ plugins: {
2392
+ yaml: plugin4
2393
+ }
2394
+ }),
2395
+ this.createRuleConfig("rules", {
2396
+ files,
2397
+ languageOptions: {
2398
+ parser
2399
+ },
2400
+ rules: {
2401
+ "style/spaced-comment": "off",
2402
+ "yaml/block-mapping-colon-indicator-newline": "error",
2403
+ "yaml/block-mapping-question-indicator-newline": "error",
2404
+ "yaml/block-mapping": "error",
2405
+ "yaml/block-sequence": "error",
2406
+ "yaml/no-empty-key": "error",
2407
+ "yaml/no-empty-sequence-entry": "error",
2408
+ "yaml/no-irregular-whitespace": "error",
2409
+ "yaml/plain-scalar": "error",
2410
+ "yaml/vue-custom-block/no-parsing-error": "error",
2411
+ "yaml/block-sequence-hyphen-indicator-newline": "error",
2412
+ "yaml/flow-mapping-curly-newline": "error",
2413
+ "yaml/flow-mapping-curly-spacing": "error",
2414
+ "yaml/flow-sequence-bracket-newline": "error",
2415
+ "yaml/flow-sequence-bracket-spacing": "error",
2416
+ "yaml/indent": ["error", indent === "tab" ? 2 : indent],
2417
+ "yaml/key-spacing": "error",
2418
+ "yaml/no-tab-indent": "error",
2419
+ "yaml/quotes": [
2420
+ "error",
2421
+ {
2422
+ avoidEscape: true,
2423
+ prefer: quotes === "backtick" ? "single" : quotes
2424
+ }
2425
+ ],
2426
+ "yaml/spaced-comment": "error",
2427
+ "yaml/no-empty-document": "error",
2428
+ "yaml/no-empty-mapping-value": "error",
2429
+ "yaml/no-trailing-zeros": "error",
2430
+ "yaml/no-multiple-empty-lines": "error",
2431
+ ...overrides
2432
+ }
2433
+ }),
2434
+ ...sortKeys.length > 0 ? [
2435
+ this.createRuleConfig("sort-keys", {
2436
+ files: sortKeys,
2437
+ languageOptions: {
2438
+ parser
2439
+ },
2440
+ rules: {
2441
+ "yaml/sort-keys": [
2442
+ "error",
2443
+ "asc",
2444
+ { allowLineSeparatedGroups: true, natural: true }
2445
+ ]
2935
2446
  }
2936
- ],
2937
- "yaml/spaced-comment": "error",
2938
- "yaml/no-empty-document": "error",
2939
- "yaml/no-empty-mapping-value": "error",
2940
- "yaml/no-trailing-zeros": "error",
2941
- "yaml/no-multiple-empty-lines": "error",
2942
- ...overrides
2943
- }
2944
- }
2945
- ];
2946
- }
2447
+ })
2448
+ ] : []
2449
+ ];
2450
+ }
2451
+ };
2947
2452
 
2948
2453
  // src/factory.ts
2949
2454
  async function exbotanical({
@@ -2960,55 +2465,96 @@ async function exbotanical({
2960
2465
  react: optionsReact,
2961
2466
  vue: optionsVue,
2962
2467
  graphql: optionsGraphql,
2468
+ packageJson: optionsPackageJson = false,
2469
+ jsonSchema: optionsJsonSchema = false,
2470
+ githubAction: optionsGithubAction = false,
2471
+ css: optionsCss = false,
2472
+ perfectionist: optionsPerfectionist,
2963
2473
  type
2964
- }, ...userConfigs) {
2474
+ } = {}, ...userConfigs) {
2965
2475
  const configs2 = [
2966
- perfectionist(),
2967
- unicorn(),
2968
- comments(),
2969
- imports(),
2970
- javascript({ ...optionsJavascript, type }),
2971
- jsdoc(),
2972
- jsx(),
2973
- node(),
2974
- regexpr(),
2975
- test({ ...factoryConfig(optionsTest) })
2476
+ new PerfectionistConfig({ ...optionsPerfectionist }).rules(),
2477
+ new UnicornConfig().rules(),
2478
+ new CommentsConfig().rules(),
2479
+ new ImportsConfig().rules(),
2480
+ new JavascriptConfig({ ...optionsJavascript, type }).rules(),
2481
+ new JsdocConfig().rules(),
2482
+ new JsxConfig().rules(),
2483
+ new NodeConfig().rules(),
2484
+ new RegexprConfig().rules(),
2485
+ new TestConfig({ ...factoryConfig(optionsTest) }).rules()
2976
2486
  ];
2977
2487
  if (optionsJsonc) {
2978
2488
  configs2.push(
2979
- packageJson(),
2980
- tsconfig(),
2981
- jsonc({
2489
+ ...optionsPackageJson ? [] : [new PackageJsonConfig().rules()],
2490
+ new TsconfigConfig().rules(),
2491
+ new JsoncConfig({
2982
2492
  ...factoryConfig(optionsJsonc),
2983
2493
  ...optionsStyle
2984
- })
2494
+ }).rules()
2495
+ );
2496
+ }
2497
+ if (optionsPackageJson) {
2498
+ configs2.push(
2499
+ new PackageJsonPluginConfig({ ...factoryConfig(optionsPackageJson) }).rules()
2500
+ );
2501
+ }
2502
+ if (optionsJsonSchema) {
2503
+ configs2.push(new JsonSchemaConfig({ ...factoryConfig(optionsJsonSchema) }).rules());
2504
+ }
2505
+ if (optionsGithubAction) {
2506
+ configs2.push(
2507
+ new GithubActionConfig({ ...factoryConfig(optionsGithubAction) }).rules()
2985
2508
  );
2986
2509
  }
2510
+ if (optionsCss) {
2511
+ configs2.push(new CssConfig({ ...factoryConfig(optionsCss) }).rules());
2512
+ }
2987
2513
  if (optionsMarkdown) {
2988
- configs2.push(markdown({ ...factoryConfig(optionsMarkdown) }));
2514
+ configs2.push(new MarkdownConfig({ ...factoryConfig(optionsMarkdown) }).rules());
2989
2515
  }
2990
2516
  if (optionsGraphql) {
2991
- configs2.push(graphql());
2517
+ configs2.push(new GraphqlConfig().rules());
2992
2518
  }
2993
2519
  if (optionsReact) {
2994
- configs2.push(react({ ...factoryConfig(optionsReact) }));
2520
+ configs2.push(new ReactConfig({ ...factoryConfig(optionsReact) }).rules());
2995
2521
  }
2996
2522
  if (optionsToml) {
2997
- configs2.push(toml({ ...factoryConfig(optionsToml), ...optionsStyle }));
2523
+ configs2.push(
2524
+ new TomlConfig({ ...factoryConfig(optionsToml), ...optionsStyle }).rules()
2525
+ );
2998
2526
  }
2999
2527
  if (optionsTypescript) {
3000
- configs2.push(typescript({ ...factoryConfig(optionsTypescript), type }));
2528
+ configs2.push(
2529
+ new TypescriptConfig({ ...factoryConfig(optionsTypescript), type }).rules()
2530
+ );
3001
2531
  }
3002
2532
  if (optionsVue) {
3003
- configs2.push(vue({ ...factoryConfig(optionsVue), graphql: !!optionsGraphql }));
2533
+ configs2.push(
2534
+ new VueConfig({ ...factoryConfig(optionsVue), graphql: !!optionsGraphql }).rules()
2535
+ );
3004
2536
  }
3005
2537
  if (optionsYaml) {
3006
- configs2.push(yaml({ ...factoryConfig(optionsYaml), ...optionsStyle }));
2538
+ configs2.push(
2539
+ new YamlConfig({ ...factoryConfig(optionsYaml), ...optionsStyle }).rules()
2540
+ );
3007
2541
  }
2542
+ configs2.push(
2543
+ new DataFilesConfig({
2544
+ files: [
2545
+ ...optionsJsonc ? [GLOB_JSON, GLOB_JSON5, GLOB_JSONC] : [],
2546
+ ...optionsYaml ? [GLOB_YAML] : [],
2547
+ ...optionsToml ? [GLOB_TOML] : []
2548
+ ]
2549
+ }).rules()
2550
+ );
3008
2551
  if (formatter) {
3009
- configs2.push(prettier());
2552
+ configs2.push(new PrettierConfig().rules());
3010
2553
  }
3011
- configs2.push(disables(), ignores(optionsIgnore));
2554
+ configs2.push(
2555
+ new DisablesConfig().rules(),
2556
+ new IgnoresConfig({ files: optionsIgnore }).rules()
2557
+ );
3012
2558
  if (userConfigs.length > 0) {
3013
2559
  const resolved2 = await Promise.all(userConfigs);
3014
2560
  configs2.push(...resolved2.map((r) => Promise.resolve(Array.isArray(r) ? r : [r])));
@@ -3020,15 +2566,10 @@ function factoryConfig(options) {
3020
2566
  if (!options) return {};
3021
2567
  return typeof options === "boolean" ? {} : options;
3022
2568
  }
3023
-
3024
- // src/options.ts
3025
- init_esm_shims();
3026
-
3027
- // src/types.ts
3028
- init_esm_shims();
3029
2569
  export {
3030
2570
  GLOB_CSS,
3031
2571
  GLOB_EXCLUDES,
2572
+ GLOB_GITHUB_WORKFLOW,
3032
2573
  GLOB_GRAPHQL,
3033
2574
  GLOB_HTML,
3034
2575
  GLOB_JS,
@@ -3040,6 +2581,7 @@ export {
3040
2581
  GLOB_MARKDOWN,
3041
2582
  GLOB_MARKDOWN_CODE,
3042
2583
  GLOB_POSTCSS,
2584
+ GLOB_SCRIPTS,
3043
2585
  GLOB_SCSS,
3044
2586
  GLOB_SRC,
3045
2587
  GLOB_SRC_EXT,