@jimmy.codes/eslint-config 3.8.2 → 3.9.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 B=Object.defineProperty;var r=(e,t)=>B(e,"name",{value:t,configurable:!0});var I=require("astro-eslint-parser"),N=require("eslint-plugin-astro"),m=require("eslint-plugin-jsx-a11y"),d=require("globals"),a=require("typescript-eslint"),h=require("@eslint-community/eslint-plugin-eslint-comments/configs"),c=require("eslint-plugin-import-x"),v=require("eslint-plugin-n"),$=require("@eslint/js"),k=require("eslint-plugin-perfectionist"),F=require("eslint-config-prettier"),J=require("@tanstack/eslint-plugin-query"),y=require("eslint-plugin-react"),V=require("eslint-plugin-react-hooks"),X=require("eslint-plugin-react-refresh"),n=require("local-pkg"),p=require("eslint-plugin-jest"),z=require("eslint-plugin-jest-dom"),q=require("eslint-plugin-testing-library"),O=require("eslint-plugin-unicorn");function g(e){var t=Object.create(null);return e&&Object.keys(e).forEach(function(s){if(s!=="default"){var i=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(t,s,i.get?i:{enumerable:!0,get:r(function(){return e[s]},"get")})}}),t.default=e,Object.freeze(t)}r(g,"_interopNamespaceDefault");var D=g(I),U=g(X),w=g(z);const o="?([cm])[jt]s?(x)",H=["**/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"],M="**/*.?([cm])js",j="**/*.?([cm])jsx",E="**/*.?([cm])tsx",l=[`**/__tests__/**/*.${o}`,`**/*.spec.${o}`,`**/*.test.${o}`,`**/*.bench.${o}`,`**/*.benchmark.${o}`],_=[`**/e2e/**/*.spec.${o}`,`**/e2e/**/*.test.${o}`,`**/cypress/**/*.spec.${o}`,`**/cypress/**/*.test.${o}`],Q="**/*.cjs",W="**/*.astro",Y=["vi.mock","describe","expect","it"],K=["@testing-library/react"],Z=r(()=>{const e=[W];return[{files:e,languageOptions:{globals:{...d.node,Astro:!1,Fragment:!1},parser:D,parserOptions:{extraFileExtensions:[".astro"],parser:a.parser},sourceType:"module"},name:"jimmy.codes/astro",plugins:{astro:N,"jsx-a11y":m},processor:"astro/client-side-ts",rules:{...m.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:a.configs.disableTypeChecked.languageOptions?.parserOptions},name:"jimmy.codes/astro/disable-type-checked",rules:a.configs.disableTypeChecked.rules},{name:"jimmy.codes/astro/imports",settings:{"import-x/core-modules":["astro:content"]}}]},"astroConfig"),ee=r(()=>[{files:[Q],languageOptions:{globals:d.commonjs},name:"jimmy.codes/commonjs"}],"commonjsConfig"),re={...h.recommended.rules,"@eslint-community/eslint-comments/no-unused-disable":"off","@eslint-community/eslint-comments/require-description":"error"},te=r(()=>[{...h.recommended,name:"jimmy.codes/eslint-comments",rules:re}],"eslintCommentsConfig"),se=r(e=>[{ignores:[...H,...e],name:"jimmy.codes/ignores"}],"ignoresConfig"),oe={...c.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"},ne={name:"jimmy.codes/imports/typescript",rules:c.configs.typescript.rules,settings:{...c.configs.typescript.settings,"import-x/resolver":{...c.configs.typescript.settings["import-x/resolver"],typescript:!0}}},ie=r(({typescript:e=!1}={})=>[{name:"jimmy.codes/imports",plugins:{"import-x":c,n:v},rules:oe},...e?[ne]:[]],"importsConfig"),ae={...$.configs.recommended.rules,"array-callback-return":["error",{allowImplicit:!0}],"arrow-body-style":["error","always"],curly:["error","all"],"no-console":"warn","no-self-compare":"error","no-template-curly-in-string":"error","no-unmodified-loop-condition":"error","no-unreachable-loop":"error","no-use-before-define":["error",{allowNamedExports:!1,classes:!1,functions:!1,variables:!0}],"no-useless-rename":"error","object-shorthand":"error","prefer-arrow-callback":"error"},ce=r(()=>[{linterOptions:{reportUnusedDisableDirectives:!0},name:"jimmy.codes/javascript",rules:ae}],"javascriptConfig"),pe={"n/no-process-exit":"off","n/prefer-node-protocol":"error"},le=r(()=>[{name:"jimmy.codes/node",plugins:{n:v},rules:pe}],"nodeConfig"),fe={...k.configs["recommended-natural"].rules,"perfectionist/sort-imports":["error",{customGroups:{type:{},value:{}},environment:"node",groups:["builtin","type","external","internal-type","internal",["parent-type","sibling-type","index-type"],["parent","sibling","index"],"object","unknown"],internalPattern:["~/**","@/**"],order:"asc",type:"natural"}]},ue=r(()=>[{name:"jimmy.codes/perfectionist",plugins:{perfectionist:k},rules:fe}],"perfectionistConfig"),me=r(()=>[{name:"jimmy.codes/prettier",...F}],"prettierConfig"),de=r(()=>n.isPackageExists("typescript"),"hasTypescript"),ye=r(()=>n.isPackageExists("react"),"hasReact"),C=r(()=>n.isPackageExists("vitest"),"hasVitest"),T=r(()=>n.isPackageExists("jest"),"hasJest"),ge=r(()=>C()||T(),"hasTesting"),je=r(()=>K.some(e=>n.isPackageExists(e)),"hasTestingLibrary"),be=r(()=>n.isPackageExists("@tanstack/react-query"),"hasReactQuery"),xe=r(()=>n.isPackageExists("astro"),"hasAstro"),he=r(e=>e===2?"error":e===1?"warn":"off","toStringSeverity"),R=r((e={})=>Object.fromEntries(Object.entries(e).map(([t,s])=>[t,typeof s=="number"?he(s):s])),"normalizeRuleEntries"),ve={...m.configs.recommended.rules,...R(y.configs.flat?.recommended?.rules),...R(y.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}]},ke=r(({utilities:e=[]}={},t=!0)=>{const s=e.includes("@tanstack/query")||t&&be();return[{files:[j,E],languageOptions:{globals:{...d.browser},parserOptions:{ecmaFeatures:{jsx:!0},jsxPragma:null}},name:"jimmy.codes/react",plugins:{"jsx-a11y":m,react:y,"react-hooks":V,"react-refresh":U},rules:ve,settings:{react:{version:"detect"}}},...s?[{files:[j,E],name:"jimmy.codes/react/query",plugins:{"@tanstack/query":J},rules:{"@tanstack/query/exhaustive-deps":"error","@tanstack/query/no-rest-destructuring":"warn","@tanstack/query/stable-query-client":"error"}}]:[]]},"reactConfig"),L={...p.configs["flat/recommended"].rules,...p.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"},qe=r(()=>[{files:l,name:"jimmy.codes/testing/testing-library",plugins:{"jest-dom":w,"testing-library":q},rules:{...q.configs.react.rules,...w.configs["flat/recommended"].rules}},{files:_,name:"jimmy.codes/testing/testing-library/disabled",rules:{"testing-library/prefer-screen-queries":"off"}}],"testingLibraryConfig"),Oe=r(({framework:e="vitest",utilities:t}={},s=!0)=>{const i=s?C():e==="vitest",f=e==="jest"||s&&T(),u=!!t?.includes("testing-library")||s&&je();return[{files:l,name:"jimmy.codes/testing",...p.configs["flat/recommended"]},...i?[{files:l,name:"jimmy.codes/testing/vitest",...p.configs["flat/recommended"],rules:{...L,"jest/no-deprecated-functions":"off","jest/require-hook":["error",{allowedFunctionCalls:Y}]}}]:[],...f?[{files:l,name:"jimmy.codes/testing/jest",...p.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"}},...u?qe():[]]},"testingConfig"),we=r(e=>[...a.configs.strictTypeChecked,...a.configs.stylisticTypeChecked.filter(t=>t.name==="typescript-eslint/stylistic-type-checked"),{languageOptions:{parserOptions:{project:e.project,tsconfigRootDir:process.cwd()}},name:"jimmy.codes/typescript",rules:{"@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-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"}},{files:[M,j],...a.configs.disableTypeChecked},{files:l,name:"jimmy.codes/typescript/testing",rules:{"@typescript-eslint/no-unsafe-argument":"off","@typescript-eslint/no-unsafe-assignment":"off"}}],"typescriptConfig"),Ee={...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"},_e=r(()=>[{...O.configs["flat/recommended"],name:"jimmy.codes/unicorn",rules:Ee}],"unicornConfig"),Ce=r(e=>typeof e=="object"?e:{project:"./tsconfig.json"},"typescriptOptions"),Te=r(e=>typeof e=="object"?e:{framework:"vitest"},"testingOptions"),Re=r(e=>typeof e=="object"?e:{utilities:[]},"reactOptions"),Le=r(({astro:e=!1,autoDetect:t=!0,configs:s=[],ignores:i=[],react:f=!1,testing:u=!1,typescript:b=!1}={},...S)=>{const x=b||t&&de(),P=f||t&&ye(),A=u||t&&ge(),G=e||t&&xe();return[ce(),ue(),le(),_e(),te(),ie({typescript:x}),x?we(Ce(b)):[],P?ke(Re(f),t):[],G?Z():[],A?Oe(Te(u),t):[],me(),ee(),se(i),s,S].flat()},"jimmyDotCodes");module.exports=Le;
1
+ "use strict";var I=Object.create;var d=Object.defineProperty;var $=Object.getOwnPropertyDescriptor;var N=Object.getOwnPropertyNames;var F=Object.getPrototypeOf,J=Object.prototype.hasOwnProperty;var r=(e,t)=>d(e,"name",{value:t,configurable:!0});var V=(e,t,s,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of N(t))!J.call(e,o)&&o!==s&&d(e,o,{get:()=>t[o],enumerable:!(a=$(t,o))||a.enumerable});return e};var h=(e,t,s)=>(s=e!=null?I(F(e)):{},V(t||!e||!e.__esModule?d(s,"default",{value:e,enumerable:!0}):s,e));var m=require("eslint-plugin-jsx-a11y"),y=require("globals"),c=require("typescript-eslint"),v=require("@eslint-community/eslint-plugin-eslint-comments/configs"),p=require("eslint-plugin-import-x"),k=require("eslint-plugin-n"),X=require("@eslint/js"),q=require("eslint-plugin-perfectionist"),U=require("eslint-config-prettier"),z=require("@tanstack/eslint-plugin-query"),g=require("eslint-plugin-react"),H=require("eslint-plugin-react-hooks"),M=require("eslint-plugin-react-refresh"),i=require("local-pkg"),l=require("eslint-plugin-jest"),w=require("eslint-plugin-jest-dom"),C=require("eslint-plugin-testing-library"),E=require("eslint-plugin-unicorn");const n="?([cm])[jt]s?(x)",Q=["**/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",j="**/*.?([cm])jsx",O="**/*.?([cm])tsx",f=[`**/__tests__/**/*.${n}`,`**/*.spec.${n}`,`**/*.test.${n}`,`**/*.bench.${n}`,`**/*.benchmark.${n}`],_=[`**/e2e/**/*.spec.${n}`,`**/e2e/**/*.test.${n}`,`**/cypress/**/*.spec.${n}`,`**/cypress/**/*.test.${n}`],Y="**/*.cjs",D="**/*.astro",K=["vi.mock","describe","expect","it"],Z=["@testing-library/react"],ee=r(async()=>{const e=[D],[t,s]=await Promise.all([import("eslint-plugin-astro"),import("astro-eslint-parser")]);return[{files:e,languageOptions:{globals:{...y.node,Astro:!1,Fragment:!1},parser:s,parserOptions:{extraFileExtensions:[".astro"],parser:c.parser},sourceType:"module"},name:"jimmy.codes/astro",plugins:{astro:t,"jsx-a11y":m},processor:"astro/client-side-ts",rules:{...m.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.configs.disableTypeChecked.languageOptions?.parserOptions},name:"jimmy.codes/astro/disable-type-checked",rules:c.configs.disableTypeChecked.rules},{name:"jimmy.codes/astro/imports",settings:{"import-x/core-modules":["astro:content"]}}]},"astroConfig"),re=r(()=>[{files:[Y],languageOptions:{globals:y.commonjs},name:"jimmy.codes/commonjs"}],"commonjsConfig"),te={...v.recommended.rules,"@eslint-community/eslint-comments/no-unused-disable":"off","@eslint-community/eslint-comments/require-description":"error"},se=r(()=>[{...v.recommended,name:"jimmy.codes/eslint-comments",rules:te}],"eslintCommentsConfig"),oe=r(e=>[{ignores:[...Q,...e],name:"jimmy.codes/ignores"}],"ignoresConfig"),ne={...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"},ie={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}}},ae=r(({typescript:e=!1}={})=>[{name:"jimmy.codes/imports",plugins:{"import-x":p,n:k},rules:ne},...e?[ie]:[]],"importsConfig"),ce={...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"},pe=r(()=>[{linterOptions:{reportUnusedDisableDirectives:!0},name:"jimmy.codes/javascript",rules:ce}],"javascriptConfig"),le={"n/no-process-exit":"off","n/prefer-node-protocol":"error"},fe=r(()=>[{name:"jimmy.codes/node",plugins:{n:k},rules:le}],"nodeConfig"),ue={...q.configs["recommended-natural"].rules,"perfectionist/sort-imports":["error",{customGroups:{type:{},value:{}},environment:"node",groups:["builtin","type","external","internal-type","internal",["parent-type","sibling-type","index-type"],["parent","sibling","index"],"object","unknown"],internalPattern:["~/**","@/**"],order:"asc",type:"natural"}]},me=r(()=>[{name:"jimmy.codes/perfectionist",plugins:{perfectionist:q},rules:ue}],"perfectionistConfig"),de=r(()=>[{name:"jimmy.codes/prettier",...U}],"prettierConfig"),ye=r(()=>i.isPackageExists("typescript"),"hasTypescript"),ge=r(()=>i.isPackageExists("react"),"hasReact"),T=r(()=>i.isPackageExists("vitest"),"hasVitest"),R=r(()=>i.isPackageExists("jest"),"hasJest"),je=r(()=>T()||R(),"hasTesting"),xe=r(()=>Z.some(e=>i.isPackageExists(e)),"hasTestingLibrary"),be=r(()=>i.isPackageExists("@tanstack/react-query"),"hasReactQuery"),he=r(()=>i.isPackageExists("astro"),"hasAstro"),ve=r(e=>e===2?"error":e===1?"warn":"off","toStringSeverity"),L=r((e={})=>Object.fromEntries(Object.entries(e).map(([t,s])=>[t,typeof s=="number"?ve(s):s])),"normalizeRuleEntries"),ke={...m.configs.recommended.rules,...L(g.configs.flat?.recommended?.rules),...L(g.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}]},qe=r(({utilities:e=[]}={},t=!0)=>{const s=e.includes("@tanstack/query")||t&&be();return[{files:[j,O],languageOptions:{globals:{...y.browser},parserOptions:{ecmaFeatures:{jsx:!0},jsxPragma:null}},name:"jimmy.codes/react",plugins:{"jsx-a11y":m,react:g,"react-hooks":H,"react-refresh":M},rules:ke,settings:{react:{version:"detect"}}},...s?[{files:[j,O],name:"jimmy.codes/react/query",plugins:{"@tanstack/query":z},rules:{"@tanstack/query/exhaustive-deps":"error","@tanstack/query/no-rest-destructuring":"warn","@tanstack/query/stable-query-client":"error"}}]:[]]},"reactConfig"),S={...l.configs["flat/recommended"].rules,...l.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"},we=r(()=>[{files:f,name:"jimmy.codes/testing/testing-library",plugins:{"jest-dom":w,"testing-library":C},rules:{...C.configs.react.rules,...w.configs["flat/recommended"].rules}},{files:_,name:"jimmy.codes/testing/testing-library/disabled",rules:{"testing-library/prefer-screen-queries":"off"}}],"testingLibraryConfig"),Ce=r(({framework:e="vitest",utilities:t}={},s=!0)=>{const a=s?T():e==="vitest",o=e==="jest"||s&&R(),u=!!t?.includes("testing-library")||s&&xe();return[{files:f,name:"jimmy.codes/testing",...l.configs["flat/recommended"]},...a?[{files:f,name:"jimmy.codes/testing/vitest",...l.configs["flat/recommended"],rules:{...S,"jest/no-deprecated-functions":"off","jest/require-hook":["error",{allowedFunctionCalls:K}]}}]:[],...o?[{files:f,name:"jimmy.codes/testing/jest",...l.configs["flat/recommended"],rules:S}]:[],{files:_,name:"jimmy.codes/testing/disabled",rules:{"jest/expect-expect":"off","jest/no-deprecated-functions":"off","jest/require-hook":"off"}},...u?we():[]]},"testingConfig"),Ee=r(e=>[...c.configs.strictTypeChecked,...c.configs.stylisticTypeChecked.filter(t=>t.name==="typescript-eslint/stylistic-type-checked"),{languageOptions:{parserOptions:{project:e.project,tsconfigRootDir:process.cwd()}},name:"jimmy.codes/typescript",rules:{"@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-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"}},{files:[W,j],...c.configs.disableTypeChecked},{files:f,name:"jimmy.codes/typescript/testing",rules:{"@typescript-eslint/no-unsafe-argument":"off","@typescript-eslint/no-unsafe-assignment":"off"}}],"typescriptConfig"),Oe={...E.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"},_e=r(()=>[{...E.configs["flat/recommended"],name:"jimmy.codes/unicorn",rules:Oe}],"unicornConfig"),Te=r(e=>typeof e=="object"?e:{project:"./tsconfig.json"},"typescriptOptions"),Re=r(e=>typeof e=="object"?e:{framework:"vitest"},"testingOptions"),Le=r(e=>typeof e=="object"?e:{utilities:[]},"reactOptions"),Se=r(async({astro:e=!1,autoDetect:t=!0,configs:s=[],ignores:a=[],react:o=!1,testing:u=!1,typescript:x=!1}={},...P)=>{const b=x||t&&ye(),G=o||t&&ge(),A=u||t&&je(),B=e||t&&he();return[pe(),me(),fe(),_e(),se(),ae({typescript:b}),b?Ee(Te(x)):[],G?qe(Le(o),t):[],B?await ee():[],A?Ce(Re(u),t):[],de(),re(),oe(a),s,P].flat()},"jimmyDotCodes");module.exports=Se;
package/dist/index.d.cts CHANGED
@@ -1,12 +1,8 @@
1
- import * as eslint_plugin_testing_library from 'eslint-plugin-testing-library';
2
- import * as eslint_plugin_jest_dom from 'eslint-plugin-jest-dom';
3
- import * as eslint_plugin_react_refresh from 'eslint-plugin-react-refresh';
4
- import * as eslint_plugin_react_hooks from 'eslint-plugin-react-hooks';
5
1
  import * as eslint_plugin_react from 'eslint-plugin-react';
6
2
  import * as eslint_plugin_n from 'eslint-plugin-n';
7
3
  import * as eslint_plugin_import_x_utils_module_visitor_js from 'eslint-plugin-import-x/utils/module-visitor.js';
8
4
  import * as eslint_plugin_import_x_types_js from 'eslint-plugin-import-x/types.js';
9
- import * as eslint_plugin_jsx_a11y from 'eslint-plugin-jsx-a11y';
5
+ import * as eslint_plugin_astro from 'eslint-plugin-astro';
10
6
  import * as eslint from 'eslint';
11
7
  import { Linter } from 'eslint';
12
8
  import * as astro_eslint_parser from 'astro-eslint-parser';
@@ -9864,7 +9860,7 @@ interface Options {
9864
9860
  typescript?: boolean | TypescriptOptions;
9865
9861
  }
9866
9862
 
9867
- declare const jimmyDotCodes: ({ astro, autoDetect, configs, ignores, react, testing, typescript, }?: Options, ...moreConfigs: Linter.Config[] | TypedConfigItem[]) => (TypedConfigItem | Linter.Config<Linter.RulesRecord> | _typescript_eslint_utils_ts_eslint.FlatConfig.Config | {
9863
+ declare const jimmyDotCodes: ({ astro, autoDetect, configs, ignores, react, testing, typescript, }?: Options, ...moreConfigs: Linter.Config[] | TypedConfigItem[]) => Promise<(TypedConfigItem | Linter.Config<Linter.RulesRecord> | _typescript_eslint_utils_ts_eslint.FlatConfig.Config | {
9868
9864
  files: string[];
9869
9865
  languageOptions: {
9870
9866
  globals: {
@@ -9945,7 +9941,16 @@ declare const jimmyDotCodes: ({ astro, autoDetect, configs, ignores, react, test
9945
9941
  WritableStreamDefaultController: false;
9946
9942
  WritableStreamDefaultWriter: false;
9947
9943
  };
9948
- parser: typeof astro_eslint_parser;
9944
+ parser: {
9945
+ default: typeof astro_eslint_parser;
9946
+ ParseError: typeof astro_eslint_parser.ParseError;
9947
+ VisitorKeys: eslint.SourceCode.VisitorKeys;
9948
+ meta: typeof astro_eslint_parser.meta;
9949
+ name: string;
9950
+ parseForESLint: typeof astro_eslint_parser.parseForESLint;
9951
+ parseTemplate: typeof astro_eslint_parser.parseTemplate;
9952
+ traverseNodes: typeof astro_eslint_parser.traverseNodes;
9953
+ };
9949
9954
  parserOptions: {
9950
9955
  extraFileExtensions: string[];
9951
9956
  parser: _typescript_eslint_utils_ts_eslint.Parser.LooseParserModule;
@@ -9954,42 +9959,12 @@ declare const jimmyDotCodes: ({ astro, autoDetect, configs, ignores, react, test
9954
9959
  };
9955
9960
  name: string;
9956
9961
  plugins: {
9957
- astro: {
9958
- meta: {
9959
- name: string;
9960
- version: string;
9961
- };
9962
- environments: {
9963
- astro: {
9964
- globals: {
9965
- Astro: boolean;
9966
- Fragment: boolean;
9967
- };
9968
- };
9969
- };
9970
- rules: {
9971
- [key: string]: eslint.Rule.RuleModule;
9972
- };
9973
- processors: {
9974
- ".astro": Linter.Processor<string | Linter.ProcessorFile>;
9975
- astro: Linter.Processor<string | Linter.ProcessorFile>;
9976
- "client-side-ts": Linter.Processor<string | Linter.ProcessorFile>;
9977
- };
9978
- } & {
9962
+ astro: typeof eslint_plugin_astro;
9963
+ "jsx-a11y": {
9979
9964
  configs: {
9980
- base: Linter.Config[];
9981
- recommended: Linter.Config[];
9982
- all: Linter.Config[];
9983
- "jsx-a11y-strict": Linter.Config[];
9984
- "jsx-a11y-recommended": Linter.Config[];
9985
- "flat/base": Linter.Config[];
9986
- "flat/recommended": Linter.Config[];
9987
- "flat/all": Linter.Config[];
9988
- "flat/jsx-a11y-strict": Linter.Config[];
9989
- "flat/jsx-a11y-recommended": Linter.Config[];
9965
+ recommended: Linter.Config<Linter.RulesRecord>;
9990
9966
  };
9991
9967
  };
9992
- "jsx-a11y": typeof eslint_plugin_jsx_a11y;
9993
9968
  };
9994
9969
  processor: string;
9995
9970
  rules: {
@@ -11702,7 +11677,11 @@ declare const jimmyDotCodes: ({ astro, autoDetect, configs, ignores, react, test
11702
11677
  };
11703
11678
  name: string;
11704
11679
  plugins: {
11705
- "jsx-a11y": typeof eslint_plugin_jsx_a11y;
11680
+ "jsx-a11y": {
11681
+ configs: {
11682
+ recommended: Linter.Config<Linter.RulesRecord>;
11683
+ };
11684
+ };
11706
11685
  react: {
11707
11686
  deprecatedRules: Partial<{
11708
11687
  'boolean-prop-naming': eslint.Rule.RuleModule;
@@ -12075,8 +12054,20 @@ declare const jimmyDotCodes: ({ astro, autoDetect, configs, ignores, react, test
12075
12054
  flat?: Record<string, eslint_plugin_react.ReactFlatConfig>;
12076
12055
  };
12077
12056
  };
12078
- "react-hooks": typeof eslint_plugin_react_hooks;
12079
- "react-refresh": typeof eslint_plugin_react_refresh;
12057
+ "react-hooks": {
12058
+ configs: {
12059
+ recommended: {
12060
+ recommended: {
12061
+ plugins: Record<string, eslint.ESLint.Plugin>;
12062
+ rules: {
12063
+ "exhaustive-deps": Linter.RuleEntry;
12064
+ "rules-of-hooks": Linter.RuleEntry;
12065
+ };
12066
+ };
12067
+ };
12068
+ };
12069
+ };
12070
+ "react-refresh": eslint.ESLint.Plugin;
12080
12071
  "@tanstack/query"?: undefined;
12081
12072
  };
12082
12073
  rules: {
@@ -12180,11 +12171,19 @@ declare const jimmyDotCodes: ({ astro, autoDetect, configs, ignores, react, test
12180
12171
  files: string[];
12181
12172
  name: string;
12182
12173
  plugins: {
12183
- "jest-dom": typeof eslint_plugin_jest_dom;
12184
- "testing-library": typeof eslint_plugin_testing_library;
12174
+ "jest-dom": {
12175
+ configs: {
12176
+ "flat/recommended": Linter.Config<Linter.RulesRecord>;
12177
+ };
12178
+ };
12179
+ "testing-library": {
12180
+ configs: {
12181
+ react: Linter.Config<Linter.RulesRecord>;
12182
+ };
12183
+ };
12185
12184
  };
12186
12185
  rules: {
12187
- [x: string]: Linter.RuleEntry<any[]>;
12186
+ [x: string]: Linter.RuleEntry<any[]> | undefined;
12188
12187
  "testing-library/prefer-screen-queries"?: undefined;
12189
12188
  };
12190
12189
  } | {
@@ -12326,6 +12325,6 @@ declare const jimmyDotCodes: ({ astro, autoDetect, configs, ignores, react, test
12326
12325
  processor?: string | Linter.Processor;
12327
12326
  plugins?: Record<string, eslint.ESLint.Plugin>;
12328
12327
  settings?: Record<string, unknown>;
12329
- })[];
12328
+ })[]>;
12330
12329
 
12331
12330
  export { type Options, type ReactOptions, type Rules, type TestingOptions, type TypedConfigItem, type TypescriptOptions, jimmyDotCodes as default };
package/dist/index.d.mts CHANGED
@@ -1,12 +1,8 @@
1
- import * as eslint_plugin_testing_library from 'eslint-plugin-testing-library';
2
- import * as eslint_plugin_jest_dom from 'eslint-plugin-jest-dom';
3
- import * as eslint_plugin_react_refresh from 'eslint-plugin-react-refresh';
4
- import * as eslint_plugin_react_hooks from 'eslint-plugin-react-hooks';
5
1
  import * as eslint_plugin_react from 'eslint-plugin-react';
6
2
  import * as eslint_plugin_n from 'eslint-plugin-n';
7
3
  import * as eslint_plugin_import_x_utils_module_visitor_js from 'eslint-plugin-import-x/utils/module-visitor.js';
8
4
  import * as eslint_plugin_import_x_types_js from 'eslint-plugin-import-x/types.js';
9
- import * as eslint_plugin_jsx_a11y from 'eslint-plugin-jsx-a11y';
5
+ import * as eslint_plugin_astro from 'eslint-plugin-astro';
10
6
  import * as eslint from 'eslint';
11
7
  import { Linter } from 'eslint';
12
8
  import * as astro_eslint_parser from 'astro-eslint-parser';
@@ -9864,7 +9860,7 @@ interface Options {
9864
9860
  typescript?: boolean | TypescriptOptions;
9865
9861
  }
9866
9862
 
9867
- declare const jimmyDotCodes: ({ astro, autoDetect, configs, ignores, react, testing, typescript, }?: Options, ...moreConfigs: Linter.Config[] | TypedConfigItem[]) => (TypedConfigItem | Linter.Config<Linter.RulesRecord> | _typescript_eslint_utils_ts_eslint.FlatConfig.Config | {
9863
+ declare const jimmyDotCodes: ({ astro, autoDetect, configs, ignores, react, testing, typescript, }?: Options, ...moreConfigs: Linter.Config[] | TypedConfigItem[]) => Promise<(TypedConfigItem | Linter.Config<Linter.RulesRecord> | _typescript_eslint_utils_ts_eslint.FlatConfig.Config | {
9868
9864
  files: string[];
9869
9865
  languageOptions: {
9870
9866
  globals: {
@@ -9945,7 +9941,16 @@ declare const jimmyDotCodes: ({ astro, autoDetect, configs, ignores, react, test
9945
9941
  WritableStreamDefaultController: false;
9946
9942
  WritableStreamDefaultWriter: false;
9947
9943
  };
9948
- parser: typeof astro_eslint_parser;
9944
+ parser: {
9945
+ default: typeof astro_eslint_parser;
9946
+ ParseError: typeof astro_eslint_parser.ParseError;
9947
+ VisitorKeys: eslint.SourceCode.VisitorKeys;
9948
+ meta: typeof astro_eslint_parser.meta;
9949
+ name: string;
9950
+ parseForESLint: typeof astro_eslint_parser.parseForESLint;
9951
+ parseTemplate: typeof astro_eslint_parser.parseTemplate;
9952
+ traverseNodes: typeof astro_eslint_parser.traverseNodes;
9953
+ };
9949
9954
  parserOptions: {
9950
9955
  extraFileExtensions: string[];
9951
9956
  parser: _typescript_eslint_utils_ts_eslint.Parser.LooseParserModule;
@@ -9954,42 +9959,12 @@ declare const jimmyDotCodes: ({ astro, autoDetect, configs, ignores, react, test
9954
9959
  };
9955
9960
  name: string;
9956
9961
  plugins: {
9957
- astro: {
9958
- meta: {
9959
- name: string;
9960
- version: string;
9961
- };
9962
- environments: {
9963
- astro: {
9964
- globals: {
9965
- Astro: boolean;
9966
- Fragment: boolean;
9967
- };
9968
- };
9969
- };
9970
- rules: {
9971
- [key: string]: eslint.Rule.RuleModule;
9972
- };
9973
- processors: {
9974
- ".astro": Linter.Processor<string | Linter.ProcessorFile>;
9975
- astro: Linter.Processor<string | Linter.ProcessorFile>;
9976
- "client-side-ts": Linter.Processor<string | Linter.ProcessorFile>;
9977
- };
9978
- } & {
9962
+ astro: typeof eslint_plugin_astro;
9963
+ "jsx-a11y": {
9979
9964
  configs: {
9980
- base: Linter.Config[];
9981
- recommended: Linter.Config[];
9982
- all: Linter.Config[];
9983
- "jsx-a11y-strict": Linter.Config[];
9984
- "jsx-a11y-recommended": Linter.Config[];
9985
- "flat/base": Linter.Config[];
9986
- "flat/recommended": Linter.Config[];
9987
- "flat/all": Linter.Config[];
9988
- "flat/jsx-a11y-strict": Linter.Config[];
9989
- "flat/jsx-a11y-recommended": Linter.Config[];
9965
+ recommended: Linter.Config<Linter.RulesRecord>;
9990
9966
  };
9991
9967
  };
9992
- "jsx-a11y": typeof eslint_plugin_jsx_a11y;
9993
9968
  };
9994
9969
  processor: string;
9995
9970
  rules: {
@@ -11702,7 +11677,11 @@ declare const jimmyDotCodes: ({ astro, autoDetect, configs, ignores, react, test
11702
11677
  };
11703
11678
  name: string;
11704
11679
  plugins: {
11705
- "jsx-a11y": typeof eslint_plugin_jsx_a11y;
11680
+ "jsx-a11y": {
11681
+ configs: {
11682
+ recommended: Linter.Config<Linter.RulesRecord>;
11683
+ };
11684
+ };
11706
11685
  react: {
11707
11686
  deprecatedRules: Partial<{
11708
11687
  'boolean-prop-naming': eslint.Rule.RuleModule;
@@ -12075,8 +12054,20 @@ declare const jimmyDotCodes: ({ astro, autoDetect, configs, ignores, react, test
12075
12054
  flat?: Record<string, eslint_plugin_react.ReactFlatConfig>;
12076
12055
  };
12077
12056
  };
12078
- "react-hooks": typeof eslint_plugin_react_hooks;
12079
- "react-refresh": typeof eslint_plugin_react_refresh;
12057
+ "react-hooks": {
12058
+ configs: {
12059
+ recommended: {
12060
+ recommended: {
12061
+ plugins: Record<string, eslint.ESLint.Plugin>;
12062
+ rules: {
12063
+ "exhaustive-deps": Linter.RuleEntry;
12064
+ "rules-of-hooks": Linter.RuleEntry;
12065
+ };
12066
+ };
12067
+ };
12068
+ };
12069
+ };
12070
+ "react-refresh": eslint.ESLint.Plugin;
12080
12071
  "@tanstack/query"?: undefined;
12081
12072
  };
12082
12073
  rules: {
@@ -12180,11 +12171,19 @@ declare const jimmyDotCodes: ({ astro, autoDetect, configs, ignores, react, test
12180
12171
  files: string[];
12181
12172
  name: string;
12182
12173
  plugins: {
12183
- "jest-dom": typeof eslint_plugin_jest_dom;
12184
- "testing-library": typeof eslint_plugin_testing_library;
12174
+ "jest-dom": {
12175
+ configs: {
12176
+ "flat/recommended": Linter.Config<Linter.RulesRecord>;
12177
+ };
12178
+ };
12179
+ "testing-library": {
12180
+ configs: {
12181
+ react: Linter.Config<Linter.RulesRecord>;
12182
+ };
12183
+ };
12185
12184
  };
12186
12185
  rules: {
12187
- [x: string]: Linter.RuleEntry<any[]>;
12186
+ [x: string]: Linter.RuleEntry<any[]> | undefined;
12188
12187
  "testing-library/prefer-screen-queries"?: undefined;
12189
12188
  };
12190
12189
  } | {
@@ -12326,6 +12325,6 @@ declare const jimmyDotCodes: ({ astro, autoDetect, configs, ignores, react, test
12326
12325
  processor?: string | Linter.Processor;
12327
12326
  plugins?: Record<string, eslint.ESLint.Plugin>;
12328
12327
  settings?: Record<string, unknown>;
12329
- })[];
12328
+ })[]>;
12330
12329
 
12331
12330
  export { type Options, type ReactOptions, type Rules, type TestingOptions, type TypedConfigItem, type TypescriptOptions, jimmyDotCodes as default };
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- var B=Object.defineProperty;var r=(e,t)=>B(e,"name",{value:t,configurable:!0});import*as I from"astro-eslint-parser";import $ from"eslint-plugin-astro";import m from"eslint-plugin-jsx-a11y";import d from"globals";import{parser as N,configs as i}from"typescript-eslint";import x from"@eslint-community/eslint-plugin-eslint-comments/configs";import c from"eslint-plugin-import-x";import h from"eslint-plugin-n";import P from"@eslint/js";import k from"eslint-plugin-perfectionist";import F from"eslint-config-prettier";import J from"@tanstack/eslint-plugin-query";import y from"eslint-plugin-react";import V from"eslint-plugin-react-hooks";import*as X from"eslint-plugin-react-refresh";import{isPackageExists as n}from"local-pkg";import a from"eslint-plugin-jest";import*as v from"eslint-plugin-jest-dom";import w from"eslint-plugin-testing-library";import C from"eslint-plugin-unicorn";const s="?([cm])[jt]s?(x)",U=["**/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"],z="**/*.?([cm])js",g="**/*.?([cm])jsx",O="**/*.?([cm])tsx",p=[`**/__tests__/**/*.${s}`,`**/*.spec.${s}`,`**/*.test.${s}`,`**/*.bench.${s}`,`**/*.benchmark.${s}`],_=[`**/e2e/**/*.spec.${s}`,`**/e2e/**/*.test.${s}`,`**/cypress/**/*.spec.${s}`,`**/cypress/**/*.test.${s}`],H="**/*.cjs",M="**/*.astro",Q=["vi.mock","describe","expect","it"],W=["@testing-library/react"],Y=r(()=>{const e=[M];return[{files:e,languageOptions:{globals:{...d.node,Astro:!1,Fragment:!1},parser:I,parserOptions:{extraFileExtensions:[".astro"],parser:N},sourceType:"module"},name:"jimmy.codes/astro",plugins:{astro:$,"jsx-a11y":m},processor:"astro/client-side-ts",rules:{...m.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:i.disableTypeChecked.languageOptions?.parserOptions},name:"jimmy.codes/astro/disable-type-checked",rules:i.disableTypeChecked.rules},{name:"jimmy.codes/astro/imports",settings:{"import-x/core-modules":["astro:content"]}}]},"astroConfig"),D=r(()=>[{files:[H],languageOptions:{globals:d.commonjs},name:"jimmy.codes/commonjs"}],"commonjsConfig"),K={...x.recommended.rules,"@eslint-community/eslint-comments/no-unused-disable":"off","@eslint-community/eslint-comments/require-description":"error"},Z=r(()=>[{...x.recommended,name:"jimmy.codes/eslint-comments",rules:K}],"eslintCommentsConfig"),ee=r(e=>[{ignores:[...U,...e],name:"jimmy.codes/ignores"}],"ignoresConfig"),re={...c.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"},te={name:"jimmy.codes/imports/typescript",rules:c.configs.typescript.rules,settings:{...c.configs.typescript.settings,"import-x/resolver":{...c.configs.typescript.settings["import-x/resolver"],typescript:!0}}},oe=r(({typescript:e=!1}={})=>[{name:"jimmy.codes/imports",plugins:{"import-x":c,n:h},rules:re},...e?[te]:[]],"importsConfig"),se={...P.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"},ne=r(()=>[{linterOptions:{reportUnusedDisableDirectives:!0},name:"jimmy.codes/javascript",rules:se}],"javascriptConfig"),ie={"n/no-process-exit":"off","n/prefer-node-protocol":"error"},ce=r(()=>[{name:"jimmy.codes/node",plugins:{n:h},rules:ie}],"nodeConfig"),ae={...k.configs["recommended-natural"].rules,"perfectionist/sort-imports":["error",{customGroups:{type:{},value:{}},environment:"node",groups:["builtin","type","external","internal-type","internal",["parent-type","sibling-type","index-type"],["parent","sibling","index"],"object","unknown"],internalPattern:["~/**","@/**"],order:"asc",type:"natural"}]},pe=r(()=>[{name:"jimmy.codes/perfectionist",plugins:{perfectionist:k},rules:ae}],"perfectionistConfig"),fe=r(()=>[{name:"jimmy.codes/prettier",...F}],"prettierConfig"),le=r(()=>n("typescript"),"hasTypescript"),me=r(()=>n("react"),"hasReact"),E=r(()=>n("vitest"),"hasVitest"),T=r(()=>n("jest"),"hasJest"),ue=r(()=>E()||T(),"hasTesting"),de=r(()=>W.some(e=>n(e)),"hasTestingLibrary"),ye=r(()=>n("@tanstack/react-query"),"hasReactQuery"),ge=r(()=>n("astro"),"hasAstro"),je=r(e=>e===2?"error":e===1?"warn":"off","toStringSeverity"),q=r((e={})=>Object.fromEntries(Object.entries(e).map(([t,o])=>[t,typeof o=="number"?je(o):o])),"normalizeRuleEntries"),be={...m.configs.recommended.rules,...q(y.configs.flat?.recommended?.rules),...q(y.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}]},xe=r(({utilities:e=[]}={},t=!0)=>{const o=e.includes("@tanstack/query")||t&&ye();return[{files:[g,O],languageOptions:{globals:{...d.browser},parserOptions:{ecmaFeatures:{jsx:!0},jsxPragma:null}},name:"jimmy.codes/react",plugins:{"jsx-a11y":m,react:y,"react-hooks":V,"react-refresh":X},rules:be,settings:{react:{version:"detect"}}},...o?[{files:[g,O],name:"jimmy.codes/react/query",plugins:{"@tanstack/query":J},rules:{"@tanstack/query/exhaustive-deps":"error","@tanstack/query/no-rest-destructuring":"warn","@tanstack/query/stable-query-client":"error"}}]:[]]},"reactConfig"),R={...a.configs["flat/recommended"].rules,...a.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"},he=r(()=>[{files:p,name:"jimmy.codes/testing/testing-library",plugins:{"jest-dom":v,"testing-library":w},rules:{...w.configs.react.rules,...v.configs["flat/recommended"].rules}},{files:_,name:"jimmy.codes/testing/testing-library/disabled",rules:{"testing-library/prefer-screen-queries":"off"}}],"testingLibraryConfig"),ke=r(({framework:e="vitest",utilities:t}={},o=!0)=>{const u=o?E():e==="vitest",f=e==="jest"||o&&T(),l=!!t?.includes("testing-library")||o&&de();return[{files:p,name:"jimmy.codes/testing",...a.configs["flat/recommended"]},...u?[{files:p,name:"jimmy.codes/testing/vitest",...a.configs["flat/recommended"],rules:{...R,"jest/no-deprecated-functions":"off","jest/require-hook":["error",{allowedFunctionCalls:Q}]}}]:[],...f?[{files:p,name:"jimmy.codes/testing/jest",...a.configs["flat/recommended"],rules:R}]:[],{files:_,name:"jimmy.codes/testing/disabled",rules:{"jest/expect-expect":"off","jest/no-deprecated-functions":"off","jest/require-hook":"off"}},...l?he():[]]},"testingConfig"),ve=r(e=>[...i.strictTypeChecked,...i.stylisticTypeChecked.filter(t=>t.name==="typescript-eslint/stylistic-type-checked"),{languageOptions:{parserOptions:{project:e.project,tsconfigRootDir:process.cwd()}},name:"jimmy.codes/typescript",rules:{"@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-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"}},{files:[z,g],...i.disableTypeChecked},{files:p,name:"jimmy.codes/typescript/testing",rules:{"@typescript-eslint/no-unsafe-argument":"off","@typescript-eslint/no-unsafe-assignment":"off"}}],"typescriptConfig"),we={...C.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"},Ce=r(()=>[{...C.configs["flat/recommended"],name:"jimmy.codes/unicorn",rules:we}],"unicornConfig"),Oe=r(e=>typeof e=="object"?e:{project:"./tsconfig.json"},"typescriptOptions"),_e=r(e=>typeof e=="object"?e:{framework:"vitest"},"testingOptions"),Ee=r(e=>typeof e=="object"?e:{utilities:[]},"reactOptions"),Te=r(({astro:e=!1,autoDetect:t=!0,configs:o=[],ignores:u=[],react:f=!1,testing:l=!1,typescript:j=!1}={},...L)=>{const b=j||t&&le(),S=f||t&&me(),G=l||t&&ue(),A=e||t&&ge();return[ne(),pe(),ce(),Ce(),Z(),oe({typescript:b}),b?ve(Oe(j)):[],S?xe(Ee(f),t):[],A?Y():[],G?ke(_e(l),t):[],fe(),D(),ee(u),o,L].flat()},"jimmyDotCodes");export{Te as default};
1
+ var B=Object.defineProperty;var r=(e,t)=>B(e,"name",{value:t,configurable:!0});import m from"eslint-plugin-jsx-a11y";import d from"globals";import{parser as I,configs as i}from"typescript-eslint";import x from"@eslint-community/eslint-plugin-eslint-comments/configs";import c from"eslint-plugin-import-x";import h from"eslint-plugin-n";import $ from"@eslint/js";import k from"eslint-plugin-perfectionist";import N from"eslint-config-prettier";import P from"@tanstack/eslint-plugin-query";import y from"eslint-plugin-react";import F from"eslint-plugin-react-hooks";import J from"eslint-plugin-react-refresh";import{isPackageExists as n}from"local-pkg";import a from"eslint-plugin-jest";import v from"eslint-plugin-jest-dom";import w from"eslint-plugin-testing-library";import C from"eslint-plugin-unicorn";const s="?([cm])[jt]s?(x)",V=["**/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"],X="**/*.?([cm])js",g="**/*.?([cm])jsx",O="**/*.?([cm])tsx",p=[`**/__tests__/**/*.${s}`,`**/*.spec.${s}`,`**/*.test.${s}`,`**/*.bench.${s}`,`**/*.benchmark.${s}`],_=[`**/e2e/**/*.spec.${s}`,`**/e2e/**/*.test.${s}`,`**/cypress/**/*.spec.${s}`,`**/cypress/**/*.test.${s}`],U="**/*.cjs",z="**/*.astro",H=["vi.mock","describe","expect","it"],M=["@testing-library/react"],Q=r(async()=>{const e=[z],[t,o]=await Promise.all([import("eslint-plugin-astro"),import("astro-eslint-parser")]);return[{files:e,languageOptions:{globals:{...d.node,Astro:!1,Fragment:!1},parser:o,parserOptions:{extraFileExtensions:[".astro"],parser:I},sourceType:"module"},name:"jimmy.codes/astro",plugins:{astro:t,"jsx-a11y":m},processor:"astro/client-side-ts",rules:{...m.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:i.disableTypeChecked.languageOptions?.parserOptions},name:"jimmy.codes/astro/disable-type-checked",rules:i.disableTypeChecked.rules},{name:"jimmy.codes/astro/imports",settings:{"import-x/core-modules":["astro:content"]}}]},"astroConfig"),W=r(()=>[{files:[U],languageOptions:{globals:d.commonjs},name:"jimmy.codes/commonjs"}],"commonjsConfig"),Y={...x.recommended.rules,"@eslint-community/eslint-comments/no-unused-disable":"off","@eslint-community/eslint-comments/require-description":"error"},D=r(()=>[{...x.recommended,name:"jimmy.codes/eslint-comments",rules:Y}],"eslintCommentsConfig"),K=r(e=>[{ignores:[...V,...e],name:"jimmy.codes/ignores"}],"ignoresConfig"),Z={...c.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"},ee={name:"jimmy.codes/imports/typescript",rules:c.configs.typescript.rules,settings:{...c.configs.typescript.settings,"import-x/resolver":{...c.configs.typescript.settings["import-x/resolver"],typescript:!0}}},re=r(({typescript:e=!1}={})=>[{name:"jimmy.codes/imports",plugins:{"import-x":c,n:h},rules:Z},...e?[ee]:[]],"importsConfig"),te={...$.configs.recommended.rules,"array-callback-return":["error",{allowImplicit:!0}],"arrow-body-style":["error","always"],curly:["error","all"],"no-console":"warn","no-self-compare":"error","no-template-curly-in-string":"error","no-unmodified-loop-condition":"error","no-unreachable-loop":"error","no-use-before-define":["error",{allowNamedExports:!1,classes:!1,functions:!1,variables:!0}],"no-useless-rename":"error","object-shorthand":"error","prefer-arrow-callback":"error"},oe=r(()=>[{linterOptions:{reportUnusedDisableDirectives:!0},name:"jimmy.codes/javascript",rules:te}],"javascriptConfig"),se={"n/no-process-exit":"off","n/prefer-node-protocol":"error"},ne=r(()=>[{name:"jimmy.codes/node",plugins:{n:h},rules:se}],"nodeConfig"),ie={...k.configs["recommended-natural"].rules,"perfectionist/sort-imports":["error",{customGroups:{type:{},value:{}},environment:"node",groups:["builtin","type","external","internal-type","internal",["parent-type","sibling-type","index-type"],["parent","sibling","index"],"object","unknown"],internalPattern:["~/**","@/**"],order:"asc",type:"natural"}]},ce=r(()=>[{name:"jimmy.codes/perfectionist",plugins:{perfectionist:k},rules:ie}],"perfectionistConfig"),ae=r(()=>[{name:"jimmy.codes/prettier",...N}],"prettierConfig"),pe=r(()=>n("typescript"),"hasTypescript"),fe=r(()=>n("react"),"hasReact"),E=r(()=>n("vitest"),"hasVitest"),T=r(()=>n("jest"),"hasJest"),le=r(()=>E()||T(),"hasTesting"),me=r(()=>M.some(e=>n(e)),"hasTestingLibrary"),ue=r(()=>n("@tanstack/react-query"),"hasReactQuery"),de=r(()=>n("astro"),"hasAstro"),ye=r(e=>e===2?"error":e===1?"warn":"off","toStringSeverity"),q=r((e={})=>Object.fromEntries(Object.entries(e).map(([t,o])=>[t,typeof o=="number"?ye(o):o])),"normalizeRuleEntries"),ge={...m.configs.recommended.rules,...q(y.configs.flat?.recommended?.rules),...q(y.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}]},je=r(({utilities:e=[]}={},t=!0)=>{const o=e.includes("@tanstack/query")||t&&ue();return[{files:[g,O],languageOptions:{globals:{...d.browser},parserOptions:{ecmaFeatures:{jsx:!0},jsxPragma:null}},name:"jimmy.codes/react",plugins:{"jsx-a11y":m,react:y,"react-hooks":F,"react-refresh":J},rules:ge,settings:{react:{version:"detect"}}},...o?[{files:[g,O],name:"jimmy.codes/react/query",plugins:{"@tanstack/query":P},rules:{"@tanstack/query/exhaustive-deps":"error","@tanstack/query/no-rest-destructuring":"warn","@tanstack/query/stable-query-client":"error"}}]:[]]},"reactConfig"),R={...a.configs["flat/recommended"].rules,...a.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"},be=r(()=>[{files:p,name:"jimmy.codes/testing/testing-library",plugins:{"jest-dom":v,"testing-library":w},rules:{...w.configs.react.rules,...v.configs["flat/recommended"].rules}},{files:_,name:"jimmy.codes/testing/testing-library/disabled",rules:{"testing-library/prefer-screen-queries":"off"}}],"testingLibraryConfig"),xe=r(({framework:e="vitest",utilities:t}={},o=!0)=>{const u=o?E():e==="vitest",f=e==="jest"||o&&T(),l=!!t?.includes("testing-library")||o&&me();return[{files:p,name:"jimmy.codes/testing",...a.configs["flat/recommended"]},...u?[{files:p,name:"jimmy.codes/testing/vitest",...a.configs["flat/recommended"],rules:{...R,"jest/no-deprecated-functions":"off","jest/require-hook":["error",{allowedFunctionCalls:H}]}}]:[],...f?[{files:p,name:"jimmy.codes/testing/jest",...a.configs["flat/recommended"],rules:R}]:[],{files:_,name:"jimmy.codes/testing/disabled",rules:{"jest/expect-expect":"off","jest/no-deprecated-functions":"off","jest/require-hook":"off"}},...l?be():[]]},"testingConfig"),he=r(e=>[...i.strictTypeChecked,...i.stylisticTypeChecked.filter(t=>t.name==="typescript-eslint/stylistic-type-checked"),{languageOptions:{parserOptions:{project:e.project,tsconfigRootDir:process.cwd()}},name:"jimmy.codes/typescript",rules:{"@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-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"}},{files:[X,g],...i.disableTypeChecked},{files:p,name:"jimmy.codes/typescript/testing",rules:{"@typescript-eslint/no-unsafe-argument":"off","@typescript-eslint/no-unsafe-assignment":"off"}}],"typescriptConfig"),ke={...C.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"},ve=r(()=>[{...C.configs["flat/recommended"],name:"jimmy.codes/unicorn",rules:ke}],"unicornConfig"),we=r(e=>typeof e=="object"?e:{project:"./tsconfig.json"},"typescriptOptions"),Ce=r(e=>typeof e=="object"?e:{framework:"vitest"},"testingOptions"),Oe=r(e=>typeof e=="object"?e:{utilities:[]},"reactOptions"),_e=r(async({astro:e=!1,autoDetect:t=!0,configs:o=[],ignores:u=[],react:f=!1,testing:l=!1,typescript:j=!1}={},...L)=>{const b=j||t&&pe(),S=f||t&&fe(),G=l||t&&le(),A=e||t&&de();return[oe(),ce(),ne(),ve(),D(),re({typescript:b}),b?he(we(j)):[],S?je(Oe(f),t):[],A?await Q():[],G?xe(Ce(l),t):[],ae(),W(),K(u),o,L].flat()},"jimmyDotCodes");export{_e as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jimmy.codes/eslint-config",
3
- "version": "3.8.2",
3
+ "version": "3.9.0",
4
4
  "description": "another opinionated eslint config",
5
5
  "keywords": [
6
6
  "eslint",