@exbotanical/eslint-config 1.1.3 → 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 +316 -20
  2. package/dist/index.js +2001 -2425
  3. package/package.json +40 -18
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";
@@ -841,8 +39,18 @@ var GLOB_MARKDOWN = "**/*.md";
841
39
  var GLOB_VUE = "**/*.vue";
842
40
  var GLOB_YAML = "**/*.y?(a)ml";
843
41
  var GLOB_TOML = "**/*.toml";
42
+ var GLOB_XML = "**/*.xml";
43
+ var GLOB_SVG = "**/*.svg";
44
+ var GLOB_HTML = "**/*.htm?(l)";
844
45
  var GLOB_GRAPHQL = "**/*.{g,graph}ql";
46
+ var GLOB_GITHUB_WORKFLOW = "**/.github/workflows/*.y?(a)ml";
47
+ var GLOB_STYLE = "**/*.{c,le,sc}ss";
48
+ var GLOB_CSS = "**/*.css";
49
+ var GLOB_POSTCSS = "**/*.{p,post}css";
50
+ var GLOB_LESS = "**/*.less";
51
+ var GLOB_SCSS = "**/*.scss";
845
52
  var GLOB_MARKDOWN_CODE = `${GLOB_MARKDOWN}/${GLOB_SRC}`;
53
+ var GLOB_SCRIPTS = [GLOB_SRC, GLOB_VUE, GLOB_MARKDOWN_CODE];
846
54
  var GLOB_TESTS = [
847
55
  `**/__tests__/**/*.${GLOB_SRC_EXT}`,
848
56
  `**/*.spec.${GLOB_SRC_EXT}`,
@@ -878,77 +86,38 @@ var GLOB_EXCLUDES = [
878
86
  "**/__snapshots__"
879
87
  ];
880
88
 
881
- // src/configs/disables.ts
882
- var NAMESPACE2 = "exbotanical/disables";
883
- async function disables() {
884
- return [
885
- {
886
- name: `${NAMESPACE2}/scripts`,
887
- files: [
888
- `**/scripts/${GLOB_SRC}`,
889
- "**/bin/**/*",
890
- `**/bin.${GLOB_SRC_EXT}`
891
- ],
892
- rules: {
893
- "no-console": "off",
894
- "ts/explicit-function-return-type": "off"
895
- }
896
- },
897
- {
898
- name: `${NAMESPACE2}/dts`,
899
- files: ["**/*.d.?([cm])ts"],
900
- rules: {
901
- "eslint-comments/no-unlimited-disable": "off",
902
- "import/no-duplicates": "off",
903
- "no-restricted-syntax": "off",
904
- "unused-imports/no-unused-vars": "off"
905
- }
906
- },
907
- {
908
- name: `${NAMESPACE2}/cjs`,
909
- files: ["**/*.js", "**/*.cjs"],
910
- rules: {
911
- "ts/no-require-imports": "off"
912
- }
913
- },
914
- {
915
- name: `${NAMESPACE2}/config-files`,
916
- files: [`**/*.config.${GLOB_SRC_EXT}`, `**/*.config.*.${GLOB_SRC_EXT}`],
917
- rules: {
918
- "no-console": "off",
919
- "ts/explicit-function-return-type": "off"
920
- }
921
- }
922
- ];
923
- }
924
-
925
- // src/configs/graphql.ts
926
- 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
+ };
927
117
 
928
118
  // src/utils.ts
929
- init_esm_shims();
930
- import { fileURLToPath as fileURLToPath2 } from "node:url";
119
+ import { fileURLToPath } from "node:url";
931
120
  import { isPackageExists } from "local-pkg";
932
- var parserPlain = {
933
- meta: {
934
- name: "parser-plain"
935
- },
936
- parseForESLint: (code) => ({
937
- ast: {
938
- body: [],
939
- comments: [],
940
- loc: { end: code.length, start: 0 },
941
- range: [0, code.length],
942
- tokens: [],
943
- type: "Program"
944
- },
945
- scopeManager: null,
946
- services: { isPlain: true },
947
- visitorKeys: {
948
- Program: []
949
- }
950
- })
951
- };
952
121
  async function interopDefault(module) {
953
122
  const resolved = await module;
954
123
  return resolved.default || resolved;
@@ -957,8 +126,7 @@ function renameRules(rules, map) {
957
126
  return Object.fromEntries(
958
127
  Object.entries(rules).map(([key, value]) => {
959
128
  for (const [from, to] of Object.entries(map)) {
960
- if (key.startsWith(`${from}/`))
961
- return [to + key.slice(from.length), value];
129
+ if (key.startsWith(`${from}/`)) return [to + key.slice(from.length), value];
962
130
  }
963
131
  return [key, value];
964
132
  })
@@ -1003,429 +171,606 @@ var processorPassThrough = {
1003
171
  return messages[0];
1004
172
  }
1005
173
  };
1006
- var scopeUrl = fileURLToPath2(new URL(".", import.meta.url));
174
+ var scopeUrl = fileURLToPath(new URL(".", import.meta.url));
1007
175
 
1008
- // src/configs/graphql.ts
1009
- async function graphql() {
1010
- const graphqlPlugin = await interopDefault(import("@graphql-eslint/eslint-plugin"));
1011
- const rules = {
1012
- ...graphqlPlugin.configs["flat/operations-recommended"].rules,
1013
- ...graphqlPlugin.configs["flat/schema-recommended"].rules
1014
- };
1015
- return [
1016
- {
1017
- files: [GLOB_JS, GLOB_JSX, GLOB_TS, GLOB_TSX],
1018
- processor: graphqlPlugin.processor
1019
- },
1020
- {
1021
- files: [GLOB_GRAPHQL],
1022
- languageOptions: {
1023
- parser: graphqlPlugin.parser
1024
- },
1025
- plugins: {
1026
- "@graphql-eslint": graphqlPlugin
1027
- },
1028
- // @ts-expect-error weird rule types in gql plugin
1029
- rules
1030
- }
1031
- ];
1032
- }
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
+ };
1033
203
 
1034
- // src/configs/ignores.ts
1035
- init_esm_shims();
1036
- var NAMESPACE3 = "exbotanical/ignores";
1037
- async function ignores(files = []) {
1038
- return [
1039
- {
1040
- name: NAMESPACE3,
1041
- ignores: [...GLOB_EXCLUDES, ...files]
1042
- }
1043
- ];
1044
- }
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
+ };
1045
235
 
1046
- // src/configs/imports.ts
1047
- init_esm_shims();
1048
- import plugin2 from "eslint-plugin-import";
1049
- var NAMESPACE4 = "exbotanical/imports";
1050
- async function imports() {
1051
- return [
1052
- {
1053
- name: `${NAMESPACE4}/rules`,
1054
- plugins: {
1055
- import: plugin2
1056
- },
1057
- rules: {
1058
- "import/consistent-type-specifier-style": ["error", "prefer-top-level"],
1059
- "import/first": "error",
1060
- "import/no-duplicates": "error",
1061
- "import/no-mutable-exports": "error",
1062
- "import/no-named-default": "error",
1063
- "import/no-self-import": "error",
1064
- "import/no-webpack-loader-syntax": "error",
1065
- "import/newline-after-import": ["error", { count: 1 }],
1066
- "import/no-unresolved": "off",
1067
- "import/order": [
1068
- "error",
1069
- {
1070
- "alphabetize": {
1071
- caseInsensitive: true,
1072
- order: "asc"
1073
- },
1074
- "groups": [
1075
- "builtin",
1076
- "external",
1077
- "internal",
1078
- "parent",
1079
- "sibling",
1080
- "index",
1081
- "object",
1082
- "type"
1083
- ],
1084
- "newlines-between": "always",
1085
- "pathGroups": [
1086
- {
1087
- group: "external",
1088
- pattern: "{vue,@vue/**}",
1089
- position: "before"
1090
- },
1091
- {
1092
- group: "external",
1093
- pattern: "{react,@react/**}",
1094
- position: "before"
1095
- },
1096
- {
1097
- group: "internal",
1098
- pattern: "@/**",
1099
- 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"
1100
383
  },
1101
- {
1102
- group: "internal",
1103
- pattern: "@@/**",
1104
- position: "before"
1105
- }
1106
- ]
1107
- }
1108
- ]
1109
- }
1110
- }
1111
- ];
1112
- }
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
+ };
1113
424
 
1114
425
  // src/configs/javascript.ts
1115
- init_esm_shims();
1116
426
  import pluginUnusedImports from "eslint-plugin-unused-imports";
1117
427
  import globals from "globals";
1118
428
 
1119
429
  // src/common.ts
1120
- init_esm_shims();
1121
430
  var VAR_IGNORE_PATTERN = "^_";
1122
431
 
1123
432
  // src/configs/javascript.ts
