@jimmy.codes/eslint-config 1.6.1 → 1.7.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/README.md CHANGED
@@ -58,6 +58,11 @@ export default jimmyDotCodes({
58
58
  * @default false
59
59
  */
60
60
  react: true,
61
+ /**
62
+ * Are Astro rules are enabled?
63
+ * @default false
64
+ */
65
+ astro: true,
61
66
  /**
62
67
  * Are testing rules are enabled?
63
68
  * @default false
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";var O=require("eslint-config-prettier"),d=require("globals"),a=require("eslint-plugin-import-x"),w=require("eslint-plugin-node-import"),E=require("eslint-plugin-simple-import-sort"),T=require("@tanstack/eslint-plugin-query"),j=require("eslint-plugin-jsx-a11y"),C=require("eslint-plugin-react"),L=require("eslint-plugin-react-hooks"),R=require("eslint-plugin-react-refresh"),c=require("local-pkg"),i=require("eslint-plugin-jest"),S=require("eslint-plugin-jest-dom"),y=require("eslint-plugin-testing-library"),p=require("typescript-eslint"),G=require("@eslint/js");function m(e){var t=Object.create(null);return e&&Object.keys(e).forEach(function(r){if(r!=="default"){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}}),t.default=e,Object.freeze(t)}var P=m(T),I=m(R),g=m(S);const s="?([cm])[jt]s?(x)",B=["**/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","**/CHANGELOG*.md","**/*.min.*","**/LICENSE*","**/__snapshots__","**/auto-import?(s).d.ts","**/components.d.ts","**/vite.config.ts.*.mjs","!.storybook"],$="**/*.?([cm])js",u="**/*.?([cm])jsx",x="**/*.?([cm])tsx",l=[`**/__tests__/**/*.${s}`,`**/*.spec.${s}`,`**/*.test.${s}`,`**/*.bench.${s}`,`**/*.benchmark.${s}`],h=[`**/e2e/**/*.spec.${s}`,`**/e2e/**/*.test.${s}`,`**/cypress/**/*.spec.${s}`,`**/cypress/**/*.test.${s}`],N="**/*.cjs",A=["vi.mock"],J=["@testing-library/react"],V=()=>[{name:"jimmy.codes/commonjs",files:[N],languageOptions:{globals:d.commonjs}}],F={...a.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"},Q={name:"jimmy.codes/imports/typescript",settings:{...a.configs.typescript.settings,"import-x/resolver":{...a.configs.typescript.settings["import-x/resolver"],typescript:!0}},rules:a.configs.typescript.rules},X=({typescript:e=!1}={})=>[{name:"jimmy.codes/imports",plugins:{"import-x":a,"simple-import-sort":E,"node-import":w},settings:{"import-x/parsers":{espree:[".js",".cjs",".mjs",".jsx"]}},languageOptions:{parserOptions:{ecmaVersion:"latest",sourceType:"module"}},rules:F},...e?[Q]:[]],z=()=>c.isPackageExists("typescript"),D=()=>c.isPackageExists("react"),b=()=>c.isPackageExists("vitest"),k=()=>c.isPackageExists("jest"),H=()=>b()||k(),M=()=>J.some(e=>c.isPackageExists(e)),W=()=>c.isPackageExists("@tanstack/react-query"),Y={...j.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"},U=({utilities:e=[]}={},t=!1)=>{const r=e.includes("@tanstack/query")||t&&W();return[{name:"jimmy.codes/react",files:[u,x],plugins:{react:C,"react-hooks":L,"jsx-a11y":{rules:j.rules},"react-refresh":I},languageOptions:{parserOptions:{jsxPragma:null,ecmaFeatures:{jsx:!0}},globals:{...d.browser}},settings:{react:{version:"detect"}},rules:Y},...r?[{name:"jimmy.codes/react/query",files:[u,x],plugins:{"@tanstack/query":P},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"},K=()=>[{name:"jimmy.codes/testing/testing-library",files:l,plugins:{"testing-library":y,"jest-dom":g},rules:{...y.configs.react.rules,...g.configs["flat/recommended"].rules}},{name:"jimmy.codes/testing/testing-library/disabled",files:h,rules:{"testing-library/prefer-screen-queries":"off"}}],Z=({framework:e="vitest",utilities:t}={},r=!1)=>{const n=r?b():e==="vitest",o=e==="jest"||r&&k(),f=!!t?.includes("testing-library")||r&&M();return[{name:"jimmy.codes/testing",files:l,...i.configs["flat/recommended"]},...n?[{name:"jimmy.codes/testing/vitest",files:l,...i.configs["flat/recommended"],rules:{...v,"jest/no-deprecated-functions":"off","jest/require-hook":["error",{allowedFunctionCalls:A}]}}]:[],...o?[{name:"jimmy.codes/testing/jest",files:l,...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"}},...f?K():[]]},ee=e=>p.config(...p.configs.strictTypeChecked,{name:"jimmy.codes/typescript",extends:[...p.configs.strictTypeChecked,...p.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:[$,u],...p.configs.disableTypeChecked}),re={...G.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"},te=e=>typeof e=="object"?e:{project:"./tsconfig.json"},se=e=>typeof e=="object"?e:{framework:"vitest"},oe=e=>typeof e=="object"?e:{utilities:[]},ne=({typescript:e=!1,react:t=!1,testing:r=!1,overrides:n=[],autoDetect:o=!1}={})=>{const f=e||o&&z(),q=t||o&&D(),_=r||o&&H();return[{name:"jimmy.codes/base",rules:re},...X({typescript:f}),...f?ee(te(e)):[],...q?U(oe(t),o):[],..._?Z(se(r),o):[],{name:"jimmy.codes/disabled",...O},...V(),{ignores:B},...n]};module.exports=ne;
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;
package/dist/index.d.cts CHANGED
@@ -1,4 +1,3 @@
1
- import * as _typescript_eslint_utils_ts_eslint from '@typescript-eslint/utils/ts-eslint';
2
1
  import * as eslint_plugin_jest_dom from 'eslint-plugin-jest-dom';
3
2
  import * as eslint_plugin_testing_library from 'eslint-plugin-testing-library';
4
3
  import * as _tanstack_eslint_plugin_query from '@tanstack/eslint-plugin-query';
@@ -6,6 +5,7 @@ import * as eslint_plugin_react_refresh from 'eslint-plugin-react-refresh';
6
5
  import * as eslint_plugin_react_hooks from 'eslint-plugin-react-hooks';
7
6
  import * as eslint from 'eslint';
8
7
  import { Linter } from 'eslint';
8
+ import * as _typescript_eslint_utils_ts_eslint from '@typescript-eslint/utils/ts-eslint';
9
9
 
10
10
  /* eslint-disable */
11
11
  /* prettier-ignore */
@@ -810,6 +810,261 @@ interface RuleOptions {
810
810
  * @deprecated
811
811
  */
812
812
  'arrow-spacing'?: Linter.RuleEntry<ArrowSpacing>
813
+ /**
814
+ * apply `jsx-a11y/alt-text` rule to Astro components
815
+ * @see https://ota-meshi.github.io/eslint-plugin-astro/rules/jsx-a11y/alt-text/
816
+ */
817
+ 'astro/jsx-a11y/alt-text'?: Linter.RuleEntry<AstroJsxA11yAltText>
818
+ /**
819
+ * apply `jsx-a11y/anchor-ambiguous-text` rule to Astro components
820
+ * @see https://ota-meshi.github.io/eslint-plugin-astro/rules/jsx-a11y/anchor-ambiguous-text/
821
+ */
822
+ 'astro/jsx-a11y/anchor-ambiguous-text'?: Linter.RuleEntry<AstroJsxA11yAnchorAmbiguousText>
823
+ /**
824
+ * apply `jsx-a11y/anchor-has-content` rule to Astro components
825
+ * @see https://ota-meshi.github.io/eslint-plugin-astro/rules/jsx-a11y/anchor-has-content/
826
+ */
827
+ 'astro/jsx-a11y/anchor-has-content'?: Linter.RuleEntry<AstroJsxA11yAnchorHasContent>
828
+ /**
829
+ * apply `jsx-a11y/anchor-is-valid` rule to Astro components
830
+ * @see https://ota-meshi.github.io/eslint-plugin-astro/rules/jsx-a11y/anchor-is-valid/
831
+ */
832
+ 'astro/jsx-a11y/anchor-is-valid'?: Linter.RuleEntry<AstroJsxA11yAnchorIsValid>
833
+ /**
834
+ * apply `jsx-a11y/aria-activedescendant-has-tabindex` rule to Astro components
835
+ * @see https://ota-meshi.github.io/eslint-plugin-astro/rules/jsx-a11y/aria-activedescendant-has-tabindex/
836
+ */
837
+ 'astro/jsx-a11y/aria-activedescendant-has-tabindex'?: Linter.RuleEntry<AstroJsxA11yAriaActivedescendantHasTabindex>
838
+ /**
839
+ * apply `jsx-a11y/aria-props` rule to Astro components
840
+ * @see https://ota-meshi.github.io/eslint-plugin-astro/rules/jsx-a11y/aria-props/
841
+ */
842
+ 'astro/jsx-a11y/aria-props'?: Linter.RuleEntry<AstroJsxA11yAriaProps>
843
+ /**
844
+ * apply `jsx-a11y/aria-proptypes` rule to Astro components
845
+ * @see https://ota-meshi.github.io/eslint-plugin-astro/rules/jsx-a11y/aria-proptypes/
846
+ */
847
+ 'astro/jsx-a11y/aria-proptypes'?: Linter.RuleEntry<AstroJsxA11yAriaProptypes>
848
+ /**
849
+ * apply `jsx-a11y/aria-role` rule to Astro components
850
+ * @see https://ota-meshi.github.io/eslint-plugin-astro/rules/jsx-a11y/aria-role/
851
+ */
852
+ 'astro/jsx-a11y/aria-role'?: Linter.RuleEntry<AstroJsxA11yAriaRole>
853
+ /**
854
+ * apply `jsx-a11y/aria-unsupported-elements` rule to Astro components
855
+ * @see https://ota-meshi.github.io/eslint-plugin-astro/rules/jsx-a11y/aria-unsupported-elements/
856
+ */
857
+ 'astro/jsx-a11y/aria-unsupported-elements'?: Linter.RuleEntry<AstroJsxA11yAriaUnsupportedElements>
858
+ /**
859
+ * apply `jsx-a11y/autocomplete-valid` rule to Astro components
860
+ * @see https://ota-meshi.github.io/eslint-plugin-astro/rules/jsx-a11y/autocomplete-valid/
861
+ */
862
+ 'astro/jsx-a11y/autocomplete-valid'?: Linter.RuleEntry<AstroJsxA11yAutocompleteValid>
863
+ /**
864
+ * apply `jsx-a11y/click-events-have-key-events` rule to Astro components
865
+ * @see https://ota-meshi.github.io/eslint-plugin-astro/rules/jsx-a11y/click-events-have-key-events/
866
+ */
867
+ 'astro/jsx-a11y/click-events-have-key-events'?: Linter.RuleEntry<AstroJsxA11yClickEventsHaveKeyEvents>
868
+ /**
869
+ * apply `jsx-a11y/control-has-associated-label` rule to Astro components
870
+ * @see https://ota-meshi.github.io/eslint-plugin-astro/rules/jsx-a11y/control-has-associated-label/
871
+ */
872
+ 'astro/jsx-a11y/control-has-associated-label'?: Linter.RuleEntry<AstroJsxA11yControlHasAssociatedLabel>
873
+ /**
874
+ * apply `jsx-a11y/heading-has-content` rule to Astro components
875
+ * @see https://ota-meshi.github.io/eslint-plugin-astro/rules/jsx-a11y/heading-has-content/
876
+ */
877
+ 'astro/jsx-a11y/heading-has-content'?: Linter.RuleEntry<AstroJsxA11yHeadingHasContent>
878
+ /**
879
+ * apply `jsx-a11y/html-has-lang` rule to Astro components
880
+ * @see https://ota-meshi.github.io/eslint-plugin-astro/rules/jsx-a11y/html-has-lang/
881
+ */
882
+ 'astro/jsx-a11y/html-has-lang'?: Linter.RuleEntry<AstroJsxA11yHtmlHasLang>
883
+ /**
884
+ * apply `jsx-a11y/iframe-has-title` rule to Astro components
885
+ * @see https://ota-meshi.github.io/eslint-plugin-astro/rules/jsx-a11y/iframe-has-title/
886
+ */
887
+ 'astro/jsx-a11y/iframe-has-title'?: Linter.RuleEntry<AstroJsxA11yIframeHasTitle>
888
+ /**
889
+ * apply `jsx-a11y/img-redundant-alt` rule to Astro components
890
+ * @see https://ota-meshi.github.io/eslint-plugin-astro/rules/jsx-a11y/img-redundant-alt/
891
+ */
892
+ 'astro/jsx-a11y/img-redundant-alt'?: Linter.RuleEntry<AstroJsxA11yImgRedundantAlt>
893
+ /**
894
+ * apply `jsx-a11y/interactive-supports-focus` rule to Astro components
895
+ * @see https://ota-meshi.github.io/eslint-plugin-astro/rules/jsx-a11y/interactive-supports-focus/
896
+ */
897
+ 'astro/jsx-a11y/interactive-supports-focus'?: Linter.RuleEntry<AstroJsxA11yInteractiveSupportsFocus>
898
+ /**
899
+ * apply `jsx-a11y/label-has-associated-control` rule to Astro components
900
+ * @see https://ota-meshi.github.io/eslint-plugin-astro/rules/jsx-a11y/label-has-associated-control/
901
+ */
902
+ 'astro/jsx-a11y/label-has-associated-control'?: Linter.RuleEntry<AstroJsxA11yLabelHasAssociatedControl>
903
+ /**
904
+ * apply `jsx-a11y/lang` rule to Astro components
905
+ * @see https://ota-meshi.github.io/eslint-plugin-astro/rules/jsx-a11y/lang/
906
+ */
907
+ 'astro/jsx-a11y/lang'?: Linter.RuleEntry<AstroJsxA11yLang>
908
+ /**
909
+ * apply `jsx-a11y/media-has-caption` rule to Astro components
910
+ * @see https://ota-meshi.github.io/eslint-plugin-astro/rules/jsx-a11y/media-has-caption/
911
+ */
912
+ 'astro/jsx-a11y/media-has-caption'?: Linter.RuleEntry<AstroJsxA11yMediaHasCaption>
913
+ /**
914
+ * apply `jsx-a11y/mouse-events-have-key-events` rule to Astro components
915
+ * @see https://ota-meshi.github.io/eslint-plugin-astro/rules/jsx-a11y/mouse-events-have-key-events/
916
+ */
917
+ 'astro/jsx-a11y/mouse-events-have-key-events'?: Linter.RuleEntry<AstroJsxA11yMouseEventsHaveKeyEvents>
918
+ /**
919
+ * apply `jsx-a11y/no-access-key` rule to Astro components
920
+ * @see https://ota-meshi.github.io/eslint-plugin-astro/rules/jsx-a11y/no-access-key/
921
+ */
922
+ 'astro/jsx-a11y/no-access-key'?: Linter.RuleEntry<AstroJsxA11yNoAccessKey>
923
+ /**
924
+ * apply `jsx-a11y/no-aria-hidden-on-focusable` rule to Astro components
925
+ * @see https://ota-meshi.github.io/eslint-plugin-astro/rules/jsx-a11y/no-aria-hidden-on-focusable/
926
+ */
927
+ 'astro/jsx-a11y/no-aria-hidden-on-focusable'?: Linter.RuleEntry<AstroJsxA11yNoAriaHiddenOnFocusable>
928
+ /**
929
+ * apply `jsx-a11y/no-autofocus` rule to Astro components
930
+ * @see https://ota-meshi.github.io/eslint-plugin-astro/rules/jsx-a11y/no-autofocus/
931
+ */
932
+ 'astro/jsx-a11y/no-autofocus'?: Linter.RuleEntry<AstroJsxA11yNoAutofocus>
933
+ /**
934
+ * apply `jsx-a11y/no-distracting-elements` rule to Astro components
935
+ * @see https://ota-meshi.github.io/eslint-plugin-astro/rules/jsx-a11y/no-distracting-elements/
936
+ */
937
+ 'astro/jsx-a11y/no-distracting-elements'?: Linter.RuleEntry<AstroJsxA11yNoDistractingElements>
938
+ /**
939
+ * apply `jsx-a11y/no-interactive-element-to-noninteractive-role` rule to Astro components
940
+ * @see https://ota-meshi.github.io/eslint-plugin-astro/rules/jsx-a11y/no-interactive-element-to-noninteractive-role/
941
+ */
942
+ 'astro/jsx-a11y/no-interactive-element-to-noninteractive-role'?: Linter.RuleEntry<AstroJsxA11yNoInteractiveElementToNoninteractiveRole>
943
+ /**
944
+ * apply `jsx-a11y/no-noninteractive-element-interactions` rule to Astro components
945
+ * @see https://ota-meshi.github.io/eslint-plugin-astro/rules/jsx-a11y/no-noninteractive-element-interactions/
946
+ */
947
+ 'astro/jsx-a11y/no-noninteractive-element-interactions'?: Linter.RuleEntry<AstroJsxA11yNoNoninteractiveElementInteractions>
948
+ /**
949
+ * apply `jsx-a11y/no-noninteractive-element-to-interactive-role` rule to Astro components
950
+ * @see https://ota-meshi.github.io/eslint-plugin-astro/rules/jsx-a11y/no-noninteractive-element-to-interactive-role/
951
+ */
952
+ 'astro/jsx-a11y/no-noninteractive-element-to-interactive-role'?: Linter.RuleEntry<AstroJsxA11yNoNoninteractiveElementToInteractiveRole>
953
+ /**
954
+ * apply `jsx-a11y/no-noninteractive-tabindex` rule to Astro components
955
+ * @see https://ota-meshi.github.io/eslint-plugin-astro/rules/jsx-a11y/no-noninteractive-tabindex/
956
+ */
957
+ 'astro/jsx-a11y/no-noninteractive-tabindex'?: Linter.RuleEntry<AstroJsxA11yNoNoninteractiveTabindex>
958
+ /**
959
+ * apply `jsx-a11y/no-redundant-roles` rule to Astro components
960
+ * @see https://ota-meshi.github.io/eslint-plugin-astro/rules/jsx-a11y/no-redundant-roles/
961
+ */
962
+ 'astro/jsx-a11y/no-redundant-roles'?: Linter.RuleEntry<AstroJsxA11yNoRedundantRoles>
963
+ /**
964
+ * apply `jsx-a11y/no-static-element-interactions` rule to Astro components
965
+ * @see https://ota-meshi.github.io/eslint-plugin-astro/rules/jsx-a11y/no-static-element-interactions/
966
+ */
967
+ 'astro/jsx-a11y/no-static-element-interactions'?: Linter.RuleEntry<AstroJsxA11yNoStaticElementInteractions>
968
+ /**
969
+ * apply `jsx-a11y/prefer-tag-over-role` rule to Astro components
970
+ * @see https://ota-meshi.github.io/eslint-plugin-astro/rules/jsx-a11y/prefer-tag-over-role/
971
+ */
972
+ 'astro/jsx-a11y/prefer-tag-over-role'?: Linter.RuleEntry<AstroJsxA11yPreferTagOverRole>
973
+ /**
974
+ * apply `jsx-a11y/role-has-required-aria-props` rule to Astro components
975
+ * @see https://ota-meshi.github.io/eslint-plugin-astro/rules/jsx-a11y/role-has-required-aria-props/
976
+ */
977
+ 'astro/jsx-a11y/role-has-required-aria-props'?: Linter.RuleEntry<AstroJsxA11yRoleHasRequiredAriaProps>
978
+ /**
979
+ * apply `jsx-a11y/role-supports-aria-props` rule to Astro components
980
+ * @see https://ota-meshi.github.io/eslint-plugin-astro/rules/jsx-a11y/role-supports-aria-props/
981
+ */
982
+ 'astro/jsx-a11y/role-supports-aria-props'?: Linter.RuleEntry<AstroJsxA11yRoleSupportsAriaProps>
983
+ /**
984
+ * apply `jsx-a11y/scope` rule to Astro components
985
+ * @see https://ota-meshi.github.io/eslint-plugin-astro/rules/jsx-a11y/scope/
986
+ */
987
+ 'astro/jsx-a11y/scope'?: Linter.RuleEntry<AstroJsxA11yScope>
988
+ /**
989
+ * apply `jsx-a11y/tabindex-no-positive` rule to Astro components
990
+ * @see https://ota-meshi.github.io/eslint-plugin-astro/rules/jsx-a11y/tabindex-no-positive/
991
+ */
992
+ 'astro/jsx-a11y/tabindex-no-positive'?: Linter.RuleEntry<AstroJsxA11yTabindexNoPositive>
993
+ /**
994
+ * the client:only directive is missing the correct component's framework value
995
+ * @see https://ota-meshi.github.io/eslint-plugin-astro/rules/missing-client-only-directive-value/
996
+ */
997
+ 'astro/missing-client-only-directive-value'?: Linter.RuleEntry<[]>
998
+ /**
999
+ * disallow conflicting set directives and child contents
1000
+ * @see https://ota-meshi.github.io/eslint-plugin-astro/rules/no-conflict-set-directives/
1001
+ */
1002
+ 'astro/no-conflict-set-directives'?: Linter.RuleEntry<[]>
1003
+ /**
1004
+ * disallow using deprecated `Astro.canonicalURL`
1005
+ * @see https://ota-meshi.github.io/eslint-plugin-astro/rules/no-deprecated-astro-canonicalurl/
1006
+ */
1007
+ 'astro/no-deprecated-astro-canonicalurl'?: Linter.RuleEntry<[]>
1008
+ /**
1009
+ * disallow using deprecated `Astro.fetchContent()`
1010
+ * @see https://ota-meshi.github.io/eslint-plugin-astro/rules/no-deprecated-astro-fetchcontent/
1011
+ */
1012
+ 'astro/no-deprecated-astro-fetchcontent'?: Linter.RuleEntry<[]>
1013
+ /**
1014
+ * disallow using deprecated `Astro.resolve()`
1015
+ * @see https://ota-meshi.github.io/eslint-plugin-astro/rules/no-deprecated-astro-resolve/
1016
+ */
1017
+ 'astro/no-deprecated-astro-resolve'?: Linter.RuleEntry<[]>
1018
+ /**
1019
+ * disallow using deprecated `getEntryBySlug()`
1020
+ * @see https://ota-meshi.github.io/eslint-plugin-astro/rules/no-deprecated-getentrybyslug/
1021
+ */
1022
+ 'astro/no-deprecated-getentrybyslug'?: Linter.RuleEntry<[]>
1023
+ /**
1024
+ * disallow use of `set:html` to prevent XSS attack
1025
+ * @see https://ota-meshi.github.io/eslint-plugin-astro/rules/no-set-html-directive/
1026
+ */
1027
+ 'astro/no-set-html-directive'?: Linter.RuleEntry<[]>
1028
+ /**
1029
+ * disallow use of `set:text`
1030
+ * @see https://ota-meshi.github.io/eslint-plugin-astro/rules/no-set-text-directive/
1031
+ */
1032
+ 'astro/no-set-text-directive'?: Linter.RuleEntry<[]>
1033
+ /**
1034
+ * disallow selectors defined in `style` tag that don't use in HTML
1035
+ * @see https://ota-meshi.github.io/eslint-plugin-astro/rules/no-unused-css-selector/
1036
+ */
1037
+ 'astro/no-unused-css-selector'?: Linter.RuleEntry<[]>
1038
+ /**
1039
+ * disallow unused `define:vars={...}` in `style` tag
1040
+ * @see https://ota-meshi.github.io/eslint-plugin-astro/rules/no-unused-define-vars-in-style/
1041
+ */
1042
+ 'astro/no-unused-define-vars-in-style'?: Linter.RuleEntry<[]>
1043
+ /**
1044
+ * require `class:list` directives instead of `class` with expressions
1045
+ * @see https://ota-meshi.github.io/eslint-plugin-astro/rules/prefer-class-list-directive/
1046
+ */
1047
+ 'astro/prefer-class-list-directive'?: Linter.RuleEntry<[]>
1048
+ /**
1049
+ * require use object instead of ternary expression in `class:list`
1050
+ * @see https://ota-meshi.github.io/eslint-plugin-astro/rules/prefer-object-class-list/
1051
+ */
1052
+ 'astro/prefer-object-class-list'?: Linter.RuleEntry<[]>
1053
+ /**
1054
+ * require use split array elements in `class:list`
1055
+ * @see https://ota-meshi.github.io/eslint-plugin-astro/rules/prefer-split-class-list/
1056
+ */
1057
+ 'astro/prefer-split-class-list'?: Linter.RuleEntry<AstroPreferSplitClassList>
1058
+ /**
1059
+ * Require or disallow semicolons instead of ASI
1060
+ * @see https://ota-meshi.github.io/eslint-plugin-astro/rules/semi/
1061
+ */
1062
+ 'astro/semi'?: Linter.RuleEntry<AstroSemi>
1063
+ /**
1064
+ * disallow warnings when compiling.
1065
+ * @see https://ota-meshi.github.io/eslint-plugin-astro/rules/valid-compile/
1066
+ */
1067
+ 'astro/valid-compile'?: Linter.RuleEntry<[]>
813
1068
  /**
814
1069
  * Enforce the use of variables within the scope they are defined
815
1070
  * @see https://eslint.org/docs/latest/rules/block-scoped-var
@@ -5235,6 +5490,17 @@ type ArrowSpacing = []|[{
5235
5490
  before?: boolean
5236
5491
  after?: boolean
5237
5492
  }]
5493
+ // ----- astro/prefer-split-class-list -----
5494
+ type AstroPreferSplitClassList = []|[{
5495
+ splitLiteral?: boolean
5496
+ }]
5497
+ // ----- astro/semi -----
5498
+ type AstroSemi = ([]|["never"]|["never", {
5499
+ beforeStatementContinuationChars?: ("always" | "any" | "never")
5500
+ }] | []|["always"]|["always", {
5501
+ omitLastInOneLineBlock?: boolean
5502
+ omitLastInOneLineClassBody?: boolean
5503
+ }])
5238
5504
  // ----- block-spacing -----
5239
5505
  type BlockSpacing = []|[("always" | "never")]
5240
5506
  // ----- brace-style -----
@@ -7527,6 +7793,11 @@ interface Options {
7527
7793
  * @default false
7528
7794
  */
7529
7795
  testing?: boolean | TestingOptions;
7796
+ /**
7797
+ * Are astro rules are enabled?
7798
+ * @default false
7799
+ */
7800
+ astro?: boolean;
7530
7801
  /**
7531
7802
  * Additional flat configs to either extend or overrides configurations
7532
7803
  * @default []
@@ -7539,7 +7810,17 @@ interface Options {
7539
7810
  autoDetect?: boolean;
7540
7811
  }
7541
7812
 
7542
- declare const jimmyDotCodes: ({ typescript, react, testing, overrides, autoDetect, }?: Options) => (FlatConfigItem | {
7813
+ declare const jimmyDotCodes: ({ typescript, react, testing, astro, overrides, autoDetect, }?: Options) => (FlatConfigItem | _typescript_eslint_utils_ts_eslint.FlatConfig.Config | {
7814
+ settings: {
7815
+ "import-x/core-modules": string[];
7816
+ };
7817
+ name: string;
7818
+ files?: undefined;
7819
+ plugins?: undefined;
7820
+ languageOptions?: undefined;
7821
+ processor?: undefined;
7822
+ rules?: undefined;
7823
+ } | {
7543
7824
  name: string;
7544
7825
  files: string[];
7545
7826
  languageOptions: {
@@ -8906,7 +9187,7 @@ declare const jimmyDotCodes: ({ typescript, react, testing, overrides, autoDetec
8906
9187
  "jest/no-deprecated-functions": "off";
8907
9188
  "jest/require-hook": "off";
8908
9189
  };
8909
- } | _typescript_eslint_utils_ts_eslint.FlatConfig.Config | {
9190
+ } | {
8910
9191
  name: string;
8911
9192
  rules: {
8912
9193
  curly: ["error", "multi-or-nest", "consistent"];
package/dist/index.d.mts CHANGED
@@ -1,4 +1,3 @@
1
- import * as _typescript_eslint_utils_ts_eslint from '@typescript-eslint/utils/ts-eslint';
2
1
  import * as eslint_plugin_jest_dom from 'eslint-plugin-jest-dom';
3
2
  import * as eslint_plugin_testing_library from 'eslint-plugin-testing-library';
4
3
  import * as _tanstack_eslint_plugin_query from '@tanstack/eslint-plugin-query';
@@ -6,6 +5,7 @@ import * as eslint_plugin_react_refresh from 'eslint-plugin-react-refresh';
6
5
  import * as eslint_plugin_react_hooks from 'eslint-plugin-react-hooks';
7
6
  import * as eslint from 'eslint';
8
7
  import { Linter } from 'eslint';
8
+ import * as _typescript_eslint_utils_ts_eslint from '@typescript-eslint/utils/ts-eslint';
9
9
 
10
10
  /* eslint-disable */
11
11
  /* prettier-ignore */
@@ -810,6 +810,261 @@ interface RuleOptions {
810
810
  * @deprecated
811
811
  */
812
812
  'arrow-spacing'?: Linter.RuleEntry<ArrowSpacing>
813
+ /**
814
+ * apply `jsx-a11y/alt-text` rule to Astro components
815
+ * @see https://ota-meshi.github.io/eslint-plugin-astro/rules/jsx-a11y/alt-text/
816
+ */
817
+ 'astro/jsx-a11y/alt-text'?: Linter.RuleEntry<AstroJsxA11yAltText>
818
+ /**
819
+ * apply `jsx-a11y/anchor-ambiguous-text` rule to Astro components
820
+ * @see https://ota-meshi.github.io/eslint-plugin-astro/rules/jsx-a11y/anchor-ambiguous-text/
821
+ */
822
+ 'astro/jsx-a11y/anchor-ambiguous-text'?: Linter.RuleEntry<AstroJsxA11yAnchorAmbiguousText>
823
+ /**
824
+ * apply `jsx-a11y/anchor-has-content` rule to Astro components
825
+ * @see https://ota-meshi.github.io/eslint-plugin-astro/rules/jsx-a11y/anchor-has-content/
826
+ */
827
+ 'astro/jsx-a11y/anchor-has-content'?: Linter.RuleEntry<AstroJsxA11yAnchorHasContent>
828
+ /**
829
+ * apply `jsx-a11y/anchor-is-valid` rule to Astro components
830
+ * @see https://ota-meshi.github.io/eslint-plugin-astro/rules/jsx-a11y/anchor-is-valid/
831
+ */
832
+ 'astro/jsx-a11y/anchor-is-valid'?: Linter.RuleEntry<AstroJsxA11yAnchorIsValid>
833
+ /**
834
+ * apply `jsx-a11y/aria-activedescendant-has-tabindex` rule to Astro components
835
+ * @see https://ota-meshi.github.io/eslint-plugin-astro/rules/jsx-a11y/aria-activedescendant-has-tabindex/
836
+ */
837
+ 'astro/jsx-a11y/aria-activedescendant-has-tabindex'?: Linter.RuleEntry<AstroJsxA11yAriaActivedescendantHasTabindex>
838
+ /**
839
+ * apply `jsx-a11y/aria-props` rule to Astro components
840
+ * @see https://ota-meshi.github.io/eslint-plugin-astro/rules/jsx-a11y/aria-props/
841
+ */
842
+ 'astro/jsx-a11y/aria-props'?: Linter.RuleEntry<AstroJsxA11yAriaProps>
843
+ /**
844
+ * apply `jsx-a11y/aria-proptypes` rule to Astro components
845
+ * @see https://ota-meshi.github.io/eslint-plugin-astro/rules/jsx-a11y/aria-proptypes/
846
+ */
847
+ 'astro/jsx-a11y/aria-proptypes'?: Linter.RuleEntry<AstroJsxA11yAriaProptypes>
848
+ /**
849
+ * apply `jsx-a11y/aria-role` rule to Astro components
850
+ * @see https://ota-meshi.github.io/eslint-plugin-astro/rules/jsx-a11y/aria-role/
851
+ */
852
+ 'astro/jsx-a11y/aria-role'?: Linter.RuleEntry<AstroJsxA11yAriaRole>
853
+ /**
854
+ * apply `jsx-a11y/aria-unsupported-elements` rule to Astro components
855
+ * @see https://ota-meshi.github.io/eslint-plugin-astro/rules/jsx-a11y/aria-unsupported-elements/
856
+ */
857
+ 'astro/jsx-a11y/aria-unsupported-elements'?: Linter.RuleEntry<AstroJsxA11yAriaUnsupportedElements>
858
+ /**
859
+ * apply `jsx-a11y/autocomplete-valid` rule to Astro components
860
+ * @see https://ota-meshi.github.io/eslint-plugin-astro/rules/jsx-a11y/autocomplete-valid/
861
+ */
862
+ 'astro/jsx-a11y/autocomplete-valid'?: Linter.RuleEntry<AstroJsxA11yAutocompleteValid>
863
+ /**
864
+ * apply `jsx-a11y/click-events-have-key-events` rule to Astro components
865
+ * @see https://ota-meshi.github.io/eslint-plugin-astro/rules/jsx-a11y/click-events-have-key-events/
866
+ */
867
+ 'astro/jsx-a11y/click-events-have-key-events'?: Linter.RuleEntry<AstroJsxA11yClickEventsHaveKeyEvents>
868
+ /**
869
+ * apply `jsx-a11y/control-has-associated-label` rule to Astro components
870
+ * @see https://ota-meshi.github.io/eslint-plugin-astro/rules/jsx-a11y/control-has-associated-label/
871
+ */
872
+ 'astro/jsx-a11y/control-has-associated-label'?: Linter.RuleEntry<AstroJsxA11yControlHasAssociatedLabel>
873
+ /**
874
+ * apply `jsx-a11y/heading-has-content` rule to Astro components
875
+ * @see https://ota-meshi.github.io/eslint-plugin-astro/rules/jsx-a11y/heading-has-content/
876
+ */
877
+ 'astro/jsx-a11y/heading-has-content'?: Linter.RuleEntry<AstroJsxA11yHeadingHasContent>
878
+ /**
879
+ * apply `jsx-a11y/html-has-lang` rule to Astro components
880
+ * @see https://ota-meshi.github.io/eslint-plugin-astro/rules/jsx-a11y/html-has-lang/
881
+ */
882
+ 'astro/jsx-a11y/html-has-lang'?: Linter.RuleEntry<AstroJsxA11yHtmlHasLang>
883
+ /**
884
+ * apply `jsx-a11y/iframe-has-title` rule to Astro components
885
+ * @see https://ota-meshi.github.io/eslint-plugin-astro/rules/jsx-a11y/iframe-has-title/
886
+ */
887
+ 'astro/jsx-a11y/iframe-has-title'?: Linter.RuleEntry<AstroJsxA11yIframeHasTitle>
888
+ /**
889
+ * apply `jsx-a11y/img-redundant-alt` rule to Astro components
890
+ * @see https://ota-meshi.github.io/eslint-plugin-astro/rules/jsx-a11y/img-redundant-alt/
891
+ */
892
+ 'astro/jsx-a11y/img-redundant-alt'?: Linter.RuleEntry<AstroJsxA11yImgRedundantAlt>
893
+ /**
894
+ * apply `jsx-a11y/interactive-supports-focus` rule to Astro components
895
+ * @see https://ota-meshi.github.io/eslint-plugin-astro/rules/jsx-a11y/interactive-supports-focus/
896
+ */
897
+ 'astro/jsx-a11y/interactive-supports-focus'?: Linter.RuleEntry<AstroJsxA11yInteractiveSupportsFocus>
898
+ /**
899
+ * apply `jsx-a11y/label-has-associated-control` rule to Astro components
900
+ * @see https://ota-meshi.github.io/eslint-plugin-astro/rules/jsx-a11y/label-has-associated-control/
901
+ */
902
+ 'astro/jsx-a11y/label-has-associated-control'?: Linter.RuleEntry<AstroJsxA11yLabelHasAssociatedControl>
903
+ /**
904
+ * apply `jsx-a11y/lang` rule to Astro components
905
+ * @see https://ota-meshi.github.io/eslint-plugin-astro/rules/jsx-a11y/lang/
906
+ */
907
+ 'astro/jsx-a11y/lang'?: Linter.RuleEntry<AstroJsxA11yLang>
908
+ /**
909
+ * apply `jsx-a11y/media-has-caption` rule to Astro components
910
+ * @see https://ota-meshi.github.io/eslint-plugin-astro/rules/jsx-a11y/media-has-caption/
911
+ */
912
+ 'astro/jsx-a11y/media-has-caption'?: Linter.RuleEntry<AstroJsxA11yMediaHasCaption>
913
+ /**
914
+ * apply `jsx-a11y/mouse-events-have-key-events` rule to Astro components
915
+ * @see https://ota-meshi.github.io/eslint-plugin-astro/rules/jsx-a11y/mouse-events-have-key-events/
916
+ */
917
+ 'astro/jsx-a11y/mouse-events-have-key-events'?: Linter.RuleEntry<AstroJsxA11yMouseEventsHaveKeyEvents>
918
+ /**
919
+ * apply `jsx-a11y/no-access-key` rule to Astro components
920
+ * @see https://ota-meshi.github.io/eslint-plugin-astro/rules/jsx-a11y/no-access-key/
921
+ */
922
+ 'astro/jsx-a11y/no-access-key'?: Linter.RuleEntry<AstroJsxA11yNoAccessKey>
923
+ /**
924
+ * apply `jsx-a11y/no-aria-hidden-on-focusable` rule to Astro components
925
+ * @see https://ota-meshi.github.io/eslint-plugin-astro/rules/jsx-a11y/no-aria-hidden-on-focusable/
926
+ */
927
+ 'astro/jsx-a11y/no-aria-hidden-on-focusable'?: Linter.RuleEntry<AstroJsxA11yNoAriaHiddenOnFocusable>
928
+ /**
929
+ * apply `jsx-a11y/no-autofocus` rule to Astro components
930
+ * @see https://ota-meshi.github.io/eslint-plugin-astro/rules/jsx-a11y/no-autofocus/
931
+ */
932
+ 'astro/jsx-a11y/no-autofocus'?: Linter.RuleEntry<AstroJsxA11yNoAutofocus>
933
+ /**
934
+ * apply `jsx-a11y/no-distracting-elements` rule to Astro components
935
+ * @see https://ota-meshi.github.io/eslint-plugin-astro/rules/jsx-a11y/no-distracting-elements/
936
+ */
937
+ 'astro/jsx-a11y/no-distracting-elements'?: Linter.RuleEntry<AstroJsxA11yNoDistractingElements>
938
+ /**
939
+ * apply `jsx-a11y/no-interactive-element-to-noninteractive-role` rule to Astro components
940
+ * @see https://ota-meshi.github.io/eslint-plugin-astro/rules/jsx-a11y/no-interactive-element-to-noninteractive-role/
941
+ */
942
+ 'astro/jsx-a11y/no-interactive-element-to-noninteractive-role'?: Linter.RuleEntry<AstroJsxA11yNoInteractiveElementToNoninteractiveRole>
943
+ /**
944
+ * apply `jsx-a11y/no-noninteractive-element-interactions` rule to Astro components
945
+ * @see https://ota-meshi.github.io/eslint-plugin-astro/rules/jsx-a11y/no-noninteractive-element-interactions/
946
+ */
947
+ 'astro/jsx-a11y/no-noninteractive-element-interactions'?: Linter.RuleEntry<AstroJsxA11yNoNoninteractiveElementInteractions>
948
+ /**
949
+ * apply `jsx-a11y/no-noninteractive-element-to-interactive-role` rule to Astro components
950
+ * @see https://ota-meshi.github.io/eslint-plugin-astro/rules/jsx-a11y/no-noninteractive-element-to-interactive-role/
951
+ */
952
+ 'astro/jsx-a11y/no-noninteractive-element-to-interactive-role'?: Linter.RuleEntry<AstroJsxA11yNoNoninteractiveElementToInteractiveRole>
953
+ /**
954
+ * apply `jsx-a11y/no-noninteractive-tabindex` rule to Astro components
955
+ * @see https://ota-meshi.github.io/eslint-plugin-astro/rules/jsx-a11y/no-noninteractive-tabindex/
956
+ */
957
+ 'astro/jsx-a11y/no-noninteractive-tabindex'?: Linter.RuleEntry<AstroJsxA11yNoNoninteractiveTabindex>
958
+ /**
959
+ * apply `jsx-a11y/no-redundant-roles` rule to Astro components
960
+ * @see https://ota-meshi.github.io/eslint-plugin-astro/rules/jsx-a11y/no-redundant-roles/
961
+ */
962
+ 'astro/jsx-a11y/no-redundant-roles'?: Linter.RuleEntry<AstroJsxA11yNoRedundantRoles>
963
+ /**
964
+ * apply `jsx-a11y/no-static-element-interactions` rule to Astro components
965
+ * @see https://ota-meshi.github.io/eslint-plugin-astro/rules/jsx-a11y/no-static-element-interactions/
966
+ */
967
+ 'astro/jsx-a11y/no-static-element-interactions'?: Linter.RuleEntry<AstroJsxA11yNoStaticElementInteractions>
968
+ /**
969
+ * apply `jsx-a11y/prefer-tag-over-role` rule to Astro components
970
+ * @see https://ota-meshi.github.io/eslint-plugin-astro/rules/jsx-a11y/prefer-tag-over-role/
971
+ */
972
+ 'astro/jsx-a11y/prefer-tag-over-role'?: Linter.RuleEntry<AstroJsxA11yPreferTagOverRole>
973
+ /**
974
+ * apply `jsx-a11y/role-has-required-aria-props` rule to Astro components
975
+ * @see https://ota-meshi.github.io/eslint-plugin-astro/rules/jsx-a11y/role-has-required-aria-props/
976
+ */
977
+ 'astro/jsx-a11y/role-has-required-aria-props'?: Linter.RuleEntry<AstroJsxA11yRoleHasRequiredAriaProps>
978
+ /**
979
+ * apply `jsx-a11y/role-supports-aria-props` rule to Astro components
980
+ * @see https://ota-meshi.github.io/eslint-plugin-astro/rules/jsx-a11y/role-supports-aria-props/
981
+ */
982
+ 'astro/jsx-a11y/role-supports-aria-props'?: Linter.RuleEntry<AstroJsxA11yRoleSupportsAriaProps>
983
+ /**
984
+ * apply `jsx-a11y/scope` rule to Astro components
985
+ * @see https://ota-meshi.github.io/eslint-plugin-astro/rules/jsx-a11y/scope/
986
+ */
987
+ 'astro/jsx-a11y/scope'?: Linter.RuleEntry<AstroJsxA11yScope>
988
+ /**
989
+ * apply `jsx-a11y/tabindex-no-positive` rule to Astro components
990
+ * @see https://ota-meshi.github.io/eslint-plugin-astro/rules/jsx-a11y/tabindex-no-positive/
991
+ */
992
+ 'astro/jsx-a11y/tabindex-no-positive'?: Linter.RuleEntry<AstroJsxA11yTabindexNoPositive>
993
+ /**
994
+ * the client:only directive is missing the correct component's framework value
995
+ * @see https://ota-meshi.github.io/eslint-plugin-astro/rules/missing-client-only-directive-value/
996
+ */
997
+ 'astro/missing-client-only-directive-value'?: Linter.RuleEntry<[]>
998
+ /**
999
+ * disallow conflicting set directives and child contents
1000
+ * @see https://ota-meshi.github.io/eslint-plugin-astro/rules/no-conflict-set-directives/
1001
+ */
1002
+ 'astro/no-conflict-set-directives'?: Linter.RuleEntry<[]>
1003
+ /**
1004
+ * disallow using deprecated `Astro.canonicalURL`
1005
+ * @see https://ota-meshi.github.io/eslint-plugin-astro/rules/no-deprecated-astro-canonicalurl/
1006
+ */
1007
+ 'astro/no-deprecated-astro-canonicalurl'?: Linter.RuleEntry<[]>
1008
+ /**
1009
+ * disallow using deprecated `Astro.fetchContent()`
1010
+ * @see https://ota-meshi.github.io/eslint-plugin-astro/rules/no-deprecated-astro-fetchcontent/
1011
+ */
1012
+ 'astro/no-deprecated-astro-fetchcontent'?: Linter.RuleEntry<[]>
1013
+ /**
1014
+ * disallow using deprecated `Astro.resolve()`
1015
+ * @see https://ota-meshi.github.io/eslint-plugin-astro/rules/no-deprecated-astro-resolve/
1016
+ */
1017
+ 'astro/no-deprecated-astro-resolve'?: Linter.RuleEntry<[]>
1018
+ /**
1019
+ * disallow using deprecated `getEntryBySlug()`
1020
+ * @see https://ota-meshi.github.io/eslint-plugin-astro/rules/no-deprecated-getentrybyslug/
1021
+ */
1022
+ 'astro/no-deprecated-getentrybyslug'?: Linter.RuleEntry<[]>
1023
+ /**
1024
+ * disallow use of `set:html` to prevent XSS attack
1025
+ * @see https://ota-meshi.github.io/eslint-plugin-astro/rules/no-set-html-directive/
1026
+ */
1027
+ 'astro/no-set-html-directive'?: Linter.RuleEntry<[]>
1028
+ /**
1029
+ * disallow use of `set:text`
1030
+ * @see https://ota-meshi.github.io/eslint-plugin-astro/rules/no-set-text-directive/
1031
+ */
1032
+ 'astro/no-set-text-directive'?: Linter.RuleEntry<[]>
1033
+ /**
1034
+ * disallow selectors defined in `style` tag that don't use in HTML
1035
+ * @see https://ota-meshi.github.io/eslint-plugin-astro/rules/no-unused-css-selector/
1036
+ */
1037
+ 'astro/no-unused-css-selector'?: Linter.RuleEntry<[]>
1038
+ /**
1039
+ * disallow unused `define:vars={...}` in `style` tag
1040
+ * @see https://ota-meshi.github.io/eslint-plugin-astro/rules/no-unused-define-vars-in-style/
1041
+ */
1042
+ 'astro/no-unused-define-vars-in-style'?: Linter.RuleEntry<[]>
1043
+ /**
1044
+ * require `class:list` directives instead of `class` with expressions
1045
+ * @see https://ota-meshi.github.io/eslint-plugin-astro/rules/prefer-class-list-directive/
1046
+ */
1047
+ 'astro/prefer-class-list-directive'?: Linter.RuleEntry<[]>
1048
+ /**
1049
+ * require use object instead of ternary expression in `class:list`
1050
+ * @see https://ota-meshi.github.io/eslint-plugin-astro/rules/prefer-object-class-list/
1051
+ */
1052
+ 'astro/prefer-object-class-list'?: Linter.RuleEntry<[]>
1053
+ /**
1054
+ * require use split array elements in `class:list`
1055
+ * @see https://ota-meshi.github.io/eslint-plugin-astro/rules/prefer-split-class-list/
1056
+ */
1057
+ 'astro/prefer-split-class-list'?: Linter.RuleEntry<AstroPreferSplitClassList>
1058
+ /**
1059
+ * Require or disallow semicolons instead of ASI
1060
+ * @see https://ota-meshi.github.io/eslint-plugin-astro/rules/semi/
1061
+ */
1062
+ 'astro/semi'?: Linter.RuleEntry<AstroSemi>
1063
+ /**
1064
+ * disallow warnings when compiling.
1065
+ * @see https://ota-meshi.github.io/eslint-plugin-astro/rules/valid-compile/
1066
+ */
1067
+ 'astro/valid-compile'?: Linter.RuleEntry<[]>
813
1068
  /**
814
1069
  * Enforce the use of variables within the scope they are defined
815
1070
  * @see https://eslint.org/docs/latest/rules/block-scoped-var
@@ -5235,6 +5490,17 @@ type ArrowSpacing = []|[{
5235
5490
  before?: boolean
5236
5491
  after?: boolean
5237
5492
  }]
5493
+ // ----- astro/prefer-split-class-list -----
5494
+ type AstroPreferSplitClassList = []|[{
5495
+ splitLiteral?: boolean
5496
+ }]
5497
+ // ----- astro/semi -----
5498
+ type AstroSemi = ([]|["never"]|["never", {
5499
+ beforeStatementContinuationChars?: ("always" | "any" | "never")
5500
+ }] | []|["always"]|["always", {
5501
+ omitLastInOneLineBlock?: boolean
5502
+ omitLastInOneLineClassBody?: boolean
5503
+ }])
5238
5504
  // ----- block-spacing -----
5239
5505
  type BlockSpacing = []|[("always" | "never")]
5240
5506
  // ----- brace-style -----
@@ -7527,6 +7793,11 @@ interface Options {
7527
7793
  * @default false
7528
7794
  */
7529
7795
  testing?: boolean | TestingOptions;
7796
+ /**
7797
+ * Are astro rules are enabled?
7798
+ * @default false
7799
+ */
7800
+ astro?: boolean;
7530
7801
  /**
7531
7802
  * Additional flat configs to either extend or overrides configurations
7532
7803
  * @default []
@@ -7539,7 +7810,17 @@ interface Options {
7539
7810
  autoDetect?: boolean;
7540
7811
  }
7541
7812
 
7542
- declare const jimmyDotCodes: ({ typescript, react, testing, overrides, autoDetect, }?: Options) => (FlatConfigItem | {
7813
+ declare const jimmyDotCodes: ({ typescript, react, testing, astro, overrides, autoDetect, }?: Options) => (FlatConfigItem | _typescript_eslint_utils_ts_eslint.FlatConfig.Config | {
7814
+ settings: {
7815
+ "import-x/core-modules": string[];
7816
+ };
7817
+ name: string;
7818
+ files?: undefined;
7819
+ plugins?: undefined;
7820
+ languageOptions?: undefined;
7821
+ processor?: undefined;
7822
+ rules?: undefined;
7823
+ } | {
7543
7824
  name: string;
7544
7825
  files: string[];
7545
7826
  languageOptions: {
@@ -8906,7 +9187,7 @@ declare const jimmyDotCodes: ({ typescript, react, testing, overrides, autoDetec
8906
9187
  "jest/no-deprecated-functions": "off";
8907
9188
  "jest/require-hook": "off";
8908
9189
  };
8909
- } | _typescript_eslint_utils_ts_eslint.FlatConfig.Config | {
9190
+ } | {
8910
9191
  name: string;
8911
9192
  rules: {
8912
9193
  curly: ["error", "multi-or-nest", "consistent"];
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- import T from"eslint-config-prettier";import u from"globals";import c from"eslint-plugin-import-x";import _ from"eslint-plugin-node-import";import O from"eslint-plugin-simple-import-sort";import*as q from"@tanstack/eslint-plugin-query";import d from"eslint-plugin-jsx-a11y";import C from"eslint-plugin-react";import L from"eslint-plugin-react-hooks";import*as E from"eslint-plugin-react-refresh";import{isPackageExists as n}from"local-pkg";import a from"eslint-plugin-jest";import*as j from"eslint-plugin-jest-dom";import y from"eslint-plugin-testing-library";import{config as R,configs as p}from"typescript-eslint";import S from"@eslint/js";const r="?([cm])[jt]s?(x)",G=["**/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","**/CHANGELOG*.md","**/*.min.*","**/LICENSE*","**/__snapshots__","**/auto-import?(s).d.ts","**/components.d.ts","**/vite.config.ts.*.mjs","!.storybook"],I="**/*.?([cm])js",l="**/*.?([cm])jsx",g="**/*.?([cm])tsx",f=[`**/__tests__/**/*.${r}`,`**/*.spec.${r}`,`**/*.test.${r}`,`**/*.bench.${r}`,`**/*.benchmark.${r}`],x=[`**/e2e/**/*.spec.${r}`,`**/e2e/**/*.test.${r}`,`**/cypress/**/*.spec.${r}`,`**/cypress/**/*.test.${r}`],B="**/*.cjs",$=["vi.mock"],N=["@testing-library/react"],A=()=>[{name:"jimmy.codes/commonjs",files:[B],languageOptions:{globals:u.commonjs}}],J={...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"},V={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},F=({typescript:e=!1}={})=>[{name:"jimmy.codes/imports",plugins:{"import-x":c,"simple-import-sort":O,"node-import":_},settings:{"import-x/parsers":{espree:[".js",".cjs",".mjs",".jsx"]}},languageOptions:{parserOptions:{ecmaVersion:"latest",sourceType:"module"}},rules:J},...e?[V]:[]],X=()=>n("typescript"),P=()=>n("react"),h=()=>n("vitest"),b=()=>n("jest"),Q=()=>h()||b(),H=()=>N.some(e=>n(e)),M=()=>n("@tanstack/react-query"),W={...d.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"},Y=({utilities:e=[]}={},s=!1)=>{const t=e.includes("@tanstack/query")||s&&M();return[{name:"jimmy.codes/react",files:[l,g],plugins:{react:C,"react-hooks":L,"jsx-a11y":{rules:d.rules},"react-refresh":E},languageOptions:{parserOptions:{jsxPragma:null,ecmaFeatures:{jsx:!0}},globals:{...u.browser}},settings:{react:{version:"detect"}},rules:W},...t?[{name:"jimmy.codes/react/query",files:[l,g],plugins:{"@tanstack/query":q},rules:{"@tanstack/query/exhaustive-deps":"error","@tanstack/query/no-rest-destructuring":"warn","@tanstack/query/stable-query-client":"error"}}]:[]]},k={...a.configs["flat/recommended"].rules,...a.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"},z=()=>[{name:"jimmy.codes/testing/testing-library",files:f,plugins:{"testing-library":y,"jest-dom":j},rules:{...y.configs.react.rules,...j.configs["flat/recommended"].rules}},{name:"jimmy.codes/testing/testing-library/disabled",files:x,rules:{"testing-library/prefer-screen-queries":"off"}}],U=({framework:e="vitest",utilities:s}={},t=!1)=>{const m=t?h():e==="vitest",o=e==="jest"||t&&b(),i=!!s?.includes("testing-library")||t&&H();return[{name:"jimmy.codes/testing",files:f,...a.configs["flat/recommended"]},...m?[{name:"jimmy.codes/testing/vitest",files:f,...a.configs["flat/recommended"],rules:{...k,"jest/no-deprecated-functions":"off","jest/require-hook":["error",{allowedFunctionCalls:$}]}}]:[],...o?[{name:"jimmy.codes/testing/jest",files:f,...a.configs["flat/recommended"],rules:k}]:[],{name:"jimmy.codes/testing/disabled",files:x,rules:{"jest/expect-expect":"off","jest/no-deprecated-functions":"off","jest/require-hook":"off"}},...i?z():[]]},K=e=>R(...p.strictTypeChecked,{name:"jimmy.codes/typescript",extends:[...p.strictTypeChecked,...p.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:[I,l],...p.disableTypeChecked}),Z={...S.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"},D=e=>typeof e=="object"?e:{project:"./tsconfig.json"},ee=e=>typeof e=="object"?e:{framework:"vitest"},re=e=>typeof e=="object"?e:{utilities:[]},te=({typescript:e=!1,react:s=!1,testing:t=!1,overrides:m=[],autoDetect:o=!1}={})=>{const i=e||o&&X(),v=s||o&&P(),w=t||o&&Q();return[{name:"jimmy.codes/base",rules:Z},...F({typescript:i}),...i?K(D(e)):[],...v?Y(re(s),o):[],...w?U(ee(t),o):[],{name:"jimmy.codes/disabled",...T},...A(),{ignores:G},...m]};export{te 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"}},{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.6.1",
3
+ "version": "1.7.0",
4
4
  "description": "another opinionated eslint config",
5
5
  "keywords": [
6
6
  "eslint",
@@ -34,8 +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.17.0",
37
38
  "eslint-config-prettier": "^9.1.0",
38
39
  "eslint-import-resolver-typescript": "^3.6.1",
40
+ "eslint-plugin-astro": "0.34.0",
39
41
  "eslint-plugin-import-x": "0.5.0",
40
42
  "eslint-plugin-jest": "^28.2.0",
41
43
  "eslint-plugin-jest-dom": "^5.2.0",