@jimmy.codes/eslint-config 3.30.1 โ†’ 4.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/README.md CHANGED
@@ -6,22 +6,33 @@
6
6
  [![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=flat-square)](https://semantic-release.gitbook.io/semantic-release)
7
7
  [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square&logo=prettier)](https://github.com/prettier/prettier)
8
8
 
9
- > ๐Ÿ” another opinionated [eslint](https://eslint.org) config
9
+ > ๐Ÿ” A pragmatic and opinionated [ESLint](https://eslint.org) config for modern development.
10
+
11
+ ## ๐Ÿš€ Philosophy
12
+
13
+ A strict yet ergonomic ESLint config that ensures **clean, maintainable, and modern** JavaScript and TypeScript codebases.
14
+
15
+ - **๐Ÿ›ก๏ธ Prevent Bugs** โ€“ Enforce safe patterns and strict error handling.
16
+ - **๐ŸŒŸ Modern JavaScript** โ€“ Prefer concise, expressive, and maintainable syntax.
17
+ - **โšก Performance & Maintainability** โ€“ Eliminate redundancy and enforce efficient patterns.
18
+ - **๐Ÿงน Consistency** โ€“ Keep code structured, readable, and free of clutter.
19
+ - **๐Ÿงช Reliable Testing** โ€“ Enforce best practices for Vitest, Jest, Playwright, and Testing Library.
20
+ - **โš›๏ธ Optimized React** โ€“ Ensure predictable rendering, hook safety, and component clarity.
10
21
 
11
22
  ## ๐Ÿ› ๏ธ Usage
12
23
 
13
- > [!NOTE]
14
- > For a better experience, make sure to use [@jimmy.codes/prettier-config](https://github.com/jimmy-guzman/prettier-config) as well.
24
+ > [!NOTE]
25
+ > For a better experience, use [@jimmy.codes/prettier-config](https://github.com/jimmy-guzman/prettier-config) as well.
15
26
 
16
27
  ### ๐Ÿ”จ Getting Started
17
28
 
18
- First install the package, by running the following:
29
+ Install the package:
19
30
 
20
31
  ```
21
32
  pnpm add -D @jimmy.codes/eslint-config
22
33
  ```
23
34
 
24
- Then all you need to in your `eslint.config.js` is:
35
+ Then, in your `eslint.config.js`, simply add:
25
36
 
26
37
  ```mjs
27
38
  import eslintConfig from "@jimmy.codes/eslint-config";
@@ -29,11 +40,22 @@ import eslintConfig from "@jimmy.codes/eslint-config";
29
40
  export default eslintConfig();
30
41
  ```
31
42
 
32
- Which will enable rules based on your project dependencies.
43
+ This automatically applies rules **based on your installed dependencies**.
33
44
 
34
45
  ### ๐Ÿ”ง Configuration
35
46
 
36
- This package contains rules that can be enabled or disabled as follows:
47
+ By default, this config **auto-detects** relevant rules based on your dependencies (`react`, `vitest`, etc.).
48
+ To disable this behavior:
49
+
50
+ ```ts
51
+ import eslintConfig from "@jimmy.codes/eslint-config";
52
+
53
+ export default eslintConfig({ autoDetect: false });
54
+ ```
55
+
56
+ #### **Manually Enable/Disable Rule Sets**
57
+
58
+ You can explicitly enable or disable rule sets:
37
59
 
38
60
  ```ts
39
61
  import eslintConfig from "@jimmy.codes/eslint-config";
@@ -52,17 +74,9 @@ export default eslintConfig({
52
74
  });
53
75
  ```
54
76
 
55
- Or you can turn off auto detection to disable rules based on a project's dependencies:
77
+ #### **Extending/Overriding the Configuration**
56
78
 
57
- ```ts
58
- import eslintConfig from "@jimmy.codes/eslint-config";
59
-
60
- export default eslintConfig({ autoDetect: false });
61
- ```
62
-
63
- #### Extending/overriding the Configuration
64
-
65
- You can also extend or override the configuration:
79
+ Use the `overrides` option:
66
80
 
67
81
  ```ts
68
82
  import eslintConfig from "@jimmy.codes/eslint-config";
@@ -85,7 +99,7 @@ export default eslintConfig({
85
99
  });
86
100
  ```
87
101
 
88
- Or pass configs as additional arguments:
102
+ Alternatively, pass multiple configurations as separate arguments:
89
103
 
90
104
  ```ts
91
105
  import eslintConfig from "@jimmy.codes/eslint-config";
@@ -107,9 +121,9 @@ export default eslintConfig(
107
121
  );
108
122
  ```
109
123
 
110
- #### Ignores
124
+ #### **Ignoring Files**
111
125
 
112
- You can also extend what is ignored:
126
+ Extend ignored files:
113
127
 
114
128
  ```ts
115
129
  import eslintConfig from "@jimmy.codes/eslint-config";
@@ -119,7 +133,13 @@ export default eslintConfig({
119
133
  });
120
134
  ```
121
135
 
136
+ ## ๐Ÿ’ฌ Want to Contribute or Suggest Changes?
137
+
138
+ PRs and discussions are welcome! Open an issue if you have suggestions.
139
+
122
140
  ## โค๏ธ Credits
123
141
 
142
+ This config is inspired by:
143
+
124
144
  - [@antfu/eslint-config](https://github.com/antfu/eslint-config) by [Anthony Fu](https://antfu.me)
125
- - [@pvtnbr/eslint-config](https://github.com/privatenumber/eslint-config) by [Hiroki Osame](https://hirok.io/)
145
+ - [@pvtnbr/eslint-config](https://github.com/privatenumber/eslint-config) by [Hiroki Osame](https://hirok.io)
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";var ee=Object.create;var d=Object.defineProperty;var re=Object.getOwnPropertyDescriptor;var te=Object.getOwnPropertyNames;var se=Object.getPrototypeOf,oe=Object.prototype.hasOwnProperty;var t=(e,r)=>d(e,"name",{value:r,configurable:!0});var ne=(e,r,s,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of te(r))!oe.call(e,a)&&a!==s&&d(e,a,{get:()=>r[a],enumerable:!(n=re(r,a))||n.enumerable});return e};var o=(e,r,s)=>(s=e!=null?ee(se(e)):{},ne(r||!e||!e.__esModule?d(s,"default",{value:e,enumerable:!0}):s,e));var g=require("globals"),p=require("typescript-eslint"),O=require("@eslint-community/eslint-plugin-eslint-comments/configs"),ie=require("eslint-import-resolver-typescript"),y=require("eslint-plugin-import-x"),q=require("eslint-plugin-n"),ae=require("@eslint/js"),C=require("eslint-plugin-jsdoc"),T=require("eslint-plugin-perfectionist"),ce=require("eslint-config-prettier"),c=require("local-pkg"),le=require("eslint-plugin-regexp"),R=require("eslint-plugin-unicorn");function pe(e){var r=Object.create(null);return e&&Object.keys(e).forEach(function(s){if(s!=="default"){var n=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(r,s,n.get?n:{enumerable:!0,get:t(function(){return e[s]},"get")})}}),r.default=e,Object.freeze(r)}t(pe,"_interopNamespaceDefault");var _=pe(le);const l="?([cm])[jt]s?(x)",fe=["**/node_modules","**/dist","**/package-lock.json","**/yarn.lock","**/pnpm-lock.yaml","**/bun.lockb","**/output","**/coverage","**/temp","**/.temp","**/tmp","**/.tmp","**/.history","**/.vitepress/cache","**/.nuxt","**/.next","**/.vercel","**/.changeset","**/.idea","**/.cache","**/.output","**/.vite-inspect","**/.yarn","**/storybook-static","**/.eslint-config-inspector","**/playwright-report","**/.astro","**/.vinxi","**/app.config.timestamp_*.js","**/CHANGELOG*.md","**/*.min.*","**/LICENSE*","**/__snapshots__","**/auto-import?(s).d.ts","**/components.d.ts","**/vite.config.ts.*.mjs","**/*.gen.*","!.storybook"],L="**/*.?([cm])js",u="**/*.?([cm])jsx",ue="**/*.?([cm])ts",j="**/*.?([cm])tsx",m=[`**/__tests__/**/*.${l}`,`**/*.spec.${l}`,`**/*.test.${l}`,`**/*.bench.${l}`,`**/*.benchmark.${l}`],S=[`**/e2e/**/*.spec.${l}`,`**/e2e/**/*.test.${l}`],x=[...S,`**/cypress/**/*.spec.${l}`,`**/cypress/**/*.test.${l}`],me=[L,u,ue,j],de="**/*.cjs",ge="**/*.astro",ye=["@testing-library/react"],i=t(async e=>{const r=await e;return r.default??r},"interopDefault"),je=t(async()=>{const e=[ge],[r,s,n]=await Promise.all([import("eslint-plugin-astro"),import("astro-eslint-parser"),i(import("eslint-plugin-jsx-a11y"))]);return[{files:e,languageOptions:{globals:{...g.node,Astro:!1,Fragment:!1},parser:s,parserOptions:{extraFileExtensions:[".astro"],parser:p.parser},sourceType:"module"},name:"jimmy.codes/astro",plugins:{astro:r,"jsx-a11y":n},processor:"astro/client-side-ts",rules:{...n.configs.recommended.rules,"astro/missing-client-only-directive-value":"error","astro/no-conflict-set-directives":"error","astro/no-deprecated-astro-canonicalurl":"error","astro/no-deprecated-astro-fetchcontent":"error","astro/no-deprecated-astro-resolve":"error","astro/no-deprecated-getentrybyslug":"error","astro/no-exports-from-components":"off","astro/no-unused-define-vars-in-style":"error","astro/valid-compile":"error"}},{files:e,languageOptions:{parserOptions:p.configs.disableTypeChecked.languageOptions?.parserOptions},name:"jimmy.codes/astro/disable-type-checked",rules:p.configs.disableTypeChecked.rules},{name:"jimmy.codes/astro/imports",settings:{"import-x/core-modules":["astro:content"]}}]},"astroConfig"),xe=t(()=>[{files:[de],languageOptions:{globals:g.commonjs},name:"jimmy.codes/commonjs"}],"commonjsConfig"),he={...O.recommended.rules,"@eslint-community/eslint-comments/no-unused-disable":"off","@eslint-community/eslint-comments/require-description":"error"},ve=t(()=>[{...O.recommended,name:"jimmy.codes/eslint-comments",rules:he}],"eslintCommentsConfig"),be=t(e=>[{ignores:[...fe,...e],name:"jimmy.codes/ignores"}],"ignoresConfig"),we={...y.configs.recommended.rules,"import-x/consistent-type-specifier-style":["error","prefer-top-level"],"import-x/extensions":["error","never",{checkTypedImports:!0,svg:"always"}],"import-x/first":"error","import-x/namespace":"off","import-x/newline-after-import":"error","import-x/no-absolute-path":"error","import-x/no-duplicates":"error","import-x/no-empty-named-blocks":"error","import-x/no-named-as-default":"error","import-x/no-named-as-default-member":"error","import-x/no-self-import":"error","import-x/no-unresolved":["error",{ignore:[String.raw`\.svg$`]}],"import-x/no-useless-path-segments":"error"},ke=t(()=>{const{rules:e,settings:r}=y.configs.typescript;return[{name:"jimmy.codes/imports/typescript",rules:e,settings:{"import-x/extensions":r["import-x/extensions"],"import-x/external-module-folders":r["import-x/external-module-folders"],"import-x/parsers":r["import-x/parsers"],"import-x/resolver-next":[ie.createTypeScriptImportResolver({alwaysTryTypes:!0})]}}]},"importsTypescriptConfig"),Pe=t(({typescript:e=!1}={})=>[{name:"jimmy.codes/imports",plugins:{"import-x":y,n:q},rules:we},...e?ke():[]],"importsConfig"),Ee={...ae.configs.recommended.rules,"array-callback-return":["error",{allowImplicit:!0}],"arrow-body-style":["error","always"],curly:["error","all"],"no-console":"warn","no-self-compare":"error","no-template-curly-in-string":"error","no-unmodified-loop-condition":"error","no-unreachable-loop":"error","no-use-before-define":["error",{allowNamedExports:!1,classes:!1,functions:!1,variables:!0}],"no-useless-rename":"error","object-shorthand":"error","prefer-arrow-callback":"error"},Oe=t(()=>[{linterOptions:{reportUnusedDisableDirectives:!0},name:"jimmy.codes/javascript",rules:Ee}],"javascriptConfig"),qe=t(()=>({...C.configs["flat/recommended-typescript-error"].rules,"jsdoc/require-jsdoc":"off","jsdoc/require-param":"off","jsdoc/require-returns":"off","jsdoc/tag-lines":["error","always",{applyToEndTag:!1}]}),"jsdocRules"),Ce=t(()=>[{...C.configs["flat/recommended-typescript-error"],name:"jimmy.codes/jsdoc",rules:qe()}],"jsdocConfig"),G=t((e={})=>Object.fromEntries(Object.entries(e).map(([r,s])=>[r,s==="warn"?"error":s])),"warningAsErrors"),Te=t(async()=>{const e=await i(import("@next/eslint-plugin-next"));return G(e.configs.recommended.rules)},"nextjsRules"),Re=t(async()=>{const e=await i(import("@next/eslint-plugin-next"));return[{files:me,name:"jimmy.codes/nextjs",plugins:{"@next/next":e},rules:await Te()}]},"nextjsConfig"),_e={"n/no-process-exit":"off","n/prefer-node-protocol":"error"},Le=t(()=>[{name:"jimmy.codes/node",plugins:{n:q},rules:_e}],"nodeConfig"),Se={...T.configs["recommended-natural"].rules,"perfectionist/sort-imports":["error",{customGroups:{type:{},value:{}},environment:"node",groups:["side-effect-style","builtin","type","external","internal-type","internal",["parent-type","sibling-type","index-type"],["parent","sibling","index"],"object","style","unknown"],internalPattern:["^~/.*","^@/.*"],order:"asc",type:"natural"}],"perfectionist/sort-modules":"off"},Ge=t(()=>[{name:"jimmy.codes/perfectionist",plugins:{perfectionist:T},rules:Se}],"perfectionistConfig"),Ae=t(async()=>({...(await i(import("eslint-plugin-playwright"))).configs["flat/recommended"].rules,"playwright/expect-expect":"error","playwright/max-nested-describe":"error","playwright/no-conditional-expect":"error","playwright/no-conditional-in-test":"error","playwright/no-element-handle":"error","playwright/no-eval":"error","playwright/no-force-option":"error","playwright/no-nested-step":"error","playwright/no-page-pause":"error","playwright/no-skipped-test":"error","playwright/no-slowed-test":"error","playwright/no-useless-await":"error","playwright/no-useless-not":"error","playwright/no-wait-for-selector":"error","playwright/no-wait-for-timeout":"error"}),"playwrightRules"),Ie=t(async()=>[{...(await i(import("eslint-plugin-playwright"))).configs["flat/recommended"],files:S,name:"jimmy.codes/playwright",rules:await Ae()}],"playwrightConfig"),Ne=t(()=>[{name:"jimmy.codes/prettier",...ce}],"prettierConfig"),Be=t(()=>c.isPackageExists("typescript"),"hasTypescript"),$e=t(()=>c.isPackageExists("react"),"hasReact"),A=t(()=>c.isPackageExists("vitest"),"hasVitest"),I=t(()=>c.isPackageExists("jest"),"hasJest"),Je=t(()=>A()||I(),"hasTesting"),Ve=t(()=>ye.some(e=>c.isPackageExists(e)),"hasTestingLibrary"),Fe=t(()=>c.isPackageExists("@tanstack/react-query"),"hasReactQuery"),Xe=t(()=>c.isPackageExists("astro"),"hasAstro"),ze=t(()=>c.isPackageExists("@playwright/test"),"hasPlaywright"),Qe=t(()=>c.isPackageExists("storybook"),"hasStorybook"),N=t(()=>c.isPackageExists("next"),"hasNext"),Ue=t(()=>c.isPackageExists("vite"),"hasVite"),He=t(e=>e===2?"error":e===1?"warn":"off","toStringSeverity"),B=t((e={})=>Object.fromEntries(Object.entries(e).map(([r,s])=>[r,typeof s=="number"?He(s):s])),"normalizeRuleEntries"),Me=["dynamic","dynamicParams","revalidate","fetchCache","runtime","preferredRegion","maxDuration","config","generateStaticParams","metadata","generateMetadata","viewport","generateViewport"],Ye=t(async()=>{const[e,r]=await Promise.all([i(import("eslint-plugin-react")),i(import("eslint-plugin-jsx-a11y"))]),s=N(),n=Ue();return{...r.configs.recommended.rules,...B(e.configs.flat.recommended?.rules),...B(e.configs.flat["jsx-runtime"]?.rules),"react-compiler/react-compiler":"error","react-hooks/exhaustive-deps":"error","react-hooks/rules-of-hooks":"error","react-refresh/only-export-components":["warn",{allowConstantExport:n,allowExportNames:s?Me:[]}],"react/boolean-prop-naming":"off","react/button-has-type":"error","react/checked-requires-onchange-or-readonly":"error","react/default-props-match-prop-types":"error","react/destructuring-assignment":"off","react/forbid-component-props":"off","react/forbid-dom-props":"off","react/forbid-elements":"off","react/forbid-foreign-prop-types":"off","react/forbid-prop-types":"off","react/forward-ref-uses-ref":"error","react/function-component-definition":"off","react/hook-use-state":"error","react/iframe-missing-sandbox":"error","react/jsx-boolean-value":["error","never"],"react/jsx-curly-brace-presence":"error","react/jsx-filename-extension":"off","react/jsx-fragments":["error","syntax"],"react/jsx-handler-names":"off","react/jsx-max-depth":"off","react/jsx-no-bind":"off","react/jsx-no-constructed-context-values":"error","react/jsx-no-leaked-render":"error","react/jsx-no-literals":"off","react/jsx-no-script-url":"error","react/jsx-no-useless-fragment":"error","react/jsx-one-expression-per-line":"off","react/jsx-pascal-case":["error",{allowNamespace:!0}],"react/jsx-props-no-spread-multi":"off","react/jsx-props-no-spreading":"off","react/jsx-sort-default-props":"off","react/jsx-sort-props":"off","react/no-access-state-in-setstate":"error","react/no-adjacent-inline-elements":"off","react/no-array-index-key":"off","react/no-arrow-function-lifecycle":"error","react/no-danger":"off","react/no-did-mount-set-state":"error","react/no-did-update-set-state":"error","react/no-invalid-html-attribute":"error","react/no-multi-comp":"off","react/no-namespace":"error","react/no-object-type-as-default-prop":"error","react/no-redundant-should-component-update":"error","react/no-set-state":"off","react/no-this-in-sfc":"error","react/no-typos":"error","react/no-unstable-nested-components":"error","react/no-unused-class-component-methods":"error","react/no-unused-prop-types":"error","react/no-unused-state":"error","react/no-will-update-set-state":"error","react/prefer-es6-class":"off","react/prefer-exact-props":"off","react/prefer-read-only-props":"off","react/prefer-stateless-function":"off","react/require-default-props":"off","react/require-optimization":"off","react/self-closing-comp":"error","react/sort-comp":"off","react/sort-default-props":"off","react/sort-prop-types":"off","react/state-in-constructor":"off","react/static-property-placement":"off","react/style-prop-object":"error","react/void-dom-elements-no-children":"error"}},"reactRules"),We=t(async()=>{const[e,r,s,n,a]=await Promise.all([i(import("eslint-plugin-react")),i(import("eslint-plugin-jsx-a11y")),import("eslint-plugin-react-hooks"),i(import("eslint-plugin-react-refresh")),i(import("eslint-plugin-react-compiler"))]);return[{files:[u,j],languageOptions:{globals:{...g.browser},parserOptions:{ecmaFeatures:{jsx:!0},jsxPragma:null}},name:"jimmy.codes/react",plugins:{"jsx-a11y":r,react:e,"react-compiler":a,"react-hooks":s,"react-refresh":n},rules:await Ye(),settings:{react:{version:"detect"}}}]},"reactConfig"),De={..._.configs["flat/recommended"].rules,"regexp/confusing-quantifier":"error","regexp/no-empty-alternative":"error","regexp/no-lazy-ends":"error","regexp/no-potentially-useless-backreference":"error","regexp/no-useless-flag":"error","regexp/optimal-lookaround-quantifier":"error"},Ke=t(()=>[{name:"jimmy.codes/regexp",plugins:{regexp:_},rules:De}],"regexpConfig"),Ze=t(async()=>{const{configs:e}=await i(import("eslint-plugin-storybook")),[r,s,n]=e["flat/recommended"];return[{name:"jimmy.codes/storybook/setup",plugins:r?.plugins},{files:s?.files,name:"jimmy.codes/storybook/stories-rules",rules:{...G(s?.rules),"import-x/no-anonymous-default-export":"off","unicorn/no-anonymous-default-export":"off"}},{files:n?.files,name:"jimmy.codes/storybook/main-rules",rules:{...n?.rules}}]},"storybookConfig"),er=t(async()=>{const e=await i(import("@tanstack/eslint-plugin-query"));return[{files:[u,j],name:"jimmy.codes/react/query",plugins:{"@tanstack/query":e},rules:{"@tanstack/query/exhaustive-deps":"error","@tanstack/query/no-rest-destructuring":"warn","@tanstack/query/stable-query-client":"error"}}]},"tanstackQueryConfig"),rr=t(async()=>{const e=await i(import("eslint-plugin-jest"));return{...e.configs["flat/recommended"].rules,...e.configs["flat/style"].rules,"jest/consistent-test-it":["error",{fn:"test",withinDescribe:"it"}],"jest/expect-expect":"error","jest/no-alias-methods":"error","jest/no-commented-out-tests":"error","jest/no-conditional-in-test":"error","jest/no-confusing-set-timeout":"error","jest/no-duplicate-hooks":"error","jest/no-hooks":"off","jest/no-large-snapshots":"off","jest/no-restricted-jest-methods":"off","jest/no-restricted-matchers":"off","jest/no-test-return-statement":"error","jest/no-untyped-mock-factory":"off","jest/prefer-called-with":"error","jest/prefer-comparison-matcher":"error","jest/prefer-each":"error","jest/prefer-equality-matcher":"error","jest/prefer-expect-assertions":"off","jest/prefer-expect-resolves":"error","jest/prefer-hooks-in-order":"error","jest/prefer-hooks-on-top":"error","jest/prefer-lowercase-title":"off","jest/prefer-mock-promise-shorthand":"error","jest/prefer-snapshot-hint":"error","jest/prefer-spy-on":"off","jest/prefer-strict-equal":"error","jest/prefer-todo":"warn","jest/require-hook":"error","jest/require-to-throw-message":"error","jest/require-top-level-describe":"off","jest/unbound-method":"off"}},"jestRules"),tr=t(async()=>({...(await i(import("@vitest/eslint-plugin"))).configs.recommended.rules,"vitest/consistent-test-it":["error",{fn:"test",withinDescribe:"it"}],"vitest/no-alias-methods":"error","vitest/no-commented-out-tests":"error","vitest/no-conditional-in-test":"error","vitest/no-disabled-tests":"warn","vitest/no-duplicate-hooks":"error","vitest/no-focused-tests":"error","vitest/no-hooks":"off","vitest/no-identical-title":"error","vitest/no-interpolation-in-snapshots":"error","vitest/no-large-snapshots":"off","vitest/no-mocks-import":"error","vitest/no-restricted-matchers":"off","vitest/no-restricted-vi-methods":"off","vitest/no-standalone-expect":"error","vitest/no-test-prefixes":"error","vitest/no-test-return-statement":"error","vitest/prefer-called-with":"error","vitest/prefer-comparison-matcher":"error","vitest/prefer-each":"error","vitest/prefer-equality-matcher":"error","vitest/prefer-expect-assertions":"off","vitest/prefer-expect-resolves":"error","vitest/prefer-hooks-in-order":"error","vitest/prefer-hooks-on-top":"error","vitest/prefer-lowercase-title":"off","vitest/prefer-mock-promise-shorthand":"error","vitest/prefer-snapshot-hint":"error","vitest/prefer-spy-on":"off","vitest/prefer-strict-boolean-matchers":"error","vitest/prefer-strict-equal":"error","vitest/prefer-to-be":"error","vitest/prefer-to-contain":"error","vitest/prefer-to-have-length":"error","vitest/prefer-todo":"warn","vitest/require-hook":"error","vitest/require-to-throw-message":"error","vitest/require-top-level-describe":"off","vitest/valid-expect":"error","vitest/valid-expect-in-promise":"error","vitest/valid-title":"error"}),"vitestRules"),sr=t(async({framework:e="vitest"}={},r=!0)=>{const s=r?A():e==="vitest",n=e==="jest"||r&&I(),a=[];if(s){const f=await i(import("@vitest/eslint-plugin"));a.push({files:m,ignores:x,...f.configs.recommended,name:"jimmy.codes/vitest",rules:await tr()})}if(n){const f=await i(import("eslint-plugin-jest"));a.push({files:m,ignores:x,...f.configs["flat/recommended"],name:"jimmy.codes/jest",rules:await rr()})}return a},"testingConfig"),or=t(async()=>{const[e,r]=await Promise.all([import("eslint-plugin-jest-dom"),i(import("eslint-plugin-testing-library"))]);return{...r.configs["flat/react"].rules,...e.configs["flat/recommended"].rules}},"testingLibraryRules"),nr=t(async()=>{const[e,r]=await Promise.all([import("eslint-plugin-jest-dom"),i(import("eslint-plugin-testing-library"))]);return[{files:m,ignores:x,name:"jimmy.codes/testing-library",plugins:{"jest-dom":e,"testing-library":r},rules:await or()}]},"testingLibraryConfig"),ir={"@typescript-eslint/consistent-type-exports":["error",{fixMixedExportsWithInlineTypeSpecifier:!1}],"@typescript-eslint/consistent-type-imports":["error",{fixStyle:"separate-type-imports"}],"@typescript-eslint/no-deprecated":"warn","@typescript-eslint/no-misused-promises":["error",{checksVoidReturn:{attributes:!1}}],"@typescript-eslint/no-unused-vars":["error",{args:"all",argsIgnorePattern:"^_",caughtErrors:"all",caughtErrorsIgnorePattern:"^_",destructuredArrayIgnorePattern:"^_",ignoreRestSiblings:!0,varsIgnorePattern:"^_"}],"@typescript-eslint/no-use-before-define":["error",{allowNamedExports:!1,classes:!1,functions:!1,variables:!0}],"@typescript-eslint/restrict-template-expressions":["error",{allowNumber:!0}],"no-use-before-define":"off"},ar=t(e=>[...p.configs.strictTypeChecked,...p.configs.stylisticTypeChecked.filter(r=>r.name==="typescript-eslint/stylistic-type-checked"),{languageOptions:{parserOptions:{...e?.project?{project:e.project}:{projectService:!0},tsconfigRootDir:process.cwd()}},name:"jimmy.codes/typescript",rules:ir},{files:[L,u],...p.configs.disableTypeChecked},{files:m,name:"jimmy.codes/typescript/testing",rules:{"@typescript-eslint/no-unsafe-argument":"off","@typescript-eslint/no-unsafe-assignment":"off"}}],"typescriptConfig"),cr={...R.configs["flat/recommended"].rules,"unicorn/filename-case":"off","unicorn/import-style":"off","unicorn/no-abusive-eslint-disable":"off","unicorn/no-anonymous-default-export":"off","unicorn/no-array-callback-reference":"off","unicorn/no-array-reduce":"off","unicorn/no-null":"off","unicorn/no-process-exit":"off","unicorn/no-useless-undefined":["error",{checkArguments:!1,checkArrowFunctionBody:!1}],"unicorn/prefer-node-protocol":"off","unicorn/prevent-abbreviations":"off"},lr=t(()=>[{...R.configs["flat/recommended"],name:"jimmy.codes/unicorn",rules:cr}],"unicornConfig"),pr=t(e=>typeof e=="object"?e:void 0,"getTypescriptOptions"),fr=t((e,r)=>typeof e=="object"?e:{framework:r.vitest?"vitest":r.jest?"jest":"vitest",...r.testingLibrary&&{utilities:["testing-library"]}},"getTestingOptions"),ur=t(e=>typeof e=="object"?e:{utilities:[]},"getReactOptions"),mr=t(({utilities:e=[]},r,s)=>r||e.includes("@tanstack/query")||s&&Fe(),"shouldEnableTanstackQuery"),dr=t(({utilities:e=[]},r)=>e.includes("testing-library")||r&&Ve(),"shouldEnableTestingLibrary"),gr=t(async({astro:e=!1,autoDetect:r=!0,configs:s=[],ignores:n=[],jest:a=!1,nextjs:f=!1,overrides:$=[],playwright:J=!1,react:h=!1,storybook:V=!1,tanstackQuery:F=!1,testing:v=!1,testingLibrary:X=!1,typescript:b=!1,vitest:w=!1}={},...z)=>{const Q=ur(h),k=fr(v,{jest:a,testingLibrary:X,vitest:w}),P=pr(b),E=b||!!P||r&&Be(),U=h||r&&$e(),H=v||a||w||r&&Je(),M=e||r&&Xe(),Y=mr(Q,F,r),W=dr(k,r),D=J||r&&ze(),K=V||r&&Qe(),Z=f||r&&N();return[Oe(),Ge(),Le(),lr(),ve(),Ke(),Ce(),Pe({typescript:E}),E?ar(P):[],U?await We():[],Y?await er():[],M?await je():[],H?await sr(k,r):[],W?await nr():[],D?await Ie():[],K?await Ze():[],Z?await Re():[],Ne(),xe(),be(n),s,$,z].flat()},"eslintConfig");module.exports=gr;
1
+ "use strict";var Z=Object.create;var d=Object.defineProperty;var ee=Object.getOwnPropertyDescriptor;var re=Object.getOwnPropertyNames;var te=Object.getPrototypeOf,oe=Object.prototype.hasOwnProperty;var r=(e,t)=>d(e,"name",{value:t,configurable:!0});var se=(e,t,o,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let l of re(t))!oe.call(e,l)&&l!==o&&d(e,l,{get:()=>t[l],enumerable:!(i=ee(t,l))||i.enumerable});return e};var s=(e,t,o)=>(o=e!=null?Z(te(e)):{},se(t||!e||!e.__esModule?d(o,"default",{value:e,enumerable:!0}):o,e));var g=require("globals"),f=require("typescript-eslint"),v=require("@eslint-community/eslint-plugin-eslint-comments/configs"),ne=require("eslint-import-resolver-typescript"),y=require("eslint-plugin-import-x"),b=require("eslint-plugin-n"),ie=require("@eslint/js"),w=require("eslint-plugin-jsdoc"),k=require("eslint-plugin-perfectionist"),ae=require("eslint-config-prettier"),a=require("local-pkg"),ce=require("eslint-plugin-regexp"),P=require("eslint-plugin-unicorn");function le(e){var t=Object.create(null);return e&&Object.keys(e).forEach(function(o){if(o!=="default"){var i=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,i.get?i:{enumerable:!0,get:r(function(){return e[o]},"get")})}}),t.default=e,Object.freeze(t)}r(le,"_interopNamespaceDefault");var E=le(ce);const p="?([cm])[jt]s?(x)",pe=["**/node_modules","**/dist","**/package-lock.json","**/yarn.lock","**/pnpm-lock.yaml","**/bun.lockb","**/output","**/coverage","**/temp","**/.temp","**/tmp","**/.tmp","**/.history","**/.vitepress/cache","**/.nuxt","**/.next","**/.vercel","**/.changeset","**/.idea","**/.cache","**/.output","**/.vite-inspect","**/.yarn","**/storybook-static","**/.eslint-config-inspector","**/playwright-report","**/.astro","**/.vinxi","**/app.config.timestamp_*.js","**/CHANGELOG*.md","**/*.min.*","**/LICENSE*","**/__snapshots__","**/auto-import?(s).d.ts","**/components.d.ts","**/vite.config.ts.*.mjs","**/*.gen.*","!.storybook"],C="**/*.?([cm])js",u="**/*.?([cm])jsx",fe="**/*.?([cm])ts",x="**/*.?([cm])tsx",m=[`**/__tests__/**/*.${p}`,`**/*.spec.${p}`,`**/*.test.${p}`,`**/*.bench.${p}`,`**/*.benchmark.${p}`],q=[`**/e2e/**/*.spec.${p}`,`**/e2e/**/*.test.${p}`],j=[...q,`**/cypress/**/*.spec.${p}`,`**/cypress/**/*.test.${p}`],ue=[C,u,fe,x],me="**/*.cjs",de="**/*.astro",ge=["@testing-library/react"],n=r(async e=>{const t=await e;return t.default??t},"interopDefault"),ye=r(async()=>{const e=[de],[t,o,i]=await Promise.all([import("eslint-plugin-astro"),import("astro-eslint-parser"),n(import("eslint-plugin-jsx-a11y"))]);return[{files:e,languageOptions:{globals:{...g.node,Astro:!1,Fragment:!1},parser:o,parserOptions:{extraFileExtensions:[".astro"],parser:f.parser},sourceType:"module"},name:"jimmy.codes/astro",plugins:{astro:t,"jsx-a11y":i},processor:"astro/client-side-ts",rules:{...i.configs.recommended.rules,"astro/missing-client-only-directive-value":"error","astro/no-conflict-set-directives":"error","astro/no-deprecated-astro-canonicalurl":"error","astro/no-deprecated-astro-fetchcontent":"error","astro/no-deprecated-astro-resolve":"error","astro/no-deprecated-getentrybyslug":"error","astro/no-exports-from-components":"off","astro/no-unused-define-vars-in-style":"error","astro/valid-compile":"error"}},{files:e,languageOptions:{parserOptions:f.configs.disableTypeChecked.languageOptions?.parserOptions},name:"jimmy.codes/astro/disable-type-checked",rules:f.configs.disableTypeChecked.rules},{name:"jimmy.codes/astro/imports",settings:{"import-x/core-modules":["astro:content"]}}]},"astroConfig"),xe=r(()=>[{files:[me],languageOptions:{globals:g.commonjs},name:"jimmy.codes/commonjs"}],"commonjsConfig"),je={...v.recommended.rules,"@eslint-community/eslint-comments/no-unused-disable":"off","@eslint-community/eslint-comments/require-description":"error"},he=r(()=>[{...v.recommended,name:"jimmy.codes/eslint-comments",rules:je}],"eslintCommentsConfig"),ve=r(e=>[{ignores:[...pe,...e],name:"jimmy.codes/ignores"}],"ignoresConfig"),be={...y.configs.recommended.rules,"import-x/consistent-type-specifier-style":["error","prefer-top-level"],"import-x/extensions":["error","never",{checkTypedImports:!0,svg:"always"}],"import-x/first":"error","import-x/namespace":"off","import-x/newline-after-import":"error","import-x/no-absolute-path":"error","import-x/no-duplicates":"error","import-x/no-empty-named-blocks":"error","import-x/no-named-as-default":"error","import-x/no-named-as-default-member":"error","import-x/no-self-import":"error","import-x/no-unresolved":["error",{ignore:[String.raw`\.svg$`]}],"import-x/no-useless-path-segments":"error"},we=r(()=>{const{rules:e,settings:t}=y.configs.typescript;return[{name:"jimmy.codes/imports/typescript",rules:e,settings:{"import-x/extensions":t["import-x/extensions"],"import-x/external-module-folders":t["import-x/external-module-folders"],"import-x/parsers":t["import-x/parsers"],"import-x/resolver-next":[ne.createTypeScriptImportResolver({alwaysTryTypes:!0})]}}]},"importsTypescriptConfig"),ke=r(({typescript:e=!1}={})=>[{name:"jimmy.codes/imports",plugins:{"import-x":y,n:b},rules:be},...e?we():[]],"importsConfig"),Pe={"array-callback-return":["error",{allowImplicit:!0}],"arrow-body-style":["error","always"],"class-methods-use-this":"error","consistent-return":"error",curly:["error","all"],"default-case":"error","default-case-last":"error","no-console":"warn","no-implicit-coercion":"error","no-implicit-globals":"error","no-loop-func":"error","no-magic-numbers":["error",{ignore:[0,1,-1,2]}],"no-new-wrappers":"error","no-param-reassign":["error",{props:!0}],"no-promise-executor-return":"error","no-self-compare":"error","no-template-curly-in-string":"error","no-throw-literal":"error","no-unmodified-loop-condition":"error","no-unreachable-loop":"error","no-use-before-define":["error",{allowNamedExports:!1,classes:!1,functions:!0,variables:!0}],"no-useless-computed-key":"error","no-useless-constructor":"error","no-useless-rename":"error","no-useless-return":"error","no-var":"error","object-shorthand":"error","prefer-arrow-callback":"error","prefer-const":"error","prefer-destructuring":["error",{AssignmentExpression:{array:!1,object:!1},VariableDeclarator:{array:!1,object:!0}}],"prefer-object-spread":"error","prefer-rest-params":"error","prefer-spread":"error","prefer-template":"error",radix:"error","require-await":"error",strict:["error","safe"],"symbol-description":"error"},Ee={...ie.configs.recommended.rules,...Pe},Ce=r(()=>[{linterOptions:{reportUnusedDisableDirectives:!0},name:"jimmy.codes/javascript",rules:Ee}],"javascriptConfig"),qe=r(async()=>{const e=await n(import("eslint-plugin-jest"));return{...e.configs["flat/recommended"].rules,...e.configs["flat/style"].rules,"jest/consistent-test-it":["error",{fn:"test",withinDescribe:"it"}],"jest/expect-expect":"error","jest/no-alias-methods":"error","jest/no-commented-out-tests":"error","jest/no-conditional-in-test":"error","jest/no-confusing-set-timeout":"error","jest/no-duplicate-hooks":"error","jest/no-hooks":"off","jest/no-large-snapshots":"off","jest/no-restricted-jest-methods":"off","jest/no-restricted-matchers":"off","jest/no-test-return-statement":"error","jest/no-untyped-mock-factory":"off","jest/prefer-called-with":"error","jest/prefer-comparison-matcher":"error","jest/prefer-each":"error","jest/prefer-equality-matcher":"error","jest/prefer-expect-assertions":"off","jest/prefer-expect-resolves":"error","jest/prefer-hooks-in-order":"error","jest/prefer-hooks-on-top":"error","jest/prefer-lowercase-title":"off","jest/prefer-mock-promise-shorthand":"error","jest/prefer-snapshot-hint":"error","jest/prefer-spy-on":"off","jest/prefer-strict-equal":"error","jest/prefer-todo":"warn","jest/require-hook":"error","jest/require-to-throw-message":"error","jest/require-top-level-describe":"off","jest/unbound-method":"off"}},"jestRules"),Oe=r(async()=>{const e=await n(import("eslint-plugin-jest"));return[{files:m,ignores:j,...e.configs["flat/recommended"],name:"jimmy.codes/jest",rules:await qe()}]},"jestConfig"),Re=r(()=>({...w.configs["flat/recommended-typescript-error"].rules,"jsdoc/require-jsdoc":"off","jsdoc/require-param":"off","jsdoc/require-returns":"off","jsdoc/tag-lines":["error","always",{applyToEndTag:!1}]}),"jsdocRules"),_e=r(()=>[{...w.configs["flat/recommended-typescript-error"],name:"jimmy.codes/jsdoc",rules:Re()}],"jsdocConfig"),O=r((e={})=>Object.fromEntries(Object.entries(e).map(([t,o])=>[t,o==="warn"?"error":o])),"warningAsErrors"),Te=r(async()=>{const e=await n(import("@next/eslint-plugin-next"));return O(e.configs.recommended.rules)},"nextjsRules"),Se=r(async()=>{const e=await n(import("@next/eslint-plugin-next"));return[{files:ue,name:"jimmy.codes/nextjs",plugins:{"@next/next":e},rules:await Te()}]},"nextjsConfig"),Le={"n/no-process-exit":"off","n/prefer-node-protocol":"error"},Ge=r(()=>[{name:"jimmy.codes/node",plugins:{n:b},rules:Le}],"nodeConfig"),Ae={...k.configs["recommended-natural"].rules,"perfectionist/sort-imports":["error",{customGroups:{type:{},value:{}},environment:"node",groups:["side-effect-style","builtin","type","external","internal-type","internal",["parent-type","sibling-type","index-type"],["parent","sibling","index"],"object","style","unknown"],internalPattern:["^~/.*","^@/.*"],order:"asc",type:"natural"}],"perfectionist/sort-modules":"off"},Be=r(()=>[{name:"jimmy.codes/perfectionist",plugins:{perfectionist:k},rules:Ae}],"perfectionistConfig"),Ie=r(async()=>({...(await n(import("eslint-plugin-playwright"))).configs["flat/recommended"].rules,"playwright/expect-expect":"error","playwright/max-nested-describe":"error","playwright/no-conditional-expect":"error","playwright/no-conditional-in-test":"error","playwright/no-element-handle":"error","playwright/no-eval":"error","playwright/no-force-option":"error","playwright/no-nested-step":"error","playwright/no-page-pause":"error","playwright/no-skipped-test":"error","playwright/no-slowed-test":"error","playwright/no-useless-await":"error","playwright/no-useless-not":"error","playwright/no-wait-for-selector":"error","playwright/no-wait-for-timeout":"error"}),"playwrightRules"),Ne=r(async()=>[{...(await n(import("eslint-plugin-playwright"))).configs["flat/recommended"],files:q,name:"jimmy.codes/playwright",rules:await Ie()}],"playwrightConfig"),De=r(()=>[{name:"jimmy.codes/prettier",...ae}],"prettierConfig"),$e=r(()=>a.isPackageExists("typescript"),"hasTypescript"),Ve=r(()=>a.isPackageExists("react"),"hasReact"),Fe=r(()=>a.isPackageExists("vitest"),"hasVitest"),Je=r(()=>a.isPackageExists("jest"),"hasJest"),Xe=r(()=>ge.some(e=>a.isPackageExists(e)),"hasTestingLibrary"),ze=r(()=>a.isPackageExists("@tanstack/react-query"),"hasReactQuery"),Ue=r(()=>a.isPackageExists("astro"),"hasAstro"),He=r(()=>a.isPackageExists("@playwright/test"),"hasPlaywright"),Me=r(()=>a.isPackageExists("storybook"),"hasStorybook"),R=r(()=>a.isPackageExists("next"),"hasNext"),Qe=r(()=>a.isPackageExists("vite"),"hasVite"),Ye=r(e=>e===2?"error":e===1?"warn":"off","toStringSeverity"),_=r((e={})=>Object.fromEntries(Object.entries(e).map(([t,o])=>[t,typeof o=="number"?Ye(o):o])),"normalizeRuleEntries"),We=["dynamic","dynamicParams","revalidate","fetchCache","runtime","preferredRegion","maxDuration","config","generateStaticParams","metadata","generateMetadata","viewport","generateViewport"],Ke=r(async()=>{const[e,t]=await Promise.all([n(import("eslint-plugin-react")),n(import("eslint-plugin-jsx-a11y"))]),o=R(),i=Qe();return{...t.configs.recommended.rules,..._(e.configs.flat.recommended?.rules),..._(e.configs.flat["jsx-runtime"]?.rules),"react-compiler/react-compiler":"error","react-hooks/exhaustive-deps":"error","react-hooks/rules-of-hooks":"error","react-refresh/only-export-components":["warn",{allowConstantExport:i,allowExportNames:o?We:[]}],"react/boolean-prop-naming":"off","react/button-has-type":"error","react/checked-requires-onchange-or-readonly":"error","react/default-props-match-prop-types":"error","react/destructuring-assignment":"off","react/forbid-component-props":"off","react/forbid-dom-props":"off","react/forbid-elements":"off","react/forbid-foreign-prop-types":"off","react/forbid-prop-types":"off","react/forward-ref-uses-ref":"error","react/function-component-definition":"off","react/hook-use-state":"error","react/iframe-missing-sandbox":"error","react/jsx-boolean-value":["error","never"],"react/jsx-curly-brace-presence":"error","react/jsx-filename-extension":"off","react/jsx-fragments":["error","syntax"],"react/jsx-handler-names":"off","react/jsx-max-depth":"off","react/jsx-no-bind":"off","react/jsx-no-constructed-context-values":"error","react/jsx-no-leaked-render":"error","react/jsx-no-literals":"off","react/jsx-no-script-url":"error","react/jsx-no-useless-fragment":"error","react/jsx-one-expression-per-line":"off","react/jsx-pascal-case":["error",{allowNamespace:!0}],"react/jsx-props-no-spread-multi":"off","react/jsx-props-no-spreading":"off","react/jsx-sort-default-props":"off","react/jsx-sort-props":"off","react/no-access-state-in-setstate":"error","react/no-adjacent-inline-elements":"off","react/no-array-index-key":"off","react/no-arrow-function-lifecycle":"error","react/no-danger":"off","react/no-did-mount-set-state":"error","react/no-did-update-set-state":"error","react/no-invalid-html-attribute":"error","react/no-multi-comp":"off","react/no-namespace":"error","react/no-object-type-as-default-prop":"error","react/no-redundant-should-component-update":"error","react/no-set-state":"off","react/no-this-in-sfc":"error","react/no-typos":"error","react/no-unstable-nested-components":"error","react/no-unused-class-component-methods":"error","react/no-unused-prop-types":"error","react/no-unused-state":"error","react/no-will-update-set-state":"error","react/prefer-es6-class":"off","react/prefer-exact-props":"off","react/prefer-read-only-props":"off","react/prefer-stateless-function":"off","react/require-default-props":"off","react/require-optimization":"off","react/self-closing-comp":"error","react/sort-comp":"off","react/sort-default-props":"off","react/sort-prop-types":"off","react/state-in-constructor":"off","react/static-property-placement":"off","react/style-prop-object":"error","react/void-dom-elements-no-children":"error"}},"reactRules"),Ze=r(async()=>{const[e,t,o,i,l]=await Promise.all([n(import("eslint-plugin-react")),n(import("eslint-plugin-jsx-a11y")),import("eslint-plugin-react-hooks"),n(import("eslint-plugin-react-refresh")),n(import("eslint-plugin-react-compiler"))]);return[{files:[u,x],languageOptions:{globals:{...g.browser},parserOptions:{ecmaFeatures:{jsx:!0},jsxPragma:null}},name:"jimmy.codes/react",plugins:{"jsx-a11y":t,react:e,"react-compiler":l,"react-hooks":o,"react-refresh":i},rules:await Ke(),settings:{react:{version:"detect"}}}]},"reactConfig"),er={...E.configs["flat/recommended"].rules,"regexp/confusing-quantifier":"error","regexp/no-empty-alternative":"error","regexp/no-lazy-ends":"error","regexp/no-potentially-useless-backreference":"error","regexp/no-useless-flag":"error","regexp/optimal-lookaround-quantifier":"error"},rr=r(()=>[{name:"jimmy.codes/regexp",plugins:{regexp:E},rules:er}],"regexpConfig"),tr=r(async()=>{const{configs:e}=await n(import("eslint-plugin-storybook")),[t,o,i]=e["flat/recommended"];return[{name:"jimmy.codes/storybook/setup",plugins:t?.plugins},{files:o?.files,name:"jimmy.codes/storybook/stories-rules",rules:{...O(o?.rules),"import-x/no-anonymous-default-export":"off","unicorn/no-anonymous-default-export":"off"}},{files:i?.files,name:"jimmy.codes/storybook/main-rules",rules:{...i?.rules}}]},"storybookConfig"),or=r(async()=>{const e=await n(import("@tanstack/eslint-plugin-query"));return[{files:[u,x],name:"jimmy.codes/react/query",plugins:{"@tanstack/query":e},rules:{"@tanstack/query/exhaustive-deps":"error","@tanstack/query/no-rest-destructuring":"warn","@tanstack/query/stable-query-client":"error"}}]},"tanstackQueryConfig"),sr=r(async()=>{const[e,t]=await Promise.all([import("eslint-plugin-jest-dom"),n(import("eslint-plugin-testing-library"))]);return{...t.configs["flat/react"].rules,...e.configs["flat/recommended"].rules}},"testingLibraryRules"),nr=r(async()=>{const[e,t]=await Promise.all([import("eslint-plugin-jest-dom"),n(import("eslint-plugin-testing-library"))]);return[{files:m,ignores:j,name:"jimmy.codes/testing-library",plugins:{"jest-dom":e,"testing-library":t},rules:await sr()}]},"testingLibraryConfig"),ir={"@typescript-eslint/consistent-type-exports":["error",{fixMixedExportsWithInlineTypeSpecifier:!1}],"@typescript-eslint/consistent-type-imports":["error",{fixStyle:"separate-type-imports"}],"@typescript-eslint/no-deprecated":"warn","@typescript-eslint/no-misused-promises":["error",{checksVoidReturn:{attributes:!1}}],"@typescript-eslint/no-unused-vars":["error",{args:"all",argsIgnorePattern:"^_",caughtErrors:"all",caughtErrorsIgnorePattern:"^_",destructuredArrayIgnorePattern:"^_",ignoreRestSiblings:!0,varsIgnorePattern:"^_"}],"@typescript-eslint/no-use-before-define":["error",{allowNamedExports:!1,classes:!1,functions:!1,variables:!0}],"@typescript-eslint/restrict-template-expressions":["error",{allowNumber:!0}],"no-use-before-define":"off"},ar=r(()=>[...f.configs.strictTypeChecked,...f.configs.stylisticTypeChecked.filter(e=>e.name==="typescript-eslint/stylistic-type-checked"),{languageOptions:{parserOptions:{projectService:!0,tsconfigRootDir:process.cwd()}},name:"jimmy.codes/typescript",rules:ir},{files:[C,u],...f.configs.disableTypeChecked},{files:m,name:"jimmy.codes/typescript/testing",rules:{"@typescript-eslint/no-unsafe-argument":"off","@typescript-eslint/no-unsafe-assignment":"off"}}],"typescriptConfig"),cr={...P.configs["flat/recommended"].rules,"unicorn/filename-case":"off","unicorn/import-style":"off","unicorn/no-abusive-eslint-disable":"off","unicorn/no-anonymous-default-export":"off","unicorn/no-array-callback-reference":"off","unicorn/no-array-reduce":"off","unicorn/no-null":"off","unicorn/no-process-exit":"off","unicorn/no-useless-undefined":["error",{checkArguments:!1,checkArrowFunctionBody:!1}],"unicorn/prefer-node-protocol":"off","unicorn/prevent-abbreviations":"off"},lr=r(()=>[{...P.configs["flat/recommended"],name:"jimmy.codes/unicorn",rules:cr}],"unicornConfig"),pr=r(async()=>({...(await n(import("@vitest/eslint-plugin"))).configs.recommended.rules,"vitest/consistent-test-it":["error",{fn:"test",withinDescribe:"it"}],"vitest/no-alias-methods":"error","vitest/no-commented-out-tests":"error","vitest/no-conditional-in-test":"error","vitest/no-disabled-tests":"warn","vitest/no-duplicate-hooks":"error","vitest/no-focused-tests":"error","vitest/no-hooks":"off","vitest/no-identical-title":"error","vitest/no-interpolation-in-snapshots":"error","vitest/no-large-snapshots":"off","vitest/no-mocks-import":"error","vitest/no-restricted-matchers":"off","vitest/no-restricted-vi-methods":"off","vitest/no-standalone-expect":"error","vitest/no-test-prefixes":"error","vitest/no-test-return-statement":"error","vitest/prefer-called-with":"error","vitest/prefer-comparison-matcher":"error","vitest/prefer-each":"error","vitest/prefer-equality-matcher":"error","vitest/prefer-expect-assertions":"off","vitest/prefer-expect-resolves":"error","vitest/prefer-hooks-in-order":"error","vitest/prefer-hooks-on-top":"error","vitest/prefer-lowercase-title":"off","vitest/prefer-mock-promise-shorthand":"error","vitest/prefer-snapshot-hint":"error","vitest/prefer-spy-on":"off","vitest/prefer-strict-boolean-matchers":"error","vitest/prefer-strict-equal":"error","vitest/prefer-to-be":"error","vitest/prefer-to-contain":"error","vitest/prefer-to-have-length":"error","vitest/prefer-todo":"warn","vitest/require-hook":"error","vitest/require-to-throw-message":"error","vitest/require-top-level-describe":"off","vitest/valid-expect":"error","vitest/valid-expect-in-promise":"error","vitest/valid-title":"error"}),"vitestRules"),fr=r(async()=>{const e=await n(import("@vitest/eslint-plugin"));return[{files:m,ignores:j,...e.configs.recommended,name:"jimmy.codes/vitest",rules:await pr()}]},"vitestConfig"),ur=r(async({astro:e=!1,autoDetect:t=!0,ignores:o=[],jest:i=!1,nextjs:l=!1,overrides:T=[],playwright:S=!1,react:L=!1,storybook:G=!1,tanstackQuery:A=!1,testingLibrary:B=!1,typescript:I=!1,vitest:N=!1}={},...D)=>{const c=r((W,K)=>W||t&&K(),"resolveFlag"),h=c(I,$e),$=c(L,Ve),V=c(e,Ue),F=c(A,ze),J=c(B,Xe),X=c(S,He),z=c(G,Me),U=c(l,R),H=c(i,Je),M=c(N,Fe),Q=[Ce(),Be(),Ge(),lr(),he(),rr(),_e(),ke({typescript:h})],Y=[h&&ar(),$&&await Ze(),F&&await or(),V&&await ye(),H&&await Oe(),M&&await fr(),J&&await nr(),X&&await Ne(),z&&await tr(),U&&await Se()].filter(Boolean);return[...Q,...Y,De(),xe(),ve(o),T,D].flat()},"eslintConfig");module.exports=ur;
package/dist/index.d.cts CHANGED
@@ -13291,44 +13291,6 @@ type Yoda = []|[("always" | "never")]|[("always" | "never"), {
13291
13291
  }]
13292
13292
 
13293
13293
  type Rules = RuleOptions;
13294
- /**
13295
- * @deprecated
13296
- */
13297
- interface TypescriptOptions {
13298
- /**
13299
- * Location of `tsconfig.json` used for [type aware linting](https://typescript-eslint.io/getting-started/typed-linting)
13300
- * @deprecated since this config uses `projectService` this is no longer needed and will be removed.
13301
- */
13302
- project: string | string[];
13303
- }
13304
- type TestingFrameworks = "jest" | "vitest";
13305
- type TestingUtilities = "testing-library";
13306
- type ReactUtilities = "@tanstack/query";
13307
- /**
13308
- * @deprecated
13309
- */
13310
- interface TestingOptions {
13311
- /**
13312
- * Which testing framework are you using?
13313
- * @default "vitest"
13314
- */
13315
- framework?: TestingFrameworks;
13316
- /**
13317
- * Enable additional rules for testing utilities such as:
13318
- * - [Testing Library](https://testing-library.com)
13319
- */
13320
- utilities?: TestingUtilities[];
13321
- }
13322
- /**
13323
- * @deprecated
13324
- */
13325
- interface ReactOptions {
13326
- /**
13327
- * Enable additional rules for utilities such as:
13328
- * - [React Query](https://tanstack.com/query/latest/docs/framework/react/overview)
13329
- */
13330
- utilities?: ReactUtilities[];
13331
- }
13332
13294
  type TypedConfigItem = Omit<Linter.Config<Linter.RulesRecord & Rules>, "plugins"> & {
13333
13295
  /**
13334
13296
  * An object containing a name-value mapping of plugin names to plugin objects. When `files` is specified, these plugins are only available to the matching files.
@@ -13343,19 +13305,14 @@ interface Options {
13343
13305
  */
13344
13306
  astro?: boolean;
13345
13307
  /**
13346
- * Is auto detection enabled?
13308
+ * Automatically enables rules based on installed dependencies.
13309
+ * For example, if `react` is installed, React-specific rules will be applied.
13347
13310
  * @default true
13348
13311
  */
13349
13312
  autoDetect?: boolean;
13350
13313
  /**
13351
- * Additional configs to either extend or overrides configurations
13352
- * @deprecated please use {@link Options.configs} instead.
13353
- *
13354
- * @default []
13355
- */
13356
- configs?: Linter.Config[] | TypedConfigItem[];
13357
- /**
13358
- * Glob patterns for files that should be ignored
13314
+ * Glob patterns for files that should be ignored.
13315
+ * Matches ESLint's ignore patterns.
13359
13316
  * @see [Ignoring files](https://eslint.org/docs/latest/use/configure/ignore)
13360
13317
  */
13361
13318
  ignores?: string[];
@@ -13370,7 +13327,8 @@ interface Options {
13370
13327
  */
13371
13328
  nextjs?: boolean;
13372
13329
  /**
13373
- * Additional configs to either extend or overrides configurations
13330
+ * Additional configs to extend or override rules.
13331
+ * Accepts ESLint configuration objects.
13374
13332
  * @default []
13375
13333
  */
13376
13334
  overrides?: Linter.Config[] | TypedConfigItem[];
@@ -13383,24 +13341,17 @@ interface Options {
13383
13341
  * Are React rules enabled?
13384
13342
  * @default false
13385
13343
  */
13386
- react?: boolean | ReactOptions;
13344
+ react?: boolean;
13387
13345
  /**
13388
13346
  * Are Storybook rules enabled?
13389
13347
  * @default false
13390
13348
  */
13391
13349
  storybook?: boolean;
13392
13350
  /**
13393
- * Are Tanstack Query rules enabled?
13351
+ * Are TanStack Query rules enabled?
13394
13352
  * @default false
13395
13353
  */
13396
13354
  tanstackQuery?: boolean;
13397
- /**
13398
- * Are testing rules enabled?
13399
- * @default false
13400
- *
13401
- * @deprecated please use {@link Options.jest}, {@link Options.vitest}, or {@link Options.testingLibrary} instead.
13402
- */
13403
- testing?: boolean | TestingOptions;
13404
13355
  /**
13405
13356
  * Are Testing Library rules enabled?
13406
13357
  * @default false
@@ -13410,7 +13361,7 @@ interface Options {
13410
13361
  * Are TypeScript rules enabled?
13411
13362
  * @default false
13412
13363
  */
13413
- typescript?: boolean | TypescriptOptions;
13364
+ typescript?: boolean;
13414
13365
  /**
13415
13366
  * Are Vitest rules enabled?
13416
13367
  * @default false
@@ -13418,7 +13369,7 @@ interface Options {
13418
13369
  vitest?: boolean;
13419
13370
  }
13420
13371
 
13421
- declare const eslintConfig: ({ astro, autoDetect, configs, ignores, jest, nextjs, overrides, playwright, react, storybook, tanstackQuery, testing, testingLibrary, typescript, vitest, }?: Options, ...moreOverrides: Linter.Config[] | TypedConfigItem[]) => Promise<(TypedConfigItem | Linter.Config<Linter.RulesRecord> | _typescript_eslint_utils_ts_eslint.FlatConfig.Config | {
13372
+ declare const eslintConfig: ({ astro, autoDetect, ignores, jest, nextjs, overrides, playwright, react, storybook, tanstackQuery, testingLibrary, typescript, vitest, }?: Options, ...moreOverrides: Linter.Config[] | TypedConfigItem[]) => Promise<(TypedConfigItem | Linter.Config<Linter.RulesRecord> | _typescript_eslint_utils_ts_eslint.FlatConfig.Config | {
13422
13373
  files: string[];
13423
13374
  languageOptions: {
13424
13375
  globals: {
@@ -14058,21 +14009,60 @@ declare const eslintConfig: ({ astro, autoDetect, configs, ignores, jest, nextjs
14058
14009
  allowImplicit: true;
14059
14010
  }];
14060
14011
  "arrow-body-style": ["error", "always"];
14012
+ "class-methods-use-this": "error";
14013
+ "consistent-return": "error";
14061
14014
  curly: ["error", "all"];
14015
+ "default-case": "error";
14016
+ "default-case-last": "error";
14062
14017
  "no-console": "warn";
14018
+ "no-implicit-coercion": "error";
14019
+ "no-implicit-globals": "error";
14020
+ "no-loop-func": "error";
14021
+ "no-magic-numbers": ["error", {
14022
+ ignore: number[];
14023
+ }];
14024
+ "no-new-wrappers": "error";
14025
+ "no-param-reassign": ["error", {
14026
+ props: true;
14027
+ }];
14028
+ "no-promise-executor-return": "error";
14063
14029
  "no-self-compare": "error";
14064
14030
  "no-template-curly-in-string": "error";
14031
+ "no-throw-literal": "error";
14065
14032
  "no-unmodified-loop-condition": "error";
14066
14033
  "no-unreachable-loop": "error";
14067
14034
  "no-use-before-define": ["error", {
14068
14035
  allowNamedExports: false;
14069
14036
  classes: false;
14070
- functions: false;
14037
+ functions: true;
14071
14038
  variables: true;
14072
14039
  }];
14040
+ "no-useless-computed-key": "error";
14041
+ "no-useless-constructor": "error";
14073
14042
  "no-useless-rename": "error";
14043
+ "no-useless-return": "error";
14044
+ "no-var": "error";
14074
14045
  "object-shorthand": "error";
14075
14046
  "prefer-arrow-callback": "error";
14047
+ "prefer-const": "error";
14048
+ "prefer-destructuring": ["error", {
14049
+ AssignmentExpression: {
14050
+ array: false;
14051
+ object: false;
14052
+ };
14053
+ VariableDeclarator: {
14054
+ array: false;
14055
+ object: true;
14056
+ };
14057
+ }];
14058
+ "prefer-object-spread": "error";
14059
+ "prefer-rest-params": "error";
14060
+ "prefer-spread": "error";
14061
+ "prefer-template": "error";
14062
+ radix: "error";
14063
+ "require-await": "error";
14064
+ strict: ["error", "safe"];
14065
+ "symbol-description": "error";
14076
14066
  };
14077
14067
  } | {
14078
14068
  name: string;
@@ -15762,11 +15752,8 @@ declare const eslintConfig: ({ astro, autoDetect, configs, ignores, jest, nextjs
15762
15752
  } | {
15763
15753
  languageOptions: {
15764
15754
  parserOptions: {
15765
- tsconfigRootDir: string;
15766
- project: string | string[];
15767
- } | {
15768
- tsconfigRootDir: string;
15769
15755
  projectService: boolean;
15756
+ tsconfigRootDir: string;
15770
15757
  };
15771
15758
  };
15772
15759
  name: string;
@@ -15840,4 +15827,4 @@ declare const eslintConfig: ({ astro, autoDetect, configs, ignores, jest, nextjs
15840
15827
  settings?: Record<string, unknown>;
15841
15828
  })[]>;
15842
15829
 
15843
- export { type Options, type ReactOptions, type Rules, type TestingOptions, type TypedConfigItem, type TypescriptOptions, eslintConfig as default };
15830
+ export { type Options, type Rules, type TypedConfigItem, eslintConfig as default };
package/dist/index.d.mts CHANGED
@@ -13291,44 +13291,6 @@ type Yoda = []|[("always" | "never")]|[("always" | "never"), {
13291
13291
  }]
13292
13292
 
13293
13293
  type Rules = RuleOptions;
13294
- /**
13295
- * @deprecated
13296
- */
13297
- interface TypescriptOptions {
13298
- /**
13299
- * Location of `tsconfig.json` used for [type aware linting](https://typescript-eslint.io/getting-started/typed-linting)
13300
- * @deprecated since this config uses `projectService` this is no longer needed and will be removed.
13301
- */
13302
- project: string | string[];
13303
- }
13304
- type TestingFrameworks = "jest" | "vitest";
13305
- type TestingUtilities = "testing-library";
13306
- type ReactUtilities = "@tanstack/query";
13307
- /**
13308
- * @deprecated
13309
- */
13310
- interface TestingOptions {
13311
- /**
13312
- * Which testing framework are you using?
13313
- * @default "vitest"
13314
- */
13315
- framework?: TestingFrameworks;
13316
- /**
13317
- * Enable additional rules for testing utilities such as:
13318
- * - [Testing Library](https://testing-library.com)
13319
- */
13320
- utilities?: TestingUtilities[];
13321
- }
13322
- /**
13323
- * @deprecated
13324
- */
13325
- interface ReactOptions {
13326
- /**
13327
- * Enable additional rules for utilities such as:
13328
- * - [React Query](https://tanstack.com/query/latest/docs/framework/react/overview)
13329
- */
13330
- utilities?: ReactUtilities[];
13331
- }
13332
13294
  type TypedConfigItem = Omit<Linter.Config<Linter.RulesRecord & Rules>, "plugins"> & {
13333
13295
  /**
13334
13296
  * An object containing a name-value mapping of plugin names to plugin objects. When `files` is specified, these plugins are only available to the matching files.
@@ -13343,19 +13305,14 @@ interface Options {
13343
13305
  */
13344
13306
  astro?: boolean;
13345
13307
  /**
13346
- * Is auto detection enabled?
13308
+ * Automatically enables rules based on installed dependencies.
13309
+ * For example, if `react` is installed, React-specific rules will be applied.
13347
13310
  * @default true
13348
13311
  */
13349
13312
  autoDetect?: boolean;
13350
13313
  /**
13351
- * Additional configs to either extend or overrides configurations
13352
- * @deprecated please use {@link Options.configs} instead.
13353
- *
13354
- * @default []
13355
- */
13356
- configs?: Linter.Config[] | TypedConfigItem[];
13357
- /**
13358
- * Glob patterns for files that should be ignored
13314
+ * Glob patterns for files that should be ignored.
13315
+ * Matches ESLint's ignore patterns.
13359
13316
  * @see [Ignoring files](https://eslint.org/docs/latest/use/configure/ignore)
13360
13317
  */
13361
13318
  ignores?: string[];
@@ -13370,7 +13327,8 @@ interface Options {
13370
13327
  */
13371
13328
  nextjs?: boolean;
13372
13329
  /**
13373
- * Additional configs to either extend or overrides configurations
13330
+ * Additional configs to extend or override rules.
13331
+ * Accepts ESLint configuration objects.
13374
13332
  * @default []
13375
13333
  */
13376
13334
  overrides?: Linter.Config[] | TypedConfigItem[];
@@ -13383,24 +13341,17 @@ interface Options {
13383
13341
  * Are React rules enabled?
13384
13342
  * @default false
13385
13343
  */
13386
- react?: boolean | ReactOptions;
13344
+ react?: boolean;
13387
13345
  /**
13388
13346
  * Are Storybook rules enabled?
13389
13347
  * @default false
13390
13348
  */
13391
13349
  storybook?: boolean;
13392
13350
  /**
13393
- * Are Tanstack Query rules enabled?
13351
+ * Are TanStack Query rules enabled?
13394
13352
  * @default false
13395
13353
  */
13396
13354
  tanstackQuery?: boolean;
13397
- /**
13398
- * Are testing rules enabled?
13399
- * @default false
13400
- *
13401
- * @deprecated please use {@link Options.jest}, {@link Options.vitest}, or {@link Options.testingLibrary} instead.
13402
- */
13403
- testing?: boolean | TestingOptions;
13404
13355
  /**
13405
13356
  * Are Testing Library rules enabled?
13406
13357
  * @default false
@@ -13410,7 +13361,7 @@ interface Options {
13410
13361
  * Are TypeScript rules enabled?
13411
13362
  * @default false
13412
13363
  */
13413
- typescript?: boolean | TypescriptOptions;
13364
+ typescript?: boolean;
13414
13365
  /**
13415
13366
  * Are Vitest rules enabled?
13416
13367
  * @default false
@@ -13418,7 +13369,7 @@ interface Options {
13418
13369
  vitest?: boolean;
13419
13370
  }
13420
13371
 
13421
- declare const eslintConfig: ({ astro, autoDetect, configs, ignores, jest, nextjs, overrides, playwright, react, storybook, tanstackQuery, testing, testingLibrary, typescript, vitest, }?: Options, ...moreOverrides: Linter.Config[] | TypedConfigItem[]) => Promise<(TypedConfigItem | Linter.Config<Linter.RulesRecord> | _typescript_eslint_utils_ts_eslint.FlatConfig.Config | {
13372
+ declare const eslintConfig: ({ astro, autoDetect, ignores, jest, nextjs, overrides, playwright, react, storybook, tanstackQuery, testingLibrary, typescript, vitest, }?: Options, ...moreOverrides: Linter.Config[] | TypedConfigItem[]) => Promise<(TypedConfigItem | Linter.Config<Linter.RulesRecord> | _typescript_eslint_utils_ts_eslint.FlatConfig.Config | {
13422
13373
  files: string[];
13423
13374
  languageOptions: {
13424
13375
  globals: {
@@ -14058,21 +14009,60 @@ declare const eslintConfig: ({ astro, autoDetect, configs, ignores, jest, nextjs
14058
14009
  allowImplicit: true;
14059
14010
  }];
14060
14011
  "arrow-body-style": ["error", "always"];
14012
+ "class-methods-use-this": "error";
14013
+ "consistent-return": "error";
14061
14014
  curly: ["error", "all"];
14015
+ "default-case": "error";
14016
+ "default-case-last": "error";
14062
14017
  "no-console": "warn";
14018
+ "no-implicit-coercion": "error";
14019
+ "no-implicit-globals": "error";
14020
+ "no-loop-func": "error";
14021
+ "no-magic-numbers": ["error", {
14022
+ ignore: number[];
14023
+ }];
14024
+ "no-new-wrappers": "error";
14025
+ "no-param-reassign": ["error", {
14026
+ props: true;
14027
+ }];
14028
+ "no-promise-executor-return": "error";
14063
14029
  "no-self-compare": "error";
14064
14030
  "no-template-curly-in-string": "error";
14031
+ "no-throw-literal": "error";
14065
14032
  "no-unmodified-loop-condition": "error";
14066
14033
  "no-unreachable-loop": "error";
14067
14034
  "no-use-before-define": ["error", {
14068
14035
  allowNamedExports: false;
14069
14036
  classes: false;
14070
- functions: false;
14037
+ functions: true;
14071
14038
  variables: true;
14072
14039
  }];
14040
+ "no-useless-computed-key": "error";
14041
+ "no-useless-constructor": "error";
14073
14042
  "no-useless-rename": "error";
14043
+ "no-useless-return": "error";
14044
+ "no-var": "error";
14074
14045
  "object-shorthand": "error";
14075
14046
  "prefer-arrow-callback": "error";
14047
+ "prefer-const": "error";
14048
+ "prefer-destructuring": ["error", {
14049
+ AssignmentExpression: {
14050
+ array: false;
14051
+ object: false;
14052
+ };
14053
+ VariableDeclarator: {
14054
+ array: false;
14055
+ object: true;
14056
+ };
14057
+ }];
14058
+ "prefer-object-spread": "error";
14059
+ "prefer-rest-params": "error";
14060
+ "prefer-spread": "error";
14061
+ "prefer-template": "error";
14062
+ radix: "error";
14063
+ "require-await": "error";
14064
+ strict: ["error", "safe"];
14065
+ "symbol-description": "error";
14076
14066
  };
14077
14067
  } | {
14078
14068
  name: string;
@@ -15762,11 +15752,8 @@ declare const eslintConfig: ({ astro, autoDetect, configs, ignores, jest, nextjs
15762
15752
  } | {
15763
15753
  languageOptions: {
15764
15754
  parserOptions: {
15765
- tsconfigRootDir: string;
15766
- project: string | string[];
15767
- } | {
15768
- tsconfigRootDir: string;
15769
15755
  projectService: boolean;
15756
+ tsconfigRootDir: string;
15770
15757
  };
15771
15758
  };
15772
15759
  name: string;
@@ -15840,4 +15827,4 @@ declare const eslintConfig: ({ astro, autoDetect, configs, ignores, jest, nextjs
15840
15827
  settings?: Record<string, unknown>;
15841
15828
  })[]>;
15842
15829
 
15843
- export { type Options, type ReactOptions, type Rules, type TestingOptions, type TypedConfigItem, type TypescriptOptions, eslintConfig as default };
15830
+ export { type Options, type Rules, type TypedConfigItem, eslintConfig as default };
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- var Z=Object.defineProperty;var r=(e,t)=>Z(e,"name",{value:t,configurable:!0});import u from"globals";import{parser as D,configs as p}from"typescript-eslint";import P from"@eslint-community/eslint-plugin-eslint-comments/configs";import{createTypeScriptImportResolver as ee}from"eslint-import-resolver-typescript";import d from"eslint-plugin-import-x";import C from"eslint-plugin-n";import re from"@eslint/js";import O from"eslint-plugin-jsdoc";import E from"eslint-plugin-perfectionist";import te from"eslint-config-prettier";import{isPackageExists as i}from"local-pkg";import*as T from"eslint-plugin-regexp";import R from"eslint-plugin-unicorn";const a="?([cm])[jt]s?(x)",oe=["**/node_modules","**/dist","**/package-lock.json","**/yarn.lock","**/pnpm-lock.yaml","**/bun.lockb","**/output","**/coverage","**/temp","**/.temp","**/tmp","**/.tmp","**/.history","**/.vitepress/cache","**/.nuxt","**/.next","**/.vercel","**/.changeset","**/.idea","**/.cache","**/.output","**/.vite-inspect","**/.yarn","**/storybook-static","**/.eslint-config-inspector","**/playwright-report","**/.astro","**/.vinxi","**/app.config.timestamp_*.js","**/CHANGELOG*.md","**/*.min.*","**/LICENSE*","**/__snapshots__","**/auto-import?(s).d.ts","**/components.d.ts","**/vite.config.ts.*.mjs","**/*.gen.*","!.storybook"],_="**/*.?([cm])js",f="**/*.?([cm])jsx",se="**/*.?([cm])ts",g="**/*.?([cm])tsx",m=[`**/__tests__/**/*.${a}`,`**/*.spec.${a}`,`**/*.test.${a}`,`**/*.bench.${a}`,`**/*.benchmark.${a}`],q=[`**/e2e/**/*.spec.${a}`,`**/e2e/**/*.test.${a}`],y=[...q,`**/cypress/**/*.spec.${a}`,`**/cypress/**/*.test.${a}`],ne=[_,f,se,g],ie="**/*.cjs",ae="**/*.astro",ce=["@testing-library/react"],s=r(async e=>{const t=await e;return t.default??t},"interopDefault"),le=r(async()=>{const e=[ae],[t,o,n]=await Promise.all([import("eslint-plugin-astro"),import("astro-eslint-parser"),s(import("eslint-plugin-jsx-a11y"))]);return[{files:e,languageOptions:{globals:{...u.node,Astro:!1,Fragment:!1},parser:o,parserOptions:{extraFileExtensions:[".astro"],parser:D},sourceType:"module"},name:"jimmy.codes/astro",plugins:{astro:t,"jsx-a11y":n},processor:"astro/client-side-ts",rules:{...n.configs.recommended.rules,"astro/missing-client-only-directive-value":"error","astro/no-conflict-set-directives":"error","astro/no-deprecated-astro-canonicalurl":"error","astro/no-deprecated-astro-fetchcontent":"error","astro/no-deprecated-astro-resolve":"error","astro/no-deprecated-getentrybyslug":"error","astro/no-exports-from-components":"off","astro/no-unused-define-vars-in-style":"error","astro/valid-compile":"error"}},{files:e,languageOptions:{parserOptions:p.disableTypeChecked.languageOptions?.parserOptions},name:"jimmy.codes/astro/disable-type-checked",rules:p.disableTypeChecked.rules},{name:"jimmy.codes/astro/imports",settings:{"import-x/core-modules":["astro:content"]}}]},"astroConfig"),pe=r(()=>[{files:[ie],languageOptions:{globals:u.commonjs},name:"jimmy.codes/commonjs"}],"commonjsConfig"),fe={...P.recommended.rules,"@eslint-community/eslint-comments/no-unused-disable":"off","@eslint-community/eslint-comments/require-description":"error"},me=r(()=>[{...P.recommended,name:"jimmy.codes/eslint-comments",rules:fe}],"eslintCommentsConfig"),ue=r(e=>[{ignores:[...oe,...e],name:"jimmy.codes/ignores"}],"ignoresConfig"),de={...d.configs.recommended.rules,"import-x/consistent-type-specifier-style":["error","prefer-top-level"],"import-x/extensions":["error","never",{checkTypedImports:!0,svg:"always"}],"import-x/first":"error","import-x/namespace":"off","import-x/newline-after-import":"error","import-x/no-absolute-path":"error","import-x/no-duplicates":"error","import-x/no-empty-named-blocks":"error","import-x/no-named-as-default":"error","import-x/no-named-as-default-member":"error","import-x/no-self-import":"error","import-x/no-unresolved":["error",{ignore:[String.raw`\.svg$`]}],"import-x/no-useless-path-segments":"error"},ge=r(()=>{const{rules:e,settings:t}=d.configs.typescript;return[{name:"jimmy.codes/imports/typescript",rules:e,settings:{"import-x/extensions":t["import-x/extensions"],"import-x/external-module-folders":t["import-x/external-module-folders"],"import-x/parsers":t["import-x/parsers"],"import-x/resolver-next":[ee({alwaysTryTypes:!0})]}}]},"importsTypescriptConfig"),ye=r(({typescript:e=!1}={})=>[{name:"jimmy.codes/imports",plugins:{"import-x":d,n:C},rules:de},...e?ge():[]],"importsConfig"),je={...re.configs.recommended.rules,"array-callback-return":["error",{allowImplicit:!0}],"arrow-body-style":["error","always"],curly:["error","all"],"no-console":"warn","no-self-compare":"error","no-template-curly-in-string":"error","no-unmodified-loop-condition":"error","no-unreachable-loop":"error","no-use-before-define":["error",{allowNamedExports:!1,classes:!1,functions:!1,variables:!0}],"no-useless-rename":"error","object-shorthand":"error","prefer-arrow-callback":"error"},he=r(()=>[{linterOptions:{reportUnusedDisableDirectives:!0},name:"jimmy.codes/javascript",rules:je}],"javascriptConfig"),xe=r(()=>({...O.configs["flat/recommended-typescript-error"].rules,"jsdoc/require-jsdoc":"off","jsdoc/require-param":"off","jsdoc/require-returns":"off","jsdoc/tag-lines":["error","always",{applyToEndTag:!1}]}),"jsdocRules"),ve=r(()=>[{...O.configs["flat/recommended-typescript-error"],name:"jimmy.codes/jsdoc",rules:xe()}],"jsdocConfig"),L=r((e={})=>Object.fromEntries(Object.entries(e).map(([t,o])=>[t,o==="warn"?"error":o])),"warningAsErrors"),be=r(async()=>{const e=await s(import("@next/eslint-plugin-next"));return L(e.configs.recommended.rules)},"nextjsRules"),we=r(async()=>{const e=await s(import("@next/eslint-plugin-next"));return[{files:ne,name:"jimmy.codes/nextjs",plugins:{"@next/next":e},rules:await be()}]},"nextjsConfig"),ke={"n/no-process-exit":"off","n/prefer-node-protocol":"error"},Pe=r(()=>[{name:"jimmy.codes/node",plugins:{n:C},rules:ke}],"nodeConfig"),Ce={...E.configs["recommended-natural"].rules,"perfectionist/sort-imports":["error",{customGroups:{type:{},value:{}},environment:"node",groups:["side-effect-style","builtin","type","external","internal-type","internal",["parent-type","sibling-type","index-type"],["parent","sibling","index"],"object","style","unknown"],internalPattern:["^~/.*","^@/.*"],order:"asc",type:"natural"}],"perfectionist/sort-modules":"off"},Oe=r(()=>[{name:"jimmy.codes/perfectionist",plugins:{perfectionist:E},rules:Ce}],"perfectionistConfig"),Ee=r(async()=>({...(await s(import("eslint-plugin-playwright"))).configs["flat/recommended"].rules,"playwright/expect-expect":"error","playwright/max-nested-describe":"error","playwright/no-conditional-expect":"error","playwright/no-conditional-in-test":"error","playwright/no-element-handle":"error","playwright/no-eval":"error","playwright/no-force-option":"error","playwright/no-nested-step":"error","playwright/no-page-pause":"error","playwright/no-skipped-test":"error","playwright/no-slowed-test":"error","playwright/no-useless-await":"error","playwright/no-useless-not":"error","playwright/no-wait-for-selector":"error","playwright/no-wait-for-timeout":"error"}),"playwrightRules"),Te=r(async()=>[{...(await s(import("eslint-plugin-playwright"))).configs["flat/recommended"],files:q,name:"jimmy.codes/playwright",rules:await Ee()}],"playwrightConfig"),Re=r(()=>[{name:"jimmy.codes/prettier",...te}],"prettierConfig"),_e=r(()=>i("typescript"),"hasTypescript"),qe=r(()=>i("react"),"hasReact"),S=r(()=>i("vitest"),"hasVitest"),G=r(()=>i("jest"),"hasJest"),Le=r(()=>S()||G(),"hasTesting"),Se=r(()=>ce.some(e=>i(e)),"hasTestingLibrary"),Ge=r(()=>i("@tanstack/react-query"),"hasReactQuery"),Ae=r(()=>i("astro"),"hasAstro"),Be=r(()=>i("@playwright/test"),"hasPlaywright"),Ie=r(()=>i("storybook"),"hasStorybook"),A=r(()=>i("next"),"hasNext"),Ne=r(()=>i("vite"),"hasVite"),$e=r(e=>e===2?"error":e===1?"warn":"off","toStringSeverity"),B=r((e={})=>Object.fromEntries(Object.entries(e).map(([t,o])=>[t,typeof o=="number"?$e(o):o])),"normalizeRuleEntries"),Je=["dynamic","dynamicParams","revalidate","fetchCache","runtime","preferredRegion","maxDuration","config","generateStaticParams","metadata","generateMetadata","viewport","generateViewport"],Ve=r(async()=>{const[e,t]=await Promise.all([s(import("eslint-plugin-react")),s(import("eslint-plugin-jsx-a11y"))]),o=A(),n=Ne();return{...t.configs.recommended.rules,...B(e.configs.flat.recommended?.rules),...B(e.configs.flat["jsx-runtime"]?.rules),"react-compiler/react-compiler":"error","react-hooks/exhaustive-deps":"error","react-hooks/rules-of-hooks":"error","react-refresh/only-export-components":["warn",{allowConstantExport:n,allowExportNames:o?Je:[]}],"react/boolean-prop-naming":"off","react/button-has-type":"error","react/checked-requires-onchange-or-readonly":"error","react/default-props-match-prop-types":"error","react/destructuring-assignment":"off","react/forbid-component-props":"off","react/forbid-dom-props":"off","react/forbid-elements":"off","react/forbid-foreign-prop-types":"off","react/forbid-prop-types":"off","react/forward-ref-uses-ref":"error","react/function-component-definition":"off","react/hook-use-state":"error","react/iframe-missing-sandbox":"error","react/jsx-boolean-value":["error","never"],"react/jsx-curly-brace-presence":"error","react/jsx-filename-extension":"off","react/jsx-fragments":["error","syntax"],"react/jsx-handler-names":"off","react/jsx-max-depth":"off","react/jsx-no-bind":"off","react/jsx-no-constructed-context-values":"error","react/jsx-no-leaked-render":"error","react/jsx-no-literals":"off","react/jsx-no-script-url":"error","react/jsx-no-useless-fragment":"error","react/jsx-one-expression-per-line":"off","react/jsx-pascal-case":["error",{allowNamespace:!0}],"react/jsx-props-no-spread-multi":"off","react/jsx-props-no-spreading":"off","react/jsx-sort-default-props":"off","react/jsx-sort-props":"off","react/no-access-state-in-setstate":"error","react/no-adjacent-inline-elements":"off","react/no-array-index-key":"off","react/no-arrow-function-lifecycle":"error","react/no-danger":"off","react/no-did-mount-set-state":"error","react/no-did-update-set-state":"error","react/no-invalid-html-attribute":"error","react/no-multi-comp":"off","react/no-namespace":"error","react/no-object-type-as-default-prop":"error","react/no-redundant-should-component-update":"error","react/no-set-state":"off","react/no-this-in-sfc":"error","react/no-typos":"error","react/no-unstable-nested-components":"error","react/no-unused-class-component-methods":"error","react/no-unused-prop-types":"error","react/no-unused-state":"error","react/no-will-update-set-state":"error","react/prefer-es6-class":"off","react/prefer-exact-props":"off","react/prefer-read-only-props":"off","react/prefer-stateless-function":"off","react/require-default-props":"off","react/require-optimization":"off","react/self-closing-comp":"error","react/sort-comp":"off","react/sort-default-props":"off","react/sort-prop-types":"off","react/state-in-constructor":"off","react/static-property-placement":"off","react/style-prop-object":"error","react/void-dom-elements-no-children":"error"}},"reactRules"),Fe=r(async()=>{const[e,t,o,n,c]=await Promise.all([s(import("eslint-plugin-react")),s(import("eslint-plugin-jsx-a11y")),import("eslint-plugin-react-hooks"),s(import("eslint-plugin-react-refresh")),s(import("eslint-plugin-react-compiler"))]);return[{files:[f,g],languageOptions:{globals:{...u.browser},parserOptions:{ecmaFeatures:{jsx:!0},jsxPragma:null}},name:"jimmy.codes/react",plugins:{"jsx-a11y":t,react:e,"react-compiler":c,"react-hooks":o,"react-refresh":n},rules:await Ve(),settings:{react:{version:"detect"}}}]},"reactConfig"),Xe={...T.configs["flat/recommended"].rules,"regexp/confusing-quantifier":"error","regexp/no-empty-alternative":"error","regexp/no-lazy-ends":"error","regexp/no-potentially-useless-backreference":"error","regexp/no-useless-flag":"error","regexp/optimal-lookaround-quantifier":"error"},Qe=r(()=>[{name:"jimmy.codes/regexp",plugins:{regexp:T},rules:Xe}],"regexpConfig"),Ue=r(async()=>{const{configs:e}=await s(import("eslint-plugin-storybook")),[t,o,n]=e["flat/recommended"];return[{name:"jimmy.codes/storybook/setup",plugins:t?.plugins},{files:o?.files,name:"jimmy.codes/storybook/stories-rules",rules:{...L(o?.rules),"import-x/no-anonymous-default-export":"off","unicorn/no-anonymous-default-export":"off"}},{files:n?.files,name:"jimmy.codes/storybook/main-rules",rules:{...n?.rules}}]},"storybookConfig"),ze=r(async()=>{const e=await s(import("@tanstack/eslint-plugin-query"));return[{files:[f,g],name:"jimmy.codes/react/query",plugins:{"@tanstack/query":e},rules:{"@tanstack/query/exhaustive-deps":"error","@tanstack/query/no-rest-destructuring":"warn","@tanstack/query/stable-query-client":"error"}}]},"tanstackQueryConfig"),He=r(async()=>{const e=await s(import("eslint-plugin-jest"));return{...e.configs["flat/recommended"].rules,...e.configs["flat/style"].rules,"jest/consistent-test-it":["error",{fn:"test",withinDescribe:"it"}],"jest/expect-expect":"error","jest/no-alias-methods":"error","jest/no-commented-out-tests":"error","jest/no-conditional-in-test":"error","jest/no-confusing-set-timeout":"error","jest/no-duplicate-hooks":"error","jest/no-hooks":"off","jest/no-large-snapshots":"off","jest/no-restricted-jest-methods":"off","jest/no-restricted-matchers":"off","jest/no-test-return-statement":"error","jest/no-untyped-mock-factory":"off","jest/prefer-called-with":"error","jest/prefer-comparison-matcher":"error","jest/prefer-each":"error","jest/prefer-equality-matcher":"error","jest/prefer-expect-assertions":"off","jest/prefer-expect-resolves":"error","jest/prefer-hooks-in-order":"error","jest/prefer-hooks-on-top":"error","jest/prefer-lowercase-title":"off","jest/prefer-mock-promise-shorthand":"error","jest/prefer-snapshot-hint":"error","jest/prefer-spy-on":"off","jest/prefer-strict-equal":"error","jest/prefer-todo":"warn","jest/require-hook":"error","jest/require-to-throw-message":"error","jest/require-top-level-describe":"off","jest/unbound-method":"off"}},"jestRules"),Me=r(async()=>({...(await s(import("@vitest/eslint-plugin"))).configs.recommended.rules,"vitest/consistent-test-it":["error",{fn:"test",withinDescribe:"it"}],"vitest/no-alias-methods":"error","vitest/no-commented-out-tests":"error","vitest/no-conditional-in-test":"error","vitest/no-disabled-tests":"warn","vitest/no-duplicate-hooks":"error","vitest/no-focused-tests":"error","vitest/no-hooks":"off","vitest/no-identical-title":"error","vitest/no-interpolation-in-snapshots":"error","vitest/no-large-snapshots":"off","vitest/no-mocks-import":"error","vitest/no-restricted-matchers":"off","vitest/no-restricted-vi-methods":"off","vitest/no-standalone-expect":"error","vitest/no-test-prefixes":"error","vitest/no-test-return-statement":"error","vitest/prefer-called-with":"error","vitest/prefer-comparison-matcher":"error","vitest/prefer-each":"error","vitest/prefer-equality-matcher":"error","vitest/prefer-expect-assertions":"off","vitest/prefer-expect-resolves":"error","vitest/prefer-hooks-in-order":"error","vitest/prefer-hooks-on-top":"error","vitest/prefer-lowercase-title":"off","vitest/prefer-mock-promise-shorthand":"error","vitest/prefer-snapshot-hint":"error","vitest/prefer-spy-on":"off","vitest/prefer-strict-boolean-matchers":"error","vitest/prefer-strict-equal":"error","vitest/prefer-to-be":"error","vitest/prefer-to-contain":"error","vitest/prefer-to-have-length":"error","vitest/prefer-todo":"warn","vitest/require-hook":"error","vitest/require-to-throw-message":"error","vitest/require-top-level-describe":"off","vitest/valid-expect":"error","vitest/valid-expect-in-promise":"error","vitest/valid-title":"error"}),"vitestRules"),Ye=r(async({framework:e="vitest"}={},t=!0)=>{const o=t?S():e==="vitest",n=e==="jest"||t&&G(),c=[];if(o){const l=await s(import("@vitest/eslint-plugin"));c.push({files:m,ignores:y,...l.configs.recommended,name:"jimmy.codes/vitest",rules:await Me()})}if(n){const l=await s(import("eslint-plugin-jest"));c.push({files:m,ignores:y,...l.configs["flat/recommended"],name:"jimmy.codes/jest",rules:await He()})}return c},"testingConfig"),We=r(async()=>{const[e,t]=await Promise.all([import("eslint-plugin-jest-dom"),s(import("eslint-plugin-testing-library"))]);return{...t.configs["flat/react"].rules,...e.configs["flat/recommended"].rules}},"testingLibraryRules"),Ke=r(async()=>{const[e,t]=await Promise.all([import("eslint-plugin-jest-dom"),s(import("eslint-plugin-testing-library"))]);return[{files:m,ignores:y,name:"jimmy.codes/testing-library",plugins:{"jest-dom":e,"testing-library":t},rules:await We()}]},"testingLibraryConfig"),Ze={"@typescript-eslint/consistent-type-exports":["error",{fixMixedExportsWithInlineTypeSpecifier:!1}],"@typescript-eslint/consistent-type-imports":["error",{fixStyle:"separate-type-imports"}],"@typescript-eslint/no-deprecated":"warn","@typescript-eslint/no-misused-promises":["error",{checksVoidReturn:{attributes:!1}}],"@typescript-eslint/no-unused-vars":["error",{args:"all",argsIgnorePattern:"^_",caughtErrors:"all",caughtErrorsIgnorePattern:"^_",destructuredArrayIgnorePattern:"^_",ignoreRestSiblings:!0,varsIgnorePattern:"^_"}],"@typescript-eslint/no-use-before-define":["error",{allowNamedExports:!1,classes:!1,functions:!1,variables:!0}],"@typescript-eslint/restrict-template-expressions":["error",{allowNumber:!0}],"no-use-before-define":"off"},De=r(e=>[...p.strictTypeChecked,...p.stylisticTypeChecked.filter(t=>t.name==="typescript-eslint/stylistic-type-checked"),{languageOptions:{parserOptions:{...e?.project?{project:e.project}:{projectService:!0},tsconfigRootDir:process.cwd()}},name:"jimmy.codes/typescript",rules:Ze},{files:[_,f],...p.disableTypeChecked},{files:m,name:"jimmy.codes/typescript/testing",rules:{"@typescript-eslint/no-unsafe-argument":"off","@typescript-eslint/no-unsafe-assignment":"off"}}],"typescriptConfig"),er={...R.configs["flat/recommended"].rules,"unicorn/filename-case":"off","unicorn/import-style":"off","unicorn/no-abusive-eslint-disable":"off","unicorn/no-anonymous-default-export":"off","unicorn/no-array-callback-reference":"off","unicorn/no-array-reduce":"off","unicorn/no-null":"off","unicorn/no-process-exit":"off","unicorn/no-useless-undefined":["error",{checkArguments:!1,checkArrowFunctionBody:!1}],"unicorn/prefer-node-protocol":"off","unicorn/prevent-abbreviations":"off"},rr=r(()=>[{...R.configs["flat/recommended"],name:"jimmy.codes/unicorn",rules:er}],"unicornConfig"),tr=r(e=>typeof e=="object"?e:void 0,"getTypescriptOptions"),or=r((e,t)=>typeof e=="object"?e:{framework:t.vitest?"vitest":t.jest?"jest":"vitest",...t.testingLibrary&&{utilities:["testing-library"]}},"getTestingOptions"),sr=r(e=>typeof e=="object"?e:{utilities:[]},"getReactOptions"),nr=r(({utilities:e=[]},t,o)=>t||e.includes("@tanstack/query")||o&&Ge(),"shouldEnableTanstackQuery"),ir=r(({utilities:e=[]},t)=>e.includes("testing-library")||t&&Se(),"shouldEnableTestingLibrary"),ar=r(async({astro:e=!1,autoDetect:t=!0,configs:o=[],ignores:n=[],jest:c=!1,nextjs:l=!1,overrides:I=[],playwright:N=!1,react:j=!1,storybook:$=!1,tanstackQuery:J=!1,testing:h=!1,testingLibrary:V=!1,typescript:x=!1,vitest:v=!1}={},...F)=>{const X=sr(j),b=or(h,{jest:c,testingLibrary:V,vitest:v}),w=tr(x),k=x||!!w||t&&_e(),Q=j||t&&qe(),U=h||c||v||t&&Le(),z=e||t&&Ae(),H=nr(X,J,t),M=ir(b,t),Y=N||t&&Be(),W=$||t&&Ie(),K=l||t&&A();return[he(),Oe(),Pe(),rr(),me(),Qe(),ve(),ye({typescript:k}),k?De(w):[],Q?await Fe():[],H?await ze():[],z?await le():[],U?await Ye(b,t):[],M?await Ke():[],Y?await Te():[],W?await Ue():[],K?await we():[],Re(),pe(),ue(n),o,I,F].flat()},"eslintConfig");export{ar as default};
1
+ var W=Object.defineProperty;var r=(e,t)=>W(e,"name",{value:t,configurable:!0});import u from"globals";import{parser as K,configs as l}from"typescript-eslint";import j from"@eslint-community/eslint-plugin-eslint-comments/configs";import{createTypeScriptImportResolver as Z}from"eslint-import-resolver-typescript";import d from"eslint-plugin-import-x";import h from"eslint-plugin-n";import ee from"@eslint/js";import b from"eslint-plugin-jsdoc";import w from"eslint-plugin-perfectionist";import re from"eslint-config-prettier";import{isPackageExists as i}from"local-pkg";import*as v from"eslint-plugin-regexp";import k from"eslint-plugin-unicorn";const c="?([cm])[jt]s?(x)",te=["**/node_modules","**/dist","**/package-lock.json","**/yarn.lock","**/pnpm-lock.yaml","**/bun.lockb","**/output","**/coverage","**/temp","**/.temp","**/tmp","**/.tmp","**/.history","**/.vitepress/cache","**/.nuxt","**/.next","**/.vercel","**/.changeset","**/.idea","**/.cache","**/.output","**/.vite-inspect","**/.yarn","**/storybook-static","**/.eslint-config-inspector","**/playwright-report","**/.astro","**/.vinxi","**/app.config.timestamp_*.js","**/CHANGELOG*.md","**/*.min.*","**/LICENSE*","**/__snapshots__","**/auto-import?(s).d.ts","**/components.d.ts","**/vite.config.ts.*.mjs","**/*.gen.*","!.storybook"],P="**/*.?([cm])js",p="**/*.?([cm])jsx",oe="**/*.?([cm])ts",g="**/*.?([cm])tsx",f=[`**/__tests__/**/*.${c}`,`**/*.spec.${c}`,`**/*.test.${c}`,`**/*.bench.${c}`,`**/*.benchmark.${c}`],C=[`**/e2e/**/*.spec.${c}`,`**/e2e/**/*.test.${c}`],y=[...C,`**/cypress/**/*.spec.${c}`,`**/cypress/**/*.test.${c}`],se=[P,p,oe,g],ne="**/*.cjs",ie="**/*.astro",ae=["@testing-library/react"],o=r(async e=>{const t=await e;return t.default??t},"interopDefault"),ce=r(async()=>{const e=[ie],[t,s,n]=await Promise.all([import("eslint-plugin-astro"),import("astro-eslint-parser"),o(import("eslint-plugin-jsx-a11y"))]);return[{files:e,languageOptions:{globals:{...u.node,Astro:!1,Fragment:!1},parser:s,parserOptions:{extraFileExtensions:[".astro"],parser:K},sourceType:"module"},name:"jimmy.codes/astro",plugins:{astro:t,"jsx-a11y":n},processor:"astro/client-side-ts",rules:{...n.configs.recommended.rules,"astro/missing-client-only-directive-value":"error","astro/no-conflict-set-directives":"error","astro/no-deprecated-astro-canonicalurl":"error","astro/no-deprecated-astro-fetchcontent":"error","astro/no-deprecated-astro-resolve":"error","astro/no-deprecated-getentrybyslug":"error","astro/no-exports-from-components":"off","astro/no-unused-define-vars-in-style":"error","astro/valid-compile":"error"}},{files:e,languageOptions:{parserOptions:l.disableTypeChecked.languageOptions?.parserOptions},name:"jimmy.codes/astro/disable-type-checked",rules:l.disableTypeChecked.rules},{name:"jimmy.codes/astro/imports",settings:{"import-x/core-modules":["astro:content"]}}]},"astroConfig"),le=r(()=>[{files:[ne],languageOptions:{globals:u.commonjs},name:"jimmy.codes/commonjs"}],"commonjsConfig"),pe={...j.recommended.rules,"@eslint-community/eslint-comments/no-unused-disable":"off","@eslint-community/eslint-comments/require-description":"error"},fe=r(()=>[{...j.recommended,name:"jimmy.codes/eslint-comments",rules:pe}],"eslintCommentsConfig"),me=r(e=>[{ignores:[...te,...e],name:"jimmy.codes/ignores"}],"ignoresConfig"),ue={...d.configs.recommended.rules,"import-x/consistent-type-specifier-style":["error","prefer-top-level"],"import-x/extensions":["error","never",{checkTypedImports:!0,svg:"always"}],"import-x/first":"error","import-x/namespace":"off","import-x/newline-after-import":"error","import-x/no-absolute-path":"error","import-x/no-duplicates":"error","import-x/no-empty-named-blocks":"error","import-x/no-named-as-default":"error","import-x/no-named-as-default-member":"error","import-x/no-self-import":"error","import-x/no-unresolved":["error",{ignore:[String.raw`\.svg$`]}],"import-x/no-useless-path-segments":"error"},de=r(()=>{const{rules:e,settings:t}=d.configs.typescript;return[{name:"jimmy.codes/imports/typescript",rules:e,settings:{"import-x/extensions":t["import-x/extensions"],"import-x/external-module-folders":t["import-x/external-module-folders"],"import-x/parsers":t["import-x/parsers"],"import-x/resolver-next":[Z({alwaysTryTypes:!0})]}}]},"importsTypescriptConfig"),ge=r(({typescript:e=!1}={})=>[{name:"jimmy.codes/imports",plugins:{"import-x":d,n:h},rules:ue},...e?de():[]],"importsConfig"),ye={"array-callback-return":["error",{allowImplicit:!0}],"arrow-body-style":["error","always"],"class-methods-use-this":"error","consistent-return":"error",curly:["error","all"],"default-case":"error","default-case-last":"error","no-console":"warn","no-implicit-coercion":"error","no-implicit-globals":"error","no-loop-func":"error","no-magic-numbers":["error",{ignore:[0,1,-1,2]}],"no-new-wrappers":"error","no-param-reassign":["error",{props:!0}],"no-promise-executor-return":"error","no-self-compare":"error","no-template-curly-in-string":"error","no-throw-literal":"error","no-unmodified-loop-condition":"error","no-unreachable-loop":"error","no-use-before-define":["error",{allowNamedExports:!1,classes:!1,functions:!0,variables:!0}],"no-useless-computed-key":"error","no-useless-constructor":"error","no-useless-rename":"error","no-useless-return":"error","no-var":"error","object-shorthand":"error","prefer-arrow-callback":"error","prefer-const":"error","prefer-destructuring":["error",{AssignmentExpression:{array:!1,object:!1},VariableDeclarator:{array:!1,object:!0}}],"prefer-object-spread":"error","prefer-rest-params":"error","prefer-spread":"error","prefer-template":"error",radix:"error","require-await":"error",strict:["error","safe"],"symbol-description":"error"},xe={...ee.configs.recommended.rules,...ye},je=r(()=>[{linterOptions:{reportUnusedDisableDirectives:!0},name:"jimmy.codes/javascript",rules:xe}],"javascriptConfig"),he=r(async()=>{const e=await o(import("eslint-plugin-jest"));return{...e.configs["flat/recommended"].rules,...e.configs["flat/style"].rules,"jest/consistent-test-it":["error",{fn:"test",withinDescribe:"it"}],"jest/expect-expect":"error","jest/no-alias-methods":"error","jest/no-commented-out-tests":"error","jest/no-conditional-in-test":"error","jest/no-confusing-set-timeout":"error","jest/no-duplicate-hooks":"error","jest/no-hooks":"off","jest/no-large-snapshots":"off","jest/no-restricted-jest-methods":"off","jest/no-restricted-matchers":"off","jest/no-test-return-statement":"error","jest/no-untyped-mock-factory":"off","jest/prefer-called-with":"error","jest/prefer-comparison-matcher":"error","jest/prefer-each":"error","jest/prefer-equality-matcher":"error","jest/prefer-expect-assertions":"off","jest/prefer-expect-resolves":"error","jest/prefer-hooks-in-order":"error","jest/prefer-hooks-on-top":"error","jest/prefer-lowercase-title":"off","jest/prefer-mock-promise-shorthand":"error","jest/prefer-snapshot-hint":"error","jest/prefer-spy-on":"off","jest/prefer-strict-equal":"error","jest/prefer-todo":"warn","jest/require-hook":"error","jest/require-to-throw-message":"error","jest/require-top-level-describe":"off","jest/unbound-method":"off"}},"jestRules"),be=r(async()=>{const e=await o(import("eslint-plugin-jest"));return[{files:f,ignores:y,...e.configs["flat/recommended"],name:"jimmy.codes/jest",rules:await he()}]},"jestConfig"),we=r(()=>({...b.configs["flat/recommended-typescript-error"].rules,"jsdoc/require-jsdoc":"off","jsdoc/require-param":"off","jsdoc/require-returns":"off","jsdoc/tag-lines":["error","always",{applyToEndTag:!1}]}),"jsdocRules"),ve=r(()=>[{...b.configs["flat/recommended-typescript-error"],name:"jimmy.codes/jsdoc",rules:we()}],"jsdocConfig"),E=r((e={})=>Object.fromEntries(Object.entries(e).map(([t,s])=>[t,s==="warn"?"error":s])),"warningAsErrors"),ke=r(async()=>{const e=await o(import("@next/eslint-plugin-next"));return E(e.configs.recommended.rules)},"nextjsRules"),Pe=r(async()=>{const e=await o(import("@next/eslint-plugin-next"));return[{files:se,name:"jimmy.codes/nextjs",plugins:{"@next/next":e},rules:await ke()}]},"nextjsConfig"),Ce={"n/no-process-exit":"off","n/prefer-node-protocol":"error"},Ee=r(()=>[{name:"jimmy.codes/node",plugins:{n:h},rules:Ce}],"nodeConfig"),Re={...w.configs["recommended-natural"].rules,"perfectionist/sort-imports":["error",{customGroups:{type:{},value:{}},environment:"node",groups:["side-effect-style","builtin","type","external","internal-type","internal",["parent-type","sibling-type","index-type"],["parent","sibling","index"],"object","style","unknown"],internalPattern:["^~/.*","^@/.*"],order:"asc",type:"natural"}],"perfectionist/sort-modules":"off"},Oe=r(()=>[{name:"jimmy.codes/perfectionist",plugins:{perfectionist:w},rules:Re}],"perfectionistConfig"),Te=r(async()=>({...(await o(import("eslint-plugin-playwright"))).configs["flat/recommended"].rules,"playwright/expect-expect":"error","playwright/max-nested-describe":"error","playwright/no-conditional-expect":"error","playwright/no-conditional-in-test":"error","playwright/no-element-handle":"error","playwright/no-eval":"error","playwright/no-force-option":"error","playwright/no-nested-step":"error","playwright/no-page-pause":"error","playwright/no-skipped-test":"error","playwright/no-slowed-test":"error","playwright/no-useless-await":"error","playwright/no-useless-not":"error","playwright/no-wait-for-selector":"error","playwright/no-wait-for-timeout":"error"}),"playwrightRules"),_e=r(async()=>[{...(await o(import("eslint-plugin-playwright"))).configs["flat/recommended"],files:C,name:"jimmy.codes/playwright",rules:await Te()}],"playwrightConfig"),qe=r(()=>[{name:"jimmy.codes/prettier",...re}],"prettierConfig"),Se=r(()=>i("typescript"),"hasTypescript"),Le=r(()=>i("react"),"hasReact"),Ge=r(()=>i("vitest"),"hasVitest"),Ae=r(()=>i("jest"),"hasJest"),Be=r(()=>ae.some(e=>i(e)),"hasTestingLibrary"),Ie=r(()=>i("@tanstack/react-query"),"hasReactQuery"),Ne=r(()=>i("astro"),"hasAstro"),De=r(()=>i("@playwright/test"),"hasPlaywright"),$e=r(()=>i("storybook"),"hasStorybook"),R=r(()=>i("next"),"hasNext"),Ve=r(()=>i("vite"),"hasVite"),Fe=r(e=>e===2?"error":e===1?"warn":"off","toStringSeverity"),O=r((e={})=>Object.fromEntries(Object.entries(e).map(([t,s])=>[t,typeof s=="number"?Fe(s):s])),"normalizeRuleEntries"),Je=["dynamic","dynamicParams","revalidate","fetchCache","runtime","preferredRegion","maxDuration","config","generateStaticParams","metadata","generateMetadata","viewport","generateViewport"],Xe=r(async()=>{const[e,t]=await Promise.all([o(import("eslint-plugin-react")),o(import("eslint-plugin-jsx-a11y"))]),s=R(),n=Ve();return{...t.configs.recommended.rules,...O(e.configs.flat.recommended?.rules),...O(e.configs.flat["jsx-runtime"]?.rules),"react-compiler/react-compiler":"error","react-hooks/exhaustive-deps":"error","react-hooks/rules-of-hooks":"error","react-refresh/only-export-components":["warn",{allowConstantExport:n,allowExportNames:s?Je:[]}],"react/boolean-prop-naming":"off","react/button-has-type":"error","react/checked-requires-onchange-or-readonly":"error","react/default-props-match-prop-types":"error","react/destructuring-assignment":"off","react/forbid-component-props":"off","react/forbid-dom-props":"off","react/forbid-elements":"off","react/forbid-foreign-prop-types":"off","react/forbid-prop-types":"off","react/forward-ref-uses-ref":"error","react/function-component-definition":"off","react/hook-use-state":"error","react/iframe-missing-sandbox":"error","react/jsx-boolean-value":["error","never"],"react/jsx-curly-brace-presence":"error","react/jsx-filename-extension":"off","react/jsx-fragments":["error","syntax"],"react/jsx-handler-names":"off","react/jsx-max-depth":"off","react/jsx-no-bind":"off","react/jsx-no-constructed-context-values":"error","react/jsx-no-leaked-render":"error","react/jsx-no-literals":"off","react/jsx-no-script-url":"error","react/jsx-no-useless-fragment":"error","react/jsx-one-expression-per-line":"off","react/jsx-pascal-case":["error",{allowNamespace:!0}],"react/jsx-props-no-spread-multi":"off","react/jsx-props-no-spreading":"off","react/jsx-sort-default-props":"off","react/jsx-sort-props":"off","react/no-access-state-in-setstate":"error","react/no-adjacent-inline-elements":"off","react/no-array-index-key":"off","react/no-arrow-function-lifecycle":"error","react/no-danger":"off","react/no-did-mount-set-state":"error","react/no-did-update-set-state":"error","react/no-invalid-html-attribute":"error","react/no-multi-comp":"off","react/no-namespace":"error","react/no-object-type-as-default-prop":"error","react/no-redundant-should-component-update":"error","react/no-set-state":"off","react/no-this-in-sfc":"error","react/no-typos":"error","react/no-unstable-nested-components":"error","react/no-unused-class-component-methods":"error","react/no-unused-prop-types":"error","react/no-unused-state":"error","react/no-will-update-set-state":"error","react/prefer-es6-class":"off","react/prefer-exact-props":"off","react/prefer-read-only-props":"off","react/prefer-stateless-function":"off","react/require-default-props":"off","react/require-optimization":"off","react/self-closing-comp":"error","react/sort-comp":"off","react/sort-default-props":"off","react/sort-prop-types":"off","react/state-in-constructor":"off","react/static-property-placement":"off","react/style-prop-object":"error","react/void-dom-elements-no-children":"error"}},"reactRules"),Ue=r(async()=>{const[e,t,s,n,m]=await Promise.all([o(import("eslint-plugin-react")),o(import("eslint-plugin-jsx-a11y")),import("eslint-plugin-react-hooks"),o(import("eslint-plugin-react-refresh")),o(import("eslint-plugin-react-compiler"))]);return[{files:[p,g],languageOptions:{globals:{...u.browser},parserOptions:{ecmaFeatures:{jsx:!0},jsxPragma:null}},name:"jimmy.codes/react",plugins:{"jsx-a11y":t,react:e,"react-compiler":m,"react-hooks":s,"react-refresh":n},rules:await Xe(),settings:{react:{version:"detect"}}}]},"reactConfig"),ze={...v.configs["flat/recommended"].rules,"regexp/confusing-quantifier":"error","regexp/no-empty-alternative":"error","regexp/no-lazy-ends":"error","regexp/no-potentially-useless-backreference":"error","regexp/no-useless-flag":"error","regexp/optimal-lookaround-quantifier":"error"},He=r(()=>[{name:"jimmy.codes/regexp",plugins:{regexp:v},rules:ze}],"regexpConfig"),Me=r(async()=>{const{configs:e}=await o(import("eslint-plugin-storybook")),[t,s,n]=e["flat/recommended"];return[{name:"jimmy.codes/storybook/setup",plugins:t?.plugins},{files:s?.files,name:"jimmy.codes/storybook/stories-rules",rules:{...E(s?.rules),"import-x/no-anonymous-default-export":"off","unicorn/no-anonymous-default-export":"off"}},{files:n?.files,name:"jimmy.codes/storybook/main-rules",rules:{...n?.rules}}]},"storybookConfig"),Qe=r(async()=>{const e=await o(import("@tanstack/eslint-plugin-query"));return[{files:[p,g],name:"jimmy.codes/react/query",plugins:{"@tanstack/query":e},rules:{"@tanstack/query/exhaustive-deps":"error","@tanstack/query/no-rest-destructuring":"warn","@tanstack/query/stable-query-client":"error"}}]},"tanstackQueryConfig"),Ye=r(async()=>{const[e,t]=await Promise.all([import("eslint-plugin-jest-dom"),o(import("eslint-plugin-testing-library"))]);return{...t.configs["flat/react"].rules,...e.configs["flat/recommended"].rules}},"testingLibraryRules"),We=r(async()=>{const[e,t]=await Promise.all([import("eslint-plugin-jest-dom"),o(import("eslint-plugin-testing-library"))]);return[{files:f,ignores:y,name:"jimmy.codes/testing-library",plugins:{"jest-dom":e,"testing-library":t},rules:await Ye()}]},"testingLibraryConfig"),Ke={"@typescript-eslint/consistent-type-exports":["error",{fixMixedExportsWithInlineTypeSpecifier:!1}],"@typescript-eslint/consistent-type-imports":["error",{fixStyle:"separate-type-imports"}],"@typescript-eslint/no-deprecated":"warn","@typescript-eslint/no-misused-promises":["error",{checksVoidReturn:{attributes:!1}}],"@typescript-eslint/no-unused-vars":["error",{args:"all",argsIgnorePattern:"^_",caughtErrors:"all",caughtErrorsIgnorePattern:"^_",destructuredArrayIgnorePattern:"^_",ignoreRestSiblings:!0,varsIgnorePattern:"^_"}],"@typescript-eslint/no-use-before-define":["error",{allowNamedExports:!1,classes:!1,functions:!1,variables:!0}],"@typescript-eslint/restrict-template-expressions":["error",{allowNumber:!0}],"no-use-before-define":"off"},Ze=r(()=>[...l.strictTypeChecked,...l.stylisticTypeChecked.filter(e=>e.name==="typescript-eslint/stylistic-type-checked"),{languageOptions:{parserOptions:{projectService:!0,tsconfigRootDir:process.cwd()}},name:"jimmy.codes/typescript",rules:Ke},{files:[P,p],...l.disableTypeChecked},{files:f,name:"jimmy.codes/typescript/testing",rules:{"@typescript-eslint/no-unsafe-argument":"off","@typescript-eslint/no-unsafe-assignment":"off"}}],"typescriptConfig"),er={...k.configs["flat/recommended"].rules,"unicorn/filename-case":"off","unicorn/import-style":"off","unicorn/no-abusive-eslint-disable":"off","unicorn/no-anonymous-default-export":"off","unicorn/no-array-callback-reference":"off","unicorn/no-array-reduce":"off","unicorn/no-null":"off","unicorn/no-process-exit":"off","unicorn/no-useless-undefined":["error",{checkArguments:!1,checkArrowFunctionBody:!1}],"unicorn/prefer-node-protocol":"off","unicorn/prevent-abbreviations":"off"},rr=r(()=>[{...k.configs["flat/recommended"],name:"jimmy.codes/unicorn",rules:er}],"unicornConfig"),tr=r(async()=>({...(await o(import("@vitest/eslint-plugin"))).configs.recommended.rules,"vitest/consistent-test-it":["error",{fn:"test",withinDescribe:"it"}],"vitest/no-alias-methods":"error","vitest/no-commented-out-tests":"error","vitest/no-conditional-in-test":"error","vitest/no-disabled-tests":"warn","vitest/no-duplicate-hooks":"error","vitest/no-focused-tests":"error","vitest/no-hooks":"off","vitest/no-identical-title":"error","vitest/no-interpolation-in-snapshots":"error","vitest/no-large-snapshots":"off","vitest/no-mocks-import":"error","vitest/no-restricted-matchers":"off","vitest/no-restricted-vi-methods":"off","vitest/no-standalone-expect":"error","vitest/no-test-prefixes":"error","vitest/no-test-return-statement":"error","vitest/prefer-called-with":"error","vitest/prefer-comparison-matcher":"error","vitest/prefer-each":"error","vitest/prefer-equality-matcher":"error","vitest/prefer-expect-assertions":"off","vitest/prefer-expect-resolves":"error","vitest/prefer-hooks-in-order":"error","vitest/prefer-hooks-on-top":"error","vitest/prefer-lowercase-title":"off","vitest/prefer-mock-promise-shorthand":"error","vitest/prefer-snapshot-hint":"error","vitest/prefer-spy-on":"off","vitest/prefer-strict-boolean-matchers":"error","vitest/prefer-strict-equal":"error","vitest/prefer-to-be":"error","vitest/prefer-to-contain":"error","vitest/prefer-to-have-length":"error","vitest/prefer-todo":"warn","vitest/require-hook":"error","vitest/require-to-throw-message":"error","vitest/require-top-level-describe":"off","vitest/valid-expect":"error","vitest/valid-expect-in-promise":"error","vitest/valid-title":"error"}),"vitestRules"),or=r(async()=>{const e=await o(import("@vitest/eslint-plugin"));return[{files:f,ignores:y,...e.configs.recommended,name:"jimmy.codes/vitest",rules:await tr()}]},"vitestConfig"),sr=r(async({astro:e=!1,autoDetect:t=!0,ignores:s=[],jest:n=!1,nextjs:m=!1,overrides:T=[],playwright:_=!1,react:q=!1,storybook:S=!1,tanstackQuery:L=!1,testingLibrary:G=!1,typescript:A=!1,vitest:B=!1}={},...I)=>{const a=r((Q,Y)=>Q||t&&Y(),"resolveFlag"),x=a(A,Se),N=a(q,Le),D=a(e,Ne),$=a(L,Ie),V=a(G,Be),F=a(_,De),J=a(S,$e),X=a(m,R),U=a(n,Ae),z=a(B,Ge),H=[je(),Oe(),Ee(),rr(),fe(),He(),ve(),ge({typescript:x})],M=[x&&Ze(),N&&await Ue(),$&&await Qe(),D&&await ce(),U&&await be(),z&&await or(),V&&await We(),F&&await _e(),J&&await Me(),X&&await Pe()].filter(Boolean);return[...H,...M,qe(),le(),me(s),T,I].flat()},"eslintConfig");export{sr as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jimmy.codes/eslint-config",
3
- "version": "3.30.1",
3
+ "version": "4.1.0",
4
4
  "description": "another opinionated eslint config",
5
5
  "keywords": [
6
6
  "eslint",