@jimmy.codes/eslint-config 3.15.0 → 3.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.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 x 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{isPackageExists as a}from"local-pkg";import v from"eslint-plugin-jest";import w from"eslint-plugin-unicorn";const s="?([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",l=[`**/__tests__/**/*.${s}`,`**/*.spec.${s}`,`**/*.test.${s}`,`**/*.bench.${s}`,`**/*.benchmark.${s}`],C=[`**/e2e/**/*.spec.${s}`,`**/e2e/**/*.test.${s}`,`**/cypress/**/*.spec.${s}`,`**/cypress/**/*.test.${s}`],V="**/*.cjs",X="**/*.astro",U=["vi.mock","describe","expect","it"],z=["@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"),n=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"),n(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={...x.recommended.rules,"@eslint-community/eslint-comments/no-unused-disable":"off","@eslint-community/eslint-comments/require-description":"error"},re=r(()=>[{...x.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"),T=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([n(import("eslint-plugin-react")),n(import("eslint-plugin-jsx-a11y"))]);return{...t.configs.recommended.rules,...T(e.configs.flat?.recommended?.rules),...T(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([n(import("eslint-plugin-react")),n(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=r(async()=>{const e=await n(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"),je=r(()=>a("typescript"),"hasTypescript"),be=r(()=>a("react"),"hasReact"),_=r(()=>a("vitest"),"hasVitest"),E=r(()=>a("jest"),"hasJest"),xe=r(()=>_()||E(),"hasTesting"),he=r(()=>z.some(e=>a(e)),"hasTestingLibrary"),ke=r(()=>a("@tanstack/react-query"),"hasReactQuery"),ve=r(()=>a("astro"),"hasAstro"),P={...v.configs["flat/recommended"].rules,...v.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(async({framework:e="vitest"}={},t=!0)=>{const o=await n(import("eslint-plugin-jest")),i=t?_():e==="vitest",f=e==="jest"||t&&E();return[{files:l,name:"jimmy.codes/testing",...o.configs["flat/recommended"]},...i?[{files:l,name:"jimmy.codes/testing/vitest",...o.configs["flat/recommended"],rules:{...P,"jest/no-deprecated-functions":"off","jest/require-hook":["error",{allowedFunctionCalls:U}]}}]:[],...f?[{files:l,name:"jimmy.codes/testing/jest",...o.configs["flat/recommended"],rules:P}]:[],{files:C,name:"jimmy.codes/testing/disabled",rules:{"jest/expect-expect":"off","jest/no-deprecated-functions":"off","jest/require-hook":"off"}}]},"testingConfig"),Oe=r(async()=>{const[e,t]=await Promise.all([import("eslint-plugin-jest-dom"),n(import("eslint-plugin-testing-library"))]);return{...t.configs.react.rules,...e.configs["flat/recommended"].rules}},"testingLibraryRules"),Ce=r(async()=>{const[e,t]=await Promise.all([import("eslint-plugin-jest-dom"),n(import("eslint-plugin-testing-library"))]);return[{files:l,name:"jimmy.codes/testing/testing-library",plugins:{"jest-dom":e,"testing-library":t},rules:await Oe()},{files:C,name:"jimmy.codes/testing/testing-library/disabled",rules:{"testing-library/prefer-screen-queries":"off"}}]},"testingLibrary"),Te={"@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"},_e=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:Te},{files:[Q,u],...c.disableTypeChecked},{files:l,name:"jimmy.codes/typescript/testing",rules:{"@typescript-eslint/no-unsafe-argument":"off","@typescript-eslint/no-unsafe-assignment":"off"}}],"typescriptConfig"),Ee={...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"},Pe=r(()=>[{...w.configs["flat/recommended"],name:"jimmy.codes/unicorn",rules:Ee}],"unicornConfig"),Re=r(async({astro:e=!1,autoDetect:t=!0,configs:o=[],ignores:i=[],react:f=!1,testing:d=!1,typescript:y=!1}={},...R)=>{const L=M(f),g=H(d),j=D(y),b=y||!!j||t&&je(),q=f||t&&be(),S=d||t&&xe(),A=e||t&&ve(),G=W(L)||t&&ke(),I=Y(g)||t&&he();return[ae(),fe(),pe(),Pe(),re(),ne({typescript:b}),b?_e(j):[],q?await ye():[],G?await ge():[],A?await K():[],S?await we(g,t):[],I?await Ce():[],me(),Z(),te(i),o,R].flat()},"jimmyDotCodes");export{Re as default};
1
+ var $=Object.defineProperty;var r=(e,t)=>$(e,"name",{value:t,configurable:!0});import m from"globals";import{parser as N,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 F from"@eslint/js";import k from"eslint-plugin-perfectionist";import J from"eslint-config-prettier";import*as v from"eslint-plugin-regexp";import{isPackageExists as a}from"local-pkg";import w from"eslint-plugin-jest";import O from"eslint-plugin-unicorn";const s="?([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"],V="**/*.?([cm])js",u="**/*.?([cm])jsx",C="**/*.?([cm])tsx",l=[`**/__tests__/**/*.${s}`,`**/*.spec.${s}`,`**/*.test.${s}`,`**/*.bench.${s}`,`**/*.benchmark.${s}`],T=[`**/e2e/**/*.spec.${s}`,`**/e2e/**/*.test.${s}`,`**/cypress/**/*.spec.${s}`,`**/cypress/**/*.test.${s}`],X="**/*.cjs",z="**/*.astro",U=["vi.mock","describe","expect","it"],D=["@testing-library/react"],H=r(e=>typeof e=="object"?e:void 0,"getTypescriptOptions"),M=r(e=>typeof e=="object"?e:{framework:"vitest"},"getTestingOptions"),W=r(e=>typeof e=="object"?e:{utilities:[]},"getReactOptions"),Y=r(e=>!!e.utilities?.includes("@tanstack/query"),"addTanstackQuery"),K=r(e=>!!e.utilities?.includes("testing-library"),"addTestingLibrary"),n=r(async e=>{const t=await e;return t.default??t},"interopDefault"),Z=r(async()=>{const e=[z],[t,o,i]=await Promise.all([import("eslint-plugin-astro"),import("astro-eslint-parser"),n(import("eslint-plugin-jsx-a11y"))]);return[{files:e,languageOptions:{globals:{...m.node,Astro:!1,Fragment:!1},parser:o,parserOptions:{extraFileExtensions:[".astro"],parser:N},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"),ee=r(()=>[{files:[X],languageOptions:{globals:m.commonjs},name:"jimmy.codes/commonjs"}],"commonjsConfig"),re={...b.recommended.rules,"@eslint-community/eslint-comments/no-unused-disable":"off","@eslint-community/eslint-comments/require-description":"error"},te=r(()=>[{...b.recommended,name:"jimmy.codes/eslint-comments",rules:re}],"eslintCommentsConfig"),oe=r(e=>[{ignores:[...Q,...e],name:"jimmy.codes/ignores"}],"ignoresConfig"),se={...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"},ne={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}}},ie=r(({typescript:e=!1}={})=>[{name:"jimmy.codes/imports",plugins:{"import-x":p,n:h},rules:se},...e?[ne]:[]],"importsConfig"),ae={...F.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:h},rules:pe}],"nodeConfig"),fe={...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"},me=r(()=>[{name:"jimmy.codes/perfectionist",plugins:{perfectionist:k},rules:fe}],"perfectionistConfig"),ue=r(()=>[{name:"jimmy.codes/prettier",...J}],"prettierConfig"),de=r(e=>e===2?"error":e===1?"warn":"off","toStringSeverity"),_=r((e={})=>Object.fromEntries(Object.entries(e).map(([t,o])=>[t,typeof o=="number"?de(o):o])),"normalizeRuleEntries"),ye=r(async()=>{const[e,t]=await Promise.all([n(import("eslint-plugin-react")),n(import("eslint-plugin-jsx-a11y"))]);return{...t.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"),ge=r(async()=>{const[e,t,o,i]=await Promise.all([n(import("eslint-plugin-react")),n(import("eslint-plugin-jsx-a11y")),import("eslint-plugin-react-hooks"),import("eslint-plugin-react-refresh")]);return[{files:[u,C],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 ye(),settings:{react:{version:"detect"}}}]},"reactConfig"),je={...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"},xe=r(()=>[{name:"jimmy.codes/regexp",plugins:{regexp:v},rules:je}],"regexpConfig"),be=r(async()=>{const e=await n(import("@tanstack/eslint-plugin-query"));return[{files:[u,C],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"),he=r(()=>a("typescript"),"hasTypescript"),ke=r(()=>a("react"),"hasReact"),E=r(()=>a("vitest"),"hasVitest"),P=r(()=>a("jest"),"hasJest"),ve=r(()=>E()||P(),"hasTesting"),we=r(()=>D.some(e=>a(e)),"hasTestingLibrary"),Oe=r(()=>a("@tanstack/react-query"),"hasReactQuery"),Ce=r(()=>a("astro"),"hasAstro"),R={...w.configs["flat/recommended"].rules,...w.configs["flat/style"].rules,"jest/consistent-test-it":["error",{fn:"test",withinDescribe:"it"}],"jest/no-alias-methods":"error","jest/no-commented-out-tests":"error","jest/no-conditional-in-test":"error","jest/no-confusing-set-timeout":"error","jest/no-duplicate-hooks":"error","jest/no-hooks":"off","jest/no-large-snapshots":"off","jest/no-restricted-jest-methods":"off","jest/no-restricted-matchers":"off","jest/no-test-return-statement":"error","jest/no-untyped-mock-factory":"off","jest/prefer-called-with":"error","jest/prefer-comparison-matcher":"error","jest/prefer-each":"error","jest/prefer-equality-matcher":"error","jest/prefer-expect-assertions":"off","jest/prefer-expect-resolves":"error","jest/prefer-hooks-in-order":"error","jest/prefer-hooks-on-top":"error","jest/prefer-lowercase-title":"off","jest/prefer-mock-promise-shorthand":"error","jest/prefer-snapshot-hint":"error","jest/prefer-spy-on":"off","jest/prefer-strict-equal":"error","jest/prefer-todo":"warn","jest/require-hook":"error","jest/require-to-throw-message":"error","jest/require-top-level-describe":"off","jest/unbound-method":"off"},Te=r(async({framework:e="vitest"}={},t=!0)=>{const o=await n(import("eslint-plugin-jest")),i=t?E():e==="vitest",f=e==="jest"||t&&P();return[{files:l,name:"jimmy.codes/testing",...o.configs["flat/recommended"]},...i?[{files:l,name:"jimmy.codes/testing/vitest",...o.configs["flat/recommended"],rules:{...R,"jest/no-deprecated-functions":"off","jest/require-hook":["error",{allowedFunctionCalls:U}]}}]:[],...f?[{files:l,name:"jimmy.codes/testing/jest",...o.configs["flat/recommended"],rules:R}]:[],{files:T,name:"jimmy.codes/testing/disabled",rules:{"jest/expect-expect":"off","jest/no-deprecated-functions":"off","jest/require-hook":"off"}}]},"testingConfig"),_e=r(async()=>{const[e,t]=await Promise.all([import("eslint-plugin-jest-dom"),n(import("eslint-plugin-testing-library"))]);return{...t.configs.react.rules,...e.configs["flat/recommended"].rules}},"testingLibraryRules"),Ee=r(async()=>{const[e,t]=await Promise.all([import("eslint-plugin-jest-dom"),n(import("eslint-plugin-testing-library"))]);return[{files:l,name:"jimmy.codes/testing/testing-library",plugins:{"jest-dom":e,"testing-library":t},rules:await _e()},{files:T,name:"jimmy.codes/testing/testing-library/disabled",rules:{"testing-library/prefer-screen-queries":"off"}}]},"testingLibrary"),Pe={"@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:Pe},{files:[V,u],...c.disableTypeChecked},{files:l,name:"jimmy.codes/typescript/testing",rules:{"@typescript-eslint/no-unsafe-argument":"off","@typescript-eslint/no-unsafe-assignment":"off"}}],"typescriptConfig"),qe={...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"},Le=r(()=>[{...O.configs["flat/recommended"],name:"jimmy.codes/unicorn",rules:qe}],"unicornConfig"),Se=r(async({astro:e=!1,autoDetect:t=!0,configs:o=[],ignores:i=[],react:f=!1,testing:d=!1,typescript:y=!1}={},...q)=>{const L=W(f),g=M(d),j=H(y),x=y||!!j||t&&he(),S=f||t&&ke(),A=d||t&&ve(),G=e||t&&Ce(),I=Y(L)||t&&Oe(),B=K(g)||t&&we();return[ce(),me(),le(),Le(),te(),xe(),ie({typescript:x}),x?Re(j):[],S?await ge():[],I?await be():[],G?await Z():[],A?await Te(g,t):[],B?await Ee():[],ue(),ee(),oe(i),o,q].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.15.0",
3
+ "version": "3.16.0",
4
4
  "description": "another opinionated eslint config",
5
5
  "keywords": [
6
6
  "eslint",
@@ -50,6 +50,7 @@
50
50
  "eslint-plugin-react": "^7.37.2",
51
51
  "eslint-plugin-react-hooks": "^5.0.0",
52
52
  "eslint-plugin-react-refresh": "0.4.14",
53
+ "eslint-plugin-regexp": "^2.7.0",
53
54
  "eslint-plugin-testing-library": "7.0.0-beta.6",
54
55
  "eslint-plugin-unicorn": "^56.0.1",
55
56
  "globals": "^15.12.0",