1124
- var NAMESPACE5 = "exbotanical/javascript";
1125
- async function javascript({ overrides = {} } = {}) {
1126
- return [
1127
- {
1128
- name: `${NAMESPACE5}/setup`,
1129
- languageOptions: {
1130
- ecmaVersion: "latest",
1131
- globals: {
1132
- ...globals.browser,
1133
- ...globals.node,
1134
- ...globals.es2021,
1135
- document: "readonly",
1136
- navigator: "readonly",
1137
- window: "readonly"
1138
- },
1139
- parserOptions: {
1140
- 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: {
1141
444
  ecmaVersion: "latest",
1142
- sourceType: "module"
1143
- },
1144
- sourceType: "module"
1145
- },
1146
- linterOptions: {
1147
- reportUnusedDisableDirectives: "error",
1148
- reportUnusedInlineConfigs: "error"
1149
- }
1150
- },
1151
- {
1152
- name: `${NAMESPACE5}/rules`,
1153
- plugins: {
1154
- "unused-imports": pluginUnusedImports
1155
- },
1156
- rules: {
1157
- "array-callback-return": ["error"],
1158
- "constructor-super": ["error"],
1159
- "for-direction": ["error"],
1160
- "getter-return": ["error"],
1161
- "no-async-promise-executor": ["error"],
1162
- "no-class-assign": ["error"],
1163
- "no-compare-neg-zero": ["error"],
1164
- "no-cond-assign": ["error", "except-parens"],
1165
- "no-const-assign": ["error"],
1166
- "no-constant-binary-expression": ["error"],
1167
- "no-constant-condition": ["error"],
1168
- "no-constructor-return": ["error"],
1169
- "no-control-regex": ["error"],
1170
- "no-debugger": ["error"],
1171
- "no-dupe-args": ["error"],
1172
- "no-dupe-class-members": ["error"],
1173
- "no-dupe-else-if": ["error"],
1174
- "no-dupe-keys": ["error"],
1175
- "no-duplicate-case": ["error"],
1176
- // See `import` ruleset
1177
- "no-duplicate-imports": ["off"],
1178
- "no-empty-character-class": ["error"],
1179
- "no-empty-pattern": ["error"],
1180
- "no-unsafe-finally": ["error"],
1181
- "no-unreachable-loop": ["error"],
1182
- "no-unreachable": ["error"],
1183
- "no-unmodified-loop-condition": ["error"],
1184
- "no-unexpected-multiline": ["error"],
1185
- "no-undef": ["error"],
1186
- "no-this-before-super": ["error"],
1187
- "no-template-curly-in-string": ["error"],
1188
- "no-sparse-arrays": ["error"],
1189
- "no-setter-return": ["error"],
1190
- "no-self-compare": ["error"],
1191
- "no-self-assign": ["error", { props: true }],
1192
- "no-prototype-builtins": ["error"],
1193
- "no-promise-executor-return": ["error"],
1194
- "no-obj-calls": ["error"],
1195
- "no-new-native-nonconstructor": ["error"],
1196
- "no-misleading-character-class": ["error"],
1197
- "no-loss-of-precision": ["error"],
1198
- "no-irregular-whitespace": ["error"],
1199
- "no-invalid-regexp": ["error"],
1200
- "no-import-assign": ["error"],
1201
- "no-func-assign": ["error"],
1202
- "no-fallthrough": ["warn"],
1203
- "no-ex-assign": ["error"],
1204
- "no-unsafe-negation": ["error"],
1205
- "no-unsafe-optional-chaining": ["error"],
1206
- "no-unused-private-class-members": ["error"],
1207
- "no-unused-vars": [
1208
- "error",
1209
- {
1210
- vars: "all",
1211
- args: "all",
1212
- argsIgnorePattern: VAR_IGNORE_PATTERN,
1213
- caughtErrorsIgnorePattern: VAR_IGNORE_PATTERN,
1214
- destructuredArrayIgnorePattern: VAR_IGNORE_PATTERN,
1215
- reportUsedIgnorePattern: true
1216
- }
1217
- ],
1218
- "no-use-before-define": [
1219
- "error",
1220
- { classes: false, functions: false, variables: true }
1221
- ],
1222
- "no-useless-assignment": ["error"],
1223
- "no-useless-backreference": ["error"],
1224
- "require-atomic-updates": ["error"],
1225
- "use-isnan": [
1226
- "error",
1227
- { enforceForIndexOf: true, enforceForSwitchCase: true }
1228
- ],
1229
- "valid-typeof": ["error", { requireStringLiterals: true }],
1230
- "class-methods-use-this": ["warn"],
1231
- "consistent-return": ["error"],
1232
- "curly": ["error", "multi-line"],
1233
- "default-case": [
1234
- "error",
1235
- {
1236
- commentPattern: String.raw`^skip\sdefault`
1237
- }
1238
- ],
1239
- "default-case-last": ["error"],
1240
- "dot-notation": ["error", { allowKeywords: true }],
1241
- "eqeqeq": ["error", "smart"],
1242
- "func-names": ["error", "as-needed"],
1243
- "accessor-pairs": [
1244
- "error",
1245
- { enforceForClassMembers: true, setWithoutGet: true }
1246
- ],
1247
- "arrow-body-style": ["error", "as-needed"],
1248
- "block-scoped-var": ["error"],
1249
- "camelcase": [
1250
- "error",
1251
- {
1252
- ignoreImports: true
1253
- }
1254
- ],
1255
- "capitalized-comments": [
1256
- "error",
1257
- "always",
1258
- {
1259
- ignoreInlineComments: true,
1260
- ignoreConsecutiveComments: true
1261
- }
1262
- ],
1263
- "grouped-accessor-pairs": ["error", "getBeforeSet"],
1264
- "max-params": ["warn", { max: 5 }],
1265
- "new-cap": [
1266
- "error",
1267
- { capIsNew: false, newIsCap: true, properties: true }
1268
- ],
1269
- "no-alert": ["error"],
1270
- "no-array-constructor": ["error"],
1271
- "no-caller": ["error"],
1272
- "no-case-declarations": ["warn"],
1273
- "no-console": ["error", { allow: ["warn", "error"] }],
1274
- "no-delete-var": ["error"],
1275
- "no-else-return": ["error"],
1276
- "no-empty": ["error", { allowEmptyCatch: true }],
1277
- "no-eval": ["error"],
1278
- "no-extra-bind": ["error"],
1279
- "no-extend-native": ["error"],
1280
- "no-extra-boolean-cast": ["error"],
1281
- "no-global-assign": ["error"],
1282
- "no-implied-eval": ["error"],
1283
- "no-invalid-this": ["error"],
1284
- "no-iterator": ["error"],
1285
- "no-labels": ["error", { allowLoop: false, allowSwitch: false }],
1286
- "no-lone-blocks": ["error"],
1287
- "no-multi-str": ["error"],
1288
- "no-new": ["error"],
1289
- "no-new-func": ["error"],
1290
- "no-new-wrappers": ["error"],
1291
- "no-octal": ["error"],
1292
- "no-octal-escape": ["error"],
1293
- "no-param-reassign": ["error"],
1294
- "no-proto": ["error"],
1295
- "no-redeclare": ["error", { builtinGlobals: false }],
1296
- "no-regex-spaces": ["error"],
1297
- "no-restricted-globals": [
1298
- "error",
1299
- { message: "Use `globalThis` instead.", name: "global" },
1300
- { message: "Use `globalThis` instead.", name: "self" }
1301
- ],
1302
- "no-restricted-properties": [
1303
- "error",
1304
- {
1305
- message: "Use `Object.getPrototypeOf` or `Object.setPrototypeOf` instead.",
1306
- property: "__proto__"
1307
- },
1308
- {
1309
- message: "Use `Object.defineProperty` instead.",
1310
- property: "__defineGetter__"
1311
- },
1312
- {
1313
- message: "Use `Object.defineProperty` instead.",
1314
- property: "__defineSetter__"
445
+ globals: {
446
+ ...globals.browser,
447
+ ...globals.node,
448
+ ...globals.es2021,
449
+ document: "readonly",
450
+ navigator: "readonly",
451
+ window: "readonly"
1315
452
  },
1316
- {
1317
- message: "Use `Object.getOwnPropertyDescriptor` instead.",
1318
- property: "__lookupGetter__"
453
+ parserOptions: {
454
+ ecmaFeatures: { jsx: true, impliedStrict: true },
455
+ ecmaVersion: "latest",
456
+ sourceType: "module"
1319
457
  },
1320
- {
1321
- message: "Use `Object.getOwnPropertyDescriptor` instead.",
1322
- property: "__lookupSetter__"
1323
- }
1324
- ],
1325
- "no-restricted-syntax": [
1326
- "error",
1327
- "TSEnumDeclaration[const=true]",
1328
- "TSExportAssignment"
1329
- ],
1330
- "no-sequences": ["error"],
1331
- "no-shadow-restricted-names": ["error"],
1332
- "no-throw-literal": ["warn"],
1333
- "no-undef-init": ["error"],
1334
- "no-unneeded-ternary": ["error", { defaultAssignment: false }],
1335
- "no-unused-expressions": [
1336
- "error",
1337
- {
1338
- allowShortCircuit: true,
1339
- allowTaggedTemplates: true,
1340
- allowTernary: true
1341
- }
1342
- ],
1343
- "no-useless-call": ["error"],
1344
- "no-useless-catch": ["error"],
1345
- "no-useless-computed-key": ["error"],
1346
- "no-useless-constructor": ["error"],
1347
- "no-useless-return": ["error"],
1348
- "no-var": ["error"],
1349
- "no-with": ["error"],
1350
- "no-useless-escape": ["error"],
1351
- "object-shorthand": [
1352
- "error",
1353
- "always",
1354
- {
1355
- avoidQuotes: true,
1356
- ignoreConstructors: false
1357
- }
1358
- ],
1359
- "one-var": ["error", { initialized: "never", uninitialized: "never" }],
1360
- "prefer-arrow-callback": [
1361
- "error",
1362
- {
1363
- allowNamedFunctions: false,
1364
- allowUnboundThis: true
1365
- }
1366
- ],
1367
- "prefer-const": [
1368
- "error",
1369
- {
1370
- destructuring: "all",
1371
- ignoreReadBeforeAssign: true
1372
- }
1373
- ],
1374
- "prefer-exponentiation-operator": ["error"],
1375
- "prefer-promise-reject-errors": ["error"],
1376
- "prefer-regex-literals": ["error", { disallowRedundantWrapping: true }],
1377
- "prefer-rest-params": ["error"],
1378
- "prefer-spread": ["error"],
1379
- "prefer-template": ["error"],
1380
- "radix": ["error"],
1381
- "symbol-description": ["error"],
1382
- "vars-on-top": ["error"],
1383
- "yoda": ["error", "never"],
1384
- "unicode-bom": ["error", "never"]
1385
- },
1386
- ...overrides
1387
- }
1388
- ];
1389
- }
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
+ };
1390
701
 
1391
702
  // src/configs/jsdoc.ts
1392
- init_esm_shims();
1393
- var NAMESPACE6 = "exbotanical/jsdoc";
1394
- async function jsdoc() {
1395
- return [
1396
- {
1397
- name: `${NAMESPACE6}/rules`,
1398
- plugins: {
1399
- jsdoc: await interopDefault(import("eslint-plugin-jsdoc"))
1400
- },
1401
- rules: {
1402
- "jsdoc/check-access": ["warn"],
1403
- "jsdoc/check-param-names": ["warn"],
1404
- "jsdoc/check-property-names": ["warn"],
1405
- "jsdoc/check-types": ["warn"],
1406
- "jsdoc/empty-tags": ["warn"],
1407
- "jsdoc/implements-on-classes": ["warn"],
1408
- "jsdoc/no-defaults": ["warn"],
1409
- "jsdoc/no-multi-asterisks": ["warn"],
1410
- "jsdoc/require-param-name": ["warn"],
1411
- "jsdoc/require-property": ["warn"],
1412
- "jsdoc/require-property-description": ["warn"],
1413
- "jsdoc/require-property-name": ["warn"],
1414
- "jsdoc/require-returns-check": ["warn"],
1415
- "jsdoc/require-returns-description": ["warn"],
1416
- "jsdoc/require-yields-check": ["warn"],
1417
- "jsdoc/check-alignment": ["warn"],
1418
- "jsdoc/multiline-blocks": ["warn"]
1419
- }
1420
- }
1421
- ];
1422
- }
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
+ };
1423
742
 
1424
- // src/configs/jsonc.ts
1425
- 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
+ };
1426
772
 
