@jimmy.codes/eslint-config 3.17.0 → 3.17.2

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 $=Object.create;var m=Object.defineProperty;var F=Object.getOwnPropertyDescriptor;var J=Object.getOwnPropertyNames;var z=Object.getPrototypeOf,D=Object.prototype.hasOwnProperty;var t=(e,r)=>m(e,"name",{value:r,configurable:!0});var Q=(e,r,s,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of J(r))!D.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?$(z(e)):{},Q(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"),V=require("@eslint/js"),w=require("eslint-plugin-perfectionist"),X=require("eslint-config-prettier"),U=require("eslint-plugin-regexp"),l=require("local-pkg"),O=require("eslint-plugin-unicorn");function H(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(H,"_interopNamespaceDefault");var P=H(U);const c="?([cm])[jt]s?(x)",M=["**/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"],W="**/*.?([cm])js",g="**/*.?([cm])jsx",E="**/*.?([cm])tsx",u=[`**/__tests__/**/*.${c}`,`**/*.spec.${c}`,`**/*.test.${c}`,`**/*.bench.${c}`,`**/*.benchmark.${c}`],q=[`**/e2e/**/*.spec.${c}`,`**/e2e/**/*.test.${c}`,`**/cypress/**/*.spec.${c}`,`**/cypress/**/*.test.${c}`],Y="**/*.cjs",K="**/*.astro",Z=["vi.mock","describe","expect","it"],ee=["@testing-library/react"],re=t(e=>typeof e=="object"?e:void 0,"getTypescriptOptions"),te=t(e=>typeof e=="object"?e:{framework:"vitest"},"getTestingOptions"),se=t(e=>typeof e=="object"?e:{utilities:[]},"getReactOptions"),oe=t(e=>!!e.utilities?.includes("@tanstack/query"),"addTanstackQuery"),ne=t(e=>!!e.utilities?.includes("testing-library"),"addTestingLibrary"),a=t(async e=>{const r=await e;return r.default??r},"interopDefault"),ie=t(async()=>{const e=[K],[r,s,n]=await Promise.all([import("eslint-plugin-astro"),import("astro-eslint-parser"),a(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"),ae=t(()=>[{files:[Y],languageOptions:{globals:d.commonjs},name:"jimmy.codes/commonjs"}],"commonjsConfig"),ce={...v.recommended.rules,"@eslint-community/eslint-comments/no-unused-disable":"off","@eslint-community/eslint-comments/require-description":"error"},le=t(()=>[{...v.recommended,name:"jimmy.codes/eslint-comments",rules:ce}],"eslintCommentsConfig"),pe=t(e=>[{ignores:[...M,...e],name:"jimmy.codes/ignores"}],"ignoresConfig"),fe={...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"},ue={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}}},me=t(({typescript:e=!1}={})=>[{name:"jimmy.codes/imports",plugins:{"import-x":f,n:k},rules:fe},...e?[ue]:[]],"importsConfig"),de={...V.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"},ge=t(()=>[{linterOptions:{reportUnusedDisableDirectives:!0},name:"jimmy.codes/javascript",rules:de}],"javascriptConfig"),ye={"n/no-process-exit":"off","n/prefer-node-protocol":"error"},je=t(()=>[{name:"jimmy.codes/node",plugins:{n:k},rules:ye}],"nodeConfig"),xe={...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"},be=t(()=>[{name:"jimmy.codes/perfectionist",plugins:{perfectionist:w},rules:xe}],"perfectionistConfig"),he=t(()=>[{name:"jimmy.codes/prettier",...X}],"prettierConfig"),ve=t(e=>e===2?"error":e===1?"warn":"off","toStringSeverity"),_=t((e={})=>Object.fromEntries(Object.entries(e).map(([r,s])=>[r,typeof s=="number"?ve(s):s])),"normalizeRuleEntries"),ke=t(async()=>{const[e,r]=await Promise.all([a(import("eslint-plugin-react")),a(import("eslint-plugin-jsx-a11y"))]);return{...r.configs.recommended.rules,..._(e.configs.flat?.recommended?.rules),..._(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"),we=t(async()=>{const[e,r,s,n]=await Promise.all([a(import("eslint-plugin-react")),a(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 ke(),settings:{react:{version:"detect"}}}]},"reactConfig"),Oe={...P.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"},Pe=t(()=>[{name:"jimmy.codes/regexp",plugins:{regexp:P},rules:Oe}],"regexpConfig"),Ee=t(async()=>{const e=await a(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"),qe=t(()=>l.isPackageExists("typescript"),"hasTypescript"),_e=t(()=>l.isPackageExists("react"),"hasReact"),C=t(()=>l.isPackageExists("vitest"),"hasVitest"),T=t(()=>l.isPackageExists("jest"),"hasJest"),Ce=t(()=>C()||T(),"hasTesting"),Te=t(()=>ee.some(e=>l.isPackageExists(e)),"hasTestingLibrary"),Re=t(()=>l.isPackageExists("@tanstack/react-query"),"hasReactQuery"),Le=t(()=>l.isPackageExists("astro"),"hasAstro"),R=t(async()=>{const e=await a(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/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"),Se=t(async()=>({...await R(),"jest/no-deprecated-functions":"off","jest/require-hook":["error",{allowedFunctionCalls:Z}]}),"vitestRules"),Ae=t(async({framework:e="vitest"}={},r=!0)=>{const s=await a(import("eslint-plugin-jest")),n=r?C():e==="vitest",i=e==="jest"||r&&T();return[...n?[{files:u,name:"jimmy.codes/vitest",...s.configs["flat/recommended"],rules:await Se()}]:[],...i?[{files:u,name:"jimmy.codes/jest",...s.configs["flat/recommended"],rules:await R()}]:[],{files:q,name:"jimmy.codes/e2e",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"),a(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"),a(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:q,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:[W,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={...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"},Fe=t(()=>[{...O.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}={},...L)=>{const S=se(i),x=te(y),b=re(j),h=j||!!b||r&&qe(),A=i||r&&_e(),G=y||r&&Ce(),I=e||r&&Le(),B=oe(S)||r&&Re(),N=ne(x)||r&&Te();return[ge(),be(),je(),Fe(),le(),Pe(),me({typescript:h}),h?Ne(b):[],A?await we():[],B?await Ee():[],I?await ie():[],G?await Ae(x,r):[],N?await Ie():[],he(),ae(),pe(n),s,L].flat()},"jimmyDotCodes");module.exports=Je;
1
+ "use strict";var $=Object.create;var d=Object.defineProperty;var F=Object.getOwnPropertyDescriptor;var J=Object.getOwnPropertyNames;var z=Object.getPrototypeOf,D=Object.prototype.hasOwnProperty;var t=(e,r)=>d(e,"name",{value:r,configurable:!0});var Q=(e,r,s,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of J(r))!D.call(e,i)&&i!==s&&d(e,i,{get:()=>r[i],enumerable:!(n=F(r,i))||n.enumerable});return e};var o=(e,r,s)=>(s=e!=null?$(z(e)):{},Q(r||!e||!e.__esModule?d(s,"default",{value:e,enumerable:!0}):s,e));var g=require("globals"),f=require("typescript-eslint"),v=require("@eslint-community/eslint-plugin-eslint-comments/configs"),u=require("eslint-plugin-import-x"),k=require("eslint-plugin-n"),V=require("@eslint/js"),w=require("eslint-plugin-perfectionist"),X=require("eslint-config-prettier"),U=require("eslint-plugin-regexp"),l=require("local-pkg"),O=require("eslint-plugin-unicorn");function H(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(H,"_interopNamespaceDefault");var P=H(U);const c="?([cm])[jt]s?(x)",M=["**/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"],W="**/*.?([cm])js",y="**/*.?([cm])jsx",E="**/*.?([cm])tsx",m=[`**/__tests__/**/*.${c}`,`**/*.spec.${c}`,`**/*.test.${c}`,`**/*.bench.${c}`,`**/*.benchmark.${c}`],q=[`**/e2e/**/*.spec.${c}`,`**/e2e/**/*.test.${c}`,`**/cypress/**/*.spec.${c}`,`**/cypress/**/*.test.${c}`],Y="**/*.cjs",K="**/*.astro",Z=["vi.mock","describe","expect","it"],ee=["@testing-library/react"],re=t(e=>typeof e=="object"?e:void 0,"getTypescriptOptions"),te=t(e=>typeof e=="object"?e:{framework:"vitest"},"getTestingOptions"),se=t(e=>typeof e=="object"?e:{utilities:[]},"getReactOptions"),oe=t(e=>!!e.utilities?.includes("@tanstack/query"),"addTanstackQuery"),ne=t(e=>!!e.utilities?.includes("testing-library"),"addTestingLibrary"),a=t(async e=>{const r=await e;return r.default??r},"interopDefault"),ie=t(async()=>{const e=[K],[r,s,n]=await Promise.all([import("eslint-plugin-astro"),import("astro-eslint-parser"),a(import("eslint-plugin-jsx-a11y"))]);return[{files:e,languageOptions:{globals:{...g.node,Astro:!1,Fragment:!1},parser:s,parserOptions:{extraFileExtensions:[".astro"],parser:f.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:f.configs.disableTypeChecked.languageOptions?.parserOptions},name:"jimmy.codes/astro/disable-type-checked",rules:f.configs.disableTypeChecked.rules},{name:"jimmy.codes/astro/imports",settings:{"import-x/core-modules":["astro:content"]}}]},"astroConfig"),ae=t(()=>[{files:[Y],languageOptions:{globals:g.commonjs},name:"jimmy.codes/commonjs"}],"commonjsConfig"),ce={...v.recommended.rules,"@eslint-community/eslint-comments/no-unused-disable":"off","@eslint-community/eslint-comments/require-description":"error"},le=t(()=>[{...v.recommended,name:"jimmy.codes/eslint-comments",rules:ce}],"eslintCommentsConfig"),pe=t(e=>[{ignores:[...M,...e],name:"jimmy.codes/ignores"}],"ignoresConfig"),fe={...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"},ue={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}}},me=t(({typescript:e=!1}={})=>[{name:"jimmy.codes/imports",plugins:{"import-x":u,n:k},rules:fe},...e?[ue]:[]],"importsConfig"),de={...V.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"},ge=t(()=>[{linterOptions:{reportUnusedDisableDirectives:!0},name:"jimmy.codes/javascript",rules:de}],"javascriptConfig"),ye={"n/no-process-exit":"off","n/prefer-node-protocol":"error"},je=t(()=>[{name:"jimmy.codes/node",plugins:{n:k},rules:ye}],"nodeConfig"),xe={...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"},be=t(()=>[{name:"jimmy.codes/perfectionist",plugins:{perfectionist:w},rules:xe}],"perfectionistConfig"),he=t(()=>[{name:"jimmy.codes/prettier",...X}],"prettierConfig"),ve=t(e=>e===2?"error":e===1?"warn":"off","toStringSeverity"),_=t((e={})=>Object.fromEntries(Object.entries(e).map(([r,s])=>[r,typeof s=="number"?ve(s):s])),"normalizeRuleEntries"),ke=t(async()=>{const[e,r]=await Promise.all([a(import("eslint-plugin-react")),a(import("eslint-plugin-jsx-a11y"))]);return{...r.configs.recommended.rules,..._(e.configs.flat?.recommended?.rules),..._(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"),we=t(async()=>{const[e,r,s,n]=await Promise.all([a(import("eslint-plugin-react")),a(import("eslint-plugin-jsx-a11y")),import("eslint-plugin-react-hooks"),import("eslint-plugin-react-refresh")]);return[{files:[y,E],languageOptions:{globals:{...g.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 ke(),settings:{react:{version:"detect"}}}]},"reactConfig"),Oe={...P.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"},Pe=t(()=>[{name:"jimmy.codes/regexp",plugins:{regexp:P},rules:Oe}],"regexpConfig"),Ee=t(async()=>{const e=await a(import("@tanstack/eslint-plugin-query"));return[{files:[y,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"),qe=t(()=>l.isPackageExists("typescript"),"hasTypescript"),_e=t(()=>l.isPackageExists("react"),"hasReact"),C=t(()=>l.isPackageExists("vitest"),"hasVitest"),T=t(()=>l.isPackageExists("jest"),"hasJest"),Ce=t(()=>C()||T(),"hasTesting"),Te=t(()=>ee.some(e=>l.isPackageExists(e)),"hasTestingLibrary"),Re=t(()=>l.isPackageExists("@tanstack/react-query"),"hasReactQuery"),Le=t(()=>l.isPackageExists("astro"),"hasAstro"),R=t(async()=>{const e=await a(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"),Se=t(async()=>({...await R(),"jest/no-deprecated-functions":"off","jest/require-hook":["error",{allowedFunctionCalls:Z}]}),"vitestRules"),Ae=t(async({framework:e="vitest"}={},r=!0)=>{const s=r?C():e==="vitest",n=e==="jest"||r&&T(),i=[];if(s){const p=await a(import("eslint-plugin-jest"));i.push({files:m,...p.configs["flat/recommended"],name:"jimmy.codes/vitest",rules:await Se()})}if(n){const p=await a(import("eslint-plugin-jest"));i.push({files:m,...p.configs["flat/recommended"],name:"jimmy.codes/jest",rules:await R()})}return i.push({files:q,name:"jimmy.codes/e2e",rules:{"jest/expect-expect":"off","jest/no-deprecated-functions":"off","jest/require-hook":"off"}}),i},"testingConfig"),Ge=t(async()=>{const[e,r]=await Promise.all([import("eslint-plugin-jest-dom"),a(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"),a(import("eslint-plugin-testing-library"))]);return[{files:m,name:"jimmy.codes/testing/testing-library",plugins:{"jest-dom":e,"testing-library":r},rules:await Ge()},{files:q,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=>[...f.configs.strictTypeChecked,...f.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:[W,y],...f.configs.disableTypeChecked},{files:m,name:"jimmy.codes/typescript/testing",rules:{"@typescript-eslint/no-unsafe-argument":"off","@typescript-eslint/no-unsafe-assignment":"off"}}],"typescriptConfig"),$e={...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"},Fe=t(()=>[{...O.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:p=!1,typescript:j=!1}={},...L)=>{const S=se(i),x=te(p),b=re(j),h=j||!!b||r&&qe(),A=i||r&&_e(),G=p||r&&Ce(),I=e||r&&Le(),B=oe(S)||r&&Re(),N=ne(x)||r&&Te();return[ge(),be(),je(),Fe(),le(),Pe(),me({typescript:h}),h?Ne(b):[],A?await we():[],B?await Ee():[],I?await ie():[],G?await Ae(x,r):[],N?await Ie():[],he(),ae(),pe(n),s,L].flat()},"jimmyDotCodes");module.exports=Je;
package/dist/index.d.cts CHANGED
@@ -12805,107 +12805,6 @@ declare const jimmyDotCodes: ({ astro, autoDetect, configs, ignores, react, test
12805
12805
  "@tanstack/query/no-rest-destructuring": "warn";
12806
12806
  "@tanstack/query/stable-query-client": "error";
12807
12807
  };
12808
- } | {
12809
- rules: {
12810
- "jest/no-deprecated-functions": "off";
12811
- "jest/require-hook": ["error", {
12812
- allowedFunctionCalls: string[];
12813
- }];
12814
- "jest/consistent-test-it": ["error", {
12815
- fn: "test";
12816
- withinDescribe: "it";
12817
- }];
12818
- "jest/no-alias-methods": "error";
12819
- "jest/no-commented-out-tests": "error";
12820
- "jest/no-conditional-in-test": "error";
12821
- "jest/no-confusing-set-timeout": "error";
12822
- "jest/no-duplicate-hooks": "error";
12823
- "jest/no-hooks": "off";
12824
- "jest/no-large-snapshots": "off";
12825
- "jest/no-restricted-jest-methods": "off";
12826
- "jest/no-restricted-matchers": "off";
12827
- "jest/no-test-return-statement": "error";
12828
- "jest/no-untyped-mock-factory": "off";
12829
- "jest/prefer-called-with": "error";
12830
- "jest/prefer-comparison-matcher": "error";
12831
- "jest/prefer-each": "error";
12832
- "jest/prefer-equality-matcher": "error";
12833
- "jest/prefer-expect-assertions": "off";
12834
- "jest/prefer-expect-resolves": "error";
12835
- "jest/prefer-hooks-in-order": "error";
12836
- "jest/prefer-hooks-on-top": "error";
12837
- "jest/prefer-lowercase-title": "off";
12838
- "jest/prefer-mock-promise-shorthand": "error";
12839
- "jest/prefer-snapshot-hint": "error";
12840
- "jest/prefer-spy-on": "off";
12841
- "jest/prefer-strict-equal": "error";
12842
- "jest/prefer-todo": "warn";
12843
- "jest/require-to-throw-message": "error";
12844
- "jest/require-top-level-describe": "off";
12845
- "jest/unbound-method": "off";
12846
- };
12847
- name: string;
12848
- files: Array<string | string[]>;
12849
- ignores?: string[];
12850
- language?: string;
12851
- languageOptions?: Linter.LanguageOptions;
12852
- linterOptions?: Linter.LinterOptions;
12853
- processor?: string | Linter.Processor;
12854
- plugins?: Record<string, eslint.ESLint.Plugin>;
12855
- settings?: Record<string, unknown>;
12856
- } | {
12857
- rules: {
12858
- "jest/consistent-test-it": ["error", {
12859
- fn: "test";
12860
- withinDescribe: "it";
12861
- }];
12862
- "jest/no-alias-methods": "error";
12863
- "jest/no-commented-out-tests": "error";
12864
- "jest/no-conditional-in-test": "error";
12865
- "jest/no-confusing-set-timeout": "error";
12866
- "jest/no-duplicate-hooks": "error";
12867
- "jest/no-hooks": "off";
12868
- "jest/no-large-snapshots": "off";
12869
- "jest/no-restricted-jest-methods": "off";
12870
- "jest/no-restricted-matchers": "off";
12871
- "jest/no-test-return-statement": "error";
12872
- "jest/no-untyped-mock-factory": "off";
12873
- "jest/prefer-called-with": "error";
12874
- "jest/prefer-comparison-matcher": "error";
12875
- "jest/prefer-each": "error";
12876
- "jest/prefer-equality-matcher": "error";
12877
- "jest/prefer-expect-assertions": "off";
12878
- "jest/prefer-expect-resolves": "error";
12879
- "jest/prefer-hooks-in-order": "error";
12880
- "jest/prefer-hooks-on-top": "error";
12881
- "jest/prefer-lowercase-title": "off";
12882
- "jest/prefer-mock-promise-shorthand": "error";
12883
- "jest/prefer-snapshot-hint": "error";
12884
- "jest/prefer-spy-on": "off";
12885
- "jest/prefer-strict-equal": "error";
12886
- "jest/prefer-todo": "warn";
12887
- "jest/require-hook": "error";
12888
- "jest/require-to-throw-message": "error";
12889
- "jest/require-top-level-describe": "off";
12890
- "jest/unbound-method": "off";
12891
- };
12892
- name: string;
12893
- files: Array<string | string[]>;
12894
- ignores?: string[];
12895
- language?: string;
12896
- languageOptions?: Linter.LanguageOptions;
12897
- linterOptions?: Linter.LinterOptions;
12898
- processor?: string | Linter.Processor;
12899
- plugins?: Record<string, eslint.ESLint.Plugin>;
12900
- settings?: Record<string, unknown>;
12901
- } | {
12902
- files: string[];
12903
- name: string;
12904
- rules: {
12905
- "jest/expect-expect": "off";
12906
- "jest/no-deprecated-functions": "off";
12907
- "jest/require-hook": "off";
12908
- };
12909
12808
  } | {
12910
12809
  files: string[];
12911
12810
  name: string;
package/dist/index.d.mts CHANGED
@@ -12805,107 +12805,6 @@ declare const jimmyDotCodes: ({ astro, autoDetect, configs, ignores, react, test
12805
12805
  "@tanstack/query/no-rest-destructuring": "warn";
12806
12806
  "@tanstack/query/stable-query-client": "error";
12807
12807
  };
12808
- } | {
12809
- rules: {
12810
- "jest/no-deprecated-functions": "off";
12811
- "jest/require-hook": ["error", {
12812
- allowedFunctionCalls: string[];
12813
- }];
12814
- "jest/consistent-test-it": ["error", {
12815
- fn: "test";
12816
- withinDescribe: "it";
12817
- }];
12818
- "jest/no-alias-methods": "error";
12819
- "jest/no-commented-out-tests": "error";
12820
- "jest/no-conditional-in-test": "error";
12821
- "jest/no-confusing-set-timeout": "error";
12822
- "jest/no-duplicate-hooks": "error";
12823
- "jest/no-hooks": "off";
12824
- "jest/no-large-snapshots": "off";
12825
- "jest/no-restricted-jest-methods": "off";
12826
- "jest/no-restricted-matchers": "off";
12827
- "jest/no-test-return-statement": "error";
12828
- "jest/no-untyped-mock-factory": "off";
12829
- "jest/prefer-called-with": "error";
12830
- "jest/prefer-comparison-matcher": "error";
12831
- "jest/prefer-each": "error";
12832
- "jest/prefer-equality-matcher": "error";
12833
- "jest/prefer-expect-assertions": "off";
12834
- "jest/prefer-expect-resolves": "error";
12835
- "jest/prefer-hooks-in-order": "error";
12836
- "jest/prefer-hooks-on-top": "error";
12837
- "jest/prefer-lowercase-title": "off";
12838
- "jest/prefer-mock-promise-shorthand": "error";
12839
- "jest/prefer-snapshot-hint": "error";
12840
- "jest/prefer-spy-on": "off";
12841
- "jest/prefer-strict-equal": "error";
12842
- "jest/prefer-todo": "warn";
12843
- "jest/require-to-throw-message": "error";
12844
- "jest/require-top-level-describe": "off";
12845
- "jest/unbound-method": "off";
12846
- };
12847
- name: string;
12848
- files: Array<string | string[]>;
12849
- ignores?: string[];
12850
- language?: string;
12851
- languageOptions?: Linter.LanguageOptions;
12852
- linterOptions?: Linter.LinterOptions;
12853
- processor?: string | Linter.Processor;
12854
- plugins?: Record<string, eslint.ESLint.Plugin>;
12855
- settings?: Record<string, unknown>;
12856
- } | {
12857
- rules: {
12858
- "jest/consistent-test-it": ["error", {
12859
- fn: "test";
12860
- withinDescribe: "it";
12861
- }];
12862
- "jest/no-alias-methods": "error";
12863
- "jest/no-commented-out-tests": "error";
12864
- "jest/no-conditional-in-test": "error";
12865
- "jest/no-confusing-set-timeout": "error";
12866
- "jest/no-duplicate-hooks": "error";
12867
- "jest/no-hooks": "off";
12868
- "jest/no-large-snapshots": "off";
12869
- "jest/no-restricted-jest-methods": "off";
12870
- "jest/no-restricted-matchers": "off";
12871
- "jest/no-test-return-statement": "error";
12872
- "jest/no-untyped-mock-factory": "off";
12873
- "jest/prefer-called-with": "error";
12874
- "jest/prefer-comparison-matcher": "error";
12875
- "jest/prefer-each": "error";
12876
- "jest/prefer-equality-matcher": "error";
12877
- "jest/prefer-expect-assertions": "off";
12878
- "jest/prefer-expect-resolves": "error";
12879
- "jest/prefer-hooks-in-order": "error";
12880
- "jest/prefer-hooks-on-top": "error";
12881
- "jest/prefer-lowercase-title": "off";
12882
- "jest/prefer-mock-promise-shorthand": "error";
12883
- "jest/prefer-snapshot-hint": "error";
12884
- "jest/prefer-spy-on": "off";
12885
- "jest/prefer-strict-equal": "error";
12886
- "jest/prefer-todo": "warn";
12887
- "jest/require-hook": "error";
12888
- "jest/require-to-throw-message": "error";
12889
- "jest/require-top-level-describe": "off";
12890
- "jest/unbound-method": "off";
12891
- };
12892
- name: string;
12893
- files: Array<string | string[]>;
12894
- ignores?: string[];
12895
- language?: string;
12896
- languageOptions?: Linter.LanguageOptions;
12897
- linterOptions?: Linter.LinterOptions;
12898
- processor?: string | Linter.Processor;
12899
- plugins?: Record<string, eslint.ESLint.Plugin>;
12900
- settings?: Record<string, unknown>;
12901
- } | {
12902
- files: string[];
12903
- name: string;
12904
- rules: {
12905
- "jest/expect-expect": "off";
12906
- "jest/no-deprecated-functions": "off";
12907
- "jest/require-hook": "off";
12908
- };
12909
12808
  } | {
12910
12809
  files: string[];
12911
12810
  name: string;
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- var B=Object.defineProperty;var r=(e,t)=>B(e,"name",{value:t,configurable:!0});import m from"globals";import{parser as $,configs as c}from"typescript-eslint";import b from"@eslint-community/eslint-plugin-eslint-comments/configs";import p from"eslint-plugin-import-x";import h from"eslint-plugin-n";import N from"@eslint/js";import k from"eslint-plugin-perfectionist";import F from"eslint-config-prettier";import*as v from"eslint-plugin-regexp";import{isPackageExists as a}from"local-pkg";import w from"eslint-plugin-unicorn";const n="?([cm])[jt]s?(x)",J=["**/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"],Q="**/*.?([cm])js",u="**/*.?([cm])jsx",O="**/*.?([cm])tsx",f=[`**/__tests__/**/*.${n}`,`**/*.spec.${n}`,`**/*.test.${n}`,`**/*.bench.${n}`,`**/*.benchmark.${n}`],C=[`**/e2e/**/*.spec.${n}`,`**/e2e/**/*.test.${n}`,`**/cypress/**/*.spec.${n}`,`**/cypress/**/*.test.${n}`],V="**/*.cjs",X="**/*.astro",z=["vi.mock","describe","expect","it"],U=["@testing-library/react"],D=r(e=>typeof e=="object"?e:void 0,"getTypescriptOptions"),H=r(e=>typeof e=="object"?e:{framework:"vitest"},"getTestingOptions"),M=r(e=>typeof e=="object"?e:{utilities:[]},"getReactOptions"),W=r(e=>!!e.utilities?.includes("@tanstack/query"),"addTanstackQuery"),Y=r(e=>!!e.utilities?.includes("testing-library"),"addTestingLibrary"),s=r(async e=>{const t=await e;return t.default??t},"interopDefault"),K=r(async()=>{const e=[X],[t,o,i]=await Promise.all([import("eslint-plugin-astro"),import("astro-eslint-parser"),s(import("eslint-plugin-jsx-a11y"))]);return[{files:e,languageOptions:{globals:{...m.node,Astro:!1,Fragment:!1},parser:o,parserOptions:{extraFileExtensions:[".astro"],parser:$},sourceType:"module"},name:"jimmy.codes/astro",plugins:{astro:t,"jsx-a11y":i},processor:"astro/client-side-ts",rules:{...i.configs.recommended.rules,"astro/missing-client-only-directive-value":"error","astro/no-conflict-set-directives":"error","astro/no-deprecated-astro-canonicalurl":"error","astro/no-deprecated-astro-fetchcontent":"error","astro/no-deprecated-astro-resolve":"error","astro/no-deprecated-getentrybyslug":"error","astro/no-exports-from-components":"off","astro/no-unused-define-vars-in-style":"error","astro/valid-compile":"error"}},{files:e,languageOptions:{parserOptions:c.disableTypeChecked.languageOptions?.parserOptions},name:"jimmy.codes/astro/disable-type-checked",rules:c.disableTypeChecked.rules},{name:"jimmy.codes/astro/imports",settings:{"import-x/core-modules":["astro:content"]}}]},"astroConfig"),Z=r(()=>[{files:[V],languageOptions:{globals:m.commonjs},name:"jimmy.codes/commonjs"}],"commonjsConfig"),ee={...b.recommended.rules,"@eslint-community/eslint-comments/no-unused-disable":"off","@eslint-community/eslint-comments/require-description":"error"},re=r(()=>[{...b.recommended,name:"jimmy.codes/eslint-comments",rules:ee}],"eslintCommentsConfig"),te=r(e=>[{ignores:[...J,...e],name:"jimmy.codes/ignores"}],"ignoresConfig"),oe={...p.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"},se={name:"jimmy.codes/imports/typescript",rules:p.configs.typescript.rules,settings:{...p.configs.typescript.settings,"import-x/resolver":{...p.configs.typescript.settings["import-x/resolver"],typescript:!0}}},ne=r(({typescript:e=!1}={})=>[{name:"jimmy.codes/imports",plugins:{"import-x":p,n:h},rules:oe},...e?[se]:[]],"importsConfig"),ie={...N.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"},ae=r(()=>[{linterOptions:{reportUnusedDisableDirectives:!0},name:"jimmy.codes/javascript",rules:ie}],"javascriptConfig"),ce={"n/no-process-exit":"off","n/prefer-node-protocol":"error"},pe=r(()=>[{name:"jimmy.codes/node",plugins:{n:h},rules:ce}],"nodeConfig"),le={...k.configs["recommended-natural"].rules,"perfectionist/sort-imports":["error",{customGroups:{type:{},value:{}},environment:"node",groups:["side-effect-style","builtin","type","external","internal-type","internal",["parent-type","sibling-type","index-type"],["parent","sibling","index"],"object","style","unknown"],internalPattern:["^~/.*","^@/.*"],order:"asc",type:"natural"}],"perfectionist/sort-modules":"off"},fe=r(()=>[{name:"jimmy.codes/perfectionist",plugins:{perfectionist:k},rules:le}],"perfectionistConfig"),me=r(()=>[{name:"jimmy.codes/prettier",...F}],"prettierConfig"),ue=r(e=>e===2?"error":e===1?"warn":"off","toStringSeverity"),P=r((e={})=>Object.fromEntries(Object.entries(e).map(([t,o])=>[t,typeof o=="number"?ue(o):o])),"normalizeRuleEntries"),de=r(async()=>{const[e,t]=await Promise.all([s(import("eslint-plugin-react")),s(import("eslint-plugin-jsx-a11y"))]);return{...t.configs.recommended.rules,...P(e.configs.flat?.recommended?.rules),...P(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"),ye=r(async()=>{const[e,t,o,i]=await Promise.all([s(import("eslint-plugin-react")),s(import("eslint-plugin-jsx-a11y")),import("eslint-plugin-react-hooks"),import("eslint-plugin-react-refresh")]);return[{files:[u,O],languageOptions:{globals:{...m.browser},parserOptions:{ecmaFeatures:{jsx:!0},jsxPragma:null}},name:"jimmy.codes/react",plugins:{"jsx-a11y":t,react:e,"react-hooks":o,"react-refresh":i},rules:await de(),settings:{react:{version:"detect"}}}]},"reactConfig"),ge={...v.configs["flat/recommended"].rules,"regexp/confusing-quantifier":"error","regexp/no-empty-alternative":"error","regexp/no-lazy-ends":"error","regexp/no-potentially-useless-backreference":"error","regexp/no-useless-flag":"error","regexp/optimal-lookaround-quantifier":"error"},je=r(()=>[{name:"jimmy.codes/regexp",plugins:{regexp:v},rules:ge}],"regexpConfig"),xe=r(async()=>{const e=await s(import("@tanstack/eslint-plugin-query"));return[{files:[u,O],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"),be=r(()=>a("typescript"),"hasTypescript"),he=r(()=>a("react"),"hasReact"),T=r(()=>a("vitest"),"hasVitest"),_=r(()=>a("jest"),"hasJest"),ke=r(()=>T()||_(),"hasTesting"),ve=r(()=>U.some(e=>a(e)),"hasTestingLibrary"),we=r(()=>a("@tanstack/react-query"),"hasReactQuery"),Oe=r(()=>a("astro"),"hasAstro"),E=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/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"),Ce=r(async()=>({...await E(),"jest/no-deprecated-functions":"off","jest/require-hook":["error",{allowedFunctionCalls:z}]}),"vitestRules"),Pe=r(async({framework:e="vitest"}={},t=!0)=>{const o=await s(import("eslint-plugin-jest")),i=t?T():e==="vitest",l=e==="jest"||t&&_();return[...i?[{files:f,name:"jimmy.codes/vitest",...o.configs["flat/recommended"],rules:await Ce()}]:[],...l?[{files:f,name:"jimmy.codes/jest",...o.configs["flat/recommended"],rules:await E()}]:[],{files:C,name:"jimmy.codes/e2e",rules:{"jest/expect-expect":"off","jest/no-deprecated-functions":"off","jest/require-hook":"off"}}]},"testingConfig"),Te=r(async()=>{const[e,t]=await Promise.all([import("eslint-plugin-jest-dom"),s(import("eslint-plugin-testing-library"))]);return{...t.configs.react.rules,...e.configs["flat/recommended"].rules}},"testingLibraryRules"),_e=r(async()=>{const[e,t]=await Promise.all([import("eslint-plugin-jest-dom"),s(import("eslint-plugin-testing-library"))]);return[{files:f,name:"jimmy.codes/testing/testing-library",plugins:{"jest-dom":e,"testing-library":t},rules:await Te()},{files:C,name:"jimmy.codes/testing/testing-library/disabled",rules:{"testing-library/prefer-screen-queries":"off"}}]},"testingLibrary"),Ee={"@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"},Re=r(e=>[...c.strictTypeChecked,...c.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:Ee},{files:[Q,u],...c.disableTypeChecked},{files:f,name:"jimmy.codes/typescript/testing",rules:{"@typescript-eslint/no-unsafe-argument":"off","@typescript-eslint/no-unsafe-assignment":"off"}}],"typescriptConfig"),qe={...w.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"},Le=r(()=>[{...w.configs["flat/recommended"],name:"jimmy.codes/unicorn",rules:qe}],"unicornConfig"),Se=r(async({astro:e=!1,autoDetect:t=!0,configs:o=[],ignores:i=[],react:l=!1,testing:d=!1,typescript:y=!1}={},...R)=>{const q=M(l),g=H(d),j=D(y),x=y||!!j||t&&be(),L=l||t&&he(),S=d||t&&ke(),A=e||t&&Oe(),G=W(q)||t&&we(),I=Y(g)||t&&ve();return[ae(),fe(),pe(),Le(),re(),je(),ne({typescript:x}),x?Re(j):[],L?await ye():[],G?await xe():[],A?await K():[],S?await Pe(g,t):[],I?await _e():[],me(),Z(),te(i),o,R].flat()},"jimmyDotCodes");export{Se as default};
1
+ var B=Object.defineProperty;var r=(e,t)=>B(e,"name",{value:t,configurable:!0});import u from"globals";import{parser as $,configs as l}from"typescript-eslint";import b from"@eslint-community/eslint-plugin-eslint-comments/configs";import f from"eslint-plugin-import-x";import h from"eslint-plugin-n";import N from"@eslint/js";import k from"eslint-plugin-perfectionist";import F from"eslint-config-prettier";import*as v from"eslint-plugin-regexp";import{isPackageExists as c}from"local-pkg";import w from"eslint-plugin-unicorn";const n="?([cm])[jt]s?(x)",J=["**/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"],Q="**/*.?([cm])js",d="**/*.?([cm])jsx",O="**/*.?([cm])tsx",m=[`**/__tests__/**/*.${n}`,`**/*.spec.${n}`,`**/*.test.${n}`,`**/*.bench.${n}`,`**/*.benchmark.${n}`],C=[`**/e2e/**/*.spec.${n}`,`**/e2e/**/*.test.${n}`,`**/cypress/**/*.spec.${n}`,`**/cypress/**/*.test.${n}`],V="**/*.cjs",X="**/*.astro",z=["vi.mock","describe","expect","it"],U=["@testing-library/react"],D=r(e=>typeof e=="object"?e:void 0,"getTypescriptOptions"),H=r(e=>typeof e=="object"?e:{framework:"vitest"},"getTestingOptions"),M=r(e=>typeof e=="object"?e:{utilities:[]},"getReactOptions"),W=r(e=>!!e.utilities?.includes("@tanstack/query"),"addTanstackQuery"),Y=r(e=>!!e.utilities?.includes("testing-library"),"addTestingLibrary"),s=r(async e=>{const t=await e;return t.default??t},"interopDefault"),K=r(async()=>{const e=[X],[t,o,i]=await Promise.all([import("eslint-plugin-astro"),import("astro-eslint-parser"),s(import("eslint-plugin-jsx-a11y"))]);return[{files:e,languageOptions:{globals:{...u.node,Astro:!1,Fragment:!1},parser:o,parserOptions:{extraFileExtensions:[".astro"],parser:$},sourceType:"module"},name:"jimmy.codes/astro",plugins:{astro:t,"jsx-a11y":i},processor:"astro/client-side-ts",rules:{...i.configs.recommended.rules,"astro/missing-client-only-directive-value":"error","astro/no-conflict-set-directives":"error","astro/no-deprecated-astro-canonicalurl":"error","astro/no-deprecated-astro-fetchcontent":"error","astro/no-deprecated-astro-resolve":"error","astro/no-deprecated-getentrybyslug":"error","astro/no-exports-from-components":"off","astro/no-unused-define-vars-in-style":"error","astro/valid-compile":"error"}},{files:e,languageOptions:{parserOptions:l.disableTypeChecked.languageOptions?.parserOptions},name:"jimmy.codes/astro/disable-type-checked",rules:l.disableTypeChecked.rules},{name:"jimmy.codes/astro/imports",settings:{"import-x/core-modules":["astro:content"]}}]},"astroConfig"),Z=r(()=>[{files:[V],languageOptions:{globals:u.commonjs},name:"jimmy.codes/commonjs"}],"commonjsConfig"),ee={...b.recommended.rules,"@eslint-community/eslint-comments/no-unused-disable":"off","@eslint-community/eslint-comments/require-description":"error"},re=r(()=>[{...b.recommended,name:"jimmy.codes/eslint-comments",rules:ee}],"eslintCommentsConfig"),te=r(e=>[{ignores:[...J,...e],name:"jimmy.codes/ignores"}],"ignoresConfig"),oe={...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"},se={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}}},ne=r(({typescript:e=!1}={})=>[{name:"jimmy.codes/imports",plugins:{"import-x":f,n:h},rules:oe},...e?[se]:[]],"importsConfig"),ie={...N.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"},ae=r(()=>[{linterOptions:{reportUnusedDisableDirectives:!0},name:"jimmy.codes/javascript",rules:ie}],"javascriptConfig"),ce={"n/no-process-exit":"off","n/prefer-node-protocol":"error"},pe=r(()=>[{name:"jimmy.codes/node",plugins:{n:h},rules:ce}],"nodeConfig"),le={...k.configs["recommended-natural"].rules,"perfectionist/sort-imports":["error",{customGroups:{type:{},value:{}},environment:"node",groups:["side-effect-style","builtin","type","external","internal-type","internal",["parent-type","sibling-type","index-type"],["parent","sibling","index"],"object","style","unknown"],internalPattern:["^~/.*","^@/.*"],order:"asc",type:"natural"}],"perfectionist/sort-modules":"off"},fe=r(()=>[{name:"jimmy.codes/perfectionist",plugins:{perfectionist:k},rules:le}],"perfectionistConfig"),me=r(()=>[{name:"jimmy.codes/prettier",...F}],"prettierConfig"),ue=r(e=>e===2?"error":e===1?"warn":"off","toStringSeverity"),P=r((e={})=>Object.fromEntries(Object.entries(e).map(([t,o])=>[t,typeof o=="number"?ue(o):o])),"normalizeRuleEntries"),de=r(async()=>{const[e,t]=await Promise.all([s(import("eslint-plugin-react")),s(import("eslint-plugin-jsx-a11y"))]);return{...t.configs.recommended.rules,...P(e.configs.flat?.recommended?.rules),...P(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"),ye=r(async()=>{const[e,t,o,i]=await Promise.all([s(import("eslint-plugin-react")),s(import("eslint-plugin-jsx-a11y")),import("eslint-plugin-react-hooks"),import("eslint-plugin-react-refresh")]);return[{files:[d,O],languageOptions:{globals:{...u.browser},parserOptions:{ecmaFeatures:{jsx:!0},jsxPragma:null}},name:"jimmy.codes/react",plugins:{"jsx-a11y":t,react:e,"react-hooks":o,"react-refresh":i},rules:await de(),settings:{react:{version:"detect"}}}]},"reactConfig"),ge={...v.configs["flat/recommended"].rules,"regexp/confusing-quantifier":"error","regexp/no-empty-alternative":"error","regexp/no-lazy-ends":"error","regexp/no-potentially-useless-backreference":"error","regexp/no-useless-flag":"error","regexp/optimal-lookaround-quantifier":"error"},je=r(()=>[{name:"jimmy.codes/regexp",plugins:{regexp:v},rules:ge}],"regexpConfig"),xe=r(async()=>{const e=await s(import("@tanstack/eslint-plugin-query"));return[{files:[d,O],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"),be=r(()=>c("typescript"),"hasTypescript"),he=r(()=>c("react"),"hasReact"),T=r(()=>c("vitest"),"hasVitest"),_=r(()=>c("jest"),"hasJest"),ke=r(()=>T()||_(),"hasTesting"),ve=r(()=>U.some(e=>c(e)),"hasTestingLibrary"),we=r(()=>c("@tanstack/react-query"),"hasReactQuery"),Oe=r(()=>c("astro"),"hasAstro"),E=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"),Ce=r(async()=>({...await E(),"jest/no-deprecated-functions":"off","jest/require-hook":["error",{allowedFunctionCalls:z}]}),"vitestRules"),Pe=r(async({framework:e="vitest"}={},t=!0)=>{const o=t?T():e==="vitest",i=e==="jest"||t&&_(),a=[];if(o){const p=await s(import("eslint-plugin-jest"));a.push({files:m,...p.configs["flat/recommended"],name:"jimmy.codes/vitest",rules:await Ce()})}if(i){const p=await s(import("eslint-plugin-jest"));a.push({files:m,...p.configs["flat/recommended"],name:"jimmy.codes/jest",rules:await E()})}return a.push({files:C,name:"jimmy.codes/e2e",rules:{"jest/expect-expect":"off","jest/no-deprecated-functions":"off","jest/require-hook":"off"}}),a},"testingConfig"),Te=r(async()=>{const[e,t]=await Promise.all([import("eslint-plugin-jest-dom"),s(import("eslint-plugin-testing-library"))]);return{...t.configs.react.rules,...e.configs["flat/recommended"].rules}},"testingLibraryRules"),_e=r(async()=>{const[e,t]=await Promise.all([import("eslint-plugin-jest-dom"),s(import("eslint-plugin-testing-library"))]);return[{files:m,name:"jimmy.codes/testing/testing-library",plugins:{"jest-dom":e,"testing-library":t},rules:await Te()},{files:C,name:"jimmy.codes/testing/testing-library/disabled",rules:{"testing-library/prefer-screen-queries":"off"}}]},"testingLibrary"),Ee={"@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"},Re=r(e=>[...l.strictTypeChecked,...l.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:Ee},{files:[Q,d],...l.disableTypeChecked},{files:m,name:"jimmy.codes/typescript/testing",rules:{"@typescript-eslint/no-unsafe-argument":"off","@typescript-eslint/no-unsafe-assignment":"off"}}],"typescriptConfig"),qe={...w.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"},Le=r(()=>[{...w.configs["flat/recommended"],name:"jimmy.codes/unicorn",rules:qe}],"unicornConfig"),Se=r(async({astro:e=!1,autoDetect:t=!0,configs:o=[],ignores:i=[],react:a=!1,testing:p=!1,typescript:y=!1}={},...R)=>{const q=M(a),g=H(p),j=D(y),x=y||!!j||t&&be(),L=a||t&&he(),S=p||t&&ke(),A=e||t&&Oe(),G=W(q)||t&&we(),I=Y(g)||t&&ve();return[ae(),fe(),pe(),Le(),re(),je(),ne({typescript:x}),x?Re(j):[],L?await ye():[],G?await xe():[],A?await K():[],S?await Pe(g,t):[],I?await _e():[],me(),Z(),te(i),o,R].flat()},"jimmyDotCodes");export{Se as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jimmy.codes/eslint-config",
3
- "version": "3.17.0",
3
+ "version": "3.17.2",
4
4
  "description": "another opinionated eslint config",
5
5
  "keywords": [
6
6
  "eslint",