@jimmy.codes/eslint-config 3.3.0 → 3.4.1

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 S=Object.defineProperty;var r=(e,t)=>S(e,"name",{value:t,configurable:!0});var A=require("eslint-config-prettier"),G=require("astro-eslint-parser"),B=require("eslint-plugin-astro"),u=require("eslint-plugin-jsx-a11y"),d=require("globals"),c=require("typescript-eslint"),i=require("eslint-plugin-import-x"),b=require("eslint-plugin-n"),h=require("eslint-plugin-perfectionist"),I=require("@tanstack/eslint-plugin-query"),$=require("eslint-plugin-react"),N=require("eslint-plugin-react-hooks"),F=require("eslint-plugin-react-refresh"),n=require("local-pkg"),p=require("eslint-plugin-jest"),J=require("eslint-plugin-jest-dom"),v=require("eslint-plugin-testing-library"),k=require("eslint-plugin-unicorn"),V=require("@eslint/js");function y(e){var t=Object.create(null);return e&&Object.keys(e).forEach(function(s){if(s!=="default"){var a=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(t,s,a.get?a:{enumerable:!0,get:r(function(){return e[s]},"get")})}}),t.default=e,Object.freeze(t)}r(y,"_interopNamespaceDefault");var X=y(G),z=y(F),q=y(J);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","**/CHANGELOG*.md","**/*.min.*","**/LICENSE*","**/__snapshots__","**/auto-import?(s).d.ts","**/components.d.ts","**/vite.config.ts.*.mjs","!.storybook"],M="**/*.?([cm])js",g="**/*.?([cm])jsx",O="**/*.?([cm])tsx",m=[`**/__tests__/**/*.${o}`,`**/*.spec.${o}`,`**/*.test.${o}`,`**/*.bench.${o}`,`**/*.benchmark.${o}`],_=[`**/e2e/**/*.spec.${o}`,`**/e2e/**/*.test.${o}`,`**/cypress/**/*.spec.${o}`,`**/cypress/**/*.test.${o}`],Q="**/*.cjs",U="**/*.astro",W=["vi.mock"],Y=["@testing-library/react"],D=r(()=>{const e=[U];return[{files:e,languageOptions:{globals:{...d.node,Astro:!1,Fragment:!1},parser:X,parserOptions:{extraFileExtensions:[".astro"],parser:c.parser},sourceType:"module"},name:"jimmy.codes/astro",plugins:{astro:B,"jsx-a11y":u},processor:"astro/client-side-ts",rules:{...u.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,...c.configs.disableTypeChecked,name:"jimmy.codes/astro/disable-type-checked"},{name:"jimmy.codes/astro/imports",settings:{"import-x/core-modules":["astro:content"]}}]},"astroConfig"),K=r(()=>[{files:[Q],languageOptions:{globals:d.commonjs},name:"jimmy.codes/commonjs"}],"commonjsConfig"),Z={...i.configs.recommended.rules,"import-x/consistent-type-specifier-style":["error","prefer-top-level"],"import-x/first":"error","import-x/namespace":"off","import-x/newline-after-import":"error","import-x/no-absolute-path":"error","import-x/no-empty-named-blocks":"error","import-x/no-self-import":"error","import-x/no-useless-path-segments":"error"},ee={name:"jimmy.codes/imports/typescript",rules:i.configs.typescript.rules,settings:{...i.configs.typescript.settings,"import-x/resolver":{...i.configs.typescript.settings["import-x/resolver"],typescript:!0}}},re=r(({typescript:e=!1}={})=>[{languageOptions:{parserOptions:{ecmaVersion:"latest",sourceType:"module"}},name:"jimmy.codes/imports",plugins:{"import-x":i,n:b},rules:Z,settings:{"import-x/parsers":{espree:[".js",".cjs",".mjs",".jsx"]}}},...e?[ee]:[]],"importsConfig"),te={"n/no-process-exit":"off","n/prefer-node-protocol":"error"},se=r(()=>[{name:"jimmy.codes/node",plugins:{n:b},rules:te}],"nodeConfig"),oe={...h.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"}]},ne=r(()=>[{name:"jimmy.codes/perfectionist",plugins:{perfectionist:h},rules:oe}],"perfectionistConfig"),ae=r(()=>n.isPackageExists("typescript"),"hasTypescript"),ce=r(()=>n.isPackageExists("react"),"hasReact"),w=r(()=>n.isPackageExists("vitest"),"hasVitest"),E=r(()=>n.isPackageExists("jest"),"hasJest"),ie=r(()=>w()||E(),"hasTesting"),pe=r(()=>Y.some(e=>n.isPackageExists(e)),"hasTestingLibrary"),fe=r(()=>n.isPackageExists("@tanstack/react-query"),"hasReactQuery"),le=r(()=>n.isPackageExists("astro"),"hasAstro"),ue={...u.configs.recommended.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/display-name":"error","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/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-key":"error","react/jsx-max-depth":"off","react/jsx-no-bind":"off","react/jsx-no-comment-textnodes":"error","react/jsx-no-constructed-context-values":"error","react/jsx-no-duplicate-props":"error","react/jsx-no-leaked-render":"error","react/jsx-no-literals":"off","react/jsx-no-script-url":"error","react/jsx-no-target-blank":"error","react/jsx-no-undef":"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-spreading":"off","react/jsx-sort-default-props":"off","react/jsx-sort-props":"off","react/jsx-uses-react":"off","react/jsx-uses-vars":"error","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-children-prop":"error","react/no-danger":"off","react/no-danger-with-children":"error","react/no-deprecated":"error","react/no-did-mount-set-state":"error","react/no-did-update-set-state":"error","react/no-direct-mutation-state":"error","react/no-find-dom-node":"error","react/no-invalid-html-attribute":"error","react/no-is-mounted":"error","react/no-multi-comp":"off","react/no-namespace":"error","react/no-object-type-as-default-prop":"off","react/no-redundant-should-component-update":"error","react/no-render-return-value":"error","react/no-set-state":"off","react/no-string-refs":"error","react/no-this-in-sfc":"error","react/no-typos":"error","react/no-unescaped-entities":"error","react/no-unknown-property":"error","react/no-unsafe":"off","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/prop-types":"error","react/react-in-jsx-scope":"off","react/require-default-props":"off","react/require-optimization":"off","react/require-render-return":"error","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}]},me=r(({utilities:e=[]}={},t=!0)=>{const s=e.includes("@tanstack/query")||t&&fe();return[{files:[g,O],languageOptions:{globals:{...d.browser},parserOptions:{ecmaFeatures:{jsx:!0},jsxPragma:null}},name:"jimmy.codes/react",plugins:{"jsx-a11y":u,react:$,"react-hooks":N,"react-refresh":z},rules:ue,settings:{react:{version:"detect"}}},...s?[{files:[g,O],name:"jimmy.codes/react/query",plugins:{"@tanstack/query":I},rules:{"@tanstack/query/exhaustive-deps":"error","@tanstack/query/no-rest-destructuring":"warn","@tanstack/query/stable-query-client":"error"}}]:[]]},"reactConfig"),T={...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"},de=r(()=>[{files:m,name:"jimmy.codes/testing/testing-library",plugins:{"jest-dom":q,"testing-library":v},rules:{...v.configs.react.rules,...q.configs["flat/recommended"].rules}},{files:_,name:"jimmy.codes/testing/testing-library/disabled",rules:{"testing-library/prefer-screen-queries":"off"}}],"testingLibraryConfig"),ye=r(({framework:e="vitest",utilities:t}={},s=!0)=>{const a=s?w():e==="vitest",f=e==="jest"||s&&E(),l=!!t?.includes("testing-library")||s&&pe();return[{files:m,name:"jimmy.codes/testing",...p.configs["flat/recommended"]},...a?[{files:m,name:"jimmy.codes/testing/vitest",...p.configs["flat/recommended"],rules:{...T,"jest/no-deprecated-functions":"off","jest/require-hook":["error",{allowedFunctionCalls:W}]}}]:[],...f?[{files:m,name:"jimmy.codes/testing/jest",...p.configs["flat/recommended"],rules:T}]:[],{files:_,name:"jimmy.codes/testing/disabled",rules:{"jest/expect-expect":"off","jest/no-deprecated-functions":"off","jest/require-hook":"off"}},...l?de():[]]},"testingConfig"),ge=r(e=>c.config(...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/restrict-template-expressions":["error",{allowNumber:!0}]}},{files:[M,g],...c.configs.disableTypeChecked}),"typescriptConfig"),je={...k.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"},xe=r(()=>[{...k.configs["flat/recommended"],name:"jimmy.codes/unicorn",rules:je}],"unicornConfig"),be={...V.configs.recommended.rules,"array-callback-return":["error",{allowImplicit:!0}],"arrow-body-style":["error","always"],curly:["error","multi-or-nest","consistent"],"no-console":"warn","no-useless-rename":"error","object-shorthand":"error","prefer-arrow-callback":"error"},he=r(e=>typeof e=="object"?e:{project:"./tsconfig.json"},"getTypescriptOptions"),ve=r(e=>typeof e=="object"?e:{framework:"vitest"},"getTestingOptions"),ke=r(e=>typeof e=="object"?e:{utilities:[]},"getReactOptions"),qe=r(({astro:e=!1,autoDetect:t=!0,configs:s=[],ignores:a=[],react:f=!1,testing:l=!1,typescript:j=!1}={},...C)=>{const x=j||t&&ae(),R=f||t&&ce(),L=l||t&&ie(),P=e||t&&le();return[{name:"jimmy.codes/base",rules:be},...ne(),...se(),...xe(),...re({typescript:x}),...x?ge(he(j)):[],...R?me(ke(f),t):[],...P?D():[],...L?ye(ve(l),t):[],{name:"jimmy.codes/disabled",...A},...K(),{ignores:[...H,...a],name:"jimmy.codes/ignores"},...s,...C]},"jimmyDotCodes");module.exports=qe;
1
+ "use strict";var A=Object.defineProperty;var r=(e,t)=>A(e,"name",{value:t,configurable:!0});var G=require("eslint-config-prettier"),B=require("astro-eslint-parser"),I=require("eslint-plugin-astro"),u=require("eslint-plugin-jsx-a11y"),d=require("globals"),a=require("typescript-eslint"),b=require("@eslint-community/eslint-plugin-eslint-comments/configs"),i=require("eslint-plugin-import-x"),h=require("eslint-plugin-n"),v=require("eslint-plugin-perfectionist"),$=require("@tanstack/eslint-plugin-query"),N=require("eslint-plugin-react"),F=require("eslint-plugin-react-hooks"),J=require("eslint-plugin-react-refresh"),n=require("local-pkg"),p=require("eslint-plugin-jest"),V=require("eslint-plugin-jest-dom"),k=require("eslint-plugin-testing-library"),q=require("eslint-plugin-unicorn"),X=require("@eslint/js");function y(e){var t=Object.create(null);return e&&Object.keys(e).forEach(function(s){if(s!=="default"){var c=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(t,s,c.get?c:{enumerable:!0,get:r(function(){return e[s]},"get")})}}),t.default=e,Object.freeze(t)}r(y,"_interopNamespaceDefault");var z=y(B),H=y(J),O=y(V);const o="?([cm])[jt]s?(x)",M=["**/node_modules","**/dist","**/package-lock.json","**/yarn.lock","**/pnpm-lock.yaml","**/bun.lockb","**/output","**/coverage","**/temp","**/.temp","**/tmp","**/.tmp","**/.history","**/.vitepress/cache","**/.nuxt","**/.next","**/.vercel","**/.changeset","**/.idea","**/.cache","**/.output","**/.vite-inspect","**/.yarn","**/storybook-static","**/.eslint-config-inspector","**/playwright-report","**/.astro","**/CHANGELOG*.md","**/*.min.*","**/LICENSE*","**/__snapshots__","**/auto-import?(s).d.ts","**/components.d.ts","**/vite.config.ts.*.mjs","**/*.gen.*","!.storybook"],Q="**/*.?([cm])js",g="**/*.?([cm])jsx",_="**/*.?([cm])tsx",m=[`**/__tests__/**/*.${o}`,`**/*.spec.${o}`,`**/*.test.${o}`,`**/*.bench.${o}`,`**/*.benchmark.${o}`],w=[`**/e2e/**/*.spec.${o}`,`**/e2e/**/*.test.${o}`,`**/cypress/**/*.spec.${o}`,`**/cypress/**/*.test.${o}`],U="**/*.cjs",W="**/*.astro",Y=["vi.mock"],D=["@testing-library/react"],K=r(()=>{const e=[W];return[{files:e,languageOptions:{globals:{...d.node,Astro:!1,Fragment:!1},parser:z,parserOptions:{extraFileExtensions:[".astro"],parser:a.parser},sourceType:"module"},name:"jimmy.codes/astro",plugins:{astro:I,"jsx-a11y":u},processor:"astro/client-side-ts",rules:{...u.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,...a.configs.disableTypeChecked,name:"jimmy.codes/astro/disable-type-checked"},{name:"jimmy.codes/astro/imports",settings:{"import-x/core-modules":["astro:content"]}}]},"astroConfig"),Z=r(()=>[{files:[U],languageOptions:{globals:d.commonjs},name:"jimmy.codes/commonjs"}],"commonjsConfig"),ee={...b.recommended.rules,"@eslint-community/eslint-comments/require-description":"error"},re=r(()=>[{...b.recommended,name:"jimmy.codes/eslint-comments",rules:ee}],"eslintCommentsConfig"),te={...i.configs.recommended.rules,"import-x/consistent-type-specifier-style":["error","prefer-top-level"],"import-x/first":"error","import-x/namespace":"off","import-x/newline-after-import":"error","import-x/no-absolute-path":"error","import-x/no-empty-named-blocks":"error","import-x/no-self-import":"error","import-x/no-useless-path-segments":"error"},se={name:"jimmy.codes/imports/typescript",rules:i.configs.typescript.rules,settings:{...i.configs.typescript.settings,"import-x/resolver":{...i.configs.typescript.settings["import-x/resolver"],typescript:!0}}},oe=r(({typescript:e=!1}={})=>[{languageOptions:{parserOptions:{ecmaVersion:"latest",sourceType:"module"}},name:"jimmy.codes/imports",plugins:{"import-x":i,n:h},rules:te,settings:{"import-x/parsers":{espree:[".js",".cjs",".mjs",".jsx"]}}},...e?[se]:[]],"importsConfig"),ne={"n/no-process-exit":"off","n/prefer-node-protocol":"error"},ce=r(()=>[{name:"jimmy.codes/node",plugins:{n:h},rules:ne}],"nodeConfig"),ae={...v.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"}]},ie=r(()=>[{name:"jimmy.codes/perfectionist",plugins:{perfectionist:v},rules:ae}],"perfectionistConfig"),pe=r(()=>n.isPackageExists("typescript"),"hasTypescript"),fe=r(()=>n.isPackageExists("react"),"hasReact"),E=r(()=>n.isPackageExists("vitest"),"hasVitest"),C=r(()=>n.isPackageExists("jest"),"hasJest"),le=r(()=>E()||C(),"hasTesting"),ue=r(()=>D.some(e=>n.isPackageExists(e)),"hasTestingLibrary"),me=r(()=>n.isPackageExists("@tanstack/react-query"),"hasReactQuery"),de=r(()=>n.isPackageExists("astro"),"hasAstro"),ye={...u.configs.recommended.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/display-name":"error","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/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-key":"error","react/jsx-max-depth":"off","react/jsx-no-bind":"off","react/jsx-no-comment-textnodes":"error","react/jsx-no-constructed-context-values":"error","react/jsx-no-duplicate-props":"error","react/jsx-no-leaked-render":"error","react/jsx-no-literals":"off","react/jsx-no-script-url":"error","react/jsx-no-target-blank":"error","react/jsx-no-undef":"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-spreading":"off","react/jsx-sort-default-props":"off","react/jsx-sort-props":"off","react/jsx-uses-react":"off","react/jsx-uses-vars":"error","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-children-prop":"error","react/no-danger":"off","react/no-danger-with-children":"error","react/no-deprecated":"error","react/no-did-mount-set-state":"error","react/no-did-update-set-state":"error","react/no-direct-mutation-state":"error","react/no-find-dom-node":"error","react/no-invalid-html-attribute":"error","react/no-is-mounted":"error","react/no-multi-comp":"off","react/no-namespace":"error","react/no-object-type-as-default-prop":"off","react/no-redundant-should-component-update":"error","react/no-render-return-value":"error","react/no-set-state":"off","react/no-string-refs":"error","react/no-this-in-sfc":"error","react/no-typos":"error","react/no-unescaped-entities":"error","react/no-unknown-property":"error","react/no-unsafe":"off","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/prop-types":"error","react/react-in-jsx-scope":"off","react/require-default-props":"off","react/require-optimization":"off","react/require-render-return":"error","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}]},ge=r(({utilities:e=[]}={},t=!0)=>{const s=e.includes("@tanstack/query")||t&&me();return[{files:[g,_],languageOptions:{globals:{...d.browser},parserOptions:{ecmaFeatures:{jsx:!0},jsxPragma:null}},name:"jimmy.codes/react",plugins:{"jsx-a11y":u,react:N,"react-hooks":F,"react-refresh":H},rules:ye,settings:{react:{version:"detect"}}},...s?[{files:[g,_],name:"jimmy.codes/react/query",plugins:{"@tanstack/query":$},rules:{"@tanstack/query/exhaustive-deps":"error","@tanstack/query/no-rest-destructuring":"warn","@tanstack/query/stable-query-client":"error"}}]:[]]},"reactConfig"),T={...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"},je=r(()=>[{files:m,name:"jimmy.codes/testing/testing-library",plugins:{"jest-dom":O,"testing-library":k},rules:{...k.configs.react.rules,...O.configs["flat/recommended"].rules}},{files:w,name:"jimmy.codes/testing/testing-library/disabled",rules:{"testing-library/prefer-screen-queries":"off"}}],"testingLibraryConfig"),xe=r(({framework:e="vitest",utilities:t}={},s=!0)=>{const c=s?E():e==="vitest",f=e==="jest"||s&&C(),l=!!t?.includes("testing-library")||s&&ue();return[{files:m,name:"jimmy.codes/testing",...p.configs["flat/recommended"]},...c?[{files:m,name:"jimmy.codes/testing/vitest",...p.configs["flat/recommended"],rules:{...T,"jest/no-deprecated-functions":"off","jest/require-hook":["error",{allowedFunctionCalls:Y}]}}]:[],...f?[{files:m,name:"jimmy.codes/testing/jest",...p.configs["flat/recommended"],rules:T}]:[],{files:w,name:"jimmy.codes/testing/disabled",rules:{"jest/expect-expect":"off","jest/no-deprecated-functions":"off","jest/require-hook":"off"}},...l?je():[]]},"testingConfig"),be=r(e=>a.config(...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/restrict-template-expressions":["error",{allowNumber:!0}]}},{files:[Q,g],...a.configs.disableTypeChecked}),"typescriptConfig"),he={...q.configs["flat/recommended"].rules,"unicorn/filename-case":"off","unicorn/import-style":"off","unicorn/no-abusive-eslint-disable":"off","unicorn/no-anonymous-default-export":"off","unicorn/no-array-callback-reference":"off","unicorn/no-array-reduce":"off","unicorn/no-null":"off","unicorn/no-process-exit":"off","unicorn/no-useless-undefined":["error",{checkArguments:!1,checkArrowFunctionBody:!1}],"unicorn/prefer-node-protocol":"off","unicorn/prevent-abbreviations":"off"},ve=r(()=>[{...q.configs["flat/recommended"],name:"jimmy.codes/unicorn",rules:he}],"unicornConfig"),ke={...X.configs.recommended.rules,"array-callback-return":["error",{allowImplicit:!0}],"arrow-body-style":["error","always"],curly:["error","multi-or-nest","consistent"],"no-console":"warn","no-useless-rename":"error","object-shorthand":"error","prefer-arrow-callback":"error"},qe=r(e=>typeof e=="object"?e:{project:"./tsconfig.json"},"getTypescriptOptions"),Oe=r(e=>typeof e=="object"?e:{framework:"vitest"},"getTestingOptions"),_e=r(e=>typeof e=="object"?e:{utilities:[]},"getReactOptions"),we=r(({astro:e=!1,autoDetect:t=!0,configs:s=[],ignores:c=[],react:f=!1,testing:l=!1,typescript:j=!1}={},...R)=>{const x=j||t&&pe(),L=f||t&&fe(),P=l||t&&le(),S=e||t&&de();return[{name:"jimmy.codes/base",rules:ke},...ie(),...ce(),...ve(),...re(),...oe({typescript:x}),...x?be(qe(j)):[],...L?ge(_e(f),t):[],...S?K():[],...P?xe(Oe(l),t):[],{name:"jimmy.codes/prettier",...G},...Z(),{ignores:[...M,...c],name:"jimmy.codes/ignores"},...s,...R]},"jimmyDotCodes");module.exports=we;
package/dist/index.d.cts CHANGED
@@ -15,6 +15,51 @@ import * as _typescript_eslint_utils_ts_eslint from '@typescript-eslint/utils/ts
15
15
 
16
16
 
17
17
  interface RuleOptions {
18
+ /**
19
+ * require a `eslint-enable` comment for every `eslint-disable` comment
20
+ * @see https://eslint-community.github.io/eslint-plugin-eslint-comments/rules/disable-enable-pair.html
21
+ */
22
+ '@eslint-community/eslint-comments/disable-enable-pair'?: Linter.RuleEntry<EslintCommunityEslintCommentsDisableEnablePair>
23
+ /**
24
+ * disallow a `eslint-enable` comment for multiple `eslint-disable` comments
25
+ * @see https://eslint-community.github.io/eslint-plugin-eslint-comments/rules/no-aggregating-enable.html
26
+ */
27
+ '@eslint-community/eslint-comments/no-aggregating-enable'?: Linter.RuleEntry<[]>
28
+ /**
29
+ * disallow duplicate `eslint-disable` comments
30
+ * @see https://eslint-community.github.io/eslint-plugin-eslint-comments/rules/no-duplicate-disable.html
31
+ */
32
+ '@eslint-community/eslint-comments/no-duplicate-disable'?: Linter.RuleEntry<[]>
33
+ /**
34
+ * disallow `eslint-disable` comments about specific rules
35
+ * @see https://eslint-community.github.io/eslint-plugin-eslint-comments/rules/no-restricted-disable.html
36
+ */
37
+ '@eslint-community/eslint-comments/no-restricted-disable'?: Linter.RuleEntry<EslintCommunityEslintCommentsNoRestrictedDisable>
38
+ /**
39
+ * disallow `eslint-disable` comments without rule names
40
+ * @see https://eslint-community.github.io/eslint-plugin-eslint-comments/rules/no-unlimited-disable.html
41
+ */
42
+ '@eslint-community/eslint-comments/no-unlimited-disable'?: Linter.RuleEntry<[]>
43
+ /**
44
+ * disallow unused `eslint-disable` comments
45
+ * @see https://eslint-community.github.io/eslint-plugin-eslint-comments/rules/no-unused-disable.html
46
+ */
47
+ '@eslint-community/eslint-comments/no-unused-disable'?: Linter.RuleEntry<[]>
48
+ /**
49
+ * disallow unused `eslint-enable` comments
50
+ * @see https://eslint-community.github.io/eslint-plugin-eslint-comments/rules/no-unused-enable.html
51
+ */
52
+ '@eslint-community/eslint-comments/no-unused-enable'?: Linter.RuleEntry<[]>
53
+ /**
54
+ * disallow ESLint directive-comments
55
+ * @see https://eslint-community.github.io/eslint-plugin-eslint-comments/rules/no-use.html
56
+ */
57
+ '@eslint-community/eslint-comments/no-use'?: Linter.RuleEntry<EslintCommunityEslintCommentsNoUse>
58
+ /**
59
+ * require include descriptions in ESLint directive-comments
60
+ * @see https://eslint-community.github.io/eslint-plugin-eslint-comments/rules/require-description.html
61
+ */
62
+ '@eslint-community/eslint-comments/require-description'?: Linter.RuleEntry<EslintCommunityEslintCommentsRequireDescription>
18
63
  /**
19
64
  * Exhaustive deps rule for useQuery
20
65
  * @see https://tanstack.com/query/latest/docs/eslint/exhaustive-deps
@@ -4954,6 +4999,20 @@ interface RuleOptions {
4954
4999
  }
4955
5000
 
4956
5001
  /* ======= Declarations ======= */
5002
+ // ----- @eslint-community/eslint-comments/disable-enable-pair -----
5003
+ type EslintCommunityEslintCommentsDisableEnablePair = []|[{
5004
+ allowWholeFile?: boolean
5005
+ }]
5006
+ // ----- @eslint-community/eslint-comments/no-restricted-disable -----
5007
+ type EslintCommunityEslintCommentsNoRestrictedDisable = string[]
5008
+ // ----- @eslint-community/eslint-comments/no-use -----
5009
+ type EslintCommunityEslintCommentsNoUse = []|[{
5010
+ allow?: ("eslint" | "eslint-disable" | "eslint-disable-line" | "eslint-disable-next-line" | "eslint-enable" | "eslint-env" | "exported" | "global" | "globals")[]
5011
+ }]
5012
+ // ----- @eslint-community/eslint-comments/require-description -----
5013
+ type EslintCommunityEslintCommentsRequireDescription = []|[{
5014
+ ignore?: ("eslint" | "eslint-disable" | "eslint-disable-line" | "eslint-disable-next-line" | "eslint-enable" | "eslint-env" | "exported" | "global" | "globals")[]
5015
+ }]
4957
5016
  // ----- @typescript-eslint/array-type -----
4958
5017
  type TypescriptEslintArrayType = []|[{
4959
5018
 
@@ -9809,6 +9868,19 @@ declare const jimmyDotCodes: ({ astro, autoDetect, configs, ignores, react, test
9809
9868
  };
9810
9869
  };
9811
9870
  name: string;
9871
+ } | {
9872
+ name: string;
9873
+ rules: {
9874
+ "@eslint-community/eslint-comments/require-description": "error";
9875
+ };
9876
+ files?: Array<string | string[]>;
9877
+ ignores?: string[];
9878
+ language?: string;
9879
+ languageOptions?: Linter.LanguageOptions;
9880
+ linterOptions?: Linter.LinterOptions;
9881
+ processor?: string | Linter.Processor;
9882
+ plugins?: Record<string, eslint.ESLint.Plugin>;
9883
+ settings?: Record<string, unknown>;
9812
9884
  } | {
9813
9885
  name: string;
9814
9886
  rules: {
@@ -11542,7 +11614,7 @@ declare const jimmyDotCodes: ({ astro, autoDetect, configs, ignores, react, test
11542
11614
  } | {
11543
11615
  languageOptions: eslint_plugin_jest.LanguageOptions;
11544
11616
  plugins: string[];
11545
- rules: eslint_plugin_jest.Rules;
11617
+ rules: Linter.RulesRecord;
11546
11618
  files: string[];
11547
11619
  name: string;
11548
11620
  } | {
package/dist/index.d.mts CHANGED
@@ -15,6 +15,51 @@ import * as _typescript_eslint_utils_ts_eslint from '@typescript-eslint/utils/ts
15
15
 
16
16
 
17
17
  interface RuleOptions {
18
+ /**
19
+ * require a `eslint-enable` comment for every `eslint-disable` comment
20
+ * @see https://eslint-community.github.io/eslint-plugin-eslint-comments/rules/disable-enable-pair.html
21
+ */
22
+ '@eslint-community/eslint-comments/disable-enable-pair'?: Linter.RuleEntry<EslintCommunityEslintCommentsDisableEnablePair>
23
+ /**
24
+ * disallow a `eslint-enable` comment for multiple `eslint-disable` comments
25
+ * @see https://eslint-community.github.io/eslint-plugin-eslint-comments/rules/no-aggregating-enable.html
26
+ */
27
+ '@eslint-community/eslint-comments/no-aggregating-enable'?: Linter.RuleEntry<[]>
28
+ /**
29
+ * disallow duplicate `eslint-disable` comments
30
+ * @see https://eslint-community.github.io/eslint-plugin-eslint-comments/rules/no-duplicate-disable.html
31
+ */
32
+ '@eslint-community/eslint-comments/no-duplicate-disable'?: Linter.RuleEntry<[]>
33
+ /**
34
+ * disallow `eslint-disable` comments about specific rules
35
+ * @see https://eslint-community.github.io/eslint-plugin-eslint-comments/rules/no-restricted-disable.html
36
+ */
37
+ '@eslint-community/eslint-comments/no-restricted-disable'?: Linter.RuleEntry<EslintCommunityEslintCommentsNoRestrictedDisable>
38
+ /**
39
+ * disallow `eslint-disable` comments without rule names
40
+ * @see https://eslint-community.github.io/eslint-plugin-eslint-comments/rules/no-unlimited-disable.html
41
+ */
42
+ '@eslint-community/eslint-comments/no-unlimited-disable'?: Linter.RuleEntry<[]>
43
+ /**
44
+ * disallow unused `eslint-disable` comments
45
+ * @see https://eslint-community.github.io/eslint-plugin-eslint-comments/rules/no-unused-disable.html
46
+ */
47
+ '@eslint-community/eslint-comments/no-unused-disable'?: Linter.RuleEntry<[]>
48
+ /**
49
+ * disallow unused `eslint-enable` comments
50
+ * @see https://eslint-community.github.io/eslint-plugin-eslint-comments/rules/no-unused-enable.html
51
+ */
52
+ '@eslint-community/eslint-comments/no-unused-enable'?: Linter.RuleEntry<[]>
53
+ /**
54
+ * disallow ESLint directive-comments
55
+ * @see https://eslint-community.github.io/eslint-plugin-eslint-comments/rules/no-use.html
56
+ */
57
+ '@eslint-community/eslint-comments/no-use'?: Linter.RuleEntry<EslintCommunityEslintCommentsNoUse>
58
+ /**
59
+ * require include descriptions in ESLint directive-comments
60
+ * @see https://eslint-community.github.io/eslint-plugin-eslint-comments/rules/require-description.html
61
+ */
62
+ '@eslint-community/eslint-comments/require-description'?: Linter.RuleEntry<EslintCommunityEslintCommentsRequireDescription>
18
63
  /**
19
64
  * Exhaustive deps rule for useQuery
20
65
  * @see https://tanstack.com/query/latest/docs/eslint/exhaustive-deps
@@ -4954,6 +4999,20 @@ interface RuleOptions {
4954
4999
  }
4955
5000
 
4956
5001
  /* ======= Declarations ======= */
5002
+ // ----- @eslint-community/eslint-comments/disable-enable-pair -----
5003
+ type EslintCommunityEslintCommentsDisableEnablePair = []|[{
5004
+ allowWholeFile?: boolean
5005
+ }]
5006
+ // ----- @eslint-community/eslint-comments/no-restricted-disable -----
5007
+ type EslintCommunityEslintCommentsNoRestrictedDisable = string[]
5008
+ // ----- @eslint-community/eslint-comments/no-use -----
5009
+ type EslintCommunityEslintCommentsNoUse = []|[{
5010
+ allow?: ("eslint" | "eslint-disable" | "eslint-disable-line" | "eslint-disable-next-line" | "eslint-enable" | "eslint-env" | "exported" | "global" | "globals")[]
5011
+ }]
5012
+ // ----- @eslint-community/eslint-comments/require-description -----
5013
+ type EslintCommunityEslintCommentsRequireDescription = []|[{
5014
+ ignore?: ("eslint" | "eslint-disable" | "eslint-disable-line" | "eslint-disable-next-line" | "eslint-enable" | "eslint-env" | "exported" | "global" | "globals")[]
5015
+ }]
4957
5016
  // ----- @typescript-eslint/array-type -----
4958
5017
  type TypescriptEslintArrayType = []|[{
4959
5018
 
@@ -9809,6 +9868,19 @@ declare const jimmyDotCodes: ({ astro, autoDetect, configs, ignores, react, test
9809
9868
  };
9810
9869
  };
9811
9870
  name: string;
9871
+ } | {
9872
+ name: string;
9873
+ rules: {
9874
+ "@eslint-community/eslint-comments/require-description": "error";
9875
+ };
9876
+ files?: Array<string | string[]>;
9877
+ ignores?: string[];
9878
+ language?: string;
9879
+ languageOptions?: Linter.LanguageOptions;
9880
+ linterOptions?: Linter.LinterOptions;
9881
+ processor?: string | Linter.Processor;
9882
+ plugins?: Record<string, eslint.ESLint.Plugin>;
9883
+ settings?: Record<string, unknown>;
9812
9884
  } | {
9813
9885
  name: string;
9814
9886
  rules: {
@@ -11542,7 +11614,7 @@ declare const jimmyDotCodes: ({ astro, autoDetect, configs, ignores, react, test
11542
11614
  } | {
11543
11615
  languageOptions: eslint_plugin_jest.LanguageOptions;
11544
11616
  plugins: string[];
11545
- rules: eslint_plugin_jest.Rules;
11617
+ rules: Linter.RulesRecord;
11546
11618
  files: string[];
11547
11619
  name: string;
11548
11620
  } | {
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- var S=Object.defineProperty;var r=(e,t)=>S(e,"name",{value:t,configurable:!0});import G from"eslint-config-prettier";import*as A from"astro-eslint-parser";import B from"eslint-plugin-astro";import f from"eslint-plugin-jsx-a11y";import d from"globals";import{parser as I,configs as l,config as $}from"typescript-eslint";import c from"eslint-plugin-import-x";import x from"eslint-plugin-n";import h from"eslint-plugin-perfectionist";import F from"@tanstack/eslint-plugin-query";import N from"eslint-plugin-react";import P from"eslint-plugin-react-hooks";import*as J from"eslint-plugin-react-refresh";import{isPackageExists as n}from"local-pkg";import a from"eslint-plugin-jest";import*as b from"eslint-plugin-jest-dom";import k from"eslint-plugin-testing-library";import v from"eslint-plugin-unicorn";import V from"@eslint/js";const o="?([cm])[jt]s?(x)",X=["**/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","**/CHANGELOG*.md","**/*.min.*","**/LICENSE*","**/__snapshots__","**/auto-import?(s).d.ts","**/components.d.ts","**/vite.config.ts.*.mjs","!.storybook"],H="**/*.?([cm])js",y="**/*.?([cm])jsx",w="**/*.?([cm])tsx",m=[`**/__tests__/**/*.${o}`,`**/*.spec.${o}`,`**/*.test.${o}`,`**/*.bench.${o}`,`**/*.benchmark.${o}`],O=[`**/e2e/**/*.spec.${o}`,`**/e2e/**/*.test.${o}`,`**/cypress/**/*.spec.${o}`,`**/cypress/**/*.test.${o}`],M="**/*.cjs",Q="**/*.astro",U=["vi.mock"],W=["@testing-library/react"],Y=r(()=>{const e=[Q];return[{files:e,languageOptions:{globals:{...d.node,Astro:!1,Fragment:!1},parser:A,parserOptions:{extraFileExtensions:[".astro"],parser:I},sourceType:"module"},name:"jimmy.codes/astro",plugins:{astro:B,"jsx-a11y":f},processor:"astro/client-side-ts",rules:{...f.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,...l.disableTypeChecked,name:"jimmy.codes/astro/disable-type-checked"},{name:"jimmy.codes/astro/imports",settings:{"import-x/core-modules":["astro:content"]}}]},"astroConfig"),z=r(()=>[{files:[M],languageOptions:{globals:d.commonjs},name:"jimmy.codes/commonjs"}],"commonjsConfig"),K={...c.configs.recommended.rules,"import-x/consistent-type-specifier-style":["error","prefer-top-level"],"import-x/first":"error","import-x/namespace":"off","import-x/newline-after-import":"error","import-x/no-absolute-path":"error","import-x/no-empty-named-blocks":"error","import-x/no-self-import":"error","import-x/no-useless-path-segments":"error"},Z={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}}},D=r(({typescript:e=!1}={})=>[{languageOptions:{parserOptions:{ecmaVersion:"latest",sourceType:"module"}},name:"jimmy.codes/imports",plugins:{"import-x":c,n:x},rules:K,settings:{"import-x/parsers":{espree:[".js",".cjs",".mjs",".jsx"]}}},...e?[Z]:[]],"importsConfig"),ee={"n/no-process-exit":"off","n/prefer-node-protocol":"error"},re=r(()=>[{name:"jimmy.codes/node",plugins:{n:x},rules:ee}],"nodeConfig"),te={...h.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"}]},oe=r(()=>[{name:"jimmy.codes/perfectionist",plugins:{perfectionist:h},rules:te}],"perfectionistConfig"),se=r(()=>n("typescript"),"hasTypescript"),ne=r(()=>n("react"),"hasReact"),T=r(()=>n("vitest"),"hasVitest"),C=r(()=>n("jest"),"hasJest"),ce=r(()=>T()||C(),"hasTesting"),ae=r(()=>W.some(e=>n(e)),"hasTestingLibrary"),ie=r(()=>n("@tanstack/react-query"),"hasReactQuery"),pe=r(()=>n("astro"),"hasAstro"),fe={...f.configs.recommended.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/display-name":"error","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/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-key":"error","react/jsx-max-depth":"off","react/jsx-no-bind":"off","react/jsx-no-comment-textnodes":"error","react/jsx-no-constructed-context-values":"error","react/jsx-no-duplicate-props":"error","react/jsx-no-leaked-render":"error","react/jsx-no-literals":"off","react/jsx-no-script-url":"error","react/jsx-no-target-blank":"error","react/jsx-no-undef":"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-spreading":"off","react/jsx-sort-default-props":"off","react/jsx-sort-props":"off","react/jsx-uses-react":"off","react/jsx-uses-vars":"error","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-children-prop":"error","react/no-danger":"off","react/no-danger-with-children":"error","react/no-deprecated":"error","react/no-did-mount-set-state":"error","react/no-did-update-set-state":"error","react/no-direct-mutation-state":"error","react/no-find-dom-node":"error","react/no-invalid-html-attribute":"error","react/no-is-mounted":"error","react/no-multi-comp":"off","react/no-namespace":"error","react/no-object-type-as-default-prop":"off","react/no-redundant-should-component-update":"error","react/no-render-return-value":"error","react/no-set-state":"off","react/no-string-refs":"error","react/no-this-in-sfc":"error","react/no-typos":"error","react/no-unescaped-entities":"error","react/no-unknown-property":"error","react/no-unsafe":"off","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/prop-types":"error","react/react-in-jsx-scope":"off","react/require-default-props":"off","react/require-optimization":"off","react/require-render-return":"error","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}]},le=r(({utilities:e=[]}={},t=!0)=>{const s=e.includes("@tanstack/query")||t&&ie();return[{files:[y,w],languageOptions:{globals:{...d.browser},parserOptions:{ecmaFeatures:{jsx:!0},jsxPragma:null}},name:"jimmy.codes/react",plugins:{"jsx-a11y":f,react:N,"react-hooks":P,"react-refresh":J},rules:fe,settings:{react:{version:"detect"}}},...s?[{files:[y,w],name:"jimmy.codes/react/query",plugins:{"@tanstack/query":F},rules:{"@tanstack/query/exhaustive-deps":"error","@tanstack/query/no-rest-destructuring":"warn","@tanstack/query/stable-query-client":"error"}}]:[]]},"reactConfig"),_={...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"},me=r(()=>[{files:m,name:"jimmy.codes/testing/testing-library",plugins:{"jest-dom":b,"testing-library":k},rules:{...k.configs.react.rules,...b.configs["flat/recommended"].rules}},{files:O,name:"jimmy.codes/testing/testing-library/disabled",rules:{"testing-library/prefer-screen-queries":"off"}}],"testingLibraryConfig"),ue=r(({framework:e="vitest",utilities:t}={},s=!0)=>{const u=s?T():e==="vitest",i=e==="jest"||s&&C(),p=!!t?.includes("testing-library")||s&&ae();return[{files:m,name:"jimmy.codes/testing",...a.configs["flat/recommended"]},...u?[{files:m,name:"jimmy.codes/testing/vitest",...a.configs["flat/recommended"],rules:{..._,"jest/no-deprecated-functions":"off","jest/require-hook":["error",{allowedFunctionCalls:U}]}}]:[],...i?[{files:m,name:"jimmy.codes/testing/jest",...a.configs["flat/recommended"],rules:_}]:[],{files:O,name:"jimmy.codes/testing/disabled",rules:{"jest/expect-expect":"off","jest/no-deprecated-functions":"off","jest/require-hook":"off"}},...p?me():[]]},"testingConfig"),de=r(e=>$(...l.strictTypeChecked,...l.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/restrict-template-expressions":["error",{allowNumber:!0}]}},{files:[H,y],...l.disableTypeChecked}),"typescriptConfig"),ye={...v.configs["flat/recommended"].rules,"unicorn/filename-case":"off","unicorn/import-style":"off","unicorn/no-abusive-eslint-disable":"off","unicorn/no-anonymous-default-export":"off","unicorn/no-array-callback-reference":"off","unicorn/no-array-reduce":"off","unicorn/no-null":"off","unicorn/no-process-exit":"off","unicorn/no-useless-undefined":["error",{checkArguments:!1,checkArrowFunctionBody:!1}],"unicorn/prefer-node-protocol":"off","unicorn/prevent-abbreviations":"off"},ge=r(()=>[{...v.configs["flat/recommended"],name:"jimmy.codes/unicorn",rules:ye}],"unicornConfig"),je={...V.configs.recommended.rules,"array-callback-return":["error",{allowImplicit:!0}],"arrow-body-style":["error","always"],curly:["error","multi-or-nest","consistent"],"no-console":"warn","no-useless-rename":"error","object-shorthand":"error","prefer-arrow-callback":"error"},xe=r(e=>typeof e=="object"?e:{project:"./tsconfig.json"},"getTypescriptOptions"),he=r(e=>typeof e=="object"?e:{framework:"vitest"},"getTestingOptions"),be=r(e=>typeof e=="object"?e:{utilities:[]},"getReactOptions"),ke=r(({astro:e=!1,autoDetect:t=!0,configs:s=[],ignores:u=[],react:i=!1,testing:p=!1,typescript:g=!1}={},...q)=>{const j=g||t&&se(),R=i||t&&ne(),E=p||t&&ce(),L=e||t&&pe();return[{name:"jimmy.codes/base",rules:je},...oe(),...re(),...ge(),...D({typescript:j}),...j?de(xe(g)):[],...R?le(be(i),t):[],...L?Y():[],...E?ue(he(p),t):[],{name:"jimmy.codes/disabled",...G},...z(),{ignores:[...X,...u],name:"jimmy.codes/ignores"},...s,...q]},"jimmyDotCodes");export{ke as default};
1
+ var G=Object.defineProperty;var r=(e,t)=>G(e,"name",{value:t,configurable:!0});import A from"eslint-config-prettier";import*as B from"astro-eslint-parser";import I from"eslint-plugin-astro";import f from"eslint-plugin-jsx-a11y";import d from"globals";import{parser as $,configs as m,config as F}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 b from"eslint-plugin-perfectionist";import N from"@tanstack/eslint-plugin-query";import P from"eslint-plugin-react";import J from"eslint-plugin-react-hooks";import*as V from"eslint-plugin-react-refresh";import{isPackageExists as n}from"local-pkg";import i from"eslint-plugin-jest";import*as k from"eslint-plugin-jest-dom";import v from"eslint-plugin-testing-library";import w from"eslint-plugin-unicorn";import X from"@eslint/js";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","**/CHANGELOG*.md","**/*.min.*","**/LICENSE*","**/__snapshots__","**/auto-import?(s).d.ts","**/components.d.ts","**/vite.config.ts.*.mjs","**/*.gen.*","!.storybook"],M="**/*.?([cm])js",y="**/*.?([cm])jsx",C="**/*.?([cm])tsx",l=[`**/__tests__/**/*.${o}`,`**/*.spec.${o}`,`**/*.test.${o}`,`**/*.bench.${o}`,`**/*.benchmark.${o}`],O=[`**/e2e/**/*.spec.${o}`,`**/e2e/**/*.test.${o}`,`**/cypress/**/*.spec.${o}`,`**/cypress/**/*.test.${o}`],Q="**/*.cjs",U="**/*.astro",W=["vi.mock"],Y=["@testing-library/react"],z=r(()=>{const e=[U];return[{files:e,languageOptions:{globals:{...d.node,Astro:!1,Fragment:!1},parser:B,parserOptions:{extraFileExtensions:[".astro"],parser:$},sourceType:"module"},name:"jimmy.codes/astro",plugins:{astro:I,"jsx-a11y":f},processor:"astro/client-side-ts",rules:{...f.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,...m.disableTypeChecked,name:"jimmy.codes/astro/disable-type-checked"},{name:"jimmy.codes/astro/imports",settings:{"import-x/core-modules":["astro:content"]}}]},"astroConfig"),K=r(()=>[{files:[Q],languageOptions:{globals:d.commonjs},name:"jimmy.codes/commonjs"}],"commonjsConfig"),Z={...x.recommended.rules,"@eslint-community/eslint-comments/require-description":"error"},D=r(()=>[{...x.recommended,name:"jimmy.codes/eslint-comments",rules:Z}],"eslintCommentsConfig"),ee={...c.configs.recommended.rules,"import-x/consistent-type-specifier-style":["error","prefer-top-level"],"import-x/first":"error","import-x/namespace":"off","import-x/newline-after-import":"error","import-x/no-absolute-path":"error","import-x/no-empty-named-blocks":"error","import-x/no-self-import":"error","import-x/no-useless-path-segments":"error"},re={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}}},te=r(({typescript:e=!1}={})=>[{languageOptions:{parserOptions:{ecmaVersion:"latest",sourceType:"module"}},name:"jimmy.codes/imports",plugins:{"import-x":c,n:h},rules:ee,settings:{"import-x/parsers":{espree:[".js",".cjs",".mjs",".jsx"]}}},...e?[re]:[]],"importsConfig"),oe={"n/no-process-exit":"off","n/prefer-node-protocol":"error"},se=r(()=>[{name:"jimmy.codes/node",plugins:{n:h},rules:oe}],"nodeConfig"),ne={...b.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:b},rules:ne}],"perfectionistConfig"),ie=r(()=>n("typescript"),"hasTypescript"),ae=r(()=>n("react"),"hasReact"),T=r(()=>n("vitest"),"hasVitest"),_=r(()=>n("jest"),"hasJest"),pe=r(()=>T()||_(),"hasTesting"),fe=r(()=>Y.some(e=>n(e)),"hasTestingLibrary"),me=r(()=>n("@tanstack/react-query"),"hasReactQuery"),le=r(()=>n("astro"),"hasAstro"),ue={...f.configs.recommended.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/display-name":"error","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/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-key":"error","react/jsx-max-depth":"off","react/jsx-no-bind":"off","react/jsx-no-comment-textnodes":"error","react/jsx-no-constructed-context-values":"error","react/jsx-no-duplicate-props":"error","react/jsx-no-leaked-render":"error","react/jsx-no-literals":"off","react/jsx-no-script-url":"error","react/jsx-no-target-blank":"error","react/jsx-no-undef":"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-spreading":"off","react/jsx-sort-default-props":"off","react/jsx-sort-props":"off","react/jsx-uses-react":"off","react/jsx-uses-vars":"error","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-children-prop":"error","react/no-danger":"off","react/no-danger-with-children":"error","react/no-deprecated":"error","react/no-did-mount-set-state":"error","react/no-did-update-set-state":"error","react/no-direct-mutation-state":"error","react/no-find-dom-node":"error","react/no-invalid-html-attribute":"error","react/no-is-mounted":"error","react/no-multi-comp":"off","react/no-namespace":"error","react/no-object-type-as-default-prop":"off","react/no-redundant-should-component-update":"error","react/no-render-return-value":"error","react/no-set-state":"off","react/no-string-refs":"error","react/no-this-in-sfc":"error","react/no-typos":"error","react/no-unescaped-entities":"error","react/no-unknown-property":"error","react/no-unsafe":"off","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/prop-types":"error","react/react-in-jsx-scope":"off","react/require-default-props":"off","react/require-optimization":"off","react/require-render-return":"error","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}]},de=r(({utilities:e=[]}={},t=!0)=>{const s=e.includes("@tanstack/query")||t&&me();return[{files:[y,C],languageOptions:{globals:{...d.browser},parserOptions:{ecmaFeatures:{jsx:!0},jsxPragma:null}},name:"jimmy.codes/react",plugins:{"jsx-a11y":f,react:P,"react-hooks":J,"react-refresh":V},rules:ue,settings:{react:{version:"detect"}}},...s?[{files:[y,C],name:"jimmy.codes/react/query",plugins:{"@tanstack/query":N},rules:{"@tanstack/query/exhaustive-deps":"error","@tanstack/query/no-rest-destructuring":"warn","@tanstack/query/stable-query-client":"error"}}]:[]]},"reactConfig"),q={...i.configs["flat/recommended"].rules,...i.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"},ye=r(()=>[{files:l,name:"jimmy.codes/testing/testing-library",plugins:{"jest-dom":k,"testing-library":v},rules:{...v.configs.react.rules,...k.configs["flat/recommended"].rules}},{files:O,name:"jimmy.codes/testing/testing-library/disabled",rules:{"testing-library/prefer-screen-queries":"off"}}],"testingLibraryConfig"),ge=r(({framework:e="vitest",utilities:t}={},s=!0)=>{const u=s?T():e==="vitest",a=e==="jest"||s&&_(),p=!!t?.includes("testing-library")||s&&fe();return[{files:l,name:"jimmy.codes/testing",...i.configs["flat/recommended"]},...u?[{files:l,name:"jimmy.codes/testing/vitest",...i.configs["flat/recommended"],rules:{...q,"jest/no-deprecated-functions":"off","jest/require-hook":["error",{allowedFunctionCalls:W}]}}]:[],...a?[{files:l,name:"jimmy.codes/testing/jest",...i.configs["flat/recommended"],rules:q}]:[],{files:O,name:"jimmy.codes/testing/disabled",rules:{"jest/expect-expect":"off","jest/no-deprecated-functions":"off","jest/require-hook":"off"}},...p?ye():[]]},"testingConfig"),je=r(e=>F(...m.strictTypeChecked,...m.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/restrict-template-expressions":["error",{allowNumber:!0}]}},{files:[M,y],...m.disableTypeChecked}),"typescriptConfig"),xe={...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"},he=r(()=>[{...w.configs["flat/recommended"],name:"jimmy.codes/unicorn",rules:xe}],"unicornConfig"),be={...X.configs.recommended.rules,"array-callback-return":["error",{allowImplicit:!0}],"arrow-body-style":["error","always"],curly:["error","multi-or-nest","consistent"],"no-console":"warn","no-useless-rename":"error","object-shorthand":"error","prefer-arrow-callback":"error"},ke=r(e=>typeof e=="object"?e:{project:"./tsconfig.json"},"getTypescriptOptions"),ve=r(e=>typeof e=="object"?e:{framework:"vitest"},"getTestingOptions"),we=r(e=>typeof e=="object"?e:{utilities:[]},"getReactOptions"),Ce=r(({astro:e=!1,autoDetect:t=!0,configs:s=[],ignores:u=[],react:a=!1,testing:p=!1,typescript:g=!1}={},...R)=>{const j=g||t&&ie(),E=a||t&&ae(),L=p||t&&pe(),S=e||t&&le();return[{name:"jimmy.codes/base",rules:be},...ce(),...se(),...he(),...D(),...te({typescript:j}),...j?je(ke(g)):[],...E?de(we(a),t):[],...S?z():[],...L?ge(ve(p),t):[],{name:"jimmy.codes/prettier",...A},...K(),{ignores:[...H,...u],name:"jimmy.codes/ignores"},...s,...R]},"jimmyDotCodes");export{Ce as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jimmy.codes/eslint-config",
3
- "version": "3.3.0",
3
+ "version": "3.4.1",
4
4
  "description": "another opinionated eslint config",
5
5
  "keywords": [
6
6
  "eslint",
@@ -31,6 +31,7 @@
31
31
  "dist"
32
32
  ],
33
33
  "dependencies": {
34
+ "@eslint-community/eslint-plugin-eslint-comments": "^4.4.1",
34
35
  "@eslint/js": "^9.14.0",
35
36
  "@tanstack/eslint-plugin-query": "^5.59.7",
36
37
  "@types/eslint": "9.6.1",