1427
773
  // src/defaults.ts
1428
- init_esm_shims();
1429
774
  var STYLE_DEFAULTS = {
1430
775
  indent: 2,
1431
776
  jsx: true,
@@ -1434,376 +779,428 @@ var STYLE_DEFAULTS = {
1434
779
  };
1435
780
 
1436
781
  // src/configs/jsonc.ts
1437
- var NAMESPACE7 = "exbotanical/jsonc";
1438
- async function jsonc({
1439
- files = [GLOB_JSON, GLOB_JSON5, GLOB_JSONC],
1440
- overrides = {}
1441
- } = {}, { indent } = STYLE_DEFAULTS) {
1442
- const [plugin4, parser] = await Promise.all([
1443
- interopDefault(import("eslint-plugin-jsonc")),
1444
- interopDefault(import("jsonc-eslint-parser"))
1445
- ]);
1446
- return [
1447
- {
1448
- name: `${NAMESPACE7}/setup`,
1449
- plugins: {
1450
- jsonc: plugin4
1451
- }
1452
- },
1453
- {
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({
1454
790
  files,
1455
- languageOptions: {
1456
- parser
1457
- },
1458
- name: `${NAMESPACE7}/rules`,
1459
- rules: {
1460
- "jsonc/no-bigint-literals": "error",
1461
- "jsonc/no-binary-expression": "error",
1462
- "jsonc/no-binary-numeric-literals": "error",
1463
- "jsonc/no-dupe-keys": "error",
1464
- "jsonc/no-escape-sequence-in-identifier": "error",
1465
- "jsonc/no-floating-decimal": "error",
1466
- "jsonc/no-hexadecimal-numeric-literals": "error",
1467
- "jsonc/no-infinity": "error",
1468
- "jsonc/no-multi-str": "error",
1469
- "jsonc/no-nan": "error",
1470
- "jsonc/no-number-props": "error",
1471
- "jsonc/no-numeric-separators": "error",
1472
- "jsonc/no-octal": "error",
1473
- "jsonc/no-octal-escape": "error",
1474
- "jsonc/no-octal-numeric-literals": "error",
1475
- "jsonc/no-parenthesized": "error",
1476
- "jsonc/no-plus-sign": "error",
1477
- "jsonc/no-regexp-literals": "error",
1478
- "jsonc/no-sparse-arrays": "error",
1479
- "jsonc/no-template-literals": "error",
1480
- "jsonc/no-undefined-value": "error",
1481
- "jsonc/no-unicode-codepoint-escapes": "error",
1482
- "jsonc/no-useless-escape": "error",
1483
- "jsonc/space-unary-ops": "error",
1484
- "jsonc/valid-json-number": "error",
1485
- "jsonc/vue-custom-block/no-parsing-error": "error",
1486
- "jsonc/array-bracket-spacing": ["error", "never"],
1487
- "jsonc/comma-dangle": ["error", "never"],
1488
- "jsonc/comma-style": ["error", "last"],
1489
- "jsonc/indent": ["error", indent],
1490
- "jsonc/key-spacing": [
1491
- "error",
1492
- { afterColon: true, beforeColon: false }
1493
- ],
1494
- "jsonc/object-curly-newline": [
1495
- "error",
1496
- { consistent: true, multiline: true }
1497
- ],
1498
- "jsonc/object-curly-spacing": ["error", "always"],
1499
- "jsonc/object-property-newline": [
1500
- "error",
1501
- { allowMultiplePropertiesPerLine: true }
1502
- ],
1503
- "jsonc/quote-props": "error",
1504
- "jsonc/quotes": "error",
1505
- ...overrides
1506
- }
1507
- }
1508
- ];
1509
- }
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
+ };
1510
880
 
1511
881
  // src/configs/jsx.ts
1512
- init_esm_shims();
1513
- var NAMESPACE8 = "exbotanical/jsx";
1514
- async function jsx() {
1515
- return [
1516
- {
1517
- name: `${NAMESPACE8}/setup`,
1518
- files: [GLOB_JSX, GLOB_TSX],
1519
- languageOptions: {
1520
- parserOptions: {
1521
- ecmaFeatures: {
1522
- 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
+ }
1523
896
  }
1524
897
  }
1525
- }
1526
- }
1527
- ];
1528
- }
898
+ })
899
+ ];
900
+ }
901
+ };
1529
902
 
1530
903
  // src/configs/markdown.ts
