@exbotanical/eslint-config 1.1.4 → 2.0.1

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