@jimmy.codes/eslint-config 3.14.2 → 3.16.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 N=Object.create;var m=Object.defineProperty;var F=Object.getOwnPropertyDescriptor;var J=Object.getOwnPropertyNames;var Q=Object.getPrototypeOf,V=Object.prototype.hasOwnProperty;var t=(e,r)=>m(e,"name",{value:r,configurable:!0});var X=(e,r,s,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of J(r))!V.call(e,i)&&i!==s&&m(e,i,{get:()=>r[i],enumerable:!(n=F(r,i))||n.enumerable});return e};var o=(e,r,s)=>(s=e!=null?N(Q(e)):{},X(r||!e||!e.__esModule?m(s,"default",{value:e,enumerable:!0}):s,e));var d=require("globals"),p=require("typescript-eslint"),v=require("@eslint-community/eslint-plugin-eslint-comments/configs"),f=require("eslint-plugin-import-x"),k=require("eslint-plugin-n"),U=require("@eslint/js"),w=require("eslint-plugin-perfectionist"),z=require("eslint-config-prettier"),l=require("local-pkg"),E=require("eslint-plugin-jest"),O=require("eslint-plugin-unicorn");const a="?([cm])[jt]s?(x)",D=["**/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"],H="**/*.?([cm])js",y="**/*.?([cm])jsx",P="**/*.?([cm])tsx",u=[`**/__tests__/**/*.${a}`,`**/*.spec.${a}`,`**/*.test.${a}`,`**/*.bench.${a}`,`**/*.benchmark.${a}`],q=[`**/e2e/**/*.spec.${a}`,`**/e2e/**/*.test.${a}`,`**/cypress/**/*.spec.${a}`,`**/cypress/**/*.test.${a}`],M="**/*.cjs",W="**/*.astro",Y=["vi.mock","describe","expect","it"],K=["@testing-library/react"],Z=t(e=>typeof e=="object"?e:void 0,"getTypescriptOptions"),ee=t(e=>typeof e=="object"?e:{framework:"vitest"},"getTestingOptions"),re=t(e=>typeof e=="object"?e:{utilities:[]},"getReactOptions"),te=t(e=>!!e.utilities?.includes("@tanstack/query"),"addTanstackQuery"),se=t(e=>!!e.utilities?.includes("testing-library"),"addTestingLibrary"),c=t(async e=>{const r=await e;return r.default??r},"interopDefault"),oe=t(async()=>{const e=[W],[r,s,n]=await Promise.all([import("eslint-plugin-astro"),import("astro-eslint-parser"),c(import("eslint-plugin-jsx-a11y"))]);return[{files:e,languageOptions:{globals:{...d.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"),ne=t(()=>[{files:[M],languageOptions:{globals:d.commonjs},name:"jimmy.codes/commonjs"}],"commonjsConfig"),ie={...v.recommended.rules,"@eslint-community/eslint-comments/no-unused-disable":"off","@eslint-community/eslint-comments/require-description":"error"},ae=t(()=>[{...v.recommended,name:"jimmy.codes/eslint-comments",rules:ie}],"eslintCommentsConfig"),ce=t(e=>[{ignores:[...D,...e],name:"jimmy.codes/ignores"}],"ignoresConfig"),le={...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"},pe={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}}},fe=t(({typescript:e=!1}={})=>[{name:"jimmy.codes/imports",plugins:{"import-x":f,n:k},rules:le},...e?[pe]:[]],"importsConfig"),ue={...U.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"},me=t(()=>[{linterOptions:{reportUnusedDisableDirectives:!0},name:"jimmy.codes/javascript",rules:ue}],"javascriptConfig"),de={"n/no-process-exit":"off","n/prefer-node-protocol":"error"},ye=t(()=>[{name:"jimmy.codes/node",plugins:{n:k},rules:de}],"nodeConfig"),ge={...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"}]},je=t(()=>[{name:"jimmy.codes/perfectionist",plugins:{perfectionist:w},rules:ge}],"perfectionistConfig"),xe=t(()=>[{name:"jimmy.codes/prettier",...z}],"prettierConfig"),be=t(e=>e===2?"error":e===1?"warn":"off","toStringSeverity"),C=t((e={})=>Object.fromEntries(Object.entries(e).map(([r,s])=>[r,typeof s=="number"?be(s):s])),"normalizeRuleEntries"),he=t(async()=>{const[e,r]=await Promise.all([c(import("eslint-plugin-react")),c(import("eslint-plugin-jsx-a11y"))]);return{...r.configs.recommended.rules,...C(e.configs.flat?.recommended?.rules),...C(e.configs.flat?.["jsx-runtime"]?.rules),"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","react-hooks/exhaustive-deps":"error","react-hooks/rules-of-hooks":"error","react-refresh/only-export-components":["warn",{allowConstantExport:!0}]}},"reactRules"),ve=t(async()=>{const[e,r,s,n]=await Promise.all([c(import("eslint-plugin-react")),c(import("eslint-plugin-jsx-a11y")),import("eslint-plugin-react-hooks"),import("eslint-plugin-react-refresh")]);return[{files:[y,P],languageOptions:{globals:{...d.browser},parserOptions:{ecmaFeatures:{jsx:!0},jsxPragma:null}},name:"jimmy.codes/react",plugins:{"jsx-a11y":r,react:e,"react-hooks":s,"react-refresh":n},rules:await he(),settings:{react:{version:"detect"}}}]},"reactConfig"),ke=t(async()=>{const e=await c(import("@tanstack/eslint-plugin-query"));return[{files:[y,P],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"}}]},"tanstackQuery"),we=t(()=>l.isPackageExists("typescript"),"hasTypescript"),Ee=t(()=>l.isPackageExists("react"),"hasReact"),T=t(()=>l.isPackageExists("vitest"),"hasVitest"),_=t(()=>l.isPackageExists("jest"),"hasJest"),Oe=t(()=>T()||_(),"hasTesting"),Pe=t(()=>K.some(e=>l.isPackageExists(e)),"hasTestingLibrary"),qe=t(()=>l.isPackageExists("@tanstack/react-query"),"hasReactQuery"),Ce=t(()=>l.isPackageExists("astro"),"hasAstro"),R={...E.configs["flat/recommended"].rules,...E.configs["flat/style"].rules,"jest/consistent-test-it":["error",{fn:"test",withinDescribe:"it"}],"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"},Te=t(async({framework:e="vitest"}={},r=!0)=>{const s=await c(import("eslint-plugin-jest")),n=r?T():e==="vitest",i=e==="jest"||r&&_();return[{files:u,name:"jimmy.codes/testing",...s.configs["flat/recommended"]},...n?[{files:u,name:"jimmy.codes/testing/vitest",...s.configs["flat/recommended"],rules:{...R,"jest/no-deprecated-functions":"off","jest/require-hook":["error",{allowedFunctionCalls:Y}]}}]:[],...i?[{files:u,name:"jimmy.codes/testing/jest",...s.configs["flat/recommended"],rules:R}]:[],{files:q,name:"jimmy.codes/testing/disabled",rules:{"jest/expect-expect":"off","jest/no-deprecated-functions":"off","jest/require-hook":"off"}}]},"testingConfig"),_e=t(async()=>{const[e,r]=await Promise.all([import("eslint-plugin-jest-dom"),c(import("eslint-plugin-testing-library"))]);return{...r.configs.react.rules,...e.configs["flat/recommended"].rules}},"testingLibraryRules"),Re=t(async()=>{const[e,r]=await Promise.all([import("eslint-plugin-jest-dom"),c(import("eslint-plugin-testing-library"))]);return[{files:u,name:"jimmy.codes/testing/testing-library",plugins:{"jest-dom":e,"testing-library":r},rules:await _e()},{files:q,name:"jimmy.codes/testing/testing-library/disabled",rules:{"testing-library/prefer-screen-queries":"off"}}]},"testingLibrary"),Le={"@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"},Se=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:Le},{files:[H,y],...p.configs.disableTypeChecked},{files:u,name:"jimmy.codes/typescript/testing",rules:{"@typescript-eslint/no-unsafe-argument":"off","@typescript-eslint/no-unsafe-assignment":"off"}}],"typescriptConfig"),Ae={...O.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"},Ge=t(()=>[{...O.configs["flat/recommended"],name:"jimmy.codes/unicorn",rules:Ae}],"unicornConfig"),Ie=t(async({astro:e=!1,autoDetect:r=!0,configs:s=[],ignores:n=[],react:i=!1,testing:g=!1,typescript:j=!1}={},...L)=>{const S=re(i),x=ee(g),b=Z(j),h=j||!!b||r&&we(),A=i||r&&Ee(),G=g||r&&Oe(),I=e||r&&Ce(),B=te(S)||r&&qe(),$=se(x)||r&&Pe();return[me(),je(),ye(),Ge(),ae(),fe({typescript:h}),h?Se(b):[],A?await ve():[],B?await ke():[],I?await oe():[],G?await Te(x,r):[],$?await Re():[],xe(),ne(),ce(n),s,L].flat()},"jimmyDotCodes");module.exports=Ie;
1
+ "use strict";var F=Object.create;var m=Object.defineProperty;var J=Object.getOwnPropertyDescriptor;var z=Object.getOwnPropertyNames;var D=Object.getPrototypeOf,Q=Object.prototype.hasOwnProperty;var t=(e,r)=>m(e,"name",{value:r,configurable:!0});var V=(e,r,s,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of z(r))!Q.call(e,i)&&i!==s&&m(e,i,{get:()=>r[i],enumerable:!(n=J(r,i))||n.enumerable});return e};var o=(e,r,s)=>(s=e!=null?F(D(e)):{},V(r||!e||!e.__esModule?m(s,"default",{value:e,enumerable:!0}):s,e));var d=require("globals"),p=require("typescript-eslint"),v=require("@eslint-community/eslint-plugin-eslint-comments/configs"),f=require("eslint-plugin-import-x"),k=require("eslint-plugin-n"),X=require("@eslint/js"),w=require("eslint-plugin-perfectionist"),U=require("eslint-config-prettier"),H=require("eslint-plugin-regexp"),l=require("local-pkg"),O=require("eslint-plugin-jest"),P=require("eslint-plugin-unicorn");function M(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(M,"_interopNamespaceDefault");var q=M(H);const a="?([cm])[jt]s?(x)",W=["**/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"],Y="**/*.?([cm])js",g="**/*.?([cm])jsx",E="**/*.?([cm])tsx",u=[`**/__tests__/**/*.${a}`,`**/*.spec.${a}`,`**/*.test.${a}`,`**/*.bench.${a}`,`**/*.benchmark.${a}`],_=[`**/e2e/**/*.spec.${a}`,`**/e2e/**/*.test.${a}`,`**/cypress/**/*.spec.${a}`,`**/cypress/**/*.test.${a}`],K="**/*.cjs",Z="**/*.astro",ee=["vi.mock","describe","expect","it"],re=["@testing-library/react"],te=t(e=>typeof e=="object"?e:void 0,"getTypescriptOptions"),se=t(e=>typeof e=="object"?e:{framework:"vitest"},"getTestingOptions"),oe=t(e=>typeof e=="object"?e:{utilities:[]},"getReactOptions"),ne=t(e=>!!e.utilities?.includes("@tanstack/query"),"addTanstackQuery"),ie=t(e=>!!e.utilities?.includes("testing-library"),"addTestingLibrary"),c=t(async e=>{const r=await e;return r.default??r},"interopDefault"),ae=t(async()=>{const e=[Z],[r,s,n]=await Promise.all([import("eslint-plugin-astro"),import("astro-eslint-parser"),c(import("eslint-plugin-jsx-a11y"))]);return[{files:e,languageOptions:{globals:{...d.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"),ce=t(()=>[{files:[K],languageOptions:{globals:d.commonjs},name:"jimmy.codes/commonjs"}],"commonjsConfig"),le={...v.recommended.rules,"@eslint-community/eslint-comments/no-unused-disable":"off","@eslint-community/eslint-comments/require-description":"error"},pe=t(()=>[{...v.recommended,name:"jimmy.codes/eslint-comments",rules:le}],"eslintCommentsConfig"),fe=t(e=>[{ignores:[...W,...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"},me={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}}},de=t(({typescript:e=!1}={})=>[{name:"jimmy.codes/imports",plugins:{"import-x":f,n:k},rules:ue},...e?[me]:[]],"importsConfig"),ge={...X.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"},ye=t(()=>[{linterOptions:{reportUnusedDisableDirectives:!0},name:"jimmy.codes/javascript",rules:ge}],"javascriptConfig"),je={"n/no-process-exit":"off","n/prefer-node-protocol":"error"},xe=t(()=>[{name:"jimmy.codes/node",plugins:{n:k},rules:je}],"nodeConfig"),be={...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"},he=t(()=>[{name:"jimmy.codes/perfectionist",plugins:{perfectionist:w},rules:be}],"perfectionistConfig"),ve=t(()=>[{name:"jimmy.codes/prettier",...U}],"prettierConfig"),ke=t(e=>e===2?"error":e===1?"warn":"off","toStringSeverity"),C=t((e={})=>Object.fromEntries(Object.entries(e).map(([r,s])=>[r,typeof s=="number"?ke(s):s])),"normalizeRuleEntries"),we=t(async()=>{const[e,r]=await Promise.all([c(import("eslint-plugin-react")),c(import("eslint-plugin-jsx-a11y"))]);return{...r.configs.recommended.rules,...C(e.configs.flat?.recommended?.rules),...C(e.configs.flat?.["jsx-runtime"]?.rules),"react-hooks/exhaustive-deps":"error","react-hooks/rules-of-hooks":"error","react-refresh/only-export-components":["warn",{allowConstantExport:!0}],"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"),Oe=t(async()=>{const[e,r,s,n]=await Promise.all([c(import("eslint-plugin-react")),c(import("eslint-plugin-jsx-a11y")),import("eslint-plugin-react-hooks"),import("eslint-plugin-react-refresh")]);return[{files:[g,E],languageOptions:{globals:{...d.browser},parserOptions:{ecmaFeatures:{jsx:!0},jsxPragma:null}},name:"jimmy.codes/react",plugins:{"jsx-a11y":r,react:e,"react-hooks":s,"react-refresh":n},rules:await we(),settings:{react:{version:"detect"}}}]},"reactConfig"),Pe={...q.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=t(()=>[{name:"jimmy.codes/regexp",plugins:{regexp:q},rules:Pe}],"regexpConfig"),Ee=t(async()=>{const e=await c(import("@tanstack/eslint-plugin-query"));return[{files:[g,E],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"}}]},"tanstackQuery"),_e=t(()=>l.isPackageExists("typescript"),"hasTypescript"),Ce=t(()=>l.isPackageExists("react"),"hasReact"),T=t(()=>l.isPackageExists("vitest"),"hasVitest"),R=t(()=>l.isPackageExists("jest"),"hasJest"),Te=t(()=>T()||R(),"hasTesting"),Re=t(()=>re.some(e=>l.isPackageExists(e)),"hasTestingLibrary"),Le=t(()=>l.isPackageExists("@tanstack/react-query"),"hasReactQuery"),Se=t(()=>l.isPackageExists("astro"),"hasAstro"),L={...O.configs["flat/recommended"].rules,...O.configs["flat/style"].rules,"jest/consistent-test-it":["error",{fn:"test",withinDescribe:"it"}],"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"},Ae=t(async({framework:e="vitest"}={},r=!0)=>{const s=await c(import("eslint-plugin-jest")),n=r?T():e==="vitest",i=e==="jest"||r&&R();return[{files:u,name:"jimmy.codes/testing",...s.configs["flat/recommended"]},...n?[{files:u,name:"jimmy.codes/testing/vitest",...s.configs["flat/recommended"],rules:{...L,"jest/no-deprecated-functions":"off","jest/require-hook":["error",{allowedFunctionCalls:ee}]}}]:[],...i?[{files:u,name:"jimmy.codes/testing/jest",...s.configs["flat/recommended"],rules:L}]:[],{files:_,name:"jimmy.codes/testing/disabled",rules:{"jest/expect-expect":"off","jest/no-deprecated-functions":"off","jest/require-hook":"off"}}]},"testingConfig"),Ge=t(async()=>{const[e,r]=await Promise.all([import("eslint-plugin-jest-dom"),c(import("eslint-plugin-testing-library"))]);return{...r.configs.react.rules,...e.configs["flat/recommended"].rules}},"testingLibraryRules"),Ie=t(async()=>{const[e,r]=await Promise.all([import("eslint-plugin-jest-dom"),c(import("eslint-plugin-testing-library"))]);return[{files:u,name:"jimmy.codes/testing/testing-library",plugins:{"jest-dom":e,"testing-library":r},rules:await Ge()},{files:_,name:"jimmy.codes/testing/testing-library/disabled",rules:{"testing-library/prefer-screen-queries":"off"}}]},"testingLibrary"),Be={"@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"},Ne=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:Be},{files:[Y,g],...p.configs.disableTypeChecked},{files:u,name:"jimmy.codes/typescript/testing",rules:{"@typescript-eslint/no-unsafe-argument":"off","@typescript-eslint/no-unsafe-assignment":"off"}}],"typescriptConfig"),$e={...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"},Fe=t(()=>[{...P.configs["flat/recommended"],name:"jimmy.codes/unicorn",rules:$e}],"unicornConfig"),Je=t(async({astro:e=!1,autoDetect:r=!0,configs:s=[],ignores:n=[],react:i=!1,testing:y=!1,typescript:j=!1}={},...S)=>{const A=oe(i),x=se(y),b=te(j),h=j||!!b||r&&_e(),G=i||r&&Ce(),I=y||r&&Te(),B=e||r&&Se(),N=ne(A)||r&&Le(),$=ie(x)||r&&Re();return[ye(),he(),xe(),Fe(),pe(),qe(),de({typescript:h}),h?Ne(b):[],G?await Oe():[],N?await Ee():[],B?await ae():[],I?await Ae(x,r):[],$?await Ie():[],ve(),ce(),fe(n),s,S].flat()},"jimmyDotCodes");module.exports=Je;