1531
- init_esm_shims();
1532
- var NAMESPACE9 = "exbotanical/markdown";
1533
- async function markdown({
1534
- files = [GLOB_MARKDOWN],
1535
- overrides = {}
1536
- } = {}) {
1537
- const markdown2 = await interopDefault(import("@eslint/markdown"));
1538
- return [
1539
- {
1540
- name: `${NAMESPACE9}/setup`,
1541
- plugins: { markdown: markdown2 }
1542
- },
1543
- {
1544
- name: `${NAMESPACE9}/processor`,
1545
- files,
1546
- ignores: ["**/*.md/*.md"],
1547
- // `eslint-plugin-markdown` only creates virtual files for code blocks,
1548
- // but not the markdown file itself (we use passthrough for this).
1549
- processor: mergeProcessors([
1550
- markdown2.processors.markdown,
1551
- processorPassThrough
1552
- ])
1553
- },
1554
- {
1555
- name: `${NAMESPACE9}/parser`,
904
+ var MarkdownConfig = class extends CustomConfig {
905
+ namespace = "markdown";
906
+ constructor({ files = [GLOB_MARKDOWN], ...rest } = {}) {
907
+ super({
1556
908
  files,
1557
- languageOptions: {
1558
- parser: parserPlain
1559
- }
1560
- },
1561
- {
1562
- name: `${NAMESPACE9}/disables`,
1563
- files: [GLOB_MARKDOWN_CODE],
1564
- languageOptions: {
1565
- parserOptions: {
1566
- 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
1567
931
  }
1568
- },
1569
- rules: {
1570
- "import/newline-after-import": "off",
1571
- "no-alert": "off",
1572
- "no-console": "off",
1573
- "no-labels": "off",
1574
- "no-lone-blocks": "off",
1575
- "no-restricted-syntax": "off",
1576
- "no-undef": "off",
1577
- "no-unused-expressions": "off",
1578
- "no-unused-labels": "off",
1579
- "no-unused-vars": "off",
1580
- "node/prefer-global/process": "off",
1581
- "style/comma-dangle": "off",
1582
- "style/eol-last": "off",
1583
- "ts/consistent-type-imports": "off",
1584
- "ts/explicit-function-return-type": "off",
1585
- "ts/no-namespace": "off",
1586
- "ts/no-redeclare": "off",
1587
- "ts/no-require-imports": "off",
1588
- "ts/no-unused-expressions": "off",
1589
- "ts/no-unused-vars": "off",
1590
- "ts/no-use-before-define": "off",
1591
- "unicode-bom": "off",
1592
- "unused-imports/no-unused-imports": "off",
1593
- "unused-imports/no-unused-vars": "off",
1594
- ...overrides
1595
- }
1596
- }
1597
- ];
1598
- }
1599
-
1600
- // src/configs/misc/index.ts
1601
- 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
+ };
1602
971
 
1603
972
  // src/configs/misc/perfectionist.ts
1604
- init_esm_shims();
1605
973
  import pluginPerfectionist from "eslint-plugin-perfectionist";
1606
- var NAMESPACE10 = "exbotanical/misc/perfectionist";
1607
- async function perfectionist() {
1608
- return [
1609
- {
1610
- name: `${NAMESPACE10}/setup`,
1611
- plugins: {
1612
- perfectionist: pluginPerfectionist
1613
- },
1614
- rules: {
1615
- "perfectionist/sort-exports": [
1616
- "error",
1617
- { order: "asc", type: "natural" }
1618
- ],
1619
- // 'perfectionist/sort-imports': [
1620
- // 'error',
1621
- // {
1622
- // groups: [
1623
- // 'type',
1624
- // ['parent-type', 'sibling-type', 'index-type', 'internal-type'],
1625
- // 'builtin',
1626
- // 'external',
1627
- // 'internal',
1628
- // ['parent', 'sibling', 'index'],
1629
- // 'side-effect',
1630
- // 'object',
1631
- // 'unknown',
1632
- // ],
1633
- // newlinesBetween: 'ignore',
1634
- // order: 'asc',
1635
- // type: 'natural',
1636
- // },
1637
- // ],
1638
- "perfectionist/sort-named-exports": [
1639
- "error",
1640
- { order: "asc", type: "natural" }
1641
- ]
1642
- // 'perfectionist/sort-named-imports': [
1643
- // 'error',
1644
- // { order: 'asc', type: 'natural' },
1645
- // ],
1646
- }
1647
- }
1648
- ];
1649
- }
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
+ };
1650
1017
 
1651
1018
  // src/configs/misc/unicorn.ts
1652
- init_esm_shims();
1653
- import pluginUnicorn from "eslint-plugin-unicorn";
1654
- var NAMESPACE11 = "exbotanical/misc/unicorn";
1655
- async function unicorn() {
1656
- return [
1657
- {
1658
- name: `${NAMESPACE11}/rules`,
1659
- plugins: {
1660
- unicorn: pluginUnicorn
1661
- },
1662
- rules: {
1663
- ...pluginUnicorn.configs.recommended.rules,
1664
- "unicorn/prevent-abbreviations": "off",
1665
- "unicorn/no-null": "off",
1666
- "unicorn/prefer-top-level-await": "off",
1667
- "unicorn/filename-case": "off",
1668
- "unicorn/no-await-expression-member": "off",
1669
- "unicorn/throw-new-error": "off",
1670
- "unicorn/no-array-callback-reference": "off",
1671
- "unicorn/no-new-array": "off"
1672
- }
1673
- }
1674
- ];
1675
- }
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
+ };
1676
1047
 
1677
1048
  // src/configs/node.ts
1678
- init_esm_shims();
1679
1049
  import plugin3 from "eslint-plugin-n";
1680
- var NAMESPACE12 = "exbotanical/node";
1681
- async function node() {
1682
- return [
1683
- {
1684
- name: `${NAMESPACE12}/rules`,
1685
- plugins: {
1686
- node: plugin3
1687
- },
1688
- rules: {
1689
- "node/handle-callback-err": ["error", "^(err|error)$"],
1690
- "node/no-deprecated-api": "error",
1691
- "node/no-exports-assign": "error",
1692
- "node/no-new-require": "error",
1693
- "node/no-path-concat": "error",
1694
- "node/prefer-global/buffer": ["error", "never"],
1695
- "node/process-exit-as-throw": "error"
1696
- }
1697
- }
1698
- ];
1699
- }
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
+ };
1700
1077
 
1701
1078
  // src/configs/package.json.ts
1702
- init_esm_shims();
1703
- var NAMESPACE13 = "exbotanical/package.json";
1704
- async function packageJson() {
1705
- return [
1706
- {
1707
- name: `${NAMESPACE13}/rules`,
1708
- files: ["**/package.json"],
1709
- rules: {
1710
- "jsonc/sort-array-values": [
1711
- "error",
1712
- {
1713
- order: { type: "asc" },
1714
- pathPattern: "^files$"
1715
- }
1716
- ],
1717
- "jsonc/sort-keys": [
1718
- "error",
1719
- {
1720
- order: [
1721
- "publisher",
1722
- "name",
1723
- "displayName",
1724
- "type",
1725
- "version",
1726
- "private",
1727
- "packageManager",
1728
- "description",
1729
- "author",
1730
- "contributors",
1731
- "license",
1732
- "funding",
1733
- "homepage",
1734
- "repository",
1735
- "bugs",
1736
- "keywords",
1737
- "categories",
1738
- "sideEffects",
1739
- "exports",
1740
- "main",
1741
- "module",
1742
- "unpkg",
1743
- "jsdelivr",
1744
- "types",
1745
- "typesVersions",
1746
- "bin",
1747
- "icon",
1748
- "files",
1749
- "engines",
1750
- "activationEvents",
1751
- "contributes",
1752
- "scripts",
1753
- "peerDependencies",
1754
- "peerDependenciesMeta",
1755
- "dependencies",
1756
- "optionalDependencies",
1757
- "devDependencies",
1758
- "pnpm",
1759
- "overrides",
1760
- "resolutions",
1761
- "husky",
1762
- "simple-git-hooks",
1763
- "lint-staged",
1764
- "eslintConfig"
1765
- ],
1766
- pathPattern: "^$"
1767
- },
1768
- {
1769
- order: { type: "asc" },
1770
- pathPattern: "^(?:dev|peer|optional|bundled)?[Dd]ependencies(Meta)?$"
1771
- },
1772
- {
1773
- order: { type: "asc" },
1774
- pathPattern: "^(?:resolutions|overrides|pnpm.overrides)$"
1775
- },
1776
- {
1777
- order: ["types", "import", "require", "default"],
1778
- pathPattern: "^exports.*$"
1779
- },
1780
- {
1781
- order: [
1782
- // Client hooks only
1783
- "pre-commit",
1784
- "prepare-commit-msg",
1785
- "commit-msg",
1786
- "post-commit",
1787
- "pre-rebase",
1788
- "post-rewrite",
1789
- "post-checkout",
1790
- "post-merge",
1791
- "pre-push",
1792
- "pre-auto-gc"
1793
- ],
1794
- pathPattern: "^(?:gitHooks|husky|simple-git-hooks)$"
1795
- }
1796
- ]
1797
- }
1798
- }
1799
- ];
1800
- }
1801
-
1802
- // src/configs/prettier.ts
1803
- 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
+ };
1804
1202
 
1805
1203
  // src/vendor/plugins/eslint-config-prettier.ts
1806
- init_esm_shims();
1807
1204
  var specialRule = 0;
