@jimmy.codes/eslint-config 4.3.1 → 5.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js ADDED
@@ -0,0 +1,538 @@
1
+ import {
2
+ hasAstro,
3
+ hasJest,
4
+ hasNext,
5
+ hasPlaywright,
6
+ hasReact,
7
+ hasReactQuery,
8
+ hasStorybook,
9
+ hasTestingLibrary,
10
+ hasTypescript,
11
+ hasVitest
12
+ } from "./chunk-OCS4JNPP.js";
13
+ import {
14
+ GLOB_CJS,
15
+ GLOB_IGNORES,
16
+ GLOB_TESTS
17
+ } from "./chunk-N5KZEOXT.js";
18
+
19
+ // src/configs/commonjs.ts
20
+ import globals from "globals";
21
+ var commonjsConfig = () => {
22
+ return [
23
+ {
24
+ files: [GLOB_CJS],
25
+ languageOptions: {
26
+ globals: globals.commonjs
27
+ },
28
+ name: "jimmy.codes/commonjs"
29
+ }
30
+ ];
31
+ };
32
+
33
+ // src/configs/eslint-comments.ts
34
+ import comments2 from "@eslint-community/eslint-plugin-eslint-comments/configs";
35
+
36
+ // src/rules/eslint-comments.ts
37
+ import comments from "@eslint-community/eslint-plugin-eslint-comments/configs";
38
+ var eslintCommentsRules = {
39
+ ...comments.recommended.rules,
40
+ "@eslint-community/eslint-comments/no-unused-disable": "off",
41
+ "@eslint-community/eslint-comments/require-description": "error"
42
+ };
43
+
44
+ // src/configs/eslint-comments.ts
45
+ var eslintCommentsConfig = () => {
46
+ return [
47
+ {
48
+ ...comments2.recommended,
49
+ name: "jimmy.codes/eslint-comments",
50
+ rules: eslintCommentsRules
51
+ }
52
+ ];
53
+ };
54
+
55
+ // src/configs/ignores.ts
56
+ var ignoresConfig = (ignores) => {
57
+ return [
58
+ {
59
+ ignores: [...GLOB_IGNORES, ...ignores],
60
+ name: "jimmy.codes/ignores"
61
+ }
62
+ ];
63
+ };
64
+
65
+ // src/configs/imports.ts
66
+ import { createTypeScriptImportResolver } from "eslint-import-resolver-typescript";
67
+ import importX2 from "eslint-plugin-import-x";
68
+ import nodePlugin from "eslint-plugin-n";
69
+
70
+ // src/rules/imports.ts
71
+ import importX from "eslint-plugin-import-x";
72
+ var importsRules = {
73
+ ...importX.configs.recommended.rules,
74
+ "import-x/consistent-type-specifier-style": ["error", "prefer-top-level"],
75
+ "import-x/extensions": [
76
+ "error",
77
+ "never",
78
+ { checkTypedImports: true, svg: "always" }
79
+ ],
80
+ "import-x/first": "error",
81
+ // ! can't get this rule to work
82
+ "import-x/namespace": "off",
83
+ "import-x/newline-after-import": "error",
84
+ "import-x/no-absolute-path": "error",
85
+ "import-x/no-duplicates": "error",
86
+ "import-x/no-empty-named-blocks": "error",
87
+ "import-x/no-named-as-default": "error",
88
+ "import-x/no-named-as-default-member": "error",
89
+ "import-x/no-self-import": "error",
90
+ "import-x/no-unresolved": ["error", { ignore: [String.raw`\.svg$`] }],
91
+ "import-x/no-useless-path-segments": "error"
92
+ };
93
+
94
+ // src/configs/imports.ts
95
+ var importsTypescriptConfig = () => {
96
+ const { rules, settings } = importX2.configs.typescript;
97
+ return [
98
+ {
99
+ name: "jimmy.codes/imports/typescript",
100
+ rules,
101
+ settings: {
102
+ "import-x/extensions": settings["import-x/extensions"],
103
+ "import-x/external-module-folders": settings["import-x/external-module-folders"],
104
+ "import-x/parsers": settings["import-x/parsers"],
105
+ "import-x/resolver-next": [createTypeScriptImportResolver()]
106
+ }
107
+ }
108
+ ];
109
+ };
110
+ var importsConfig = ({
111
+ typescript = false
112
+ } = {}) => {
113
+ return [
114
+ {
115
+ name: "jimmy.codes/imports",
116
+ plugins: {
117
+ "import-x": importX2,
118
+ "n": nodePlugin
119
+ },
120
+ rules: importsRules
121
+ },
122
+ ...typescript ? importsTypescriptConfig() : []
123
+ ];
124
+ };
125
+
126
+ // src/rules/javascript.ts
127
+ import eslint from "@eslint/js";
128
+ var additionalRules = {
129
+ "array-callback-return": [
130
+ "error",
131
+ {
132
+ allowImplicit: true
133
+ // Allow implicit return for flexibility while enforcing return consistency
134
+ }
135
+ ],
136
+ "arrow-body-style": ["error", "always"],
137
+ // Enforce `{}` in arrow functions for consistency (open to revisiting)
138
+ "class-methods-use-this": "error",
139
+ // Ensures class methods are used within their class (avoids unnecessary methods)
140
+ "consistent-return": "error",
141
+ // Prevents inconsistent function returns (e.g., sometimes returning `undefined`)
142
+ "curly": ["error", "all"],
143
+ // Enforce `{}` around all control statements (avoids accidental bugs)
144
+ "default-case": "error",
145
+ // Require `default` case in switch statements (prevents unintended fallthrough)
146
+ "default-case-last": "error",
147
+ // Ensure the `default` case is the last one in `switch`
148
+ "no-console": "warn",
149
+ // Allow logging in development, but should be reviewed for production builds
150
+ "no-implicit-coercion": "error",
151
+ // Prevents shorthand type conversions (e.g., `!!value`, `+var`)
152
+ "no-implicit-globals": "error",
153
+ // Prevents defining variables in the global scope
154
+ "no-loop-func": "error",
155
+ // Disallow function declarations inside loops (prevents scoping issues)
156
+ "no-magic-numbers": ["error", { ignore: [0, 1, -1, 2] }],
157
+ // Helps catch unexplained numbers while allowing common values
158
+ "no-new-wrappers": "error",
159
+ // Prevents `new String()`, `new Number()`, etc. (use literals instead)
160
+ "no-param-reassign": ["error", { props: true }],
161
+ // Disallow reassigning function parameters but allow modifying object properties
162
+ "no-promise-executor-return": "error",
163
+ // Ensures `new Promise` executors always return something
164
+ "no-self-compare": "error",
165
+ // Disallows `x === x` (usually a mistake)
166
+ "no-template-curly-in-string": "error",
167
+ // Flags unintended use of `${}` inside strings without backticks
168
+ "no-throw-literal": "error",
169
+ // Prevents throwing non-error objects (e.g., `throw "error"` should be `throw new Error("error")`)
170
+ "no-unmodified-loop-condition": "error",
171
+ // Ensures loop conditions change, preventing infinite loops
172
+ "no-unreachable-loop": "error",
173
+ // Prevents loops that can never execute
174
+ "no-use-before-define": [
175
+ "error",
176
+ {
177
+ allowNamedExports: false,
178
+ classes: false,
179
+ functions: true,
180
+ // Allow function hoisting
181
+ variables: true
182
+ }
183
+ ],
184
+ "no-useless-computed-key": "error",
185
+ // Disallows unnecessary computed keys in objects (e.g., `{["key"]: value}` instead of `{ key: value }`)
186
+ "no-useless-constructor": "error",
187
+ // Disallows empty constructors
188
+ "no-useless-rename": "error",
189
+ // Disallows renaming variables to the same name in import/export/destructuring
190
+ "no-useless-return": "error",
191
+ // Prevents redundant `return;` statements
192
+ "no-var": "error",
193
+ // Enforce `let` and `const` (modern best practice)
194
+ "object-shorthand": "error",
195
+ // Enforces `{ foo }` instead of `{ foo: foo }`
196
+ "prefer-arrow-callback": "error",
197
+ // Enforces arrow functions in callbacks where possible
198
+ "prefer-const": "error",
199
+ // Requires `const` when a variable isn’t reassigned
200
+ "prefer-destructuring": [
201
+ "error",
202
+ {
203
+ AssignmentExpression: {
204
+ array: false,
205
+ // Allow `x = arr[0]`, don't force `[x] = arr`
206
+ object: false
207
+ // Allow `x = obj.x`, don't force `{ x } = obj`
208
+ },
209
+ VariableDeclarator: {
210
+ array: false,
211
+ object: true
212
+ // Enforce destructuring for objects (`const { x } = obj`)
213
+ }
214
+ }
215
+ ],
216
+ "prefer-object-spread": "error",
217
+ // Enforces `{ ...obj }` over `Object.assign()`
218
+ "prefer-rest-params": "error",
219
+ // Use `...args` instead of `arguments`
220
+ "prefer-spread": "error",
221
+ // Use `[...arr]` instead of `arr.concat()`
222
+ "prefer-template": "error",
223
+ // Use template literals instead of string concatenation
224
+ "radix": "error",
225
+ // Require a radix argument in `parseInt`
226
+ "require-await": "error",
227
+ // Disallows async functions without `await` (prevents unnecessary `async`)
228
+ "strict": ["error", "safe"],
229
+ // Enforces `"use strict"` only where needed (safe mode)
230
+ "symbol-description": "error"
231
+ // Requires descriptions when creating `Symbol()`
232
+ };
233
+ var javascriptRules = {
234
+ ...eslint.configs.recommended.rules,
235
+ ...additionalRules
236
+ };
237
+
238
+ // src/configs/javascript.ts
239
+ var javascriptConfig = () => {
240
+ return [
241
+ {
242
+ linterOptions: {
243
+ reportUnusedDisableDirectives: true
244
+ },
245
+ name: "jimmy.codes/javascript",
246
+ rules: javascriptRules
247
+ },
248
+ {
249
+ files: GLOB_TESTS,
250
+ name: "jimmy.codes/javascript/testing",
251
+ rules: {
252
+ "no-magic-numbers": "off"
253
+ }
254
+ }
255
+ ];
256
+ };
257
+
258
+ // src/configs/jsdoc.ts
259
+ import jsdocPlugin2 from "eslint-plugin-jsdoc";
260
+
261
+ // src/rules/jsdoc.ts
262
+ import jsdocPlugin from "eslint-plugin-jsdoc";
263
+ var jsdocRules = () => {
264
+ return {
265
+ ...jsdocPlugin.configs["flat/recommended-typescript-error"].rules,
266
+ "jsdoc/require-jsdoc": "off",
267
+ // Disable enforced JSDoc (TypeScript provides type info)
268
+ "jsdoc/require-param": "off",
269
+ // Avoid redundant param documentation (rely on TypeScript)
270
+ "jsdoc/require-returns": "off",
271
+ // Avoid redundant return type documentation (rely on TypeScript)
272
+ "jsdoc/tag-lines": [
273
+ "error",
274
+ "always",
275
+ {
276
+ applyToEndTag: false,
277
+ // No need for a blank line before closing JSDoc
278
+ startLines: 1
279
+ // Require exactly one blank line before the first tag
280
+ }
281
+ ]
282
+ };
283
+ };
284
+
285
+ // src/configs/jsdoc.ts
286
+ var jsdocConfig = () => {
287
+ return [
288
+ {
289
+ ...jsdocPlugin2.configs["flat/recommended-typescript-error"],
290
+ name: "jimmy.codes/jsdoc",
291
+ rules: jsdocRules()
292
+ }
293
+ ];
294
+ };
295
+
296
+ // src/configs/node.ts
297
+ import nodePlugin2 from "eslint-plugin-n";
298
+
299
+ // src/rules/node.ts
300
+ var nodeRules = {
301
+ "n/no-process-exit": "off",
302
+ // TODO [2025-12-31]: enable this rule
303
+ "n/prefer-node-protocol": "error"
304
+ };
305
+
306
+ // src/configs/node.ts
307
+ var nodeConfig = () => {
308
+ return [
309
+ {
310
+ name: "jimmy.codes/node",
311
+ plugins: {
312
+ n: nodePlugin2
313
+ },
314
+ rules: nodeRules
315
+ }
316
+ ];
317
+ };
318
+
319
+ // src/configs/perfectionist.ts
320
+ import perfectionist2 from "eslint-plugin-perfectionist";
321
+
322
+ // src/rules/perfectionist.ts
323
+ import perfectionist from "eslint-plugin-perfectionist";
324
+ var perfectionistRules = {
325
+ ...perfectionist.configs["recommended-natural"].rules,
326
+ "perfectionist/sort-imports": [
327
+ "error",
328
+ {
329
+ customGroups: { type: {}, value: {} },
330
+ environment: "node",
331
+ groups: [
332
+ "side-effect-style",
333
+ "builtin",
334
+ "type",
335
+ "external",
336
+ "internal-type",
337
+ "internal",
338
+ ["parent-type", "sibling-type", "index-type"],
339
+ ["parent", "sibling", "index"],
340
+ "object",
341
+ "style",
342
+ "unknown"
343
+ ],
344
+ internalPattern: ["^~/.*", "^@/.*"],
345
+ order: "asc",
346
+ type: "natural"
347
+ }
348
+ ],
349
+ // TODO: enable perfectionist/sort-modules
350
+ // "perfectionist/sort-modules": [
351
+ // "error",
352
+ // {
353
+ // customGroups: [],
354
+ // groups: [
355
+ // "declare-enum",
356
+ // "enum",
357
+ // "export-enum",
358
+ // ["declare-interface", "declare-type"],
359
+ // ["interface", "type"],
360
+ // ["export-interface", "export-type"],
361
+ // "declare-class",
362
+ // "class",
363
+ // "export-class",
364
+ // "declare-function",
365
+ // "function",
366
+ // "export-function",
367
+ // ],
368
+ // ignoreCase: true,
369
+ // newlinesBetween: "ignore",
370
+ // order: "asc",
371
+ // partitionByComment: false,
372
+ // partitionByNewLine: false,
373
+ // specialCharacters: "keep",
374
+ // type: "natural",
375
+ // },
376
+ // ],
377
+ "perfectionist/sort-modules": "off"
378
+ };
379
+
380
+ // src/configs/perfectionist.ts
381
+ var perfectionistConfig = () => {
382
+ return [
383
+ {
384
+ name: "jimmy.codes/perfectionist",
385
+ plugins: {
386
+ // TODO: remove unknown conversion
387
+ perfectionist: perfectionist2
388
+ },
389
+ rules: perfectionistRules
390
+ }
391
+ ];
392
+ };
393
+
394
+ // src/configs/prettier.ts
395
+ import eslintConfigPrettier from "eslint-config-prettier/flat";
396
+ var prettierConfig = () => {
397
+ return [
398
+ { ...eslintConfigPrettier, name: "jimmy.codes/prettier" }
399
+ ];
400
+ };
401
+
402
+ // src/configs/regexp.ts
403
+ import * as regexpPlugin2 from "eslint-plugin-regexp";
404
+
405
+ // src/rules/regexp.ts
406
+ import * as regexpPlugin from "eslint-plugin-regexp";
407
+ var regexpRules = {
408
+ ...regexpPlugin.configs["flat/recommended"].rules,
409
+ "regexp/confusing-quantifier": "error",
410
+ "regexp/no-empty-alternative": "error",
411
+ "regexp/no-lazy-ends": "error",
412
+ "regexp/no-potentially-useless-backreference": "error",
413
+ "regexp/no-useless-flag": "error",
414
+ "regexp/optimal-lookaround-quantifier": "error"
415
+ };
416
+
417
+ // src/configs/regexp.ts
418
+ var regexpConfig = () => {
419
+ return [
420
+ {
421
+ name: "jimmy.codes/regexp",
422
+ plugins: { regexp: regexpPlugin2 },
423
+ rules: regexpRules
424
+ }
425
+ ];
426
+ };
427
+
428
+ // src/configs/unicorn.ts
429
+ import eslintPluginUnicorn2 from "eslint-plugin-unicorn";
430
+
431
+ // src/rules/unicorn.ts
432
+ import eslintPluginUnicorn from "eslint-plugin-unicorn";
433
+ var unicornRules = {
434
+ ...eslintPluginUnicorn.configs["flat/recommended"].rules,
435
+ "unicorn/filename-case": "off",
436
+ "unicorn/import-style": "off",
437
+ "unicorn/no-abusive-eslint-disable": "off",
438
+ "unicorn/no-anonymous-default-export": "off",
439
+ "unicorn/no-array-callback-reference": "off",
440
+ // TODO: enable when https://github.com/sindresorhus/eslint-plugin-unicorn/issues/781 is resolved.
441
+ "unicorn/no-array-reduce": "off",
442
+ "unicorn/no-null": "off",
443
+ "unicorn/no-process-exit": "off",
444
+ "unicorn/no-useless-undefined": [
445
+ "error",
446
+ { checkArguments: false, checkArrowFunctionBody: false }
447
+ ],
448
+ "unicorn/prefer-node-protocol": "off",
449
+ "unicorn/prevent-abbreviations": "off"
450
+ };
451
+
452
+ // src/configs/unicorn.ts
453
+ var unicornConfig = () => {
454
+ return [
455
+ {
456
+ ...eslintPluginUnicorn2.configs["flat/recommended"],
457
+ name: "jimmy.codes/unicorn",
458
+ rules: unicornRules
459
+ }
460
+ ];
461
+ };
462
+
463
+ // src/utils/unwrap.ts
464
+ var unwrap = async (module) => {
465
+ const resolved = await module;
466
+ if (typeof resolved.default === "function") {
467
+ return resolved.default();
468
+ }
469
+ return resolved;
470
+ };
471
+
472
+ // src/factory.ts
473
+ var defineConfig = async ({
474
+ astro = false,
475
+ autoDetect = true,
476
+ ignores = [],
477
+ jest = false,
478
+ nextjs = false,
479
+ overrides = [],
480
+ playwright = false,
481
+ react = false,
482
+ storybook = false,
483
+ tanstackQuery = false,
484
+ testingLibrary = false,
485
+ typescript = false,
486
+ vitest = false
487
+ } = {}, ...moreOverrides) => {
488
+ const resolveFlag = (explicit, detector) => {
489
+ return explicit || autoDetect && detector();
490
+ };
491
+ const isTypescriptEnabled = resolveFlag(typescript, hasTypescript);
492
+ const isReactEnabled = resolveFlag(react, hasReact);
493
+ const isAstroEnabled = resolveFlag(astro, hasAstro);
494
+ const isTanstackQueryEnabled = resolveFlag(tanstackQuery, hasReactQuery);
495
+ const isTestingLibraryEnabled = resolveFlag(
496
+ testingLibrary,
497
+ hasTestingLibrary
498
+ );
499
+ const isPlaywrightEnabled = resolveFlag(playwright, hasPlaywright);
500
+ const isStorybookEnabled = resolveFlag(storybook, hasStorybook);
501
+ const isNextjsEnabled = resolveFlag(nextjs, hasNext);
502
+ const isJestEnabled = resolveFlag(jest, hasJest);
503
+ const isVitestEnabled = resolveFlag(vitest, hasVitest);
504
+ const baseConfigs = [
505
+ javascriptConfig(),
506
+ perfectionistConfig(),
507
+ nodeConfig(),
508
+ unicornConfig(),
509
+ eslintCommentsConfig(),
510
+ regexpConfig(),
511
+ jsdocConfig(),
512
+ importsConfig({ typescript: isTypescriptEnabled })
513
+ ];
514
+ const featureConfigs = await Promise.all([
515
+ isTypescriptEnabled && unwrap(import("./typescript-IBCLQD7Q.js")),
516
+ isReactEnabled && unwrap(import("./react-X5DWOH4Y.js")),
517
+ isTanstackQueryEnabled && unwrap(import("./tanstack-query-UHBVVQ7V.js")),
518
+ isAstroEnabled && unwrap(import("./astro-Z5RFF624.js")),
519
+ isJestEnabled && unwrap(import("./jest-AHG2WRSU.js")),
520
+ isVitestEnabled && unwrap(import("./vitest-YI6KNRZE.js")),
521
+ isTestingLibraryEnabled && unwrap(import("./testing-library-7RTMAEOX.js")),
522
+ isPlaywrightEnabled && unwrap(import("./playwright-U4PCWDYV.js")),
523
+ isStorybookEnabled && unwrap(import("./storybook-4KS3DD3C.js")),
524
+ isNextjsEnabled && unwrap(import("./nextjs-RCR4GYMK.js"))
525
+ ]);
526
+ return [
527
+ ...baseConfigs,
528
+ ...featureConfigs.filter(Boolean),
529
+ commonjsConfig(),
530
+ ignoresConfig(ignores),
531
+ prettierConfig(),
532
+ overrides,
533
+ moreOverrides
534
+ ].flat();
535
+ };
536
+ export {
537
+ defineConfig
538
+ };
@@ -0,0 +1,72 @@
1
+ import {
2
+ interopDefault
3
+ } from "./chunk-72FT76PY.js";
4
+ import {
5
+ GLOB_E2E,
6
+ GLOB_TESTS
7
+ } from "./chunk-N5KZEOXT.js";
8
+
9
+ // src/rules/jest.ts
10
+ var jestRules = async () => {
11
+ const jestPlugin = await interopDefault(import("eslint-plugin-jest"));
12
+ return {
13
+ ...jestPlugin.configs["flat/recommended"].rules,
14
+ ...jestPlugin.configs["flat/style"].rules,
15
+ "jest/consistent-test-it": [
16
+ "error",
17
+ {
18
+ fn: "test",
19
+ withinDescribe: "it"
20
+ }
21
+ ],
22
+ "jest/expect-expect": "error",
23
+ "jest/no-alias-methods": "error",
24
+ "jest/no-commented-out-tests": "error",
25
+ "jest/no-conditional-in-test": "error",
26
+ "jest/no-confusing-set-timeout": "error",
27
+ "jest/no-duplicate-hooks": "error",
28
+ "jest/no-hooks": "off",
29
+ "jest/no-large-snapshots": "off",
30
+ "jest/no-restricted-jest-methods": "off",
31
+ "jest/no-restricted-matchers": "off",
32
+ "jest/no-test-return-statement": "error",
33
+ "jest/no-untyped-mock-factory": "off",
34
+ // requires typescript
35
+ "jest/prefer-called-with": "error",
36
+ "jest/prefer-comparison-matcher": "error",
37
+ "jest/prefer-each": "error",
38
+ "jest/prefer-equality-matcher": "error",
39
+ "jest/prefer-expect-assertions": "off",
40
+ "jest/prefer-expect-resolves": "error",
41
+ "jest/prefer-hooks-in-order": "error",
42
+ "jest/prefer-hooks-on-top": "error",
43
+ "jest/prefer-lowercase-title": "off",
44
+ "jest/prefer-mock-promise-shorthand": "error",
45
+ "jest/prefer-snapshot-hint": "error",
46
+ "jest/prefer-spy-on": "off",
47
+ "jest/prefer-strict-equal": "error",
48
+ "jest/prefer-todo": "warn",
49
+ "jest/require-hook": "error",
50
+ "jest/require-to-throw-message": "error",
51
+ "jest/require-top-level-describe": "off",
52
+ "jest/unbound-method": "off"
53
+ // requires typescript
54
+ };
55
+ };
56
+
57
+ // src/configs/jest.ts
58
+ async function jestConfig() {
59
+ const jestPlugin = await interopDefault(import("eslint-plugin-jest"));
60
+ return [
61
+ {
62
+ files: GLOB_TESTS,
63
+ ignores: GLOB_E2E,
64
+ ...jestPlugin.configs["flat/recommended"],
65
+ name: "jimmy.codes/jest",
66
+ rules: await jestRules()
67
+ }
68
+ ];
69
+ }
70
+ export {
71
+ jestConfig as default
72
+ };
@@ -0,0 +1,35 @@
1
+ import {
2
+ warningAsErrors
3
+ } from "./chunk-BJU7UEJ3.js";
4
+ import {
5
+ interopDefault
6
+ } from "./chunk-72FT76PY.js";
7
+ import {
8
+ GLOB_NEXTJS
9
+ } from "./chunk-N5KZEOXT.js";
10
+
11
+ // src/rules/nextjs.ts
12
+ var nextjsRules = async () => {
13
+ const nextjsPlugin = await interopDefault(import("@next/eslint-plugin-next"));
14
+ return warningAsErrors(
15
+ nextjsPlugin.configs.recommended.rules
16
+ );
17
+ };
18
+
19
+ // src/configs/nextjs.ts
20
+ async function nextjsConfig() {
21
+ const nextjsPlugin = await interopDefault(import("@next/eslint-plugin-next"));
22
+ return [
23
+ {
24
+ files: GLOB_NEXTJS,
25
+ name: "jimmy.codes/nextjs",
26
+ plugins: {
27
+ "@next/next": nextjsPlugin
28
+ },
29
+ rules: await nextjsRules()
30
+ }
31
+ ];
32
+ }
33
+ export {
34
+ nextjsConfig as default
35
+ };
@@ -0,0 +1,49 @@
1
+ import {
2
+ interopDefault
3
+ } from "./chunk-72FT76PY.js";
4
+ import {
5
+ GLOB_PLAYWRIGHT
6
+ } from "./chunk-N5KZEOXT.js";
7
+
8
+ // src/rules/playwright.ts
9
+ var playwrightRules = async () => {
10
+ const playwrightPlugin = await interopDefault(
11
+ import("eslint-plugin-playwright")
12
+ );
13
+ return {
14
+ ...playwrightPlugin.configs["flat/recommended"].rules,
15
+ "playwright/expect-expect": "error",
16
+ "playwright/max-nested-describe": "error",
17
+ "playwright/no-conditional-expect": "error",
18
+ "playwright/no-conditional-in-test": "error",
19
+ "playwright/no-element-handle": "error",
20
+ "playwright/no-eval": "error",
21
+ "playwright/no-force-option": "error",
22
+ "playwright/no-nested-step": "error",
23
+ "playwright/no-page-pause": "error",
24
+ "playwright/no-skipped-test": "error",
25
+ "playwright/no-slowed-test": "error",
26
+ "playwright/no-useless-await": "error",
27
+ "playwright/no-useless-not": "error",
28
+ "playwright/no-wait-for-selector": "error",
29
+ "playwright/no-wait-for-timeout": "error"
30
+ };
31
+ };
32
+
33
+ // src/configs/playwright.ts
34
+ async function playwrightConfig() {
35
+ const playwrightPlugin = await interopDefault(
36
+ import("eslint-plugin-playwright")
37
+ );
38
+ return [
39
+ {
40
+ ...playwrightPlugin.configs["flat/recommended"],
41
+ files: GLOB_PLAYWRIGHT,
42
+ name: "jimmy.codes/playwright",
43
+ rules: await playwrightRules()
44
+ }
45
+ ];
46
+ }
47
+ export {
48
+ playwrightConfig as default
49
+ };