@jimmy.codes/eslint-config 1.7.0 → 1.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +5 -0
- package/dist/index.d.mts +5 -0
- package/dist/index.mjs +1 -1
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var T=require("eslint-config-prettier"),w=require("astro-eslint-parser"),C=require("eslint-plugin-astro"),f=require("eslint-plugin-jsx-a11y"),d=require("globals"),n=require("typescript-eslint"),i=require("eslint-plugin-import-x"),L=require("eslint-plugin-node-import"),R=require("eslint-plugin-simple-import-sort"),S=require("@tanstack/eslint-plugin-query"),G=require("eslint-plugin-react"),A=require("eslint-plugin-react-hooks"),P=require("eslint-plugin-react-refresh"),a=require("local-pkg"),p=require("eslint-plugin-jest"),B=require("eslint-plugin-jest-dom"),g=require("eslint-plugin-testing-library"),I=require("@eslint/js");function l(e){var t=Object.create(null);return e&&Object.keys(e).forEach(function(r){if(r!=="default"){var c=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,c.get?c:{enumerable:!0,get:function(){return e[r]}})}}),t.default=e,Object.freeze(t)}var $=l(w),N=l(S),F=l(P),x=l(B);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","**/CHANGELOG*.md","**/*.min.*","**/LICENSE*","**/__snapshots__","**/auto-import?(s).d.ts","**/components.d.ts","**/vite.config.ts.*.mjs","!.storybook"],V="**/*.?([cm])js",y="**/*.?([cm])jsx",h="**/*.?([cm])tsx",m=[`**/__tests__/**/*.${s}`,`**/*.spec.${s}`,`**/*.test.${s}`,`**/*.bench.${s}`,`**/*.benchmark.${s}`],b=[`**/e2e/**/*.spec.${s}`,`**/e2e/**/*.test.${s}`,`**/cypress/**/*.spec.${s}`,`**/cypress/**/*.test.${s}`],Q="**/*.cjs",X="**/*.astro",z=["vi.mock"],H=["@testing-library/react"],M=()=>{const e=[X];return[{files:e,name:"jimmy.codes/astro",plugins:{astro:C,"jsx-a11y":{rules:f.rules}},languageOptions:{globals:{...d.node,Astro:!1,Fragment:!1},parser:$,sourceType:"module",parserOptions:{parser:n.parser,extraFileExtensions:[".astro"]}},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-unused-define-vars-in-style":"error","astro/valid-compile":"error"}},{files:e,...n.configs.disableTypeChecked,name:"jimmy.codes/astro/disable-type-checked"},{settings:{"import-x/core-modules":["astro:content"]},name:"jimmy.codes/astro/imports"}]},W=()=>[{name:"jimmy.codes/commonjs",files:[Q],languageOptions:{globals:d.commonjs}}],Y={...i.configs.recommended.rules,"import-x/namespace":"off","import-x/newline-after-import":"error","import-x/first":"error","import-x/no-absolute-path":"error","import-x/no-useless-path-segments":"error","import-x/no-empty-named-blocks":"error","import-x/no-self-import":"error","simple-import-sort/imports":"error","simple-import-sort/exports":"error","node-import/prefer-node-protocol":"error"},D={name:"jimmy.codes/imports/typescript",settings:{...i.configs.typescript.settings,"import-x/resolver":{...i.configs.typescript.settings["import-x/resolver"],typescript:!0}},rules:i.configs.typescript.rules},U=({typescript:e=!1}={})=>[{name:"jimmy.codes/imports",plugins:{"import-x":i,"simple-import-sort":R,"node-import":L},settings:{"import-x/parsers":{espree:[".js",".cjs",".mjs",".jsx"]}},languageOptions:{parserOptions:{ecmaVersion:"latest",sourceType:"module"}},rules:Y},...e?[D]:[]],K=()=>a.isPackageExists("typescript"),Z=()=>a.isPackageExists("react"),v=()=>a.isPackageExists("vitest"),k=()=>a.isPackageExists("jest"),ee=()=>v()||k(),re=()=>H.some(e=>a.isPackageExists(e)),te=()=>a.isPackageExists("@tanstack/react-query"),se=()=>a.isPackageExists("astro"),oe={...f.configs.recommended.rules,"react-hooks/exhaustive-deps":"error","react-hooks/rules-of-hooks":"error","react/display-name":"error","react/jsx-key":"error","react/jsx-no-comment-textnodes":"error","react/jsx-no-duplicate-props":"error","react/jsx-no-target-blank":"error","react/jsx-no-undef":"error","react/jsx-uses-vars":"error","react/no-children-prop":"error","react/no-danger-with-children":"error","react/no-deprecated":"error","react/no-direct-mutation-state":"error","react/no-find-dom-node":"error","react/no-is-mounted":"error","react/no-render-return-value":"error","react/no-string-refs":"error","react/no-unescaped-entities":"error","react/no-unknown-property":"error","react/no-unsafe":"off","react/prop-types":"error","react/require-render-return":"error","react/react-in-jsx-scope":"off","react/jsx-uses-react":"off","react-refresh/only-export-components":["warn",{allowConstantExport:!0}],"react/self-closing-comp":"error","react/jsx-curly-brace-presence":"error","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/function-component-definition":"off","react/hook-use-state":"error","react/iframe-missing-sandbox":"error","react/jsx-boolean-value":["error","never"],"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-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":"off","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/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"},ne=({utilities:e=[]}={},t=!1)=>{const r=e.includes("@tanstack/query")||t&&te();return[{name:"jimmy.codes/react",files:[y,h],plugins:{react:G,"react-hooks":A,"jsx-a11y":{rules:f.rules},"react-refresh":F},languageOptions:{parserOptions:{jsxPragma:null,ecmaFeatures:{jsx:!0}},globals:{...d.browser}},settings:{react:{version:"detect"}},rules:oe},...r?[{name:"jimmy.codes/react/query",files:[y,h],plugins:{"@tanstack/query":N},rules:{"@tanstack/query/exhaustive-deps":"error","@tanstack/query/no-rest-destructuring":"warn","@tanstack/query/stable-query-client":"error"}}]:[]]},q={...p.configs["flat/recommended"].rules,...p.configs["flat/style"].rules,"jest/no-alias-methods":"error","jest/no-commented-out-tests":"error","jest/consistent-test-it":["error",{fn:"test",withinDescribe:"it"}],"jest/no-conditional-in-test":"error","jest/no-confusing-set-timeout":"error","jest/no-duplicate-hooks":"error","jest/no-hooks":"off","jest/no-large-snapshots":"off","jest/no-restricted-jest-methods":"off","jest/no-restricted-matchers":"off","jest/no-test-return-statement":"error","jest/no-untyped-mock-factory":"off","jest/prefer-called-with":"error","jest/prefer-comparison-matcher":"error","jest/prefer-each":"error","jest/prefer-equality-matcher":"error","jest/prefer-expect-assertions":"off","jest/prefer-expect-resolves":"error","jest/prefer-hooks-in-order":"error","jest/prefer-hooks-on-top":"error","jest/prefer-lowercase-title":"off","jest/prefer-mock-promise-shorthand":"error","jest/prefer-snapshot-hint":"error","jest/prefer-spy-on":"off","jest/prefer-strict-equal":"error","jest/prefer-todo":"warn","jest/require-hook":"error","jest/require-to-throw-message":"error","jest/require-top-level-describe":"off","jest/unbound-method":"off"},ae=()=>[{name:"jimmy.codes/testing/testing-library",files:m,plugins:{"testing-library":g,"jest-dom":x},rules:{...g.configs.react.rules,...x.configs["flat/recommended"].rules}},{name:"jimmy.codes/testing/testing-library/disabled",files:b,rules:{"testing-library/prefer-screen-queries":"off"}}],ce=({framework:e="vitest",utilities:t}={},r=!1)=>{const c=r?v():e==="vitest",u=e==="jest"||r&&k(),o=!!t?.includes("testing-library")||r&&re();return[{name:"jimmy.codes/testing",files:m,...p.configs["flat/recommended"]},...c?[{name:"jimmy.codes/testing/vitest",files:m,...p.configs["flat/recommended"],rules:{...q,"jest/no-deprecated-functions":"off","jest/require-hook":["error",{allowedFunctionCalls:z}]}}]:[],...u?[{name:"jimmy.codes/testing/jest",files:m,...p.configs["flat/recommended"],rules:q}]:[],{name:"jimmy.codes/testing/disabled",files:b,rules:{"jest/expect-expect":"off","jest/no-deprecated-functions":"off","jest/require-hook":"off"}},...o?ae():[]]},ie=e=>n.config(...n.configs.strictTypeChecked,{name:"jimmy.codes/typescript",extends:[...n.configs.strictTypeChecked,...n.configs.stylisticTypeChecked],languageOptions:{parserOptions:{project:e.project,tsconfigRootDir:process.cwd()}},rules:{"@typescript-eslint/consistent-type-imports":["error",{fixStyle:"inline-type-imports"}],"@typescript-eslint/consistent-type-exports":["error",{fixMixedExportsWithInlineTypeSpecifier:!0}],"@typescript-eslint/no-misused-promises":["error",{checksVoidReturn:{attributes:!1}}],"@typescript-eslint/restrict-template-expressions":["error",{allowNumber:!0}]}},{files:[V,y],...n.configs.disableTypeChecked}),pe={...I.configs.recommended.rules,curly:["error","multi-or-nest","consistent"],"arrow-body-style":["error","always"],"object-shorthand":"error","no-useless-rename":"error","prefer-arrow-callback":"error","no-console":"warn"},fe=e=>typeof e=="object"?e:{project:"./tsconfig.json"},le=e=>typeof e=="object"?e:{framework:"vitest"},me=e=>typeof e=="object"?e:{utilities:[]},ue=({typescript:e=!1,react:t=!1,testing:r=!1,astro:c=!1,overrides:u=[],autoDetect:o=!1}={})=>{const j=e||o&&K(),_=t||o&&Z(),O=r||o&&ee(),E=c||o&&se();return[{name:"jimmy.codes/base",rules:pe},...U({typescript:j}),...j?ie(fe(e)):[],..._?ne(me(t),o):[],...E?M():[],...O?ce(le(r),o):[],{name:"jimmy.codes/disabled",...T},...W(),{ignores:J},...u]};module.exports=ue;
|
|
1
|
+
"use strict";var T=require("eslint-config-prettier"),w=require("astro-eslint-parser"),C=require("eslint-plugin-astro"),f=require("eslint-plugin-jsx-a11y"),d=require("globals"),n=require("typescript-eslint"),i=require("eslint-plugin-import-x"),L=require("eslint-plugin-node-import"),R=require("eslint-plugin-simple-import-sort"),S=require("@tanstack/eslint-plugin-query"),G=require("eslint-plugin-react"),A=require("eslint-plugin-react-hooks"),P=require("eslint-plugin-react-refresh"),a=require("local-pkg"),p=require("eslint-plugin-jest"),B=require("eslint-plugin-jest-dom"),g=require("eslint-plugin-testing-library"),I=require("@eslint/js");function l(e){var t=Object.create(null);return e&&Object.keys(e).forEach(function(r){if(r!=="default"){var c=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,c.get?c:{enumerable:!0,get:function(){return e[r]}})}}),t.default=e,Object.freeze(t)}var $=l(w),N=l(S),F=l(P),x=l(B);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","**/CHANGELOG*.md","**/*.min.*","**/LICENSE*","**/__snapshots__","**/auto-import?(s).d.ts","**/components.d.ts","**/vite.config.ts.*.mjs","!.storybook"],V="**/*.?([cm])js",y="**/*.?([cm])jsx",h="**/*.?([cm])tsx",m=[`**/__tests__/**/*.${s}`,`**/*.spec.${s}`,`**/*.test.${s}`,`**/*.bench.${s}`,`**/*.benchmark.${s}`],b=[`**/e2e/**/*.spec.${s}`,`**/e2e/**/*.test.${s}`,`**/cypress/**/*.spec.${s}`,`**/cypress/**/*.test.${s}`],Q="**/*.cjs",X="**/*.astro",z=["vi.mock"],H=["@testing-library/react"],M=()=>{const e=[X];return[{files:e,name:"jimmy.codes/astro",plugins:{astro:C,"jsx-a11y":{rules:f.rules}},languageOptions:{globals:{...d.node,Astro:!1,Fragment:!1},parser:$,sourceType:"module",parserOptions:{parser:n.parser,extraFileExtensions:[".astro"]}},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-unused-define-vars-in-style":"error","astro/valid-compile":"error","astro/no-exports-from-components":"off"}},{files:e,...n.configs.disableTypeChecked,name:"jimmy.codes/astro/disable-type-checked"},{settings:{"import-x/core-modules":["astro:content"]},name:"jimmy.codes/astro/imports"}]},W=()=>[{name:"jimmy.codes/commonjs",files:[Q],languageOptions:{globals:d.commonjs}}],Y={...i.configs.recommended.rules,"import-x/namespace":"off","import-x/newline-after-import":"error","import-x/first":"error","import-x/no-absolute-path":"error","import-x/no-useless-path-segments":"error","import-x/no-empty-named-blocks":"error","import-x/no-self-import":"error","simple-import-sort/imports":"error","simple-import-sort/exports":"error","node-import/prefer-node-protocol":"error"},D={name:"jimmy.codes/imports/typescript",settings:{...i.configs.typescript.settings,"import-x/resolver":{...i.configs.typescript.settings["import-x/resolver"],typescript:!0}},rules:i.configs.typescript.rules},U=({typescript:e=!1}={})=>[{name:"jimmy.codes/imports",plugins:{"import-x":i,"simple-import-sort":R,"node-import":L},settings:{"import-x/parsers":{espree:[".js",".cjs",".mjs",".jsx"]}},languageOptions:{parserOptions:{ecmaVersion:"latest",sourceType:"module"}},rules:Y},...e?[D]:[]],K=()=>a.isPackageExists("typescript"),Z=()=>a.isPackageExists("react"),v=()=>a.isPackageExists("vitest"),k=()=>a.isPackageExists("jest"),ee=()=>v()||k(),re=()=>H.some(e=>a.isPackageExists(e)),te=()=>a.isPackageExists("@tanstack/react-query"),se=()=>a.isPackageExists("astro"),oe={...f.configs.recommended.rules,"react-hooks/exhaustive-deps":"error","react-hooks/rules-of-hooks":"error","react/display-name":"error","react/jsx-key":"error","react/jsx-no-comment-textnodes":"error","react/jsx-no-duplicate-props":"error","react/jsx-no-target-blank":"error","react/jsx-no-undef":"error","react/jsx-uses-vars":"error","react/no-children-prop":"error","react/no-danger-with-children":"error","react/no-deprecated":"error","react/no-direct-mutation-state":"error","react/no-find-dom-node":"error","react/no-is-mounted":"error","react/no-render-return-value":"error","react/no-string-refs":"error","react/no-unescaped-entities":"error","react/no-unknown-property":"error","react/no-unsafe":"off","react/prop-types":"error","react/require-render-return":"error","react/react-in-jsx-scope":"off","react/jsx-uses-react":"off","react-refresh/only-export-components":["warn",{allowConstantExport:!0}],"react/self-closing-comp":"error","react/jsx-curly-brace-presence":"error","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/function-component-definition":"off","react/hook-use-state":"error","react/iframe-missing-sandbox":"error","react/jsx-boolean-value":["error","never"],"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-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":"off","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/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"},ne=({utilities:e=[]}={},t=!1)=>{const r=e.includes("@tanstack/query")||t&&te();return[{name:"jimmy.codes/react",files:[y,h],plugins:{react:G,"react-hooks":A,"jsx-a11y":{rules:f.rules},"react-refresh":F},languageOptions:{parserOptions:{jsxPragma:null,ecmaFeatures:{jsx:!0}},globals:{...d.browser}},settings:{react:{version:"detect"}},rules:oe},...r?[{name:"jimmy.codes/react/query",files:[y,h],plugins:{"@tanstack/query":N},rules:{"@tanstack/query/exhaustive-deps":"error","@tanstack/query/no-rest-destructuring":"warn","@tanstack/query/stable-query-client":"error"}}]:[]]},q={...p.configs["flat/recommended"].rules,...p.configs["flat/style"].rules,"jest/no-alias-methods":"error","jest/no-commented-out-tests":"error","jest/consistent-test-it":["error",{fn:"test",withinDescribe:"it"}],"jest/no-conditional-in-test":"error","jest/no-confusing-set-timeout":"error","jest/no-duplicate-hooks":"error","jest/no-hooks":"off","jest/no-large-snapshots":"off","jest/no-restricted-jest-methods":"off","jest/no-restricted-matchers":"off","jest/no-test-return-statement":"error","jest/no-untyped-mock-factory":"off","jest/prefer-called-with":"error","jest/prefer-comparison-matcher":"error","jest/prefer-each":"error","jest/prefer-equality-matcher":"error","jest/prefer-expect-assertions":"off","jest/prefer-expect-resolves":"error","jest/prefer-hooks-in-order":"error","jest/prefer-hooks-on-top":"error","jest/prefer-lowercase-title":"off","jest/prefer-mock-promise-shorthand":"error","jest/prefer-snapshot-hint":"error","jest/prefer-spy-on":"off","jest/prefer-strict-equal":"error","jest/prefer-todo":"warn","jest/require-hook":"error","jest/require-to-throw-message":"error","jest/require-top-level-describe":"off","jest/unbound-method":"off"},ae=()=>[{name:"jimmy.codes/testing/testing-library",files:m,plugins:{"testing-library":g,"jest-dom":x},rules:{...g.configs.react.rules,...x.configs["flat/recommended"].rules}},{name:"jimmy.codes/testing/testing-library/disabled",files:b,rules:{"testing-library/prefer-screen-queries":"off"}}],ce=({framework:e="vitest",utilities:t}={},r=!1)=>{const c=r?v():e==="vitest",u=e==="jest"||r&&k(),o=!!t?.includes("testing-library")||r&&re();return[{name:"jimmy.codes/testing",files:m,...p.configs["flat/recommended"]},...c?[{name:"jimmy.codes/testing/vitest",files:m,...p.configs["flat/recommended"],rules:{...q,"jest/no-deprecated-functions":"off","jest/require-hook":["error",{allowedFunctionCalls:z}]}}]:[],...u?[{name:"jimmy.codes/testing/jest",files:m,...p.configs["flat/recommended"],rules:q}]:[],{name:"jimmy.codes/testing/disabled",files:b,rules:{"jest/expect-expect":"off","jest/no-deprecated-functions":"off","jest/require-hook":"off"}},...o?ae():[]]},ie=e=>n.config(...n.configs.strictTypeChecked,{name:"jimmy.codes/typescript",extends:[...n.configs.strictTypeChecked,...n.configs.stylisticTypeChecked],languageOptions:{parserOptions:{project:e.project,tsconfigRootDir:process.cwd()}},rules:{"@typescript-eslint/consistent-type-imports":["error",{fixStyle:"inline-type-imports"}],"@typescript-eslint/consistent-type-exports":["error",{fixMixedExportsWithInlineTypeSpecifier:!0}],"@typescript-eslint/no-misused-promises":["error",{checksVoidReturn:{attributes:!1}}],"@typescript-eslint/restrict-template-expressions":["error",{allowNumber:!0}]}},{files:[V,y],...n.configs.disableTypeChecked}),pe={...I.configs.recommended.rules,curly:["error","multi-or-nest","consistent"],"arrow-body-style":["error","always"],"object-shorthand":"error","no-useless-rename":"error","prefer-arrow-callback":"error","no-console":"warn"},fe=e=>typeof e=="object"?e:{project:"./tsconfig.json"},le=e=>typeof e=="object"?e:{framework:"vitest"},me=e=>typeof e=="object"?e:{utilities:[]},ue=({typescript:e=!1,react:t=!1,testing:r=!1,astro:c=!1,overrides:u=[],autoDetect:o=!1}={})=>{const j=e||o&&K(),_=t||o&&Z(),O=r||o&&ee(),E=c||o&&se();return[{name:"jimmy.codes/base",rules:pe},...U({typescript:j}),...j?ie(fe(e)):[],..._?ne(me(t),o):[],...E?M():[],...O?ce(le(r),o):[],{name:"jimmy.codes/disabled",...T},...W(),{ignores:J},...u]};module.exports=ue;
|
package/dist/index.d.cts
CHANGED
|
@@ -1020,6 +1020,11 @@ interface RuleOptions {
|
|
|
1020
1020
|
* @see https://ota-meshi.github.io/eslint-plugin-astro/rules/no-deprecated-getentrybyslug/
|
|
1021
1021
|
*/
|
|
1022
1022
|
'astro/no-deprecated-getentrybyslug'?: Linter.RuleEntry<[]>
|
|
1023
|
+
/**
|
|
1024
|
+
* disallow value export
|
|
1025
|
+
* @see https://ota-meshi.github.io/eslint-plugin-astro/rules/no-exports-from-components/
|
|
1026
|
+
*/
|
|
1027
|
+
'astro/no-exports-from-components'?: Linter.RuleEntry<[]>
|
|
1023
1028
|
/**
|
|
1024
1029
|
* disallow use of `set:html` to prevent XSS attack
|
|
1025
1030
|
* @see https://ota-meshi.github.io/eslint-plugin-astro/rules/no-set-html-directive/
|
package/dist/index.d.mts
CHANGED
|
@@ -1020,6 +1020,11 @@ interface RuleOptions {
|
|
|
1020
1020
|
* @see https://ota-meshi.github.io/eslint-plugin-astro/rules/no-deprecated-getentrybyslug/
|
|
1021
1021
|
*/
|
|
1022
1022
|
'astro/no-deprecated-getentrybyslug'?: Linter.RuleEntry<[]>
|
|
1023
|
+
/**
|
|
1024
|
+
* disallow value export
|
|
1025
|
+
* @see https://ota-meshi.github.io/eslint-plugin-astro/rules/no-exports-from-components/
|
|
1026
|
+
*/
|
|
1027
|
+
'astro/no-exports-from-components'?: Linter.RuleEntry<[]>
|
|
1023
1028
|
/**
|
|
1024
1029
|
* disallow use of `set:html` to prevent XSS attack
|
|
1025
1030
|
* @see https://ota-meshi.github.io/eslint-plugin-astro/rules/no-set-html-directive/
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import _ from"eslint-config-prettier";import*as C from"astro-eslint-parser";import q from"eslint-plugin-astro";import p from"eslint-plugin-jsx-a11y";import d from"globals";import{parser as E,configs as a,config as L}from"typescript-eslint";import c from"eslint-plugin-import-x";import R from"eslint-plugin-node-import";import S from"eslint-plugin-simple-import-sort";import*as G from"@tanstack/eslint-plugin-query";import A from"eslint-plugin-react";import B from"eslint-plugin-react-hooks";import*as I from"eslint-plugin-react-refresh";import{isPackageExists as s}from"local-pkg";import i from"eslint-plugin-jest";import*as j from"eslint-plugin-jest-dom";import g from"eslint-plugin-testing-library";import $ from"@eslint/js";const r="?([cm])[jt]s?(x)",N=["**/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"],F="**/*.?([cm])js",u="**/*.?([cm])jsx",x="**/*.?([cm])tsx",f=[`**/__tests__/**/*.${r}`,`**/*.spec.${r}`,`**/*.test.${r}`,`**/*.bench.${r}`,`**/*.benchmark.${r}`],h=[`**/e2e/**/*.spec.${r}`,`**/e2e/**/*.test.${r}`,`**/cypress/**/*.spec.${r}`,`**/cypress/**/*.test.${r}`],J="**/*.cjs",V="**/*.astro",X=["vi.mock"],P=["@testing-library/react"],Q=()=>{const e=[V];return[{files:e,name:"jimmy.codes/astro",plugins:{astro:q,"jsx-a11y":{rules:p.rules}},languageOptions:{globals:{...d.node,Astro:!1,Fragment:!1},parser:C,sourceType:"module",parserOptions:{parser:E,extraFileExtensions:[".astro"]}},processor:"astro/client-side-ts",rules:{...p.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-unused-define-vars-in-style":"error","astro/valid-compile":"error"}},{files:e,...a.disableTypeChecked,name:"jimmy.codes/astro/disable-type-checked"},{settings:{"import-x/core-modules":["astro:content"]},name:"jimmy.codes/astro/imports"}]},H=()=>[{name:"jimmy.codes/commonjs",files:[J],languageOptions:{globals:d.commonjs}}],M={...c.configs.recommended.rules,"import-x/namespace":"off","import-x/newline-after-import":"error","import-x/first":"error","import-x/no-absolute-path":"error","import-x/no-useless-path-segments":"error","import-x/no-empty-named-blocks":"error","import-x/no-self-import":"error","simple-import-sort/imports":"error","simple-import-sort/exports":"error","node-import/prefer-node-protocol":"error"},W={name:"jimmy.codes/imports/typescript",settings:{...c.configs.typescript.settings,"import-x/resolver":{...c.configs.typescript.settings["import-x/resolver"],typescript:!0}},rules:c.configs.typescript.rules},Y=({typescript:e=!1}={})=>[{name:"jimmy.codes/imports",plugins:{"import-x":c,"simple-import-sort":S,"node-import":R},settings:{"import-x/parsers":{espree:[".js",".cjs",".mjs",".jsx"]}},languageOptions:{parserOptions:{ecmaVersion:"latest",sourceType:"module"}},rules:M},...e?[W]:[]],z=()=>s("typescript"),U=()=>s("react"),b=()=>s("vitest"),k=()=>s("jest"),K=()=>b()||k(),Z=()=>P.some(e=>s(e)),D=()=>s("@tanstack/react-query"),ee=()=>s("astro"),re={...p.configs.recommended.rules,"react-hooks/exhaustive-deps":"error","react-hooks/rules-of-hooks":"error","react/display-name":"error","react/jsx-key":"error","react/jsx-no-comment-textnodes":"error","react/jsx-no-duplicate-props":"error","react/jsx-no-target-blank":"error","react/jsx-no-undef":"error","react/jsx-uses-vars":"error","react/no-children-prop":"error","react/no-danger-with-children":"error","react/no-deprecated":"error","react/no-direct-mutation-state":"error","react/no-find-dom-node":"error","react/no-is-mounted":"error","react/no-render-return-value":"error","react/no-string-refs":"error","react/no-unescaped-entities":"error","react/no-unknown-property":"error","react/no-unsafe":"off","react/prop-types":"error","react/require-render-return":"error","react/react-in-jsx-scope":"off","react/jsx-uses-react":"off","react-refresh/only-export-components":["warn",{allowConstantExport:!0}],"react/self-closing-comp":"error","react/jsx-curly-brace-presence":"error","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/function-component-definition":"off","react/hook-use-state":"error","react/iframe-missing-sandbox":"error","react/jsx-boolean-value":["error","never"],"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-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":"off","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/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"},te=({utilities:e=[]}={},n=!1)=>{const t=e.includes("@tanstack/query")||n&&D();return[{name:"jimmy.codes/react",files:[u,x],plugins:{react:A,"react-hooks":B,"jsx-a11y":{rules:p.rules},"react-refresh":I},languageOptions:{parserOptions:{jsxPragma:null,ecmaFeatures:{jsx:!0}},globals:{...d.browser}},settings:{react:{version:"detect"}},rules:re},...t?[{name:"jimmy.codes/react/query",files:[u,x],plugins:{"@tanstack/query":G},rules:{"@tanstack/query/exhaustive-deps":"error","@tanstack/query/no-rest-destructuring":"warn","@tanstack/query/stable-query-client":"error"}}]:[]]},v={...i.configs["flat/recommended"].rules,...i.configs["flat/style"].rules,"jest/no-alias-methods":"error","jest/no-commented-out-tests":"error","jest/consistent-test-it":["error",{fn:"test",withinDescribe:"it"}],"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"},oe=()=>[{name:"jimmy.codes/testing/testing-library",files:f,plugins:{"testing-library":g,"jest-dom":j},rules:{...g.configs.react.rules,...j.configs["flat/recommended"].rules}},{name:"jimmy.codes/testing/testing-library/disabled",files:h,rules:{"testing-library/prefer-screen-queries":"off"}}],se=({framework:e="vitest",utilities:n}={},t=!1)=>{const m=t?b():e==="vitest",l=e==="jest"||t&&k(),o=!!n?.includes("testing-library")||t&&Z();return[{name:"jimmy.codes/testing",files:f,...i.configs["flat/recommended"]},...m?[{name:"jimmy.codes/testing/vitest",files:f,...i.configs["flat/recommended"],rules:{...v,"jest/no-deprecated-functions":"off","jest/require-hook":["error",{allowedFunctionCalls:X}]}}]:[],...l?[{name:"jimmy.codes/testing/jest",files:f,...i.configs["flat/recommended"],rules:v}]:[],{name:"jimmy.codes/testing/disabled",files:h,rules:{"jest/expect-expect":"off","jest/no-deprecated-functions":"off","jest/require-hook":"off"}},...o?oe():[]]},ne=e=>L(...a.strictTypeChecked,{name:"jimmy.codes/typescript",extends:[...a.strictTypeChecked,...a.stylisticTypeChecked],languageOptions:{parserOptions:{project:e.project,tsconfigRootDir:process.cwd()}},rules:{"@typescript-eslint/consistent-type-imports":["error",{fixStyle:"inline-type-imports"}],"@typescript-eslint/consistent-type-exports":["error",{fixMixedExportsWithInlineTypeSpecifier:!0}],"@typescript-eslint/no-misused-promises":["error",{checksVoidReturn:{attributes:!1}}],"@typescript-eslint/restrict-template-expressions":["error",{allowNumber:!0}]}},{files:[F,u],...a.disableTypeChecked}),ae={...$.configs.recommended.rules,curly:["error","multi-or-nest","consistent"],"arrow-body-style":["error","always"],"object-shorthand":"error","no-useless-rename":"error","prefer-arrow-callback":"error","no-console":"warn"},ce=e=>typeof e=="object"?e:{project:"./tsconfig.json"},ie=e=>typeof e=="object"?e:{framework:"vitest"},pe=e=>typeof e=="object"?e:{utilities:[]},fe=({typescript:e=!1,react:n=!1,testing:t=!1,astro:m=!1,overrides:l=[],autoDetect:o=!1}={})=>{const y=e||o&&z(),O=n||o&&U(),T=t||o&&K(),w=m||o&&ee();return[{name:"jimmy.codes/base",rules:ae},...Y({typescript:y}),...y?ne(ce(e)):[],...O?te(pe(n),o):[],...w?Q():[],...T?se(ie(t),o):[],{name:"jimmy.codes/disabled",..._},...H(),{ignores:N},...l]};export{fe as default};
|
|
1
|
+
import _ from"eslint-config-prettier";import*as C from"astro-eslint-parser";import q from"eslint-plugin-astro";import p from"eslint-plugin-jsx-a11y";import d from"globals";import{parser as E,configs as a,config as L}from"typescript-eslint";import c from"eslint-plugin-import-x";import R from"eslint-plugin-node-import";import S from"eslint-plugin-simple-import-sort";import*as G from"@tanstack/eslint-plugin-query";import A from"eslint-plugin-react";import B from"eslint-plugin-react-hooks";import*as I from"eslint-plugin-react-refresh";import{isPackageExists as s}from"local-pkg";import i from"eslint-plugin-jest";import*as j from"eslint-plugin-jest-dom";import g from"eslint-plugin-testing-library";import $ from"@eslint/js";const r="?([cm])[jt]s?(x)",N=["**/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"],F="**/*.?([cm])js",u="**/*.?([cm])jsx",x="**/*.?([cm])tsx",f=[`**/__tests__/**/*.${r}`,`**/*.spec.${r}`,`**/*.test.${r}`,`**/*.bench.${r}`,`**/*.benchmark.${r}`],h=[`**/e2e/**/*.spec.${r}`,`**/e2e/**/*.test.${r}`,`**/cypress/**/*.spec.${r}`,`**/cypress/**/*.test.${r}`],J="**/*.cjs",V="**/*.astro",X=["vi.mock"],P=["@testing-library/react"],Q=()=>{const e=[V];return[{files:e,name:"jimmy.codes/astro",plugins:{astro:q,"jsx-a11y":{rules:p.rules}},languageOptions:{globals:{...d.node,Astro:!1,Fragment:!1},parser:C,sourceType:"module",parserOptions:{parser:E,extraFileExtensions:[".astro"]}},processor:"astro/client-side-ts",rules:{...p.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-unused-define-vars-in-style":"error","astro/valid-compile":"error","astro/no-exports-from-components":"off"}},{files:e,...a.disableTypeChecked,name:"jimmy.codes/astro/disable-type-checked"},{settings:{"import-x/core-modules":["astro:content"]},name:"jimmy.codes/astro/imports"}]},H=()=>[{name:"jimmy.codes/commonjs",files:[J],languageOptions:{globals:d.commonjs}}],M={...c.configs.recommended.rules,"import-x/namespace":"off","import-x/newline-after-import":"error","import-x/first":"error","import-x/no-absolute-path":"error","import-x/no-useless-path-segments":"error","import-x/no-empty-named-blocks":"error","import-x/no-self-import":"error","simple-import-sort/imports":"error","simple-import-sort/exports":"error","node-import/prefer-node-protocol":"error"},W={name:"jimmy.codes/imports/typescript",settings:{...c.configs.typescript.settings,"import-x/resolver":{...c.configs.typescript.settings["import-x/resolver"],typescript:!0}},rules:c.configs.typescript.rules},Y=({typescript:e=!1}={})=>[{name:"jimmy.codes/imports",plugins:{"import-x":c,"simple-import-sort":S,"node-import":R},settings:{"import-x/parsers":{espree:[".js",".cjs",".mjs",".jsx"]}},languageOptions:{parserOptions:{ecmaVersion:"latest",sourceType:"module"}},rules:M},...e?[W]:[]],z=()=>s("typescript"),U=()=>s("react"),b=()=>s("vitest"),k=()=>s("jest"),K=()=>b()||k(),Z=()=>P.some(e=>s(e)),D=()=>s("@tanstack/react-query"),ee=()=>s("astro"),re={...p.configs.recommended.rules,"react-hooks/exhaustive-deps":"error","react-hooks/rules-of-hooks":"error","react/display-name":"error","react/jsx-key":"error","react/jsx-no-comment-textnodes":"error","react/jsx-no-duplicate-props":"error","react/jsx-no-target-blank":"error","react/jsx-no-undef":"error","react/jsx-uses-vars":"error","react/no-children-prop":"error","react/no-danger-with-children":"error","react/no-deprecated":"error","react/no-direct-mutation-state":"error","react/no-find-dom-node":"error","react/no-is-mounted":"error","react/no-render-return-value":"error","react/no-string-refs":"error","react/no-unescaped-entities":"error","react/no-unknown-property":"error","react/no-unsafe":"off","react/prop-types":"error","react/require-render-return":"error","react/react-in-jsx-scope":"off","react/jsx-uses-react":"off","react-refresh/only-export-components":["warn",{allowConstantExport:!0}],"react/self-closing-comp":"error","react/jsx-curly-brace-presence":"error","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/function-component-definition":"off","react/hook-use-state":"error","react/iframe-missing-sandbox":"error","react/jsx-boolean-value":["error","never"],"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-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":"off","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/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"},te=({utilities:e=[]}={},n=!1)=>{const t=e.includes("@tanstack/query")||n&&D();return[{name:"jimmy.codes/react",files:[u,x],plugins:{react:A,"react-hooks":B,"jsx-a11y":{rules:p.rules},"react-refresh":I},languageOptions:{parserOptions:{jsxPragma:null,ecmaFeatures:{jsx:!0}},globals:{...d.browser}},settings:{react:{version:"detect"}},rules:re},...t?[{name:"jimmy.codes/react/query",files:[u,x],plugins:{"@tanstack/query":G},rules:{"@tanstack/query/exhaustive-deps":"error","@tanstack/query/no-rest-destructuring":"warn","@tanstack/query/stable-query-client":"error"}}]:[]]},v={...i.configs["flat/recommended"].rules,...i.configs["flat/style"].rules,"jest/no-alias-methods":"error","jest/no-commented-out-tests":"error","jest/consistent-test-it":["error",{fn:"test",withinDescribe:"it"}],"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"},oe=()=>[{name:"jimmy.codes/testing/testing-library",files:f,plugins:{"testing-library":g,"jest-dom":j},rules:{...g.configs.react.rules,...j.configs["flat/recommended"].rules}},{name:"jimmy.codes/testing/testing-library/disabled",files:h,rules:{"testing-library/prefer-screen-queries":"off"}}],se=({framework:e="vitest",utilities:n}={},t=!1)=>{const m=t?b():e==="vitest",l=e==="jest"||t&&k(),o=!!n?.includes("testing-library")||t&&Z();return[{name:"jimmy.codes/testing",files:f,...i.configs["flat/recommended"]},...m?[{name:"jimmy.codes/testing/vitest",files:f,...i.configs["flat/recommended"],rules:{...v,"jest/no-deprecated-functions":"off","jest/require-hook":["error",{allowedFunctionCalls:X}]}}]:[],...l?[{name:"jimmy.codes/testing/jest",files:f,...i.configs["flat/recommended"],rules:v}]:[],{name:"jimmy.codes/testing/disabled",files:h,rules:{"jest/expect-expect":"off","jest/no-deprecated-functions":"off","jest/require-hook":"off"}},...o?oe():[]]},ne=e=>L(...a.strictTypeChecked,{name:"jimmy.codes/typescript",extends:[...a.strictTypeChecked,...a.stylisticTypeChecked],languageOptions:{parserOptions:{project:e.project,tsconfigRootDir:process.cwd()}},rules:{"@typescript-eslint/consistent-type-imports":["error",{fixStyle:"inline-type-imports"}],"@typescript-eslint/consistent-type-exports":["error",{fixMixedExportsWithInlineTypeSpecifier:!0}],"@typescript-eslint/no-misused-promises":["error",{checksVoidReturn:{attributes:!1}}],"@typescript-eslint/restrict-template-expressions":["error",{allowNumber:!0}]}},{files:[F,u],...a.disableTypeChecked}),ae={...$.configs.recommended.rules,curly:["error","multi-or-nest","consistent"],"arrow-body-style":["error","always"],"object-shorthand":"error","no-useless-rename":"error","prefer-arrow-callback":"error","no-console":"warn"},ce=e=>typeof e=="object"?e:{project:"./tsconfig.json"},ie=e=>typeof e=="object"?e:{framework:"vitest"},pe=e=>typeof e=="object"?e:{utilities:[]},fe=({typescript:e=!1,react:n=!1,testing:t=!1,astro:m=!1,overrides:l=[],autoDetect:o=!1}={})=>{const y=e||o&&z(),O=n||o&&U(),T=t||o&&K(),w=m||o&&ee();return[{name:"jimmy.codes/base",rules:ae},...Y({typescript:y}),...y?ne(ce(e)):[],...O?te(pe(n),o):[],...w?Q():[],...T?se(ie(t),o):[],{name:"jimmy.codes/disabled",..._},...H(),{ignores:N},...l]};export{fe as default};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jimmy.codes/eslint-config",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.0",
|
|
4
4
|
"description": "another opinionated eslint config",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint",
|
|
@@ -34,10 +34,10 @@
|
|
|
34
34
|
"@eslint/js": "^8.57.0",
|
|
35
35
|
"@tanstack/eslint-plugin-query": "^5.28.11",
|
|
36
36
|
"@typescript-eslint/utils": "^7.6.0",
|
|
37
|
-
"astro-eslint-parser": "0.
|
|
37
|
+
"astro-eslint-parser": "^1.0.1",
|
|
38
38
|
"eslint-config-prettier": "^9.1.0",
|
|
39
39
|
"eslint-import-resolver-typescript": "^3.6.1",
|
|
40
|
-
"eslint-plugin-astro": "
|
|
40
|
+
"eslint-plugin-astro": "^1.1.1",
|
|
41
41
|
"eslint-plugin-import-x": "0.5.0",
|
|
42
42
|
"eslint-plugin-jest": "^28.2.0",
|
|
43
43
|
"eslint-plugin-jest-dom": "^5.2.0",
|