1808
1205
  var eslint_config_prettier_default = {
1809
1206
  rules: {
@@ -2094,12 +1491,25 @@ var eslint_config_prettier_default = {
2094
1491
  };
2095
1492
 
2096
1493
  // src/configs/prettier.ts
2097
- async function prettier() {
2098
- return [eslint_config_prettier_default];
2099
- }
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
+ };
2100
1511
 
2101
1512
  // src/configs/react.ts
2102
- init_esm_shims();
2103
1513
  import { isPackageExists as isPackageExists2 } from "local-pkg";
2104
1514
  var REACT_REFRESH_ALLOW_CONSTANT_EXPORT_PACKAGES = ["vite"];
2105
1515
  var REACT_ROUTER_PACKAGES = [
@@ -2108,172 +1518,195 @@ var REACT_ROUTER_PACKAGES = [
2108
1518
  "@react-router/serve",
2109
1519
  "@react-router/dev"
2110
1520
  ];
2111
- var NAMESPACE14 = "exbotanical/react";
2112
- async function react({
2113
- files = [GLOB_SRC],
2114
- filesTypeAware = [GLOB_TS, GLOB_TSX],
2115
- ignoresTypeAware = [],
2116
- overrides = {},
2117
- tsconfigPath
2118
- }) {
2119
- const isTypeAware = !!tsconfigPath;
2120
- const typeAwareRules = {
2121
- "react/no-leaked-conditional-rendering": "warn"
2122
- };
2123
- const [pluginReact, pluginReactHooks, pluginReactRefresh] = await Promise.all(
2124
- [
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([
2125
1551
  interopDefault(import("@eslint-react/eslint-plugin")),
2126
1552
  interopDefault(import("eslint-plugin-react-hooks")),
2127
1553
  interopDefault(import("eslint-plugin-react-refresh"))
2128
- ]
2129
- );
2130
- const isAllowConstantExport = REACT_REFRESH_ALLOW_CONSTANT_EXPORT_PACKAGES.some((index) => isPackageExists2(index));
2131
- const isUsingReactRouter = REACT_ROUTER_PACKAGES.some((index) => isPackageExists2(index));
2132
- const plugins = pluginReact.configs.all.plugins;
2133
- return [
2134
- {
2135
- name: `${NAMESPACE14}/setup`,
2136
- plugins: {
2137
- "react": plugins["@eslint-react"],
2138
- "react-dom": plugins["@eslint-react/dom"],
2139
- "react-hooks": pluginReactHooks,
2140
- "react-hooks-extra": plugins["@eslint-react/hooks-extra"],
2141
- "react-naming-convention": plugins["@eslint-react/naming-convention"],
2142
- "react-refresh": pluginReactRefresh,
2143
- "react-web-api": plugins["@eslint-react/web-api"]
2144
- }
2145
- },
2146
- {
2147
- name: `${NAMESPACE14}/rules`,
2148
- files,
2149
- languageOptions: {
2150
- parserOptions: {
2151
- ecmaFeatures: {
2152
- jsx: true
2153
- }
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"
2154
1581
  },
2155
- sourceType: "module"
2156
- },
2157
- rules: {
2158
- // Recommended rules from @eslint-react/dom
2159
- "react-dom/no-children-in-void-dom-elements": "warn",
2160
- "react-dom/no-dangerously-set-innerhtml": "warn",
2161
- "react-dom/no-dangerously-set-innerhtml-with-children": "error",
2162
- "react-dom/no-find-dom-node": "error",
2163
- "react-dom/no-missing-button-type": "warn",
2164
- "react-dom/no-missing-iframe-sandbox": "warn",
2165
- "react-dom/no-namespace": "error",
2166
- "react-dom/no-render-return-value": "error",
2167
- "react-dom/no-script-url": "warn",
2168
- "react-dom/no-unsafe-iframe-sandbox": "warn",
2169
- "react-dom/no-unsafe-target-blank": "warn",
2170
- // Recommended rules react-hooks
2171
- "react-hooks/exhaustive-deps": "warn",
2172
- "react-hooks/rules-of-hooks": "error",
2173
- // React refresh
2174
- "react-refresh/only-export-components": [
2175
- "warn",
2176
- {
2177
- allowConstantExport: isAllowConstantExport,
2178
- allowExportNames: [
2179
- ...isUsingReactRouter ? ["meta", "links", "headers", "loader", "action"] : []
2180
- ]
2181
- }
2182
- ],
2183
- // Recommended rules from @eslint-react/web-api
2184
- "react-web-api/no-leaked-event-listener": "warn",
2185
- "react-web-api/no-leaked-interval": "warn",
2186
- "react-web-api/no-leaked-resize-observer": "warn",
2187
- "react-web-api/no-leaked-timeout": "warn",
2188
- // Recommended rules from @eslint-react
2189
- "react/ensure-forward-ref-using-ref": "warn",
2190
- "react/jsx-no-duplicate-props": "warn",
2191
- "react/jsx-uses-vars": "warn",
2192
- "react/no-access-state-in-setstate": "error",
2193
- "react/no-array-index-key": "warn",
2194
- "react/no-children-count": "warn",
2195
- "react/no-children-for-each": "warn",
2196
- "react/no-children-map": "warn",
2197
- "react/no-children-only": "warn",
2198
- "react/no-children-to-array": "warn",
2199
- "react/no-clone-element": "warn",
2200
- "react/no-comment-textnodes": "warn",
2201
- "react/no-component-will-mount": "error",
2202
- "react/no-component-will-receive-props": "error",
2203
- "react/no-component-will-update": "error",
2204
- "react/no-context-provider": "warn",
2205
- "react/no-create-ref": "error",
2206
- "react/no-default-props": "error",
2207
- "react/no-direct-mutation-state": "error",
2208
- "react/no-duplicate-key": "error",
2209
- "react/no-forward-ref": "warn",
2210
- "react/no-implicit-key": "warn",
2211
- "react/no-missing-key": "error",
2212
- "react/no-nested-components": "error",
2213
- "react/no-prop-types": "error",
2214
- "react/no-redundant-should-component-update": "error",
2215
- "react/no-set-state-in-component-did-mount": "warn",
2216
- "react/no-set-state-in-component-did-update": "warn",
2217
- "react/no-set-state-in-component-will-update": "warn",
2218
- "react/no-string-refs": "error",
2219
- "react/no-unsafe-component-will-mount": "warn",
2220
- "react/no-unsafe-component-will-receive-props": "warn",
2221
- "react/no-unsafe-component-will-update": "warn",
2222
- "react/no-unstable-context-value": "warn",
2223
- "react/no-unstable-default-props": "warn",
2224
- "react/no-unused-class-component-members": "warn",
2225
- "react/no-unused-state": "warn",
2226
- "react/prefer-destructuring-assignment": "warn",
2227
- "react/prefer-shorthand-boolean": "warn",
2228
- "react/prefer-shorthand-fragment": "warn",
2229
- ...overrides
2230
- }
2231
- },
2232
- ...isTypeAware ? [
2233
- {
2234
- name: `${NAMESPACE14}/type-aware-rules`,
2235
- files: filesTypeAware,
2236
- ignores: ignoresTypeAware,
2237
1582
  rules: {
2238
- ...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
2239
1655
  }
2240
- }
2241
- ] : []
2242
- ];
2243
- }
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
+ };
2244
1669
 
2245
1670
  // src/configs/regexpr.ts
2246
- init_esm_shims();
2247
1671
  import { configs } from "eslint-plugin-regexp";
2248
- var NAMESPACE15 = "exbotanical/regexpr";
2249
- async function regexpr({
2250
- level = "error",
2251
- overrides = {}
2252
- } = {}) {
2253
- const config = configs["flat/recommended"];
2254
- const rules = {
2255
- ...config.rules
2256
- };
2257
- if (level === "warn") {
2258
- for (const key in rules) {
2259
- if (rules[key] === "error") rules[key] = "warn";
2260
- }
1672
+ var RegexprConfig = class extends CustomConfig {
1673
+ namespace = "regexpr";
1674
+ constructor({ level = "error", ...rest } = {}) {
1675
+ super({
1676
+ level,
1677
+ ...rest
1678
+ });
2261
1679
  }
2262
- return [
2263
- {
2264
- ...config,
2265
- name: `${NAMESPACE15}/rules`,
2266
- rules: {
2267
- ...rules,
2268
- ...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";
2269
1689
  }
2270
1690
  }
2271
- ];
2272
- }
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
+ };
2273
1708
 
2274
1709
  // src/configs/test.ts
2275
- init_esm_shims();
2276
- var import_flat = __toESM(require_flat(), 1);
2277
1710
  var PLUGIN_RUNNER_MAP = {
2278
1711
  tap: [
2279
1712
  "eslint-plugin-tap",
@@ -2308,633 +1741,714 @@ var PLUGIN_RUNNER_MAP = {
2308
1741
  })
2309
1742
  ]
2310
1743
  };
2311
- var NAMESPACE16 = "exbotanical/test";
2312
- async function test({
2313
- runner = "vitest",
2314
- cypress = false,
2315
- files = GLOB_TESTS,
2316
- overrides = {}
2317
- }) {
2318
- const [plugin4, rules] = PLUGIN_RUNNER_MAP[runner];
2319
- const [pluginRunner, pluginNoOnlyTests] = await Promise.all([
2320
- interopDefault(import(plugin4)),
2321
- // @ts-expect-error no types
2322
- interopDefault(import("eslint-plugin-no-only-tests"))
2323
- ]);
2324
- const extraConfigs = [];
2325
- if (cypress) {
2326
- extraConfigs.push({
2327
- name: `${NAMESPACE16}/cypress/rules`,
2328
- ...import_flat.default.configs.recommended,
2329
- ...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
2330
1757
  });
2331
1758
  }
2332
- return [
2333
- {
2334
- name: `${NAMESPACE16}/setup`,
2335
- plugins: {
2336
- test: {
2337
- ...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"],
2338
1798
  rules: {
2339
- ...pluginNoOnlyTests.rules,
2340
- ...rules(pluginRunner)
1799
+ ...pluginRunner.configs["flat/recommended"].rules
2341
1800
  }
1801
+ })
1802
+ ] : [],
1803
+ this.createRuleConfig("rules", {
1804
+ files,
1805
+ rules: {
1806
+ "test/no-only-tests": "error",
1807
+ ...overrides
2342
1808
  }
2343
- }
2344
- },
2345
- runner === "jest" ? {
2346
- name: `${NAMESPACE16}/jest`,
2347
- ...pluginRunner.configs["flat/recommended"],
2348
- rules: {
2349
- ...pluginRunner.configs["flat/recommended"].rules
2350
- }
2351
- } : {},
2352
- {
2353
- name: `${NAMESPACE16}/rules`,
2354
- files,
2355
- rules: {
2356
- ...overrides
2357
- }
2358
- },
2359
- ...extraConfigs
2360
- ];
2361
- }
1809
+ }),
1810
+ ...extraConfigs
1811
+ ];
1812
+ }
1813
+ };
2362
1814
 
2363
1815
  // src/configs/toml.ts
