@jimmy.codes/eslint-config 3.24.0 → 3.25.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";var Z=Object.create;var g=Object.defineProperty;var ee=Object.getOwnPropertyDescriptor;var re=Object.getOwnPropertyNames;var te=Object.getPrototypeOf,se=Object.prototype.hasOwnProperty;var t=(e,r)=>g(e,"name",{value:r,configurable:!0});var oe=(e,r,s,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of re(r))!se.call(e,a)&&a!==s&&g(e,a,{get:()=>r[a],enumerable:!(n=ee(r,a))||n.enumerable});return e};var o=(e,r,s)=>(s=e!=null?Z(te(e)):{},oe(r||!e||!e.__esModule?g(s,"default",{value:e,enumerable:!0}):s,e));var y=require("globals"),p=require("typescript-eslint"),O=require("@eslint-community/eslint-plugin-eslint-comments/configs"),u=require("eslint-plugin-import-x"),C=require("eslint-plugin-n"),ne=require("@eslint/js"),_=require("eslint-plugin-perfectionist"),ie=require("eslint-config-prettier"),c=require("local-pkg"),ae=require("eslint-plugin-regexp"),q=require("eslint-plugin-unicorn");function ce(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(ce,"_interopNamespaceDefault");var T=ce(ae);const l="?([cm])[jt]s?(x)",le=["**/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"],R="**/*.?([cm])js",m="**/*.?([cm])jsx",pe="**/*.?([cm])ts",j="**/*.?([cm])tsx",d=[`**/__tests__/**/*.${l}`,`**/*.spec.${l}`,`**/*.test.${l}`,`**/*.bench.${l}`,`**/*.benchmark.${l}`],L=[`**/e2e/**/*.spec.${l}`,`**/e2e/**/*.test.${l}`],x=[...L,`**/cypress/**/*.spec.${l}`,`**/cypress/**/*.test.${l}`],fe=[R,m,pe,j],ue="**/*.cjs",me="**/*.astro",de=["vi.mock","describe","expect","it"],ge=["@testing-library/react"],i=t(async e=>{const r=await e;return r.default??r},"interopDefault"),ye=t(async()=>{const e=[me],[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:{...y.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"),je=t(()=>[{files:[ue],languageOptions:{globals:y.commonjs},name:"jimmy.codes/commonjs"}],"commonjsConfig"),xe={...O.recommended.rules,"@eslint-community/eslint-comments/no-unused-disable":"off","@eslint-community/eslint-comments/require-description":"error"},he=t(()=>[{...O.recommended,name:"jimmy.codes/eslint-comments",rules:xe}],"eslintCommentsConfig"),be=t(e=>[{ignores:[...le,...e],name:"jimmy.codes/ignores"}],"ignoresConfig"),we={...u.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"},ve={name:"jimmy.codes/imports/typescript",rules:u.configs.typescript.rules,settings:{...u.configs.typescript.settings,"import-x/resolver":{...u.configs.typescript.settings["import-x/resolver"],typescript:!0}}},ke=t(({typescript:e=!1}={})=>[{name:"jimmy.codes/imports",plugins:{"import-x":u,n:C},rules:we},...e?[ve]:[]],"importsConfig"),Pe={...ne.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"},Ee=t(()=>[{linterOptions:{reportUnusedDisableDirectives:!0},name:"jimmy.codes/javascript",rules:Pe}],"javascriptConfig"),Oe=t(async()=>({...(await i(import("@next/eslint-plugin-next"))).configs["core-web-vitals"].rules}),"nextjsRules"),Ce=t(async()=>{const e=await i(import("@next/eslint-plugin-next"));return[{files:fe,name:"jimmy.codes/nextjs",plugins:{"@next/next":e},rules:await Oe()}]},"nextjsConfig"),_e={"n/no-process-exit":"off","n/prefer-node-protocol":"error"},qe=t(()=>[{name:"jimmy.codes/node",plugins:{n:C},rules:_e}],"nodeConfig"),Te={..._.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"},Re=t(()=>[{name:"jimmy.codes/perfectionist",plugins:{perfectionist:_},rules:Te}],"perfectionistConfig"),Le=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-useless-await":"error","playwright/no-useless-not":"error","playwright/no-wait-for-selector":"error","playwright/no-wait-for-timeout":"error"}),"playwrightRules"),Se=t(async()=>[{...(await i(import("eslint-plugin-playwright"))).configs["flat/recommended"],files:L,name:"jimmy.codes/playwright",rules:await Le()}],"playwrightConfig"),Ge=t(()=>[{name:"jimmy.codes/prettier",...ie}],"prettierConfig"),Ae=t(()=>c.isPackageExists("typescript"),"hasTypescript"),Ne=t(()=>c.isPackageExists("react"),"hasReact"),S=t(()=>c.isPackageExists("vitest"),"hasVitest"),G=t(()=>c.isPackageExists("jest"),"hasJest"),Ie=t(()=>S()||G(),"hasTesting"),Be=t(()=>ge.some(e=>c.isPackageExists(e)),"hasTestingLibrary"),$e=t(()=>c.isPackageExists("@tanstack/react-query"),"hasReactQuery"),Fe=t(()=>c.isPackageExists("astro"),"hasAstro"),Ve=t(()=>c.isPackageExists("@playwright/test"),"hasPlaywright"),Je=t(()=>c.isPackageExists("storybook"),"hasStorybook"),A=t(()=>c.isPackageExists("next"),"hasNext"),Ue=t(()=>c.isPackageExists("vite"),"hasVite"),Xe=t(e=>e===2?"error":e===1?"warn":"off","toStringSeverity"),N=t((e={})=>Object.fromEntries(Object.entries(e).map(([r,s])=>[r,typeof s=="number"?Xe(s):s])),"normalizeRuleEntries"),ze=["dynamic","dynamicParams","revalidate","fetchCache","runtime","preferredRegion","maxDuration","config","generateStaticParams","metadata","generateMetadata","viewport","generateViewport"],Qe=t(async()=>{const[e,r]=await Promise.all([i(import("eslint-plugin-react")),i(import("eslint-plugin-jsx-a11y"))]),s=A(),n=Ue();return{...r.configs.recommended.rules,...N(e.configs.flat?.recommended?.rules),...N(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?ze:[]}],"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"),He=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:[m,j],languageOptions:{globals:{...y.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 Qe(),settings:{react:{version:"detect"}}}]},"reactConfig"),Me={...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"},We=t(()=>[{name:"jimmy.codes/regexp",plugins:{regexp:T},rules:Me}],"regexpConfig"),Ye=t((e={})=>Object.fromEntries(Object.entries(e).map(([r,s])=>[r,s==="warn"?"error":s])),"warningAsErrors"),De=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:{...Ye(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"),Ke=t(async()=>{const e=await i(import("@tanstack/eslint-plugin-query"));return[{files:[m,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"),I=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"),Ze=t(async()=>({...await I(),"jest/no-deprecated-functions":"off","jest/require-hook":["error",{allowedFunctionCalls:de}]}),"vitestRules"),er=t(async({framework:e="vitest"}={},r=!0)=>{const s=r?S():e==="vitest",n=e==="jest"||r&&G(),a=[];if(s){const f=await i(import("eslint-plugin-jest"));a.push({files:d,ignores:x,...f.configs["flat/recommended"],name:"jimmy.codes/vitest",rules:await Ze()})}if(n){const f=await i(import("eslint-plugin-jest"));a.push({files:d,ignores:x,...f.configs["flat/recommended"],name:"jimmy.codes/jest",rules:await I()})}return a},"testingConfig"),rr=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"),tr=t(async()=>{const[e,r]=await Promise.all([import("eslint-plugin-jest-dom"),i(import("eslint-plugin-testing-library"))]);return[{files:d,ignores:x,name:"jimmy.codes/testing-library",plugins:{"jest-dom":e,"testing-library":r},rules:await rr()}]},"testingLibraryConfig"),sr={"@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"},or=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:sr},{files:[R,m],...p.configs.disableTypeChecked},{files:d,name:"jimmy.codes/typescript/testing",rules:{"@typescript-eslint/no-unsafe-argument":"off","@typescript-eslint/no-unsafe-assignment":"off"}}],"typescriptConfig"),nr={...q.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"},ir=t(()=>[{...q.configs["flat/recommended"],name:"jimmy.codes/unicorn",rules:nr}],"unicornConfig"),ar=t(e=>typeof e=="object"?e:void 0,"getTypescriptOptions"),cr=t((e,r)=>typeof e=="object"?e:{framework:r.vitest?"vitest":r.jest?"jest":"vitest",...r.testingLibrary&&{utilities:["testing-library"]}},"getTestingOptions"),lr=t(e=>typeof e=="object"?e:{utilities:[]},"getReactOptions"),pr=t(({utilities:e=[]},r,s)=>r||e.includes("@tanstack/query")||s&&$e(),"shouldEnableTanstackQuery"),fr=t(({utilities:e=[]},r)=>e.includes("testing-library")||r&&Be(),"shouldEnableTestingLibrary"),ur=t(async({astro:e=!1,autoDetect:r=!0,configs:s=[],ignores:n=[],jest:a=!1,nextjs:f=!1,overrides:B=[],playwright:$=!1,react:h=!1,storybook:F=!1,tanstackQuery:V=!1,testing:b=!1,testingLibrary:J=!1,typescript:w=!1,vitest:v=!1}={},...U)=>{const X=lr(h),k=cr(b,{jest:a,testingLibrary:J,vitest:v}),P=ar(w),E=w||!!P||r&&Ae(),z=h||r&&Ne(),Q=b||a||v||r&&Ie(),H=e||r&&Fe(),M=pr(X,V,r),W=fr(k,r),Y=$||r&&Ve(),D=F||r&&Je(),K=f||r&&A();return[Ee(),Re(),qe(),ir(),he(),We(),ke({typescript:E}),E?or(P):[],z?await He():[],M?await Ke():[],H?await ye():[],Q?await er(k,r):[],W?await tr():[],Y?await Se():[],D?await De():[],K?await Ce():[],Ge(),je(),be(n),s,B,U].flat()},"eslintConfig");module.exports=ur;
1
+ "use strict";var ee=Object.create;var g=Object.defineProperty;var re=Object.getOwnPropertyDescriptor;var te=Object.getOwnPropertyNames;var se=Object.getPrototypeOf,oe=Object.prototype.hasOwnProperty;var t=(e,r)=>g(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&&g(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?g(s,"default",{value:e,enumerable:!0}):s,e));var y=require("globals"),p=require("typescript-eslint"),O=require("@eslint-community/eslint-plugin-eslint-comments/configs"),u=require("eslint-plugin-import-x"),C=require("eslint-plugin-n"),ie=require("@eslint/js"),_=require("eslint-plugin-perfectionist"),ae=require("eslint-config-prettier"),c=require("local-pkg"),ce=require("eslint-plugin-regexp"),q=require("eslint-plugin-unicorn");function le(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(le,"_interopNamespaceDefault");var T=le(ce);const l="?([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"],R="**/*.?([cm])js",m="**/*.?([cm])jsx",fe="**/*.?([cm])ts",j="**/*.?([cm])tsx",d=[`**/__tests__/**/*.${l}`,`**/*.spec.${l}`,`**/*.test.${l}`,`**/*.bench.${l}`,`**/*.benchmark.${l}`],L=[`**/e2e/**/*.spec.${l}`,`**/e2e/**/*.test.${l}`],x=[...L,`**/cypress/**/*.spec.${l}`,`**/cypress/**/*.test.${l}`],ue=[R,m,fe,j],me="**/*.cjs",de="**/*.astro",ge=["vi.mock","describe","expect","it"],ye=["@testing-library/react"],i=t(async e=>{const r=await e;return r.default??r},"interopDefault"),je=t(async()=>{const e=[de],[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:{...y.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:[me],languageOptions:{globals:y.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"},be=t(()=>[{...O.recommended,name:"jimmy.codes/eslint-comments",rules:he}],"eslintCommentsConfig"),we=t(e=>[{ignores:[...pe,...e],name:"jimmy.codes/ignores"}],"ignoresConfig"),ve={...u.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={name:"jimmy.codes/imports/typescript",rules:u.configs.typescript.rules,settings:{...u.configs.typescript.settings,"import-x/resolver":{...u.configs.typescript.settings["import-x/resolver"],typescript:!0}}},Pe=t(({typescript:e=!1}={})=>[{name:"jimmy.codes/imports",plugins:{"import-x":u,n:C},rules:ve},...e?[ke]:[]],"importsConfig"),Ee={...ie.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"),S=t((e={})=>Object.fromEntries(Object.entries(e).map(([r,s])=>[r,s==="warn"?"error":s])),"warningAsErrors"),Ce=t(async()=>{const e=await i(import("@next/eslint-plugin-next"));return S(e.configs.recommended.rules)},"nextjsRules"),_e=t(async()=>{const e=await i(import("@next/eslint-plugin-next"));return[{files:ue,name:"jimmy.codes/nextjs",plugins:{"@next/next":e},rules:await Ce()}]},"nextjsConfig"),qe={"n/no-process-exit":"off","n/prefer-node-protocol":"error"},Te=t(()=>[{name:"jimmy.codes/node",plugins:{n:C},rules:qe}],"nodeConfig"),Re={..._.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"},Le=t(()=>[{name:"jimmy.codes/perfectionist",plugins:{perfectionist:_},rules:Re}],"perfectionistConfig"),Se=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-useless-await":"error","playwright/no-useless-not":"error","playwright/no-wait-for-selector":"error","playwright/no-wait-for-timeout":"error"}),"playwrightRules"),Ge=t(async()=>[{...(await i(import("eslint-plugin-playwright"))).configs["flat/recommended"],files:L,name:"jimmy.codes/playwright",rules:await Se()}],"playwrightConfig"),Ae=t(()=>[{name:"jimmy.codes/prettier",...ae}],"prettierConfig"),Ne=t(()=>c.isPackageExists("typescript"),"hasTypescript"),Ie=t(()=>c.isPackageExists("react"),"hasReact"),G=t(()=>c.isPackageExists("vitest"),"hasVitest"),A=t(()=>c.isPackageExists("jest"),"hasJest"),Be=t(()=>G()||A(),"hasTesting"),$e=t(()=>ye.some(e=>c.isPackageExists(e)),"hasTestingLibrary"),Fe=t(()=>c.isPackageExists("@tanstack/react-query"),"hasReactQuery"),Ve=t(()=>c.isPackageExists("astro"),"hasAstro"),Je=t(()=>c.isPackageExists("@playwright/test"),"hasPlaywright"),Ue=t(()=>c.isPackageExists("storybook"),"hasStorybook"),N=t(()=>c.isPackageExists("next"),"hasNext"),Xe=t(()=>c.isPackageExists("vite"),"hasVite"),ze=t(e=>e===2?"error":e===1?"warn":"off","toStringSeverity"),I=t((e={})=>Object.fromEntries(Object.entries(e).map(([r,s])=>[r,typeof s=="number"?ze(s):s])),"normalizeRuleEntries"),Qe=["dynamic","dynamicParams","revalidate","fetchCache","runtime","preferredRegion","maxDuration","config","generateStaticParams","metadata","generateMetadata","viewport","generateViewport"],He=t(async()=>{const[e,r]=await Promise.all([i(import("eslint-plugin-react")),i(import("eslint-plugin-jsx-a11y"))]),s=N(),n=Xe();return{...r.configs.recommended.rules,...I(e.configs.flat?.recommended?.rules),...I(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?Qe:[]}],"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"),Me=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:[m,j],languageOptions:{globals:{...y.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 He(),settings:{react:{version:"detect"}}}]},"reactConfig"),We={...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"},Ye=t(()=>[{name:"jimmy.codes/regexp",plugins:{regexp:T},rules:We}],"regexpConfig"),De=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:{...S(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"),Ke=t(async()=>{const e=await i(import("@tanstack/eslint-plugin-query"));return[{files:[m,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"),B=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"),Ze=t(async()=>({...await B(),"jest/no-deprecated-functions":"off","jest/require-hook":["error",{allowedFunctionCalls:ge}]}),"vitestRules"),er=t(async({framework:e="vitest"}={},r=!0)=>{const s=r?G():e==="vitest",n=e==="jest"||r&&A(),a=[];if(s){const f=await i(import("eslint-plugin-jest"));a.push({files:d,ignores:x,...f.configs["flat/recommended"],name:"jimmy.codes/vitest",rules:await Ze()})}if(n){const f=await i(import("eslint-plugin-jest"));a.push({files:d,ignores:x,...f.configs["flat/recommended"],name:"jimmy.codes/jest",rules:await B()})}return a},"testingConfig"),rr=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"),tr=t(async()=>{const[e,r]=await Promise.all([import("eslint-plugin-jest-dom"),i(import("eslint-plugin-testing-library"))]);return[{files:d,ignores:x,name:"jimmy.codes/testing-library",plugins:{"jest-dom":e,"testing-library":r},rules:await rr()}]},"testingLibraryConfig"),sr={"@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"},or=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:sr},{files:[R,m],...p.configs.disableTypeChecked},{files:d,name:"jimmy.codes/typescript/testing",rules:{"@typescript-eslint/no-unsafe-argument":"off","@typescript-eslint/no-unsafe-assignment":"off"}}],"typescriptConfig"),nr={...q.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"},ir=t(()=>[{...q.configs["flat/recommended"],name:"jimmy.codes/unicorn",rules:nr}],"unicornConfig"),ar=t(e=>typeof e=="object"?e:void 0,"getTypescriptOptions"),cr=t((e,r)=>typeof e=="object"?e:{framework:r.vitest?"vitest":r.jest?"jest":"vitest",...r.testingLibrary&&{utilities:["testing-library"]}},"getTestingOptions"),lr=t(e=>typeof e=="object"?e:{utilities:[]},"getReactOptions"),pr=t(({utilities:e=[]},r,s)=>r||e.includes("@tanstack/query")||s&&Fe(),"shouldEnableTanstackQuery"),fr=t(({utilities:e=[]},r)=>e.includes("testing-library")||r&&$e(),"shouldEnableTestingLibrary"),ur=t(async({astro:e=!1,autoDetect:r=!0,configs:s=[],ignores:n=[],jest:a=!1,nextjs:f=!1,overrides:$=[],playwright:F=!1,react:h=!1,storybook:V=!1,tanstackQuery:J=!1,testing:b=!1,testingLibrary:U=!1,typescript:w=!1,vitest:v=!1}={},...X)=>{const z=lr(h),k=cr(b,{jest:a,testingLibrary:U,vitest:v}),P=ar(w),E=w||!!P||r&&Ne(),Q=h||r&&Ie(),H=b||a||v||r&&Be(),M=e||r&&Ve(),W=pr(z,J,r),Y=fr(k,r),D=F||r&&Je(),K=V||r&&Ue(),Z=f||r&&N();return[Oe(),Le(),Te(),ir(),be(),Ye(),Pe({typescript:E}),E?or(P):[],Q?await Me():[],W?await Ke():[],M?await je():[],H?await er(k,r):[],Y?await tr():[],D?await Ge():[],K?await De():[],Z?await _e():[],Ae(),xe(),we(n),s,$,X].flat()},"eslintConfig");module.exports=ur;
package/dist/index.d.cts CHANGED
@@ -11696,7 +11696,7 @@ declare const eslintConfig: ({ astro, autoDetect, configs, ignores, jest, nextjs
11696
11696
  };
11697
11697
  };
11698
11698
  rules: {
11699
- [x: string]: Linter.RuleEntry<any[]> | undefined;
11699
+ [k: string]: 0 | 1 | 2 | "off" | "error" | [Linter.RuleSeverity, ...any[]] | undefined;
11700
11700
  };
11701
11701
  } | {
11702
11702
  name: string;
package/dist/index.d.mts CHANGED
@@ -11696,7 +11696,7 @@ declare const eslintConfig: ({ astro, autoDetect, configs, ignores, jest, nextjs
11696
11696
  };
11697
11697
  };
11698
11698
  rules: {
11699
- [x: string]: Linter.RuleEntry<any[]> | undefined;
11699
+ [k: string]: 0 | 1 | 2 | "off" | "error" | [Linter.RuleSeverity, ...any[]] | undefined;
11700
11700
  };
11701
11701
  } | {
11702
11702
  name: string;
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- var K=Object.defineProperty;var r=(e,t)=>K(e,"name",{value:t,configurable:!0});import d from"globals";import{parser as Z,configs as p}from"typescript-eslint";import P from"@eslint-community/eslint-plugin-eslint-comments/configs";import f from"eslint-plugin-import-x";import C from"eslint-plugin-n";import D from"@eslint/js";import O from"eslint-plugin-perfectionist";import ee from"eslint-config-prettier";import{isPackageExists as i}from"local-pkg";import*as E from"eslint-plugin-regexp";import T from"eslint-plugin-unicorn";const a="?([cm])[jt]s?(x)",re=["**/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",m="**/*.?([cm])jsx",te="**/*.?([cm])ts",g="**/*.?([cm])tsx",u=[`**/__tests__/**/*.${a}`,`**/*.spec.${a}`,`**/*.test.${a}`,`**/*.bench.${a}`,`**/*.benchmark.${a}`],R=[`**/e2e/**/*.spec.${a}`,`**/e2e/**/*.test.${a}`],y=[...R,`**/cypress/**/*.spec.${a}`,`**/cypress/**/*.test.${a}`],oe=[_,m,te,g],se="**/*.cjs",ne="**/*.astro",ie=["vi.mock","describe","expect","it"],ae=["@testing-library/react"],s=r(async e=>{const t=await e;return t.default??t},"interopDefault"),ce=r(async()=>{const e=[ne],[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:{...d.node,Astro:!1,Fragment:!1},parser:o,parserOptions:{extraFileExtensions:[".astro"],parser:Z},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"),le=r(()=>[{files:[se],languageOptions:{globals:d.commonjs},name:"jimmy.codes/commonjs"}],"commonjsConfig"),pe={...P.recommended.rules,"@eslint-community/eslint-comments/no-unused-disable":"off","@eslint-community/eslint-comments/require-description":"error"},fe=r(()=>[{...P.recommended,name:"jimmy.codes/eslint-comments",rules:pe}],"eslintCommentsConfig"),me=r(e=>[{ignores:[...re,...e],name:"jimmy.codes/ignores"}],"ignoresConfig"),ue={...f.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={name:"jimmy.codes/imports/typescript",rules:f.configs.typescript.rules,settings:{...f.configs.typescript.settings,"import-x/resolver":{...f.configs.typescript.settings["import-x/resolver"],typescript:!0}}},ge=r(({typescript:e=!1}={})=>[{name:"jimmy.codes/imports",plugins:{"import-x":f,n:C},rules:ue},...e?[de]:[]],"importsConfig"),ye={...D.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"},je=r(()=>[{linterOptions:{reportUnusedDisableDirectives:!0},name:"jimmy.codes/javascript",rules:ye}],"javascriptConfig"),xe=r(async()=>({...(await s(import("@next/eslint-plugin-next"))).configs["core-web-vitals"].rules}),"nextjsRules"),he=r(async()=>{const e=await s(import("@next/eslint-plugin-next"));return[{files:oe,name:"jimmy.codes/nextjs",plugins:{"@next/next":e},rules:await xe()}]},"nextjsConfig"),be={"n/no-process-exit":"off","n/prefer-node-protocol":"error"},we=r(()=>[{name:"jimmy.codes/node",plugins:{n:C},rules:be}],"nodeConfig"),ke={...O.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"},ve=r(()=>[{name:"jimmy.codes/perfectionist",plugins:{perfectionist:O},rules:ke}],"perfectionistConfig"),Pe=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-useless-await":"error","playwright/no-useless-not":"error","playwright/no-wait-for-selector":"error","playwright/no-wait-for-timeout":"error"}),"playwrightRules"),Ce=r(async()=>[{...(await s(import("eslint-plugin-playwright"))).configs["flat/recommended"],files:R,name:"jimmy.codes/playwright",rules:await Pe()}],"playwrightConfig"),Oe=r(()=>[{name:"jimmy.codes/prettier",...ee}],"prettierConfig"),Ee=r(()=>i("typescript"),"hasTypescript"),Te=r(()=>i("react"),"hasReact"),L=r(()=>i("vitest"),"hasVitest"),S=r(()=>i("jest"),"hasJest"),_e=r(()=>L()||S(),"hasTesting"),Re=r(()=>ae.some(e=>i(e)),"hasTestingLibrary"),Le=r(()=>i("@tanstack/react-query"),"hasReactQuery"),Se=r(()=>i("astro"),"hasAstro"),qe=r(()=>i("@playwright/test"),"hasPlaywright"),Ge=r(()=>i("storybook"),"hasStorybook"),q=r(()=>i("next"),"hasNext"),Ae=r(()=>i("vite"),"hasVite"),Ie=r(e=>e===2?"error":e===1?"warn":"off","toStringSeverity"),G=r((e={})=>Object.fromEntries(Object.entries(e).map(([t,o])=>[t,typeof o=="number"?Ie(o):o])),"normalizeRuleEntries"),Ne=["dynamic","dynamicParams","revalidate","fetchCache","runtime","preferredRegion","maxDuration","config","generateStaticParams","metadata","generateMetadata","viewport","generateViewport"],Be=r(async()=>{const[e,t]=await Promise.all([s(import("eslint-plugin-react")),s(import("eslint-plugin-jsx-a11y"))]),o=q(),n=Ae();return{...t.configs.recommended.rules,...G(e.configs.flat?.recommended?.rules),...G(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?Ne:[]}],"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"),$e=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:[m,g],languageOptions:{globals:{...d.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 Be(),settings:{react:{version:"detect"}}}]},"reactConfig"),Fe={...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"},Ve=r(()=>[{name:"jimmy.codes/regexp",plugins:{regexp:E},rules:Fe}],"regexpConfig"),Je=r((e={})=>Object.fromEntries(Object.entries(e).map(([t,o])=>[t,o==="warn"?"error":o])),"warningAsErrors"),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:{...Je(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"),Xe=r(async()=>{const e=await s(import("@tanstack/eslint-plugin-query"));return[{files:[m,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"),A=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"),Qe=r(async()=>({...await A(),"jest/no-deprecated-functions":"off","jest/require-hook":["error",{allowedFunctionCalls:ie}]}),"vitestRules"),ze=r(async({framework:e="vitest"}={},t=!0)=>{const o=t?L():e==="vitest",n=e==="jest"||t&&S(),c=[];if(o){const l=await s(import("eslint-plugin-jest"));c.push({files:u,ignores:y,...l.configs["flat/recommended"],name:"jimmy.codes/vitest",rules:await Qe()})}if(n){const l=await s(import("eslint-plugin-jest"));c.push({files:u,ignores:y,...l.configs["flat/recommended"],name:"jimmy.codes/jest",rules:await A()})}return c},"testingConfig"),He=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"),Me=r(async()=>{const[e,t]=await Promise.all([import("eslint-plugin-jest-dom"),s(import("eslint-plugin-testing-library"))]);return[{files:u,ignores:y,name:"jimmy.codes/testing-library",plugins:{"jest-dom":e,"testing-library":t},rules:await He()}]},"testingLibraryConfig"),We={"@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"},Ye=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:We},{files:[_,m],...p.disableTypeChecked},{files:u,name:"jimmy.codes/typescript/testing",rules:{"@typescript-eslint/no-unsafe-argument":"off","@typescript-eslint/no-unsafe-assignment":"off"}}],"typescriptConfig"),Ke={...T.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"},Ze=r(()=>[{...T.configs["flat/recommended"],name:"jimmy.codes/unicorn",rules:Ke}],"unicornConfig"),De=r(e=>typeof e=="object"?e:void 0,"getTypescriptOptions"),er=r((e,t)=>typeof e=="object"?e:{framework:t.vitest?"vitest":t.jest?"jest":"vitest",...t.testingLibrary&&{utilities:["testing-library"]}},"getTestingOptions"),rr=r(e=>typeof e=="object"?e:{utilities:[]},"getReactOptions"),tr=r(({utilities:e=[]},t,o)=>t||e.includes("@tanstack/query")||o&&Le(),"shouldEnableTanstackQuery"),or=r(({utilities:e=[]},t)=>e.includes("testing-library")||t&&Re(),"shouldEnableTestingLibrary"),sr=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:B=!1,tanstackQuery:$=!1,testing:x=!1,testingLibrary:F=!1,typescript:h=!1,vitest:b=!1}={},...V)=>{const J=rr(j),w=er(x,{jest:c,testingLibrary:F,vitest:b}),k=De(h),v=h||!!k||t&&Ee(),U=j||t&&Te(),X=x||c||b||t&&_e(),Q=e||t&&Se(),z=tr(J,$,t),H=or(w,t),M=N||t&&qe(),W=B||t&&Ge(),Y=l||t&&q();return[je(),ve(),we(),Ze(),fe(),Ve(),ge({typescript:v}),v?Ye(k):[],U?await $e():[],z?await Xe():[],Q?await ce():[],X?await ze(w,t):[],H?await Me():[],M?await Ce():[],W?await Ue():[],Y?await he():[],Oe(),le(),me(n),o,I,V].flat()},"eslintConfig");export{sr as default};
1
+ var Z=Object.defineProperty;var r=(e,t)=>Z(e,"name",{value:t,configurable:!0});import d from"globals";import{parser as D,configs as p}from"typescript-eslint";import P from"@eslint-community/eslint-plugin-eslint-comments/configs";import f from"eslint-plugin-import-x";import C from"eslint-plugin-n";import ee from"@eslint/js";import O from"eslint-plugin-perfectionist";import re from"eslint-config-prettier";import{isPackageExists as i}from"local-pkg";import*as E from"eslint-plugin-regexp";import T from"eslint-plugin-unicorn";const a="?([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"],_="**/*.?([cm])js",m="**/*.?([cm])jsx",oe="**/*.?([cm])ts",g="**/*.?([cm])tsx",u=[`**/__tests__/**/*.${a}`,`**/*.spec.${a}`,`**/*.test.${a}`,`**/*.bench.${a}`,`**/*.benchmark.${a}`],R=[`**/e2e/**/*.spec.${a}`,`**/e2e/**/*.test.${a}`],y=[...R,`**/cypress/**/*.spec.${a}`,`**/cypress/**/*.test.${a}`],se=[_,m,oe,g],ne="**/*.cjs",ie="**/*.astro",ae=["vi.mock","describe","expect","it"],ce=["@testing-library/react"],s=r(async e=>{const t=await e;return t.default??t},"interopDefault"),le=r(async()=>{const e=[ie],[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:{...d.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:[ne],languageOptions:{globals:d.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:[...te,...e],name:"jimmy.codes/ignores"}],"ignoresConfig"),de={...f.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={name:"jimmy.codes/imports/typescript",rules:f.configs.typescript.rules,settings:{...f.configs.typescript.settings,"import-x/resolver":{...f.configs.typescript.settings["import-x/resolver"],typescript:!0}}},ye=r(({typescript:e=!1}={})=>[{name:"jimmy.codes/imports",plugins:{"import-x":f,n:C},rules:de},...e?[ge]:[]],"importsConfig"),je={...ee.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"},xe=r(()=>[{linterOptions:{reportUnusedDisableDirectives:!0},name:"jimmy.codes/javascript",rules:je}],"javascriptConfig"),L=r((e={})=>Object.fromEntries(Object.entries(e).map(([t,o])=>[t,o==="warn"?"error":o])),"warningAsErrors"),he=r(async()=>{const e=await s(import("@next/eslint-plugin-next"));return L(e.configs.recommended.rules)},"nextjsRules"),be=r(async()=>{const e=await s(import("@next/eslint-plugin-next"));return[{files:se,name:"jimmy.codes/nextjs",plugins:{"@next/next":e},rules:await he()}]},"nextjsConfig"),we={"n/no-process-exit":"off","n/prefer-node-protocol":"error"},ke=r(()=>[{name:"jimmy.codes/node",plugins:{n:C},rules:we}],"nodeConfig"),ve={...O.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"},Pe=r(()=>[{name:"jimmy.codes/perfectionist",plugins:{perfectionist:O},rules:ve}],"perfectionistConfig"),Ce=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-useless-await":"error","playwright/no-useless-not":"error","playwright/no-wait-for-selector":"error","playwright/no-wait-for-timeout":"error"}),"playwrightRules"),Oe=r(async()=>[{...(await s(import("eslint-plugin-playwright"))).configs["flat/recommended"],files:R,name:"jimmy.codes/playwright",rules:await Ce()}],"playwrightConfig"),Ee=r(()=>[{name:"jimmy.codes/prettier",...re}],"prettierConfig"),Te=r(()=>i("typescript"),"hasTypescript"),_e=r(()=>i("react"),"hasReact"),S=r(()=>i("vitest"),"hasVitest"),q=r(()=>i("jest"),"hasJest"),Re=r(()=>S()||q(),"hasTesting"),Le=r(()=>ce.some(e=>i(e)),"hasTestingLibrary"),Se=r(()=>i("@tanstack/react-query"),"hasReactQuery"),qe=r(()=>i("astro"),"hasAstro"),Ge=r(()=>i("@playwright/test"),"hasPlaywright"),Ae=r(()=>i("storybook"),"hasStorybook"),G=r(()=>i("next"),"hasNext"),Ie=r(()=>i("vite"),"hasVite"),Ne=r(e=>e===2?"error":e===1?"warn":"off","toStringSeverity"),A=r((e={})=>Object.fromEntries(Object.entries(e).map(([t,o])=>[t,typeof o=="number"?Ne(o):o])),"normalizeRuleEntries"),Be=["dynamic","dynamicParams","revalidate","fetchCache","runtime","preferredRegion","maxDuration","config","generateStaticParams","metadata","generateMetadata","viewport","generateViewport"],$e=r(async()=>{const[e,t]=await Promise.all([s(import("eslint-plugin-react")),s(import("eslint-plugin-jsx-a11y"))]),o=G(),n=Ie();return{...t.configs.recommended.rules,...A(e.configs.flat?.recommended?.rules),...A(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?Be:[]}],"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:[m,g],languageOptions:{globals:{...d.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 $e(),settings:{react:{version:"detect"}}}]},"reactConfig"),Ve={...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"},Je=r(()=>[{name:"jimmy.codes/regexp",plugins:{regexp:E},rules:Ve}],"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"),Xe=r(async()=>{const e=await s(import("@tanstack/eslint-plugin-query"));return[{files:[m,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"),I=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"),Qe=r(async()=>({...await I(),"jest/no-deprecated-functions":"off","jest/require-hook":["error",{allowedFunctionCalls:ae}]}),"vitestRules"),ze=r(async({framework:e="vitest"}={},t=!0)=>{const o=t?S():e==="vitest",n=e==="jest"||t&&q(),c=[];if(o){const l=await s(import("eslint-plugin-jest"));c.push({files:u,ignores:y,...l.configs["flat/recommended"],name:"jimmy.codes/vitest",rules:await Qe()})}if(n){const l=await s(import("eslint-plugin-jest"));c.push({files:u,ignores:y,...l.configs["flat/recommended"],name:"jimmy.codes/jest",rules:await I()})}return c},"testingConfig"),He=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"),Me=r(async()=>{const[e,t]=await Promise.all([import("eslint-plugin-jest-dom"),s(import("eslint-plugin-testing-library"))]);return[{files:u,ignores:y,name:"jimmy.codes/testing-library",plugins:{"jest-dom":e,"testing-library":t},rules:await He()}]},"testingLibraryConfig"),We={"@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"},Ye=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:We},{files:[_,m],...p.disableTypeChecked},{files:u,name:"jimmy.codes/typescript/testing",rules:{"@typescript-eslint/no-unsafe-argument":"off","@typescript-eslint/no-unsafe-assignment":"off"}}],"typescriptConfig"),Ke={...T.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"},Ze=r(()=>[{...T.configs["flat/recommended"],name:"jimmy.codes/unicorn",rules:Ke}],"unicornConfig"),De=r(e=>typeof e=="object"?e:void 0,"getTypescriptOptions"),er=r((e,t)=>typeof e=="object"?e:{framework:t.vitest?"vitest":t.jest?"jest":"vitest",...t.testingLibrary&&{utilities:["testing-library"]}},"getTestingOptions"),rr=r(e=>typeof e=="object"?e:{utilities:[]},"getReactOptions"),tr=r(({utilities:e=[]},t,o)=>t||e.includes("@tanstack/query")||o&&Se(),"shouldEnableTanstackQuery"),or=r(({utilities:e=[]},t)=>e.includes("testing-library")||t&&Le(),"shouldEnableTestingLibrary"),sr=r(async({astro:e=!1,autoDetect:t=!0,configs:o=[],ignores:n=[],jest:c=!1,nextjs:l=!1,overrides:N=[],playwright:B=!1,react:j=!1,storybook:$=!1,tanstackQuery:F=!1,testing:x=!1,testingLibrary:V=!1,typescript:h=!1,vitest:b=!1}={},...J)=>{const U=rr(j),w=er(x,{jest:c,testingLibrary:V,vitest:b}),k=De(h),v=h||!!k||t&&Te(),X=j||t&&_e(),Q=x||c||b||t&&Re(),z=e||t&&qe(),H=tr(U,F,t),M=or(w,t),W=B||t&&Ge(),Y=$||t&&Ae(),K=l||t&&G();return[xe(),Pe(),ke(),Ze(),me(),Je(),ye({typescript:v}),v?Ye(k):[],X?await Fe():[],H?await Xe():[],z?await le():[],Q?await ze(w,t):[],M?await Me():[],W?await Oe():[],Y?await Ue():[],K?await be():[],Ee(),pe(),ue(n),o,N,J].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.24.0",
3
+ "version": "3.25.0",
4
4
  "description": "another opinionated eslint config",
5
5
  "keywords": [
6
6
  "eslint",