@exbotanical/eslint-config 1.1.2 → 1.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,6 +1,794 @@
1
- import {
2
- init_esm_shims
3
- } from "./chunk-6GNDNAEM.js";
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
+ });
600
+
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
+ });
646
+
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
+ }
689
+ };
690
+ }
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
+ }
723
+ };
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
+ }
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;
790
+ }
791
+ });
4
792
 
5
793
  // src/index.ts
6
794
  init_esm_shims();
@@ -53,7 +841,15 @@ var GLOB_MARKDOWN = "**/*.md";
53
841
  var GLOB_VUE = "**/*.vue";
54
842
  var GLOB_YAML = "**/*.y?(a)ml";
55
843
  var GLOB_TOML = "**/*.toml";
844
+ var GLOB_XML = "**/*.xml";
845
+ var GLOB_SVG = "**/*.svg";
846
+ var GLOB_HTML = "**/*.htm?(l)";
56
847
  var GLOB_GRAPHQL = "**/*.{g,graph}ql";
848
+ var GLOB_STYLE = "**/*.{c,le,sc}ss";
849
+ var GLOB_CSS = "**/*.css";
850
+ var GLOB_POSTCSS = "**/*.{p,post}css";
851
+ var GLOB_LESS = "**/*.less";
852
+ var GLOB_SCSS = "**/*.scss";
57
853
  var GLOB_MARKDOWN_CODE = `${GLOB_MARKDOWN}/${GLOB_SRC}`;
58
854
  var GLOB_TESTS = [
59
855
  `**/__tests__/**/*.${GLOB_SRC_EXT}`,
@@ -139,7 +935,7 @@ init_esm_shims();
139
935
 
140
936
  // src/utils.ts
141
937
  init_esm_shims();
142
- import { fileURLToPath } from "node:url";
938
+ import { fileURLToPath as fileURLToPath2 } from "node:url";
143
939
  import { isPackageExists } from "local-pkg";
144
940
  var parserPlain = {
145
941
  meta: {
@@ -215,7 +1011,7 @@ var processorPassThrough = {
215
1011
  return messages[0];
216
1012
  }
217
1013
  };
218
- var scopeUrl = fileURLToPath(new URL(".", import.meta.url));
1014
+ var scopeUrl = fileURLToPath2(new URL(".", import.meta.url));
219
1015
 
220
1016
  // src/configs/graphql.ts
221
1017
  async function graphql() {
@@ -878,7 +1674,9 @@ async function unicorn() {
878
1674
  "unicorn/prefer-top-level-await": "off",
879
1675
  "unicorn/filename-case": "off",
880
1676
  "unicorn/no-await-expression-member": "off",
881
- "unicorn/throw-new-error": "off"
1677
+ "unicorn/throw-new-error": "off",
1678
+ "unicorn/no-array-callback-reference": "off",
1679
+ "unicorn/no-new-array": "off"
882
1680
  }
883
1681
  }
884
1682
  ];
@@ -1483,6 +2281,7 @@ async function regexpr({
1483
2281
 
1484
2282
  // src/configs/test.ts
1485
2283
  init_esm_shims();
2284
+ var import_flat = __toESM(require_flat(), 1);
1486
2285
  var PLUGIN_RUNNER_MAP = {
1487
2286
  tap: [
1488
2287
  "eslint-plugin-tap",
@@ -1506,14 +2305,14 @@ var PLUGIN_RUNNER_MAP = {
1506
2305
  ],
1507
2306
  vitest: [
1508
2307
  "@vitest/eslint-plugin",
1509
- async () => ({
1510
- ...(await interopDefault(import("@vitest/eslint-plugin"))).configs.recommended.rules
2308
+ (plugin4) => ({
2309
+ ...plugin4.configs.recommended.rules
1511
2310
  })
1512
2311
  ],
1513
2312
  jest: [
1514
2313
  "eslint-plugin-jest",
1515
- async () => ({
1516
- ...(await interopDefault(import("./lib-C4ZW2PPJ.js"))).configs["flat/recommended"].rules
2314
+ (plugin4) => ({
2315
+ ...plugin4.configs["flat/recommended"].rules
1517
2316
  })
1518
2317
  ]
1519
2318
  };
@@ -1532,10 +2331,9 @@ async function test({
1532
2331
  ]);
1533
2332
  const extraConfigs = [];
1534
2333
  if (cypress) {
1535
- const pluginCypress = await interopDefault(import("./flat-QQMMJZVN.js"));
1536
2334
  extraConfigs.push({
1537
2335
  name: `${NAMESPACE16}/cypress/rules`,
1538
- ...pluginCypress.configs.recommended,
2336
+ ...import_flat.default.configs.recommended,
1539
2337
  ...typeof cypress === "boolean" ? {} : cypress
1540
2338
  });
1541
2339
  }
@@ -1546,12 +2344,20 @@ async function test({
1546
2344
  test: {
1547
2345
  ...pluginRunner,
1548
2346
  rules: {
1549
- ...await Promise.resolve(rules()),
1550
- ...pluginNoOnlyTests.rules
2347
+ ...pluginNoOnlyTests.rules,
2348
+ ...rules(pluginRunner)
1551
2349
  }
1552
2350
  }
1553
2351
  }
1554
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
+ } : {},
1555
2361
  {
1556
2362
  name: `${NAMESPACE16}/rules`,
1557
2363
  files,
@@ -2221,5 +3027,30 @@ init_esm_shims();
2221
3027
  // src/types.ts
2222
3028
  init_esm_shims();
2223
3029
  export {
3030
+ GLOB_CSS,
3031
+ GLOB_EXCLUDES,
3032
+ GLOB_GRAPHQL,
3033
+ GLOB_HTML,
3034
+ GLOB_JS,
3035
+ GLOB_JSON,
3036
+ GLOB_JSON5,
3037
+ GLOB_JSONC,
3038
+ GLOB_JSX,
3039
+ GLOB_LESS,
3040
+ GLOB_MARKDOWN,
3041
+ GLOB_MARKDOWN_CODE,
3042
+ GLOB_POSTCSS,
3043
+ GLOB_SCSS,
3044
+ GLOB_SRC,
3045
+ GLOB_SRC_EXT,
3046
+ GLOB_STYLE,
3047
+ GLOB_SVG,
3048
+ GLOB_TESTS,
3049
+ GLOB_TOML,
3050
+ GLOB_TS,
3051
+ GLOB_TSX,
3052
+ GLOB_VUE,
3053
+ GLOB_XML,
3054
+ GLOB_YAML,
2224
3055
  exbotanical as default
2225
3056
  };