2364
- init_esm_shims();
2365
- var NAMESPACE17 = "exbotanical/toml";
2366
- async function toml({ files = [GLOB_TOML], overrides = {} } = {}, { indent } = STYLE_DEFAULTS) {
2367
- const [plugin4, parser] = await Promise.all([
2368
- interopDefault(import("eslint-plugin-toml")),
2369
- interopDefault(import("toml-eslint-parser"))
2370
- ]);
2371
- return [
2372
- {
2373
- name: `${NAMESPACE17}/setup`,
2374
- plugins: {
2375
- toml: plugin4
2376
- }
2377
- },
2378
- {
2379
- 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({
2380
1824
  files,
2381
- languageOptions: {
2382
- parser
2383
- },
2384
- rules: {
2385
- "style/spaced-comment": "off",
2386
- "toml/comma-style": "error",
2387
- "toml/keys-order": "error",
2388
- "toml/no-space-dots": "error",
2389
- "toml/no-unreadable-number-separator": "error",
2390
- "toml/precision-of-fractional-seconds": "error",
2391
- "toml/precision-of-integer": "error",
2392
- "toml/tables-order": "error",
2393
- "toml/vue-custom-block/no-parsing-error": "error",
2394
- "toml/array-bracket-newline": "error",
2395
- "toml/array-bracket-spacing": "error",
2396
- "toml/array-element-newline": "error",
2397
- "toml/indent": ["error", indent === "tab" ? 2 : indent],
2398
- "toml/inline-table-curly-spacing": "error",
2399
- "toml/key-spacing": "error",
2400
- "toml/padding-line-between-pairs": "error",
2401
- "toml/padding-line-between-tables": "error",
2402
- "toml/quoted-keys": "error",
2403
- "toml/spaced-comment": "error",
2404
- "toml/table-bracket-spacing": "error",
2405
- ...overrides
2406
- }
2407
- }
2408
- ];
2409
- }
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
+ };
2410
1877
 
2411
1878
  // src/configs/tsconfig.ts
2412
- init_esm_shims();
2413
- var NAMESPACE18 = "exbotanical/tsconfig";
2414
- async function tsconfig() {
2415
- return [
2416
- {
2417
- name: `${NAMESPACE18}/rules`,
2418
- files: ["**/tsconfig.json", "**/tsconfig.*.json"],
2419
- rules: {
2420
- "jsonc/sort-keys": [
2421
- "error",
2422
- {
2423
- order: [
2424
- "extends",
2425
- "compilerOptions",
2426
- "references",
2427
- "files",
2428
- "include",
2429
- "exclude"
2430
- ],
2431
- pathPattern: "^$"
2432
- },
2433
- {
2434
- order: [
2435
- /* Projects */
2436
- "incremental",
2437
- "composite",
2438
- "tsBuildInfoFile",
2439
- "disableSourceOfProjectReferenceRedirect",
2440
- "disableSolutionSearching",
2441
- "disableReferencedProjectLoad",
2442
- /* Language and Environment */
2443
- "target",
2444
- "jsx",
2445
- "jsxFactory",
2446
- "jsxFragmentFactory",
2447
- "jsxImportSource",
2448
- "lib",
2449
- "moduleDetection",
2450
- "noLib",
2451
- "reactNamespace",
2452
- "useDefineForClassFields",
2453
- "emitDecoratorMetadata",
2454
- "experimentalDecorators",
2455
- /* Modules */
2456
- "baseUrl",
2457
- "rootDir",
2458
- "rootDirs",
2459
- "customConditions",
2460
- "module",
2461
- "moduleResolution",
2462
- "moduleSuffixes",
2463
- "noResolve",
2464
- "paths",
2465
- "resolveJsonModule",
2466
- "resolvePackageJsonExports",
2467
- "resolvePackageJsonImports",
2468
- "typeRoots",
2469
- "types",
2470
- "allowArbitraryExtensions",
2471
- "allowImportingTsExtensions",
2472
- "allowUmdGlobalAccess",
2473
- /* JavaScript Support */
2474
- "allowJs",
2475
- "checkJs",
2476
- "maxNodeModuleJsDepth",
2477
- /* Type Checking */
2478
- "strict",
2479
- "strictBindCallApply",
2480
- "strictFunctionTypes",
2481
- "strictNullChecks",
2482
- "strictPropertyInitialization",
2483
- "allowUnreachableCode",
2484
- "allowUnusedLabels",
2485
- "alwaysStrict",
2486
- "exactOptionalPropertyTypes",
2487
- "noFallthroughCasesInSwitch",
2488
- "noImplicitAny",
2489
- "noImplicitOverride",
2490
- "noImplicitReturns",
2491
- "noImplicitThis",
2492
- "noPropertyAccessFromIndexSignature",
2493
- "noUncheckedIndexedAccess",
2494
- "noUnusedLocals",
2495
- "noUnusedParameters",
2496
- "useUnknownInCatchVariables",
2497
- /* Emit */
2498
- "declaration",
2499
- "declarationDir",
2500
- "declarationMap",
2501
- "downlevelIteration",
2502
- "emitBOM",
2503
- "emitDeclarationOnly",
2504
- "importHelpers",
2505
- "importsNotUsedAsValues",
2506
- "inlineSourceMap",
2507
- "inlineSources",
2508
- "mapRoot",
2509
- "newLine",
2510
- "noEmit",
2511
- "noEmitHelpers",
2512
- "noEmitOnError",
2513
- "outDir",
2514
- "outFile",
2515
- "preserveConstEnums",
2516
- "preserveValueImports",
2517
- "removeComments",
2518
- "sourceMap",
2519
- "sourceRoot",
2520
- "stripInternal",
2521
- /* Interop Constraints */
2522
- "allowSyntheticDefaultImports",
2523
- "esModuleInterop",
2524
- "forceConsistentCasingInFileNames",
2525
- "isolatedDeclarations",
2526
- "isolatedModules",
2527
- "preserveSymlinks",
2528
- "verbatimModuleSyntax",
2529
- /* Completeness */
2530
- "skipDefaultLibCheck",
2531
- "skipLibCheck"
2532
- ],
2533
- pathPattern: "^compilerOptions$"
2534
- }
2535
- ]
2536
- }
2537
- }
2538
- ];
2539
- }
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
+ };
2540
2011
 
2541
2012
  // src/configs/typescript.ts
