@jimmy.codes/eslint-config 2.0.0 → 3.0.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
@@ -8,8 +8,6 @@
8
8
 
9
9
  > 🔍 another opinionated [eslint](https://eslint.org) config
10
10
 
11
- _This is an evolution of [eslint-config-jimmy-guzman](https://github.com/jimmy-guzman/eslint-config-jimmy-guzman)_
12
-
13
11
  ## 🛠️ Usage
14
12
 
15
13
  _For a better experience, make sure to use [@jimmy.codes/prettier-config](https://github.com/jimmy-guzman/prettier-config) as well_
@@ -36,12 +34,14 @@ And if you're using [VS Code](https://code.visualstudio.com), make sure to enabl
36
34
  ```jsonc
37
35
  // .vscode/settings.json
38
36
  {
39
- "eslint.experimental.useFlatConfig": true,
37
+ "eslint.useFlatConfig": true,
40
38
  }
41
39
  ```
42
40
 
43
41
  ### 🔧 Configuration
44
42
 
43
+ **By default all rules are enabled based on the project's dependencies.**
44
+
45
45
  This package contains rules that can be enabled or disabled as follows:
46
46
 
47
47
  ```js
@@ -49,34 +49,34 @@ import jimmyDotCodes from "@jimmy.codes/eslint-config";
49
49
 
50
50
  export default jimmyDotCodes({
51
51
  /**
52
- * Are TypeScript rules are enabled?
52
+ * Are TypeScript rules enabled?
53
53
  * @default false
54
54
  */
55
55
  typescript: true,
56
56
  /**
57
- * Are React rules are enabled?
57
+ * Are React rules enabled?
58
58
  * @default false
59
59
  */
60
60
  react: true,
61
61
  /**
62
- * Are Astro rules are enabled?
62
+ * Are Astro rules enabled?
63
63
  * @default false
64
64
  */
65
65
  astro: true,
66
66
  /**
67
- * Are testing rules are enabled?
67
+ * Are testing rules enabled?
68
68
  * @default false
69
69
  */
70
70
  testing: true,
71
71
  });
72
72
  ```
73
73
 
74
- Or you can enable auto detection to enable rules based on a project's dependencies
74
+ Or you can turn off auto detection to enable rules based on a project's dependencies
75
75
 
76
76
  ```js
77
77
  import jimmyDotCodes from "@jimmy.codes/eslint-config";
78
78
 
79
- export default jimmyDotCodes({ autoDetect: true });
79
+ export default jimmyDotCodes({ autoDetect: false });
80
80
  ```
81
81
 
82
82
  #### TypeScript
@@ -122,27 +122,39 @@ export default jimmyDotCodes({
122
122
  });
123
123
  ```
124
124
 
125
- #### Overrides
125
+ #### Extending the Configuration
126
126
 
127
- You can also extend or override the configuration:
127
+ You can also extend the configuration:
128
128
 
129
129
  ```js
130
130
  import jimmyDotCodes from "@jimmy.codes/eslint-config";
131
131
 
132
- export default jimmyDotCodes({
133
- overrides: [
134
- {
135
- rules: {
136
- "prefer-const": "error",
137
- },
138
- },
139
- {
140
- files: ["/**/*.js"],
141
- rules: {
142
- semi: "error",
132
+ export default jimmyDotCodes(
133
+ {
134
+ configs: [
135
+ {
136
+ files: ["**/*.js"],
137
+ rules: {
138
+ "prefer-spread": "error",
139
+ },
143
140
  },
141
+ ],
142
+ },
143
+ {
144
+ rules: {
145
+ "prefer-const": "error",
144
146
  },
145
- ],
147
+ },
148
+ );
149
+ ```
150
+
151
+ You can also extend what is ignored:
152
+
153
+ ```ts
154
+ import jimmyDotCodes from "@jimmy.codes/eslint-config";
155
+
156
+ export default jimmyDotCodes({
157
+ ignores: ["**/*.mjs"],
146
158
  });
147
159
  ```
148
160
 
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";var T=Object.defineProperty;var r=(e,s)=>T(e,"name",{value:s,configurable:!0});var C=require("eslint-config-prettier"),L=require("astro-eslint-parser"),R=require("eslint-plugin-astro"),l=require("eslint-plugin-jsx-a11y"),d=require("globals"),a=require("typescript-eslint"),p=require("eslint-plugin-import-x"),S=require("eslint-plugin-node-import"),G=require("eslint-plugin-simple-import-sort"),P=require("@tanstack/eslint-plugin-query"),A=require("eslint-plugin-react"),B=require("eslint-plugin-react-hooks"),I=require("eslint-plugin-react-refresh"),c=require("local-pkg"),f=require("eslint-plugin-jest"),$=require("eslint-plugin-jest-dom"),x=require("eslint-plugin-testing-library"),N=require("@eslint/js");function y(e){var s=Object.create(null);return e&&Object.keys(e).forEach(function(t){if(t!=="default"){var i=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(s,t,i.get?i:{enumerable:!0,get:r(function(){return e[t]},"get")})}}),s.default=e,Object.freeze(s)}r(y,"_interopNamespaceDefault");var F=y(L),J=y(I),h=y($);const o="?([cm])[jt]s?(x)",V=["**/node_modules","**/dist","**/package-lock.json","**/yarn.lock","**/pnpm-lock.yaml","**/bun.lockb","**/output","**/coverage","**/temp","**/.temp","**/tmp","**/.tmp","**/.history","**/.vitepress/cache","**/.nuxt","**/.next","**/.vercel","**/.changeset","**/.idea","**/.cache","**/.output","**/.vite-inspect","**/.yarn","**/storybook-static","**/.eslint-config-inspector","**/playwright-report","**/.astro","**/CHANGELOG*.md","**/*.min.*","**/LICENSE*","**/__snapshots__","**/auto-import?(s).d.ts","**/components.d.ts","**/vite.config.ts.*.mjs","!.storybook"],X="**/*.?([cm])js",g="**/*.?([cm])jsx",b="**/*.?([cm])tsx",m=[`**/__tests__/**/*.${o}`,`**/*.spec.${o}`,`**/*.test.${o}`,`**/*.bench.${o}`,`**/*.benchmark.${o}`],v=[`**/e2e/**/*.spec.${o}`,`**/e2e/**/*.test.${o}`,`**/cypress/**/*.spec.${o}`,`**/cypress/**/*.test.${o}`],z="**/*.cjs",H="**/*.astro",M=["vi.mock"],Q=["@testing-library/react"],W=r(()=>{const e=[H];return[{files:e,name:"jimmy.codes/astro",plugins:{astro:R,"jsx-a11y":l},languageOptions:{globals:{...d.node,Astro:!1,Fragment:!1},parser:F,sourceType:"module",parserOptions:{parser:a.parser,extraFileExtensions:[".astro"]}},processor:"astro/client-side-ts",rules:{...l.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.configs.disableTypeChecked,name:"jimmy.codes/astro/disable-type-checked"},{settings:{"import-x/core-modules":["astro:content"]},name:"jimmy.codes/astro/imports"}]},"astroConfig"),Y=r(()=>[{name:"jimmy.codes/commonjs",files:[z],languageOptions:{globals:d.commonjs}}],"commonjsConfig"),D={...p.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"},U={name:"jimmy.codes/imports/typescript",settings:{...p.configs.typescript.settings,"import-x/resolver":{...p.configs.typescript.settings["import-x/resolver"],typescript:!0}},rules:p.configs.typescript.rules},K=r(({typescript:e=!1}={})=>[{name:"jimmy.codes/imports",plugins:{"import-x":p,"simple-import-sort":G,"node-import":S},settings:{"import-x/parsers":{espree:[".js",".cjs",".mjs",".jsx"]}},languageOptions:{parserOptions:{ecmaVersion:"latest",sourceType:"module"}},rules:D},...e?[U]:[]],"importsConfig"),Z=r(()=>c.isPackageExists("typescript"),"hasTypescript"),ee=r(()=>c.isPackageExists("react"),"hasReact"),k=r(()=>c.isPackageExists("vitest"),"hasVitest"),q=r(()=>c.isPackageExists("jest"),"hasJest"),re=r(()=>k()||q(),"hasTesting"),te=r(()=>Q.some(e=>c.isPackageExists(e)),"hasTestingLibrary"),se=r(()=>c.isPackageExists("@tanstack/react-query"),"hasReactQuery"),oe=r(()=>c.isPackageExists("astro"),"hasAstro"),ne={...l.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"},ae=r(({utilities:e=[]}={},s=!1)=>{const t=e.includes("@tanstack/query")||s&&se();return[{name:"jimmy.codes/react",files:[g,b],plugins:{react:A,"react-hooks":B,"jsx-a11y":l,"react-refresh":J},languageOptions:{parserOptions:{jsxPragma:null,ecmaFeatures:{jsx:!0}},globals:{...d.browser}},settings:{react:{version:"detect"}},rules:ne},...t?[{name:"jimmy.codes/react/query",files:[g,b],plugins:{"@tanstack/query":P},rules:{"@tanstack/query/exhaustive-deps":"error","@tanstack/query/no-rest-destructuring":"warn","@tanstack/query/stable-query-client":"error"}}]:[]]},"reactConfig"),O={...f.configs["flat/recommended"].rules,...f.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"},ce=r(()=>[{name:"jimmy.codes/testing/testing-library",files:m,plugins:{"testing-library":x,"jest-dom":h},rules:{...x.configs.react.rules,...h.configs["flat/recommended"].rules}},{name:"jimmy.codes/testing/testing-library/disabled",files:v,rules:{"testing-library/prefer-screen-queries":"off"}}],"testingLibraryConfig"),ie=r(({framework:e="vitest",utilities:s}={},t=!1)=>{const i=t?k():e==="vitest",u=e==="jest"||t&&q(),n=!!s?.includes("testing-library")||t&&te();return[{name:"jimmy.codes/testing",files:m,...f.configs["flat/recommended"]},...i?[{name:"jimmy.codes/testing/vitest",files:m,...f.configs["flat/recommended"],rules:{...O,"jest/no-deprecated-functions":"off","jest/require-hook":["error",{allowedFunctionCalls:M}]}}]:[],...u?[{name:"jimmy.codes/testing/jest",files:m,...f.configs["flat/recommended"],rules:O}]:[],{name:"jimmy.codes/testing/disabled",files:v,rules:{"jest/expect-expect":"off","jest/no-deprecated-functions":"off","jest/require-hook":"off"}},...n?ce():[]]},"testingConfig"),pe=r(e=>a.config(...a.configs.strictTypeChecked,{name:"jimmy.codes/typescript",extends:[...a.configs.strictTypeChecked,...a.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}],"@typescript-eslint/no-deprecated":"warn"}},{files:[X,g],...a.configs.disableTypeChecked}),"typescriptConfig"),fe={...N.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"},le=r(e=>typeof e=="object"?e:{project:"./tsconfig.json"},"getTypescriptOptions"),me=r(e=>typeof e=="object"?e:{framework:"vitest"},"getTestingOptions"),ue=r(e=>typeof e=="object"?e:{utilities:[]},"getReactOptions"),de=r(({typescript:e=!1,react:s=!1,testing:t=!1,astro:i=!1,overrides:u=[],autoDetect:n=!1}={})=>{const j=e||n&&Z(),_=s||n&&ee(),E=t||n&&re(),w=i||n&&oe();return[{name:"jimmy.codes/base",rules:fe},...K({typescript:j}),...j?pe(le(e)):[],..._?ae(ue(s),n):[],...w?W():[],...E?ie(me(t),n):[],{name:"jimmy.codes/disabled",...C},...Y(),{ignores:V},...u]},"jimmyDotCodes");module.exports=de;
1
+ "use strict";var L=Object.defineProperty;var r=(e,s)=>L(e,"name",{value:s,configurable:!0});var R=require("eslint-config-prettier"),S=require("astro-eslint-parser"),G=require("eslint-plugin-astro"),l=require("eslint-plugin-jsx-a11y"),d=require("globals"),a=require("typescript-eslint"),p=require("eslint-plugin-import-x"),P=require("eslint-plugin-node-import"),A=require("eslint-plugin-simple-import-sort"),B=require("@tanstack/eslint-plugin-query"),I=require("eslint-plugin-react"),$=require("eslint-plugin-react-hooks"),N=require("eslint-plugin-react-refresh"),c=require("local-pkg"),f=require("eslint-plugin-jest"),F=require("eslint-plugin-jest-dom"),x=require("eslint-plugin-testing-library"),J=require("@eslint/js");function y(e){var s=Object.create(null);return e&&Object.keys(e).forEach(function(t){if(t!=="default"){var i=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(s,t,i.get?i:{enumerable:!0,get:r(function(){return e[t]},"get")})}}),s.default=e,Object.freeze(s)}r(y,"_interopNamespaceDefault");var V=y(S),X=y(N),h=y(F);const o="?([cm])[jt]s?(x)",z=["**/node_modules","**/dist","**/package-lock.json","**/yarn.lock","**/pnpm-lock.yaml","**/bun.lockb","**/output","**/coverage","**/temp","**/.temp","**/tmp","**/.tmp","**/.history","**/.vitepress/cache","**/.nuxt","**/.next","**/.vercel","**/.changeset","**/.idea","**/.cache","**/.output","**/.vite-inspect","**/.yarn","**/storybook-static","**/.eslint-config-inspector","**/playwright-report","**/.astro","**/CHANGELOG*.md","**/*.min.*","**/LICENSE*","**/__snapshots__","**/auto-import?(s).d.ts","**/components.d.ts","**/vite.config.ts.*.mjs","!.storybook"],H="**/*.?([cm])js",g="**/*.?([cm])jsx",b="**/*.?([cm])tsx",m=[`**/__tests__/**/*.${o}`,`**/*.spec.${o}`,`**/*.test.${o}`,`**/*.bench.${o}`,`**/*.benchmark.${o}`],v=[`**/e2e/**/*.spec.${o}`,`**/e2e/**/*.test.${o}`,`**/cypress/**/*.spec.${o}`,`**/cypress/**/*.test.${o}`],M="**/*.cjs",Q="**/*.astro",W=["vi.mock"],Y=["@testing-library/react"],D=r(()=>{const e=[Q];return[{files:e,name:"jimmy.codes/astro",plugins:{astro:G,"jsx-a11y":l},languageOptions:{globals:{...d.node,Astro:!1,Fragment:!1},parser:V,sourceType:"module",parserOptions:{parser:a.parser,extraFileExtensions:[".astro"]}},processor:"astro/client-side-ts",rules:{...l.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.configs.disableTypeChecked,name:"jimmy.codes/astro/disable-type-checked"},{settings:{"import-x/core-modules":["astro:content"]},name:"jimmy.codes/astro/imports"}]},"astroConfig"),U=r(()=>[{name:"jimmy.codes/commonjs",files:[M],languageOptions:{globals:d.commonjs}}],"commonjsConfig"),K={...p.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"},Z={name:"jimmy.codes/imports/typescript",settings:{...p.configs.typescript.settings,"import-x/resolver":{...p.configs.typescript.settings["import-x/resolver"],typescript:!0}},rules:p.configs.typescript.rules},ee=r(({typescript:e=!1}={})=>[{name:"jimmy.codes/imports",plugins:{"import-x":p,"simple-import-sort":A,"node-import":P},settings:{"import-x/parsers":{espree:[".js",".cjs",".mjs",".jsx"]}},languageOptions:{parserOptions:{ecmaVersion:"latest",sourceType:"module"}},rules:K},...e?[Z]:[]],"importsConfig"),re=r(()=>c.isPackageExists("typescript"),"hasTypescript"),te=r(()=>c.isPackageExists("react"),"hasReact"),k=r(()=>c.isPackageExists("vitest"),"hasVitest"),q=r(()=>c.isPackageExists("jest"),"hasJest"),se=r(()=>k()||q(),"hasTesting"),oe=r(()=>Y.some(e=>c.isPackageExists(e)),"hasTestingLibrary"),ne=r(()=>c.isPackageExists("@tanstack/react-query"),"hasReactQuery"),ae=r(()=>c.isPackageExists("astro"),"hasAstro"),ce={...l.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"},ie=r(({utilities:e=[]}={},s=!0)=>{const t=e.includes("@tanstack/query")||s&&ne();return[{name:"jimmy.codes/react",files:[g,b],plugins:{react:I,"react-hooks":$,"jsx-a11y":l,"react-refresh":X},languageOptions:{parserOptions:{jsxPragma:null,ecmaFeatures:{jsx:!0}},globals:{...d.browser}},settings:{react:{version:"detect"}},rules:ce},...t?[{name:"jimmy.codes/react/query",files:[g,b],plugins:{"@tanstack/query":B},rules:{"@tanstack/query/exhaustive-deps":"error","@tanstack/query/no-rest-destructuring":"warn","@tanstack/query/stable-query-client":"error"}}]:[]]},"reactConfig"),O={...f.configs["flat/recommended"].rules,...f.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"},pe=r(()=>[{name:"jimmy.codes/testing/testing-library",files:m,plugins:{"testing-library":x,"jest-dom":h},rules:{...x.configs.react.rules,...h.configs["flat/recommended"].rules}},{name:"jimmy.codes/testing/testing-library/disabled",files:v,rules:{"testing-library/prefer-screen-queries":"off"}}],"testingLibraryConfig"),fe=r(({framework:e="vitest",utilities:s}={},t=!0)=>{const i=t?k():e==="vitest",n=e==="jest"||t&&q(),u=!!s?.includes("testing-library")||t&&oe();return[{name:"jimmy.codes/testing",files:m,...f.configs["flat/recommended"]},...i?[{name:"jimmy.codes/testing/vitest",files:m,...f.configs["flat/recommended"],rules:{...O,"jest/no-deprecated-functions":"off","jest/require-hook":["error",{allowedFunctionCalls:W}]}}]:[],...n?[{name:"jimmy.codes/testing/jest",files:m,...f.configs["flat/recommended"],rules:O}]:[],{name:"jimmy.codes/testing/disabled",files:v,rules:{"jest/expect-expect":"off","jest/no-deprecated-functions":"off","jest/require-hook":"off"}},...u?pe():[]]},"testingConfig"),le=r(e=>a.config(...a.configs.strictTypeChecked,{name:"jimmy.codes/typescript",extends:[...a.configs.strictTypeChecked,...a.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}],"@typescript-eslint/no-deprecated":"warn"}},{files:[H,g],...a.configs.disableTypeChecked}),"typescriptConfig"),me={...J.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"},ue=r(e=>typeof e=="object"?e:{project:"./tsconfig.json"},"getTypescriptOptions"),de=r(e=>typeof e=="object"?e:{framework:"vitest"},"getTestingOptions"),ye=r(e=>typeof e=="object"?e:{utilities:[]},"getReactOptions"),ge=r(({typescript:e=!1,react:s=!1,testing:t=!1,astro:i=!1,autoDetect:n=!0,configs:u=[],ignores:_=[]}={},...E)=>{const j=e||n&&re(),w=s||n&&te(),T=t||n&&se(),C=i||n&&ae();return[{name:"jimmy.codes/base",rules:me},...ee({typescript:j}),...j?le(ue(e)):[],...w?ie(ye(s),n):[],...C?D():[],...T?fe(de(t),n):[],{name:"jimmy.codes/disabled",...R},...U(),{name:"jimmy.codes/ignores",ignores:[...z,..._]},...u,...E]},"jimmyDotCodes");module.exports=ge;