2542
- init_esm_shims();
2543
- var NAMESPACE19 = "exbotanical/typescript";
2544
- async function typescript(options = {}) {
2545
- const {
2546
- type = "app",
2013
+ var TypescriptConfig = class extends CustomConfig {
2014
+ namespace = "typescript";
2015
+ constructor({
2547
2016
  parserOptions = {},
2548
- overrides = {},
2549
2017
  typeAwareOverrides = {},
2550
- ignoresTypeAware = []
2551
- } = options;
2552
- const files = options.files ?? [GLOB_TS, GLOB_TSX];
2553
- const filesTypeAware = options.filesTypeAware ?? [GLOB_TS, GLOB_TSX];
2554
- const tsconfigPath = options?.tsconfigPath;
2555
- const isTypeAware = !!tsconfigPath;
2556
- const typeAwareRules = {
2557
- "dot-notation": ["off"],
2558
- "no-implied-eval": ["off"],
2559
- "ts/await-thenable": ["error"],
2560
- "ts/dot-notation": ["error", { allowKeywords: true }],
2561
- "ts/no-floating-promises": ["error"],
2562
- "ts/no-for-in-array": ["error"],
2563
- "ts/no-implied-eval": ["error"],
2564
- "ts/no-misused-promises": ["error"],
2565
- "ts/no-unnecessary-type-assertion": ["error"],
2566
- "ts/no-unsafe-argument": ["error"],
2567
- "ts/no-unsafe-assignment": ["error"],
2568
- "ts/no-unsafe-call": ["error"],
2569
- "ts/no-unsafe-member-access": ["error"],
2570
- "ts/no-unsafe-return": ["error"],
2571
- "ts/promise-function-async": ["error"],
2572
- "ts/restrict-plus-operands": ["error"],
2573
- "ts/restrict-template-expressions": ["error"],
2574
- "ts/return-await": ["error", "in-try-catch"],
2575
- "ts/strict-boolean-expressions": [
2576
- "error",
2577
- { allowNullableBoolean: true, allowNullableObject: true }
2578
- ],
2579
- "ts/switch-exhaustiveness-check": ["error"],
2580
- "ts/unbound-method": ["error"]
2581
- };
2582
- const [plugin4, parser] = await Promise.all([
2583
- interopDefault(import("@typescript-eslint/eslint-plugin")),
2584
- interopDefault(import("@typescript-eslint/parser"))
2585
- ]);
2586
- function makeParser(typeAware, files2, ignores2 = []) {
2587
- return {
2588
- name: `${NAMESPACE19}/${typeAware ? "type-aware-parser" : "parser"}`,
2589
- files: files2,
2590
- ignores: ignores2,
2591
- languageOptions: {
2592
- parser,
2593
- parserOptions: {
2594
- sourceType: "module",
2595
- ...typeAware ? {
2596
- projectService: {
2597
- allowDefaultProject: ["./*.js"],
2598
- defaultProject: tsconfigPath
2599
- },
2600
- tsconfigRootDir: process.cwd()
2601
- } : {},
2602
- ...parserOptions
2603
- }
2604
- }
2605
- };
2018
+ ignoresTypeAware = [],
2019
+ ...rest
2020
+ } = {}) {
2021
+ super({
2022
+ parserOptions,
2023
+ typeAwareOverrides,
2024
+ ignoresTypeAware,
2025
+ ...rest
2026
+ });
2606
2027
  }
2607
- return [
2608
- {
2609
- name: `${NAMESPACE19}/setup`,
2610
- plugins: {
2611
- ts: plugin4
2612
- }
2613
- },
2614
- makeParser(false, files),
2615
- ...isTypeAware ? [makeParser(true, filesTypeAware, ignoresTypeAware)] : [],
2616
- {
2617
- name: `${NAMESPACE19}/rules`,
2618
- files,
2619
- rules: {
2620
- ...renameRules(
2621
- plugin4.configs["eslint-recommended"].overrides[0].rules,
2622
- { "@typescript-eslint": "ts" }
2623
- ),
2624
- ...renameRules(plugin4.configs.strict.rules, {
2625
- "@typescript-eslint": "ts"
2626
- }),
2627
- "no-dupe-class-members": ["off"],
2628
- "no-redeclare": ["off"],
2629
- "no-use-before-define": ["off"],
2630
- "no-useless-constructor": ["off"],
2631
- "ts/ban-ts-comment": [
2632
- "error",
2633
- { "ts-expect-error": "allow-with-description" }
2634
- ],
2635
- "ts/consistent-type-definitions": ["error", "interface"],
2636
- "ts/consistent-type-imports": [
2637
- "error",
2638
- {
2639
- disallowTypeAnnotations: false,
2640
- fixStyle: "separate-type-imports",
2641
- prefer: "type-imports"
2642
- }
2643
- ],
2644
- // See: https://www.totaltypescript.com/method-shorthand-syntax-considered-harmful
2645
- "ts/method-signature-style": ["error", "property"],
2646
- "ts/no-dupe-class-members": ["error"],
2647
- "ts/no-dynamic-delete": ["off"],
2648
- "ts/no-empty-object-type": ["error", { allowInterfaces: "always" }],
2649
- "ts/no-explicit-any": ["warn"],
2650
- "ts/no-extraneous-class": ["off"],
2651
- "ts/no-import-type-side-effects": ["error"],
2652
- "ts/no-invalid-void-type": ["error"],
2653
- "ts/no-non-null-assertion": ["error"],
2654
- "ts/no-redeclare": ["error", { builtinGlobals: false }],
2655
- "ts/no-require-imports": ["error"],
2656
- "ts/no-unused-expressions": [
2657
- "error",
2658
- {
2659
- allowShortCircuit: true,
2660
- allowTaggedTemplates: true,
2661
- allowTernary: true
2662
- }
2663
- ],
2664
- "ts/no-unused-vars": [
2665
- "error",
2666
- {
2667
- vars: "all",
2668
- args: "all",
2669
- argsIgnorePattern: VAR_IGNORE_PATTERN,
2670
- caughtErrorsIgnorePattern: VAR_IGNORE_PATTERN,
2671
- destructuredArrayIgnorePattern: VAR_IGNORE_PATTERN,
2672
- 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
2673
2081
  }
2674
- ],
2675
- "ts/no-use-before-define": [
2676
- "error",
2677
- { classes: false, functions: false, variables: true }
2678
- ],
2679
- "ts/no-useless-constructor": ["error"],
2680
- "ts/no-wrapper-object-types": ["error"],
2681
- "ts/triple-slash-reference": ["off"],
2682
- "ts/unified-signatures": ["off"],
2683
- ...type === "lib" ? {
2684
- "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": [
2685
2109
  "error",
2686
2110
  {
2687
- allowExpressions: true,
2688
- allowHigherOrderFunctions: true,
2689
- allowIIFEs: true
2111
+ disallowTypeAnnotations: false,
2112
+ fixStyle: "separate-type-imports",
2113
+ prefer: "type-imports"
2690
2114
  }
2691
- ]
2692
- } : {},
2693
- ...overrides
2694
- }
2695
- },
2696
- ...isTypeAware ? [
2697
- {
2698
- name: `${NAMESPACE19}/rules-type-aware`,
2699
- files: filesTypeAware,
2700
- ignores: ignoresTypeAware,
2701
- rules: {
2702
- ...typeAwareRules,
2703
- ...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
2704
2156
  }
2705
- }
2706
- ] : []
2707
- ];
2708
- }
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
+ };
2709
2171
 
2710
2172
  // src/configs/vue.ts
2711
- init_esm_shims();
2712
- var NAMESPACE20 = "exbotanical/vue";
2713
- async function vue({
2714
- files = [GLOB_VUE],
2715
- overrides = {},
2716
- typescript: typescript2 = true,
2717
- vueVersion = 3,
2718
- graphql: graphql2 = false
2719
- }, { indent } = STYLE_DEFAULTS) {
2720
- const [pluginVue, parserVue, processorVueBlocks] = await Promise.all([
2721
- interopDefault(import("eslint-plugin-vue")),
2722
- interopDefault(import("vue-eslint-parser")),
2723
- interopDefault(import("eslint-processor-vue-blocks"))
2724
- ]);
2725
- return [
2726
- {
2727
- name: `${NAMESPACE20}/setup`,
2728
- plugins: {
2729
- vue: pluginVue
2730
- },
2731
- languageOptions: {
2732
- globals: {
2733
- computed: "readonly",
2734
- defineEmits: "readonly",
2735
- defineExpose: "readonly",
2736
- defineProps: "readonly",
2737
- onMounted: "readonly",
2738
- onUnmounted: "readonly",
2739
- reactive: "readonly",
2740
- ref: "readonly",
2741
- shallowReactive: "readonly",
2742
- shallowRef: "readonly",
2743
- toRef: "readonly",
2744
- toRefs: "readonly",
2745
- watch: "readonly",
2746
- watchEffect: "readonly"
2747
- }
2748
- }
2749
- },
2750
- {
2751
- 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({
2752
2184
  files,
2753
- languageOptions: {
2754
- parser: parserVue,
2755
- parserOptions: {
2756
- ecmaFeatures: {
2757
- jsx: true
2758
- },
2759
- extraFileExtensions: [".vue"],
2760
- parser: typescript2 ? await interopDefault(import("@typescript-eslint/parser")) : null,
2761
- sourceType: "module"
2762
- }
2763
- },
2764
- processor: graphql2 === false ? pluginVue.processors[".vue"] : mergeProcessors([
2765
- pluginVue.processors[".vue"],
2766
- processorVueBlocks({
2767
- blocks: {
2768
- script: true,
2769
- scriptSetup: true,
2770
- customBlocks: true
2771
- }
2772
- })
2773
- ]),
2774
- rules: {
2775
- ...pluginVue.configs.base.rules,
2776
- ...vueVersion === 2 ? {
2777
- ...pluginVue.configs.essential.rules,
2778
- ...pluginVue.configs["strongly-recommended"].rules,
2779
- ...pluginVue.configs.recommended.rules
2780
- } : {
2781
- ...pluginVue.configs["vue3-essential"].rules,
2782
- ...pluginVue.configs["vue3-strongly-recommended"].rules,
2783
- ...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
2784
2210
  },
2785
- "node/prefer-global/process": "off",
2786
- "ts/explicit-function-return-type": "off",
2787
- "vue/block-order": [
2788
- "error",
2789
- {
2790
- order: ["script", "template", "style"]
2791
- }
2792
- ],
2793
- "vue/component-name-in-template-casing": ["error", "PascalCase"],
2794
- "vue/component-options-name-casing": ["error", "PascalCase"],
2795
- "vue/component-tags-order": "off",
2796
- "vue/custom-event-name-casing": ["error", "camelCase"],
2797
- "vue/define-macros-order": [
2798
- "error",
2799
- {
2800
- order: ["defineOptions", "defineProps", "defineEmits", "defineSlots"]
2801
- }
2802
- ],
2803
- "vue/dot-location": ["error", "property"],
2804
- "vue/dot-notation": ["error", { allowKeywords: true }],
2805
- "vue/eqeqeq": ["error", "smart"],
2806
- "vue/html-indent": ["error", indent],
2807
- "vue/html-quotes": ["error", "double"],
2808
- "vue/max-attributes-per-line": "off",
2809
- "vue/multi-word-component-names": "off",
2810
- "vue/no-dupe-keys": "off",
2811
- "vue/no-empty-pattern": "error",
2812
- "vue/no-irregular-whitespace": "error",
2813
- "vue/no-loss-of-precision": "error",
2814
- "vue/no-restricted-syntax": [
2815
- "error",
2816
- "DebuggerStatement",
2817
- "LabeledStatement",
2818
- "WithStatement"
2819
- ],
2820
- "vue/no-restricted-v-bind": ["error", "/^v-/"],
2821
- "vue/no-setup-props-reactivity-loss": "off",
2822
- "vue/no-sparse-arrays": "error",
2823
- "vue/no-unused-refs": "error",
2824
- "vue/no-useless-v-bind": "error",
2825
- "vue/no-v-html": "off",
2826
- "vue/object-shorthand": [
2827
- "error",
2828
- "always",
2829
- {
2830
- avoidQuotes: true,
2831
- ignoreConstructors: false
2832
- }
2833
- ],
2834
- "vue/prefer-separate-static-class": "error",
2835
- "vue/prefer-template": "error",
2836
- "vue/prop-name-casing": ["error", "camelCase"],
2837
- "vue/require-default-prop": "off",
2838
- "vue/require-prop-types": "off",
2839
- "vue/space-infix-ops": "error",
2840
- "vue/space-unary-ops": ["error", { nonwords: false, words: true }],
2841
- "vue/array-bracket-spacing": ["error", "never"],
2842
- "vue/arrow-spacing": ["error", { after: true, before: true }],
2843
- "vue/block-spacing": ["error", "always"],
2844
- "vue/block-tag-newline": [
2845
- "error",
2846
- {
2847
- multiline: "always",
2848
- 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"
2849
2227
  }
2850
- ],
2851
- "vue/brace-style": ["error", "stroustrup", { allowSingleLine: true }],
2852
- "vue/comma-dangle": ["error", "always-multiline"],
2853
- "vue/comma-spacing": ["error", { after: true, before: false }],
2854
- "vue/comma-style": ["error", "last"],
2855
- "vue/html-comment-content-spacing": [
2856
- "error",
2857
- "always",
2858
- {
2859
- 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"
2860
2241
  }
2861
- ],
2862
- "vue/key-spacing": ["error", { afterColon: true, beforeColon: false }],
2863
- "vue/keyword-spacing": ["error", { after: true, before: true }],
2864
- "vue/object-curly-newline": "off",
2865
- "vue/object-curly-spacing": ["error", "always"],
2866
- "vue/object-property-newline": [
2867
- "error",
2868
- { allowMultiplePropertiesPerLine: true }
2869
- ],
2870
- "vue/operator-linebreak": ["error", "before"],
2871
- "vue/padding-line-between-blocks": ["error", "always"],
2872
- "vue/quote-props": ["error", "consistent-as-needed"],
2873
- "vue/space-in-parens": ["error", "never"],
2874
- "vue/template-curly-spacing": "error",
2875
- ...overrides
2876
- }
2877
- }
2878
- ];
2879
- }
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
+ };
2880
2360
 
2881
2361
  // src/configs/yaml.ts
2882
- init_esm_shims();
2883
- var NAMESPACE21 = "exbotanical/yaml";
2884
- async function yaml({ files = [GLOB_YAML], overrides = {} } = {}, { indent, quotes } = STYLE_DEFAULTS) {
2885
- const [plugin4, parser] = await Promise.all([
2886
- interopDefault(import("eslint-plugin-yml")),
2887
- interopDefault(import("yaml-eslint-parser"))
2888
- ]);
2889
- return [
2890
- {
2891
- name: `${NAMESPACE21}/setup`,
2892
- plugins: {
2893
- yaml: plugin4
2894
- }
2895
- },
2896
- {
2897
- 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({
2898
2371
  files,
2899
- languageOptions: {
2900
- parser
2901
- },
2902
- rules: {
2903
- "style/spaced-comment": "off",
2904
- "yaml/block-mapping-colon-indicator-newline": "error",
2905
- "yaml/block-mapping-question-indicator-newline": "error",
2906
- "yaml/block-mapping": "error",
2907
- "yaml/block-sequence": "error",
2908
- "yaml/no-empty-key": "error",
2909
- "yaml/no-empty-sequence-entry": "error",
2910
- "yaml/no-irregular-whitespace": "error",
2911
- "yaml/plain-scalar": "error",
2912
- "yaml/vue-custom-block/no-parsing-error": "error",
2913
- "yaml/block-sequence-hyphen-indicator-newline": "error",
2914
- "yaml/flow-mapping-curly-newline": "error",
2915
- "yaml/flow-mapping-curly-spacing": "error",
2916
- "yaml/flow-sequence-bracket-newline": "error",
2917
- "yaml/flow-sequence-bracket-spacing": "error",
2918
- "yaml/indent": ["error", indent === "tab" ? 2 : indent],
2919
- "yaml/key-spacing": "error",
2920
- "yaml/no-tab-indent": "error",
2921
- "yaml/quotes": [
2922
- "error",
2923
- {
2924
- avoidEscape: true,
2925
- 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
+ ]
2926
2446
  }
2927
- ],
2928
- "yaml/spaced-comment": "error",
2929
- "yaml/no-empty-document": "error",
2930
- "yaml/no-empty-mapping-value": "error",
2931
- "yaml/no-trailing-zeros": "error",
2932
- "yaml/no-multiple-empty-lines": "error",
2933
- ...overrides
2934
- }
2935
- }
2936
- ];
2937
- }
2447
+ })
2448
+ ] : []
2449
+ ];
2450
+ }
2451
+ };
2938
2452
 
2939
2453
  // src/factory.ts
2940
2454
  async function exbotanical({
@@ -2951,55 +2465,96 @@ async function exbotanical({
2951
2465
  react: optionsReact,
2952
2466
  vue: optionsVue,
2953
2467
  graphql: optionsGraphql,
2468
+ packageJson: optionsPackageJson = false,
2469
+ jsonSchema: optionsJsonSchema = false,
2470
+ githubAction: optionsGithubAction = false,
2471
+ css: optionsCss = false,
2472
+ perfectionist: optionsPerfectionist,
2954
2473
  type
2955
- }, ...userConfigs) {
2474
+ } = {}, ...userConfigs) {
2956
2475
  const configs2 = [
2957
- perfectionist(),
2958
- unicorn(),
2959
- comments(),
2960
- imports(),
2961
- javascript({ ...optionsJavascript, type }),
2962
- jsdoc(),
2963
- jsx(),
2964
- node(),
2965
- regexpr(),
2966
- 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()
2967
2486
  ];
2968
2487
  if (optionsJsonc) {
2969
2488
  configs2.push(
2970
- packageJson(),
2971
- tsconfig(),
2972
- jsonc({
2489
+ ...optionsPackageJson ? [] : [new PackageJsonConfig().rules()],
2490
+ new TsconfigConfig().rules(),
2491
+ new JsoncConfig({
2973
2492
  ...factoryConfig(optionsJsonc),
2974
2493
  ...optionsStyle
2975
- })
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()
2976
2508
  );
2977
2509
  }
2510
+ if (optionsCss) {
2511
+ configs2.push(new CssConfig({ ...factoryConfig(optionsCss) }).rules());
2512
+ }
2978
2513
  if (optionsMarkdown) {
2979
- configs2.push(markdown({ ...factoryConfig(optionsMarkdown) }));
2514
+ configs2.push(new MarkdownConfig({ ...factoryConfig(optionsMarkdown) }).rules());
2980
2515
  }
2981
2516
  if (optionsGraphql) {
2982
- configs2.push(graphql());
2517
+ configs2.push(new GraphqlConfig().rules());
2983
2518
  }
2984
2519
  if (optionsReact) {
2985
- configs2.push(react({ ...factoryConfig(optionsReact) }));
2520
+ configs2.push(new ReactConfig({ ...factoryConfig(optionsReact) }).rules());
2986
2521
  }
2987
2522
  if (optionsToml) {
2988
- configs2.push(toml({ ...factoryConfig(optionsToml), ...optionsStyle }));
2523
+ configs2.push(
2524
+ new TomlConfig({ ...factoryConfig(optionsToml), ...optionsStyle }).rules()
2525
+ );
2989
2526
  }
2990
2527
  if (optionsTypescript) {
2991
- configs2.push(typescript({ ...factoryConfig(optionsTypescript), type }));
2528
+ configs2.push(
2529
+ new TypescriptConfig({ ...factoryConfig(optionsTypescript), type }).rules()
2530
+ );
2992
2531
  }
2993
2532
  if (optionsVue) {
2994
- configs2.push(vue({ ...factoryConfig(optionsVue), graphql: !!optionsGraphql }));
2533
+ configs2.push(
2534
+ new VueConfig({ ...factoryConfig(optionsVue), graphql: !!optionsGraphql }).rules()
2535
+ );
2995
2536
  }
2996
2537
  if (optionsYaml) {
2997
- configs2.push(yaml({ ...factoryConfig(optionsYaml), ...optionsStyle }));
2538
+ configs2.push(
2539
+ new YamlConfig({ ...factoryConfig(optionsYaml), ...optionsStyle }).rules()
2540
+ );
2998
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
+ );
2999
2551
  if (formatter) {
3000
- configs2.push(prettier());
2552
+ configs2.push(new PrettierConfig().rules());
3001
2553
  }
3002
- configs2.push(disables(), ignores(optionsIgnore));
2554
+ configs2.push(
2555
+ new DisablesConfig().rules(),
2556
+ new IgnoresConfig({ files: optionsIgnore }).rules()
2557
+ );
3003
2558
  if (userConfigs.length > 0) {
3004
2559
  const resolved2 = await Promise.all(userConfigs);
3005
2560
  configs2.push(...resolved2.map((r) => Promise.resolve(Array.isArray(r) ? r : [r])));
@@ -3011,12 +2566,33 @@ function factoryConfig(options) {
3011
2566
  if (!options) return {};
3012
2567
  return typeof options === "boolean" ? {} : options;
3013
2568
  }
3014
-
3015
- // src/options.ts
3016
- init_esm_shims();
3017
-
3018
- // src/types.ts
3019
- init_esm_shims();
3020
2569
  export {
2570
+ GLOB_CSS,
2571
+ GLOB_EXCLUDES,
2572
+ GLOB_GITHUB_WORKFLOW,
2573
+ GLOB_GRAPHQL,
2574
+ GLOB_HTML,
2575
+ GLOB_JS,
2576
+ GLOB_JSON,
2577
+ GLOB_JSON5,
2578
+ GLOB_JSONC,
2579
+ GLOB_JSX,
2580
+ GLOB_LESS,
2581
+ GLOB_MARKDOWN,
2582
+ GLOB_MARKDOWN_CODE,
2583
+ GLOB_POSTCSS,
2584
+ GLOB_SCRIPTS,
2585
+ GLOB_SCSS,
2586
+ GLOB_SRC,
2587
+ GLOB_SRC_EXT,
2588
+ GLOB_STYLE,
2589
+ GLOB_SVG,
2590
+ GLOB_TESTS,
2591
+ GLOB_TOML,
2592
+ GLOB_TS,
2593
+ GLOB_TSX,
2594
+ GLOB_VUE,
2595
+ GLOB_XML,
2596
+ GLOB_YAML,
3021
2597
  exbotanical as default
3022
2598
  };