@jimmy.codes/eslint-config 4.0.0 โ 4.1.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 +33 -15
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +40 -1
- package/dist/index.d.mts +40 -1
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -6,16 +6,27 @@
|
|
|
6
6
|
[](https://semantic-release.gitbook.io/semantic-release)
|
|
7
7
|
[](https://github.com/prettier/prettier)
|
|
8
8
|
|
|
9
|
-
> ๐
|
|
9
|
+
> ๐ A pragmatic and opinionated [ESLint](https://eslint.org) config for modern development.
|
|
10
|
+
|
|
11
|
+
## ๐ Philosophy
|
|
12
|
+
|
|
13
|
+
A strict yet ergonomic ESLint config that ensures **clean, maintainable, and modern** JavaScript and TypeScript codebases.
|
|
14
|
+
|
|
15
|
+
- **๐ก๏ธ Prevent Bugs** โ Enforce safe patterns and strict error handling.
|
|
16
|
+
- **๐ Modern JavaScript** โ Prefer concise, expressive, and maintainable syntax.
|
|
17
|
+
- **โก Performance & Maintainability** โ Eliminate redundancy and enforce efficient patterns.
|
|
18
|
+
- **๐งน Consistency** โ Keep code structured, readable, and free of clutter.
|
|
19
|
+
- **๐งช Reliable Testing** โ Enforce best practices for Vitest, Jest, Playwright, and Testing Library.
|
|
20
|
+
- **โ๏ธ Optimized React** โ Ensure predictable rendering, hook safety, and component clarity.
|
|
10
21
|
|
|
11
22
|
## ๐ ๏ธ Usage
|
|
12
23
|
|
|
13
|
-
> [!NOTE]
|
|
14
|
-
> For a better experience,
|
|
24
|
+
> [!NOTE]
|
|
25
|
+
> For a better experience, use [@jimmy.codes/prettier-config](https://github.com/jimmy-guzman/prettier-config) as well.
|
|
15
26
|
|
|
16
27
|
### ๐จ Getting Started
|
|
17
28
|
|
|
18
|
-
|
|
29
|
+
Install the package:
|
|
19
30
|
|
|
20
31
|
```
|
|
21
32
|
pnpm add -D @jimmy.codes/eslint-config
|
|
@@ -29,11 +40,12 @@ import eslintConfig from "@jimmy.codes/eslint-config";
|
|
|
29
40
|
export default eslintConfig();
|
|
30
41
|
```
|
|
31
42
|
|
|
32
|
-
This automatically applies rules based on your installed dependencies
|
|
43
|
+
This automatically applies rules **based on your installed dependencies**.
|
|
33
44
|
|
|
34
45
|
### ๐ง Configuration
|
|
35
46
|
|
|
36
|
-
By default, this config
|
|
47
|
+
By default, this config **auto-detects** relevant rules based on your dependencies (`react`, `vitest`, etc.).
|
|
48
|
+
To disable this behavior:
|
|
37
49
|
|
|
38
50
|
```ts
|
|
39
51
|
import eslintConfig from "@jimmy.codes/eslint-config";
|
|
@@ -41,7 +53,9 @@ import eslintConfig from "@jimmy.codes/eslint-config";
|
|
|
41
53
|
export default eslintConfig({ autoDetect: false });
|
|
42
54
|
```
|
|
43
55
|
|
|
44
|
-
|
|
56
|
+
#### **Manually Enable/Disable Rule Sets**
|
|
57
|
+
|
|
58
|
+
You can explicitly enable or disable rule sets:
|
|
45
59
|
|
|
46
60
|
```ts
|
|
47
61
|
import eslintConfig from "@jimmy.codes/eslint-config";
|
|
@@ -60,9 +74,9 @@ export default eslintConfig({
|
|
|
60
74
|
});
|
|
61
75
|
```
|
|
62
76
|
|
|
63
|
-
#### Extending/Overriding the Configuration
|
|
77
|
+
#### **Extending/Overriding the Configuration**
|
|
64
78
|
|
|
65
|
-
|
|
79
|
+
Use the `overrides` option:
|
|
66
80
|
|
|
67
81
|
```ts
|
|
68
82
|
import eslintConfig from "@jimmy.codes/eslint-config";
|
|
@@ -85,7 +99,7 @@ export default eslintConfig({
|
|
|
85
99
|
});
|
|
86
100
|
```
|
|
87
101
|
|
|
88
|
-
Alternatively,
|
|
102
|
+
Alternatively, pass multiple configurations as separate arguments:
|
|
89
103
|
|
|
90
104
|
```ts
|
|
91
105
|
import eslintConfig from "@jimmy.codes/eslint-config";
|
|
@@ -107,11 +121,9 @@ export default eslintConfig(
|
|
|
107
121
|
);
|
|
108
122
|
```
|
|
109
123
|
|
|
110
|
-
|
|
124
|
+
#### **Ignoring Files**
|
|
111
125
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
You can also extend what is ignored:
|
|
126
|
+
Extend ignored files:
|
|
115
127
|
|
|
116
128
|
```ts
|
|
117
129
|
import eslintConfig from "@jimmy.codes/eslint-config";
|
|
@@ -121,7 +133,13 @@ export default eslintConfig({
|
|
|
121
133
|
});
|
|
122
134
|
```
|
|
123
135
|
|
|
136
|
+
## ๐ฌ Want to Contribute or Suggest Changes?
|
|
137
|
+
|
|
138
|
+
PRs and discussions are welcome! Open an issue if you have suggestions.
|
|
139
|
+
|
|
124
140
|
## โค๏ธ Credits
|
|
125
141
|
|
|
142
|
+
This config is inspired by:
|
|
143
|
+
|
|
126
144
|
- [@antfu/eslint-config](https://github.com/antfu/eslint-config) by [Anthony Fu](https://antfu.me)
|
|
127
|
-
- [@pvtnbr/eslint-config](https://github.com/privatenumber/eslint-config) by [Hiroki Osame](https://hirok.io
|
|
145
|
+
- [@pvtnbr/eslint-config](https://github.com/privatenumber/eslint-config) by [Hiroki Osame](https://hirok.io)
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var Z=Object.create;var d=Object.defineProperty;var ee=Object.getOwnPropertyDescriptor;var re=Object.getOwnPropertyNames;var te=Object.getPrototypeOf,oe=Object.prototype.hasOwnProperty;var r=(e,t)=>d(e,"name",{value:t,configurable:!0});var se=(e,t,o,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let l of re(t))!oe.call(e,l)&&l!==o&&d(e,l,{get:()=>t[l],enumerable:!(i=ee(t,l))||i.enumerable});return e};var s=(e,t,o)=>(o=e!=null?Z(te(e)):{},se(t||!e||!e.__esModule?d(o,"default",{value:e,enumerable:!0}):o,e));var g=require("globals"),f=require("typescript-eslint"),v=require("@eslint-community/eslint-plugin-eslint-comments/configs"),ne=require("eslint-import-resolver-typescript"),y=require("eslint-plugin-import-x"),b=require("eslint-plugin-n"),ie=require("@eslint/js"),w=require("eslint-plugin-jsdoc"),k=require("eslint-plugin-perfectionist"),ae=require("eslint-config-prettier"),a=require("local-pkg"),ce=require("eslint-plugin-regexp"),P=require("eslint-plugin-unicorn");function le(e){var t=Object.create(null);return e&&Object.keys(e).forEach(function(o){if(o!=="default"){var i=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,i.get?i:{enumerable:!0,get:r(function(){return e[o]},"get")})}}),t.default=e,Object.freeze(t)}r(le,"_interopNamespaceDefault");var E=le(ce);const p="?([cm])[jt]s?(x)",pe=["**/node_modules","**/dist","**/package-lock.json","**/yarn.lock","**/pnpm-lock.yaml","**/bun.lockb","**/output","**/coverage","**/temp","**/.temp","**/tmp","**/.tmp","**/.history","**/.vitepress/cache","**/.nuxt","**/.next","**/.vercel","**/.changeset","**/.idea","**/.cache","**/.output","**/.vite-inspect","**/.yarn","**/storybook-static","**/.eslint-config-inspector","**/playwright-report","**/.astro","**/.vinxi","**/app.config.timestamp_*.js","**/CHANGELOG*.md","**/*.min.*","**/LICENSE*","**/__snapshots__","**/auto-import?(s).d.ts","**/components.d.ts","**/vite.config.ts.*.mjs","**/*.gen.*","!.storybook"],C="**/*.?([cm])js",u="**/*.?([cm])jsx",fe="**/*.?([cm])ts",x="**/*.?([cm])tsx",m=[`**/__tests__/**/*.${p}`,`**/*.spec.${p}`,`**/*.test.${p}`,`**/*.bench.${p}`,`**/*.benchmark.${p}`],q=[`**/e2e/**/*.spec.${p}`,`**/e2e/**/*.test.${p}`],j=[...q,`**/cypress/**/*.spec.${p}`,`**/cypress/**/*.test.${p}`],ue=[C,u,fe,x],me="**/*.cjs",de="**/*.astro",ge=["@testing-library/react"],n=r(async e=>{const t=await e;return t.default??t},"interopDefault"),ye=r(async()=>{const e=[de],[t,o,i]=await Promise.all([import("eslint-plugin-astro"),import("astro-eslint-parser"),n(import("eslint-plugin-jsx-a11y"))]);return[{files:e,languageOptions:{globals:{...g.node,Astro:!1,Fragment:!1},parser:o,parserOptions:{extraFileExtensions:[".astro"],parser:f.parser},sourceType:"module"},name:"jimmy.codes/astro",plugins:{astro:t,"jsx-a11y":i},processor:"astro/client-side-ts",rules:{...i.configs.recommended.rules,"astro/missing-client-only-directive-value":"error","astro/no-conflict-set-directives":"error","astro/no-deprecated-astro-canonicalurl":"error","astro/no-deprecated-astro-fetchcontent":"error","astro/no-deprecated-astro-resolve":"error","astro/no-deprecated-getentrybyslug":"error","astro/no-exports-from-components":"off","astro/no-unused-define-vars-in-style":"error","astro/valid-compile":"error"}},{files:e,languageOptions:{parserOptions:f.configs.disableTypeChecked.languageOptions?.parserOptions},name:"jimmy.codes/astro/disable-type-checked",rules:f.configs.disableTypeChecked.rules},{name:"jimmy.codes/astro/imports",settings:{"import-x/core-modules":["astro:content"]}}]},"astroConfig"),xe=r(()=>[{files:[me],languageOptions:{globals:g.commonjs},name:"jimmy.codes/commonjs"}],"commonjsConfig"),je={...v.recommended.rules,"@eslint-community/eslint-comments/no-unused-disable":"off","@eslint-community/eslint-comments/require-description":"error"},he=r(()=>[{...v.recommended,name:"jimmy.codes/eslint-comments",rules:je}],"eslintCommentsConfig"),ve=r(e=>[{ignores:[...pe,...e],name:"jimmy.codes/ignores"}],"ignoresConfig"),be={...y.configs.recommended.rules,"import-x/consistent-type-specifier-style":["error","prefer-top-level"],"import-x/extensions":["error","never",{checkTypedImports:!0,svg:"always"}],"import-x/first":"error","import-x/namespace":"off","import-x/newline-after-import":"error","import-x/no-absolute-path":"error","import-x/no-duplicates":"error","import-x/no-empty-named-blocks":"error","import-x/no-named-as-default":"error","import-x/no-named-as-default-member":"error","import-x/no-self-import":"error","import-x/no-unresolved":["error",{ignore:[String.raw`\.svg$`]}],"import-x/no-useless-path-segments":"error"},we=r(()=>{const{rules:e,settings:t}=y.configs.typescript;return[{name:"jimmy.codes/imports/typescript",rules:e,settings:{"import-x/extensions":t["import-x/extensions"],"import-x/external-module-folders":t["import-x/external-module-folders"],"import-x/parsers":t["import-x/parsers"],"import-x/resolver-next":[ne.createTypeScriptImportResolver({alwaysTryTypes:!0})]}}]},"importsTypescriptConfig"),ke=r(({typescript:e=!1}={})=>[{name:"jimmy.codes/imports",plugins:{"import-x":y,n:b},rules:be},...e?we():[]],"importsConfig"),Pe={...ie.configs.recommended.rules,"array-callback-return":["error",{allowImplicit:!0}],"arrow-body-style":["error","always"],curly:["error","all"],"no-console":"warn","no-self-compare":"error","no-template-curly-in-string":"error","no-unmodified-loop-condition":"error","no-unreachable-loop":"error","no-use-before-define":["error",{allowNamedExports:!1,classes:!1,functions:!1,variables:!0}],"no-useless-rename":"error","object-shorthand":"error","prefer-arrow-callback":"error"},Ee=r(()=>[{linterOptions:{reportUnusedDisableDirectives:!0},name:"jimmy.codes/javascript",rules:Pe}],"javascriptConfig"),Ce=r(async()=>{const e=await n(import("eslint-plugin-jest"));return{...e.configs["flat/recommended"].rules,...e.configs["flat/style"].rules,"jest/consistent-test-it":["error",{fn:"test",withinDescribe:"it"}],"jest/expect-expect":"error","jest/no-alias-methods":"error","jest/no-commented-out-tests":"error","jest/no-conditional-in-test":"error","jest/no-confusing-set-timeout":"error","jest/no-duplicate-hooks":"error","jest/no-hooks":"off","jest/no-large-snapshots":"off","jest/no-restricted-jest-methods":"off","jest/no-restricted-matchers":"off","jest/no-test-return-statement":"error","jest/no-untyped-mock-factory":"off","jest/prefer-called-with":"error","jest/prefer-comparison-matcher":"error","jest/prefer-each":"error","jest/prefer-equality-matcher":"error","jest/prefer-expect-assertions":"off","jest/prefer-expect-resolves":"error","jest/prefer-hooks-in-order":"error","jest/prefer-hooks-on-top":"error","jest/prefer-lowercase-title":"off","jest/prefer-mock-promise-shorthand":"error","jest/prefer-snapshot-hint":"error","jest/prefer-spy-on":"off","jest/prefer-strict-equal":"error","jest/prefer-todo":"warn","jest/require-hook":"error","jest/require-to-throw-message":"error","jest/require-top-level-describe":"off","jest/unbound-method":"off"}},"jestRules"),qe=r(async()=>{const e=await n(import("eslint-plugin-jest"));return[{files:m,ignores:j,...e.configs["flat/recommended"],name:"jimmy.codes/jest",rules:await Ce()}]},"jestConfig"),Oe=r(()=>({...w.configs["flat/recommended-typescript-error"].rules,"jsdoc/require-jsdoc":"off","jsdoc/require-param":"off","jsdoc/require-returns":"off","jsdoc/tag-lines":["error","always",{applyToEndTag:!1}]}),"jsdocRules"),Re=r(()=>[{...w.configs["flat/recommended-typescript-error"],name:"jimmy.codes/jsdoc",rules:Oe()}],"jsdocConfig"),O=r((e={})=>Object.fromEntries(Object.entries(e).map(([t,o])=>[t,o==="warn"?"error":o])),"warningAsErrors"),_e=r(async()=>{const e=await n(import("@next/eslint-plugin-next"));return O(e.configs.recommended.rules)},"nextjsRules"),Te=r(async()=>{const e=await n(import("@next/eslint-plugin-next"));return[{files:ue,name:"jimmy.codes/nextjs",plugins:{"@next/next":e},rules:await _e()}]},"nextjsConfig"),Se={"n/no-process-exit":"off","n/prefer-node-protocol":"error"},Le=r(()=>[{name:"jimmy.codes/node",plugins:{n:b},rules:Se}],"nodeConfig"),Ge={...k.configs["recommended-natural"].rules,"perfectionist/sort-imports":["error",{customGroups:{type:{},value:{}},environment:"node",groups:["side-effect-style","builtin","type","external","internal-type","internal",["parent-type","sibling-type","index-type"],["parent","sibling","index"],"object","style","unknown"],internalPattern:["^~/.*","^@/.*"],order:"asc",type:"natural"}],"perfectionist/sort-modules":"off"},Ae=r(()=>[{name:"jimmy.codes/perfectionist",plugins:{perfectionist:k},rules:Ge}],"perfectionistConfig"),Be=r(async()=>({...(await n(import("eslint-plugin-playwright"))).configs["flat/recommended"].rules,"playwright/expect-expect":"error","playwright/max-nested-describe":"error","playwright/no-conditional-expect":"error","playwright/no-conditional-in-test":"error","playwright/no-element-handle":"error","playwright/no-eval":"error","playwright/no-force-option":"error","playwright/no-nested-step":"error","playwright/no-page-pause":"error","playwright/no-skipped-test":"error","playwright/no-slowed-test":"error","playwright/no-useless-await":"error","playwright/no-useless-not":"error","playwright/no-wait-for-selector":"error","playwright/no-wait-for-timeout":"error"}),"playwrightRules"),Ie=r(async()=>[{...(await n(import("eslint-plugin-playwright"))).configs["flat/recommended"],files:q,name:"jimmy.codes/playwright",rules:await Be()}],"playwrightConfig"),Ne=r(()=>[{name:"jimmy.codes/prettier",...ae}],"prettierConfig"),De=r(()=>a.isPackageExists("typescript"),"hasTypescript"),$e=r(()=>a.isPackageExists("react"),"hasReact"),Fe=r(()=>a.isPackageExists("vitest"),"hasVitest"),Je=r(()=>a.isPackageExists("jest"),"hasJest"),Ve=r(()=>ge.some(e=>a.isPackageExists(e)),"hasTestingLibrary"),Xe=r(()=>a.isPackageExists("@tanstack/react-query"),"hasReactQuery"),ze=r(()=>a.isPackageExists("astro"),"hasAstro"),Ue=r(()=>a.isPackageExists("@playwright/test"),"hasPlaywright"),He=r(()=>a.isPackageExists("storybook"),"hasStorybook"),R=r(()=>a.isPackageExists("next"),"hasNext"),Me=r(()=>a.isPackageExists("vite"),"hasVite"),Qe=r(e=>e===2?"error":e===1?"warn":"off","toStringSeverity"),_=r((e={})=>Object.fromEntries(Object.entries(e).map(([t,o])=>[t,typeof o=="number"?Qe(o):o])),"normalizeRuleEntries"),Ye=["dynamic","dynamicParams","revalidate","fetchCache","runtime","preferredRegion","maxDuration","config","generateStaticParams","metadata","generateMetadata","viewport","generateViewport"],We=r(async()=>{const[e,t]=await Promise.all([n(import("eslint-plugin-react")),n(import("eslint-plugin-jsx-a11y"))]),o=R(),i=Me();return{...t.configs.recommended.rules,..._(e.configs.flat.recommended?.rules),..._(e.configs.flat["jsx-runtime"]?.rules),"react-compiler/react-compiler":"error","react-hooks/exhaustive-deps":"error","react-hooks/rules-of-hooks":"error","react-refresh/only-export-components":["warn",{allowConstantExport:i,allowExportNames:o?Ye:[]}],"react/boolean-prop-naming":"off","react/button-has-type":"error","react/checked-requires-onchange-or-readonly":"error","react/default-props-match-prop-types":"error","react/destructuring-assignment":"off","react/forbid-component-props":"off","react/forbid-dom-props":"off","react/forbid-elements":"off","react/forbid-foreign-prop-types":"off","react/forbid-prop-types":"off","react/forward-ref-uses-ref":"error","react/function-component-definition":"off","react/hook-use-state":"error","react/iframe-missing-sandbox":"error","react/jsx-boolean-value":["error","never"],"react/jsx-curly-brace-presence":"error","react/jsx-filename-extension":"off","react/jsx-fragments":["error","syntax"],"react/jsx-handler-names":"off","react/jsx-max-depth":"off","react/jsx-no-bind":"off","react/jsx-no-constructed-context-values":"error","react/jsx-no-leaked-render":"error","react/jsx-no-literals":"off","react/jsx-no-script-url":"error","react/jsx-no-useless-fragment":"error","react/jsx-one-expression-per-line":"off","react/jsx-pascal-case":["error",{allowNamespace:!0}],"react/jsx-props-no-spread-multi":"off","react/jsx-props-no-spreading":"off","react/jsx-sort-default-props":"off","react/jsx-sort-props":"off","react/no-access-state-in-setstate":"error","react/no-adjacent-inline-elements":"off","react/no-array-index-key":"off","react/no-arrow-function-lifecycle":"error","react/no-danger":"off","react/no-did-mount-set-state":"error","react/no-did-update-set-state":"error","react/no-invalid-html-attribute":"error","react/no-multi-comp":"off","react/no-namespace":"error","react/no-object-type-as-default-prop":"error","react/no-redundant-should-component-update":"error","react/no-set-state":"off","react/no-this-in-sfc":"error","react/no-typos":"error","react/no-unstable-nested-components":"error","react/no-unused-class-component-methods":"error","react/no-unused-prop-types":"error","react/no-unused-state":"error","react/no-will-update-set-state":"error","react/prefer-es6-class":"off","react/prefer-exact-props":"off","react/prefer-read-only-props":"off","react/prefer-stateless-function":"off","react/require-default-props":"off","react/require-optimization":"off","react/self-closing-comp":"error","react/sort-comp":"off","react/sort-default-props":"off","react/sort-prop-types":"off","react/state-in-constructor":"off","react/static-property-placement":"off","react/style-prop-object":"error","react/void-dom-elements-no-children":"error"}},"reactRules"),Ke=r(async()=>{const[e,t,o,i,l]=await Promise.all([n(import("eslint-plugin-react")),n(import("eslint-plugin-jsx-a11y")),import("eslint-plugin-react-hooks"),n(import("eslint-plugin-react-refresh")),n(import("eslint-plugin-react-compiler"))]);return[{files:[u,x],languageOptions:{globals:{...g.browser},parserOptions:{ecmaFeatures:{jsx:!0},jsxPragma:null}},name:"jimmy.codes/react",plugins:{"jsx-a11y":t,react:e,"react-compiler":l,"react-hooks":o,"react-refresh":i},rules:await We(),settings:{react:{version:"detect"}}}]},"reactConfig"),Ze={...E.configs["flat/recommended"].rules,"regexp/confusing-quantifier":"error","regexp/no-empty-alternative":"error","regexp/no-lazy-ends":"error","regexp/no-potentially-useless-backreference":"error","regexp/no-useless-flag":"error","regexp/optimal-lookaround-quantifier":"error"},er=r(()=>[{name:"jimmy.codes/regexp",plugins:{regexp:E},rules:Ze}],"regexpConfig"),rr=r(async()=>{const{configs:e}=await n(import("eslint-plugin-storybook")),[t,o,i]=e["flat/recommended"];return[{name:"jimmy.codes/storybook/setup",plugins:t?.plugins},{files:o?.files,name:"jimmy.codes/storybook/stories-rules",rules:{...O(o?.rules),"import-x/no-anonymous-default-export":"off","unicorn/no-anonymous-default-export":"off"}},{files:i?.files,name:"jimmy.codes/storybook/main-rules",rules:{...i?.rules}}]},"storybookConfig"),tr=r(async()=>{const e=await n(import("@tanstack/eslint-plugin-query"));return[{files:[u,x],name:"jimmy.codes/react/query",plugins:{"@tanstack/query":e},rules:{"@tanstack/query/exhaustive-deps":"error","@tanstack/query/no-rest-destructuring":"warn","@tanstack/query/stable-query-client":"error"}}]},"tanstackQueryConfig"),or=r(async()=>{const[e,t]=await Promise.all([import("eslint-plugin-jest-dom"),n(import("eslint-plugin-testing-library"))]);return{...t.configs["flat/react"].rules,...e.configs["flat/recommended"].rules}},"testingLibraryRules"),sr=r(async()=>{const[e,t]=await Promise.all([import("eslint-plugin-jest-dom"),n(import("eslint-plugin-testing-library"))]);return[{files:m,ignores:j,name:"jimmy.codes/testing-library",plugins:{"jest-dom":e,"testing-library":t},rules:await or()}]},"testingLibraryConfig"),nr={"@typescript-eslint/consistent-type-exports":["error",{fixMixedExportsWithInlineTypeSpecifier:!1}],"@typescript-eslint/consistent-type-imports":["error",{fixStyle:"separate-type-imports"}],"@typescript-eslint/no-deprecated":"warn","@typescript-eslint/no-misused-promises":["error",{checksVoidReturn:{attributes:!1}}],"@typescript-eslint/no-unused-vars":["error",{args:"all",argsIgnorePattern:"^_",caughtErrors:"all",caughtErrorsIgnorePattern:"^_",destructuredArrayIgnorePattern:"^_",ignoreRestSiblings:!0,varsIgnorePattern:"^_"}],"@typescript-eslint/no-use-before-define":["error",{allowNamedExports:!1,classes:!1,functions:!1,variables:!0}],"@typescript-eslint/restrict-template-expressions":["error",{allowNumber:!0}],"no-use-before-define":"off"},ir=r(()=>[...f.configs.strictTypeChecked,...f.configs.stylisticTypeChecked.filter(e=>e.name==="typescript-eslint/stylistic-type-checked"),{languageOptions:{parserOptions:{projectService:!0,tsconfigRootDir:process.cwd()}},name:"jimmy.codes/typescript",rules:nr},{files:[C,u],...f.configs.disableTypeChecked},{files:m,name:"jimmy.codes/typescript/testing",rules:{"@typescript-eslint/no-unsafe-argument":"off","@typescript-eslint/no-unsafe-assignment":"off"}}],"typescriptConfig"),ar={...P.configs["flat/recommended"].rules,"unicorn/filename-case":"off","unicorn/import-style":"off","unicorn/no-abusive-eslint-disable":"off","unicorn/no-anonymous-default-export":"off","unicorn/no-array-callback-reference":"off","unicorn/no-array-reduce":"off","unicorn/no-null":"off","unicorn/no-process-exit":"off","unicorn/no-useless-undefined":["error",{checkArguments:!1,checkArrowFunctionBody:!1}],"unicorn/prefer-node-protocol":"off","unicorn/prevent-abbreviations":"off"},cr=r(()=>[{...P.configs["flat/recommended"],name:"jimmy.codes/unicorn",rules:ar}],"unicornConfig"),lr=r(async()=>({...(await n(import("@vitest/eslint-plugin"))).configs.recommended.rules,"vitest/consistent-test-it":["error",{fn:"test",withinDescribe:"it"}],"vitest/no-alias-methods":"error","vitest/no-commented-out-tests":"error","vitest/no-conditional-in-test":"error","vitest/no-disabled-tests":"warn","vitest/no-duplicate-hooks":"error","vitest/no-focused-tests":"error","vitest/no-hooks":"off","vitest/no-identical-title":"error","vitest/no-interpolation-in-snapshots":"error","vitest/no-large-snapshots":"off","vitest/no-mocks-import":"error","vitest/no-restricted-matchers":"off","vitest/no-restricted-vi-methods":"off","vitest/no-standalone-expect":"error","vitest/no-test-prefixes":"error","vitest/no-test-return-statement":"error","vitest/prefer-called-with":"error","vitest/prefer-comparison-matcher":"error","vitest/prefer-each":"error","vitest/prefer-equality-matcher":"error","vitest/prefer-expect-assertions":"off","vitest/prefer-expect-resolves":"error","vitest/prefer-hooks-in-order":"error","vitest/prefer-hooks-on-top":"error","vitest/prefer-lowercase-title":"off","vitest/prefer-mock-promise-shorthand":"error","vitest/prefer-snapshot-hint":"error","vitest/prefer-spy-on":"off","vitest/prefer-strict-boolean-matchers":"error","vitest/prefer-strict-equal":"error","vitest/prefer-to-be":"error","vitest/prefer-to-contain":"error","vitest/prefer-to-have-length":"error","vitest/prefer-todo":"warn","vitest/require-hook":"error","vitest/require-to-throw-message":"error","vitest/require-top-level-describe":"off","vitest/valid-expect":"error","vitest/valid-expect-in-promise":"error","vitest/valid-title":"error"}),"vitestRules"),pr=r(async()=>{const e=await n(import("@vitest/eslint-plugin"));return[{files:m,ignores:j,...e.configs.recommended,name:"jimmy.codes/vitest",rules:await lr()}]},"vitestConfig"),fr=r(async({astro:e=!1,autoDetect:t=!0,ignores:o=[],jest:i=!1,nextjs:l=!1,overrides:T=[],playwright:S=!1,react:L=!1,storybook:G=!1,tanstackQuery:A=!1,testingLibrary:B=!1,typescript:I=!1,vitest:N=!1}={},...D)=>{const c=r((W,K)=>W||t&&K(),"resolveFlag"),h=c(I,De),$=c(L,$e),F=c(e,ze),J=c(A,Xe),V=c(B,Ve),X=c(S,Ue),z=c(G,He),U=c(l,R),H=c(i,Je),M=c(N,Fe),Q=[Ee(),Ae(),Le(),cr(),he(),er(),Re(),ke({typescript:h})],Y=[h&&ir(),$&&await Ke(),J&&await tr(),F&&await ye(),H&&await qe(),M&&await pr(),V&&await sr(),X&&await Ie(),z&&await rr(),U&&await Te()].filter(Boolean);return[...Q,...Y,Ne(),xe(),ve(o),T,D].flat()},"eslintConfig");module.exports=fr;
|
|
1
|
+
"use strict";var Z=Object.create;var d=Object.defineProperty;var ee=Object.getOwnPropertyDescriptor;var re=Object.getOwnPropertyNames;var te=Object.getPrototypeOf,oe=Object.prototype.hasOwnProperty;var r=(e,t)=>d(e,"name",{value:t,configurable:!0});var se=(e,t,o,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let l of re(t))!oe.call(e,l)&&l!==o&&d(e,l,{get:()=>t[l],enumerable:!(i=ee(t,l))||i.enumerable});return e};var s=(e,t,o)=>(o=e!=null?Z(te(e)):{},se(t||!e||!e.__esModule?d(o,"default",{value:e,enumerable:!0}):o,e));var g=require("globals"),f=require("typescript-eslint"),v=require("@eslint-community/eslint-plugin-eslint-comments/configs"),ne=require("eslint-import-resolver-typescript"),y=require("eslint-plugin-import-x"),b=require("eslint-plugin-n"),ie=require("@eslint/js"),w=require("eslint-plugin-jsdoc"),k=require("eslint-plugin-perfectionist"),ae=require("eslint-config-prettier"),a=require("local-pkg"),ce=require("eslint-plugin-regexp"),P=require("eslint-plugin-unicorn");function le(e){var t=Object.create(null);return e&&Object.keys(e).forEach(function(o){if(o!=="default"){var i=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,i.get?i:{enumerable:!0,get:r(function(){return e[o]},"get")})}}),t.default=e,Object.freeze(t)}r(le,"_interopNamespaceDefault");var E=le(ce);const p="?([cm])[jt]s?(x)",pe=["**/node_modules","**/dist","**/package-lock.json","**/yarn.lock","**/pnpm-lock.yaml","**/bun.lockb","**/output","**/coverage","**/temp","**/.temp","**/tmp","**/.tmp","**/.history","**/.vitepress/cache","**/.nuxt","**/.next","**/.vercel","**/.changeset","**/.idea","**/.cache","**/.output","**/.vite-inspect","**/.yarn","**/storybook-static","**/.eslint-config-inspector","**/playwright-report","**/.astro","**/.vinxi","**/app.config.timestamp_*.js","**/CHANGELOG*.md","**/*.min.*","**/LICENSE*","**/__snapshots__","**/auto-import?(s).d.ts","**/components.d.ts","**/vite.config.ts.*.mjs","**/*.gen.*","!.storybook"],C="**/*.?([cm])js",u="**/*.?([cm])jsx",fe="**/*.?([cm])ts",x="**/*.?([cm])tsx",m=[`**/__tests__/**/*.${p}`,`**/*.spec.${p}`,`**/*.test.${p}`,`**/*.bench.${p}`,`**/*.benchmark.${p}`],q=[`**/e2e/**/*.spec.${p}`,`**/e2e/**/*.test.${p}`],j=[...q,`**/cypress/**/*.spec.${p}`,`**/cypress/**/*.test.${p}`],ue=[C,u,fe,x],me="**/*.cjs",de="**/*.astro",ge=["@testing-library/react"],n=r(async e=>{const t=await e;return t.default??t},"interopDefault"),ye=r(async()=>{const e=[de],[t,o,i]=await Promise.all([import("eslint-plugin-astro"),import("astro-eslint-parser"),n(import("eslint-plugin-jsx-a11y"))]);return[{files:e,languageOptions:{globals:{...g.node,Astro:!1,Fragment:!1},parser:o,parserOptions:{extraFileExtensions:[".astro"],parser:f.parser},sourceType:"module"},name:"jimmy.codes/astro",plugins:{astro:t,"jsx-a11y":i},processor:"astro/client-side-ts",rules:{...i.configs.recommended.rules,"astro/missing-client-only-directive-value":"error","astro/no-conflict-set-directives":"error","astro/no-deprecated-astro-canonicalurl":"error","astro/no-deprecated-astro-fetchcontent":"error","astro/no-deprecated-astro-resolve":"error","astro/no-deprecated-getentrybyslug":"error","astro/no-exports-from-components":"off","astro/no-unused-define-vars-in-style":"error","astro/valid-compile":"error"}},{files:e,languageOptions:{parserOptions:f.configs.disableTypeChecked.languageOptions?.parserOptions},name:"jimmy.codes/astro/disable-type-checked",rules:f.configs.disableTypeChecked.rules},{name:"jimmy.codes/astro/imports",settings:{"import-x/core-modules":["astro:content"]}}]},"astroConfig"),xe=r(()=>[{files:[me],languageOptions:{globals:g.commonjs},name:"jimmy.codes/commonjs"}],"commonjsConfig"),je={...v.recommended.rules,"@eslint-community/eslint-comments/no-unused-disable":"off","@eslint-community/eslint-comments/require-description":"error"},he=r(()=>[{...v.recommended,name:"jimmy.codes/eslint-comments",rules:je}],"eslintCommentsConfig"),ve=r(e=>[{ignores:[...pe,...e],name:"jimmy.codes/ignores"}],"ignoresConfig"),be={...y.configs.recommended.rules,"import-x/consistent-type-specifier-style":["error","prefer-top-level"],"import-x/extensions":["error","never",{checkTypedImports:!0,svg:"always"}],"import-x/first":"error","import-x/namespace":"off","import-x/newline-after-import":"error","import-x/no-absolute-path":"error","import-x/no-duplicates":"error","import-x/no-empty-named-blocks":"error","import-x/no-named-as-default":"error","import-x/no-named-as-default-member":"error","import-x/no-self-import":"error","import-x/no-unresolved":["error",{ignore:[String.raw`\.svg$`]}],"import-x/no-useless-path-segments":"error"},we=r(()=>{const{rules:e,settings:t}=y.configs.typescript;return[{name:"jimmy.codes/imports/typescript",rules:e,settings:{"import-x/extensions":t["import-x/extensions"],"import-x/external-module-folders":t["import-x/external-module-folders"],"import-x/parsers":t["import-x/parsers"],"import-x/resolver-next":[ne.createTypeScriptImportResolver({alwaysTryTypes:!0})]}}]},"importsTypescriptConfig"),ke=r(({typescript:e=!1}={})=>[{name:"jimmy.codes/imports",plugins:{"import-x":y,n:b},rules:be},...e?we():[]],"importsConfig"),Pe={"array-callback-return":["error",{allowImplicit:!0}],"arrow-body-style":["error","always"],"class-methods-use-this":"error","consistent-return":"error",curly:["error","all"],"default-case":"error","default-case-last":"error","no-console":"warn","no-implicit-coercion":"error","no-implicit-globals":"error","no-loop-func":"error","no-magic-numbers":["error",{ignore:[0,1,-1,2]}],"no-new-wrappers":"error","no-param-reassign":["error",{props:!0}],"no-promise-executor-return":"error","no-self-compare":"error","no-template-curly-in-string":"error","no-throw-literal":"error","no-unmodified-loop-condition":"error","no-unreachable-loop":"error","no-use-before-define":["error",{allowNamedExports:!1,classes:!1,functions:!0,variables:!0}],"no-useless-computed-key":"error","no-useless-constructor":"error","no-useless-rename":"error","no-useless-return":"error","no-var":"error","object-shorthand":"error","prefer-arrow-callback":"error","prefer-const":"error","prefer-destructuring":["error",{AssignmentExpression:{array:!1,object:!1},VariableDeclarator:{array:!1,object:!0}}],"prefer-object-spread":"error","prefer-rest-params":"error","prefer-spread":"error","prefer-template":"error",radix:"error","require-await":"error",strict:["error","safe"],"symbol-description":"error"},Ee={...ie.configs.recommended.rules,...Pe},Ce=r(()=>[{linterOptions:{reportUnusedDisableDirectives:!0},name:"jimmy.codes/javascript",rules:Ee}],"javascriptConfig"),qe=r(async()=>{const e=await n(import("eslint-plugin-jest"));return{...e.configs["flat/recommended"].rules,...e.configs["flat/style"].rules,"jest/consistent-test-it":["error",{fn:"test",withinDescribe:"it"}],"jest/expect-expect":"error","jest/no-alias-methods":"error","jest/no-commented-out-tests":"error","jest/no-conditional-in-test":"error","jest/no-confusing-set-timeout":"error","jest/no-duplicate-hooks":"error","jest/no-hooks":"off","jest/no-large-snapshots":"off","jest/no-restricted-jest-methods":"off","jest/no-restricted-matchers":"off","jest/no-test-return-statement":"error","jest/no-untyped-mock-factory":"off","jest/prefer-called-with":"error","jest/prefer-comparison-matcher":"error","jest/prefer-each":"error","jest/prefer-equality-matcher":"error","jest/prefer-expect-assertions":"off","jest/prefer-expect-resolves":"error","jest/prefer-hooks-in-order":"error","jest/prefer-hooks-on-top":"error","jest/prefer-lowercase-title":"off","jest/prefer-mock-promise-shorthand":"error","jest/prefer-snapshot-hint":"error","jest/prefer-spy-on":"off","jest/prefer-strict-equal":"error","jest/prefer-todo":"warn","jest/require-hook":"error","jest/require-to-throw-message":"error","jest/require-top-level-describe":"off","jest/unbound-method":"off"}},"jestRules"),Oe=r(async()=>{const e=await n(import("eslint-plugin-jest"));return[{files:m,ignores:j,...e.configs["flat/recommended"],name:"jimmy.codes/jest",rules:await qe()}]},"jestConfig"),Re=r(()=>({...w.configs["flat/recommended-typescript-error"].rules,"jsdoc/require-jsdoc":"off","jsdoc/require-param":"off","jsdoc/require-returns":"off","jsdoc/tag-lines":["error","always",{applyToEndTag:!1}]}),"jsdocRules"),_e=r(()=>[{...w.configs["flat/recommended-typescript-error"],name:"jimmy.codes/jsdoc",rules:Re()}],"jsdocConfig"),O=r((e={})=>Object.fromEntries(Object.entries(e).map(([t,o])=>[t,o==="warn"?"error":o])),"warningAsErrors"),Te=r(async()=>{const e=await n(import("@next/eslint-plugin-next"));return O(e.configs.recommended.rules)},"nextjsRules"),Se=r(async()=>{const e=await n(import("@next/eslint-plugin-next"));return[{files:ue,name:"jimmy.codes/nextjs",plugins:{"@next/next":e},rules:await Te()}]},"nextjsConfig"),Le={"n/no-process-exit":"off","n/prefer-node-protocol":"error"},Ge=r(()=>[{name:"jimmy.codes/node",plugins:{n:b},rules:Le}],"nodeConfig"),Ae={...k.configs["recommended-natural"].rules,"perfectionist/sort-imports":["error",{customGroups:{type:{},value:{}},environment:"node",groups:["side-effect-style","builtin","type","external","internal-type","internal",["parent-type","sibling-type","index-type"],["parent","sibling","index"],"object","style","unknown"],internalPattern:["^~/.*","^@/.*"],order:"asc",type:"natural"}],"perfectionist/sort-modules":"off"},Be=r(()=>[{name:"jimmy.codes/perfectionist",plugins:{perfectionist:k},rules:Ae}],"perfectionistConfig"),Ie=r(async()=>({...(await n(import("eslint-plugin-playwright"))).configs["flat/recommended"].rules,"playwright/expect-expect":"error","playwright/max-nested-describe":"error","playwright/no-conditional-expect":"error","playwright/no-conditional-in-test":"error","playwright/no-element-handle":"error","playwright/no-eval":"error","playwright/no-force-option":"error","playwright/no-nested-step":"error","playwright/no-page-pause":"error","playwright/no-skipped-test":"error","playwright/no-slowed-test":"error","playwright/no-useless-await":"error","playwright/no-useless-not":"error","playwright/no-wait-for-selector":"error","playwright/no-wait-for-timeout":"error"}),"playwrightRules"),Ne=r(async()=>[{...(await n(import("eslint-plugin-playwright"))).configs["flat/recommended"],files:q,name:"jimmy.codes/playwright",rules:await Ie()}],"playwrightConfig"),De=r(()=>[{name:"jimmy.codes/prettier",...ae}],"prettierConfig"),$e=r(()=>a.isPackageExists("typescript"),"hasTypescript"),Ve=r(()=>a.isPackageExists("react"),"hasReact"),Fe=r(()=>a.isPackageExists("vitest"),"hasVitest"),Je=r(()=>a.isPackageExists("jest"),"hasJest"),Xe=r(()=>ge.some(e=>a.isPackageExists(e)),"hasTestingLibrary"),ze=r(()=>a.isPackageExists("@tanstack/react-query"),"hasReactQuery"),Ue=r(()=>a.isPackageExists("astro"),"hasAstro"),He=r(()=>a.isPackageExists("@playwright/test"),"hasPlaywright"),Me=r(()=>a.isPackageExists("storybook"),"hasStorybook"),R=r(()=>a.isPackageExists("next"),"hasNext"),Qe=r(()=>a.isPackageExists("vite"),"hasVite"),Ye=r(e=>e===2?"error":e===1?"warn":"off","toStringSeverity"),_=r((e={})=>Object.fromEntries(Object.entries(e).map(([t,o])=>[t,typeof o=="number"?Ye(o):o])),"normalizeRuleEntries"),We=["dynamic","dynamicParams","revalidate","fetchCache","runtime","preferredRegion","maxDuration","config","generateStaticParams","metadata","generateMetadata","viewport","generateViewport"],Ke=r(async()=>{const[e,t]=await Promise.all([n(import("eslint-plugin-react")),n(import("eslint-plugin-jsx-a11y"))]),o=R(),i=Qe();return{...t.configs.recommended.rules,..._(e.configs.flat.recommended?.rules),..._(e.configs.flat["jsx-runtime"]?.rules),"react-compiler/react-compiler":"error","react-hooks/exhaustive-deps":"error","react-hooks/rules-of-hooks":"error","react-refresh/only-export-components":["warn",{allowConstantExport:i,allowExportNames:o?We:[]}],"react/boolean-prop-naming":"off","react/button-has-type":"error","react/checked-requires-onchange-or-readonly":"error","react/default-props-match-prop-types":"error","react/destructuring-assignment":"off","react/forbid-component-props":"off","react/forbid-dom-props":"off","react/forbid-elements":"off","react/forbid-foreign-prop-types":"off","react/forbid-prop-types":"off","react/forward-ref-uses-ref":"error","react/function-component-definition":"off","react/hook-use-state":"error","react/iframe-missing-sandbox":"error","react/jsx-boolean-value":["error","never"],"react/jsx-curly-brace-presence":"error","react/jsx-filename-extension":"off","react/jsx-fragments":["error","syntax"],"react/jsx-handler-names":"off","react/jsx-max-depth":"off","react/jsx-no-bind":"off","react/jsx-no-constructed-context-values":"error","react/jsx-no-leaked-render":"error","react/jsx-no-literals":"off","react/jsx-no-script-url":"error","react/jsx-no-useless-fragment":"error","react/jsx-one-expression-per-line":"off","react/jsx-pascal-case":["error",{allowNamespace:!0}],"react/jsx-props-no-spread-multi":"off","react/jsx-props-no-spreading":"off","react/jsx-sort-default-props":"off","react/jsx-sort-props":"off","react/no-access-state-in-setstate":"error","react/no-adjacent-inline-elements":"off","react/no-array-index-key":"off","react/no-arrow-function-lifecycle":"error","react/no-danger":"off","react/no-did-mount-set-state":"error","react/no-did-update-set-state":"error","react/no-invalid-html-attribute":"error","react/no-multi-comp":"off","react/no-namespace":"error","react/no-object-type-as-default-prop":"error","react/no-redundant-should-component-update":"error","react/no-set-state":"off","react/no-this-in-sfc":"error","react/no-typos":"error","react/no-unstable-nested-components":"error","react/no-unused-class-component-methods":"error","react/no-unused-prop-types":"error","react/no-unused-state":"error","react/no-will-update-set-state":"error","react/prefer-es6-class":"off","react/prefer-exact-props":"off","react/prefer-read-only-props":"off","react/prefer-stateless-function":"off","react/require-default-props":"off","react/require-optimization":"off","react/self-closing-comp":"error","react/sort-comp":"off","react/sort-default-props":"off","react/sort-prop-types":"off","react/state-in-constructor":"off","react/static-property-placement":"off","react/style-prop-object":"error","react/void-dom-elements-no-children":"error"}},"reactRules"),Ze=r(async()=>{const[e,t,o,i,l]=await Promise.all([n(import("eslint-plugin-react")),n(import("eslint-plugin-jsx-a11y")),import("eslint-plugin-react-hooks"),n(import("eslint-plugin-react-refresh")),n(import("eslint-plugin-react-compiler"))]);return[{files:[u,x],languageOptions:{globals:{...g.browser},parserOptions:{ecmaFeatures:{jsx:!0},jsxPragma:null}},name:"jimmy.codes/react",plugins:{"jsx-a11y":t,react:e,"react-compiler":l,"react-hooks":o,"react-refresh":i},rules:await Ke(),settings:{react:{version:"detect"}}}]},"reactConfig"),er={...E.configs["flat/recommended"].rules,"regexp/confusing-quantifier":"error","regexp/no-empty-alternative":"error","regexp/no-lazy-ends":"error","regexp/no-potentially-useless-backreference":"error","regexp/no-useless-flag":"error","regexp/optimal-lookaround-quantifier":"error"},rr=r(()=>[{name:"jimmy.codes/regexp",plugins:{regexp:E},rules:er}],"regexpConfig"),tr=r(async()=>{const{configs:e}=await n(import("eslint-plugin-storybook")),[t,o,i]=e["flat/recommended"];return[{name:"jimmy.codes/storybook/setup",plugins:t?.plugins},{files:o?.files,name:"jimmy.codes/storybook/stories-rules",rules:{...O(o?.rules),"import-x/no-anonymous-default-export":"off","unicorn/no-anonymous-default-export":"off"}},{files:i?.files,name:"jimmy.codes/storybook/main-rules",rules:{...i?.rules}}]},"storybookConfig"),or=r(async()=>{const e=await n(import("@tanstack/eslint-plugin-query"));return[{files:[u,x],name:"jimmy.codes/react/query",plugins:{"@tanstack/query":e},rules:{"@tanstack/query/exhaustive-deps":"error","@tanstack/query/no-rest-destructuring":"warn","@tanstack/query/stable-query-client":"error"}}]},"tanstackQueryConfig"),sr=r(async()=>{const[e,t]=await Promise.all([import("eslint-plugin-jest-dom"),n(import("eslint-plugin-testing-library"))]);return{...t.configs["flat/react"].rules,...e.configs["flat/recommended"].rules}},"testingLibraryRules"),nr=r(async()=>{const[e,t]=await Promise.all([import("eslint-plugin-jest-dom"),n(import("eslint-plugin-testing-library"))]);return[{files:m,ignores:j,name:"jimmy.codes/testing-library",plugins:{"jest-dom":e,"testing-library":t},rules:await sr()}]},"testingLibraryConfig"),ir={"@typescript-eslint/consistent-type-exports":["error",{fixMixedExportsWithInlineTypeSpecifier:!1}],"@typescript-eslint/consistent-type-imports":["error",{fixStyle:"separate-type-imports"}],"@typescript-eslint/no-deprecated":"warn","@typescript-eslint/no-misused-promises":["error",{checksVoidReturn:{attributes:!1}}],"@typescript-eslint/no-unused-vars":["error",{args:"all",argsIgnorePattern:"^_",caughtErrors:"all",caughtErrorsIgnorePattern:"^_",destructuredArrayIgnorePattern:"^_",ignoreRestSiblings:!0,varsIgnorePattern:"^_"}],"@typescript-eslint/no-use-before-define":["error",{allowNamedExports:!1,classes:!1,functions:!1,variables:!0}],"@typescript-eslint/restrict-template-expressions":["error",{allowNumber:!0}],"no-use-before-define":"off"},ar=r(()=>[...f.configs.strictTypeChecked,...f.configs.stylisticTypeChecked.filter(e=>e.name==="typescript-eslint/stylistic-type-checked"),{languageOptions:{parserOptions:{projectService:!0,tsconfigRootDir:process.cwd()}},name:"jimmy.codes/typescript",rules:ir},{files:[C,u],...f.configs.disableTypeChecked},{files:m,name:"jimmy.codes/typescript/testing",rules:{"@typescript-eslint/no-unsafe-argument":"off","@typescript-eslint/no-unsafe-assignment":"off"}}],"typescriptConfig"),cr={...P.configs["flat/recommended"].rules,"unicorn/filename-case":"off","unicorn/import-style":"off","unicorn/no-abusive-eslint-disable":"off","unicorn/no-anonymous-default-export":"off","unicorn/no-array-callback-reference":"off","unicorn/no-array-reduce":"off","unicorn/no-null":"off","unicorn/no-process-exit":"off","unicorn/no-useless-undefined":["error",{checkArguments:!1,checkArrowFunctionBody:!1}],"unicorn/prefer-node-protocol":"off","unicorn/prevent-abbreviations":"off"},lr=r(()=>[{...P.configs["flat/recommended"],name:"jimmy.codes/unicorn",rules:cr}],"unicornConfig"),pr=r(async()=>({...(await n(import("@vitest/eslint-plugin"))).configs.recommended.rules,"vitest/consistent-test-it":["error",{fn:"test",withinDescribe:"it"}],"vitest/no-alias-methods":"error","vitest/no-commented-out-tests":"error","vitest/no-conditional-in-test":"error","vitest/no-disabled-tests":"warn","vitest/no-duplicate-hooks":"error","vitest/no-focused-tests":"error","vitest/no-hooks":"off","vitest/no-identical-title":"error","vitest/no-interpolation-in-snapshots":"error","vitest/no-large-snapshots":"off","vitest/no-mocks-import":"error","vitest/no-restricted-matchers":"off","vitest/no-restricted-vi-methods":"off","vitest/no-standalone-expect":"error","vitest/no-test-prefixes":"error","vitest/no-test-return-statement":"error","vitest/prefer-called-with":"error","vitest/prefer-comparison-matcher":"error","vitest/prefer-each":"error","vitest/prefer-equality-matcher":"error","vitest/prefer-expect-assertions":"off","vitest/prefer-expect-resolves":"error","vitest/prefer-hooks-in-order":"error","vitest/prefer-hooks-on-top":"error","vitest/prefer-lowercase-title":"off","vitest/prefer-mock-promise-shorthand":"error","vitest/prefer-snapshot-hint":"error","vitest/prefer-spy-on":"off","vitest/prefer-strict-boolean-matchers":"error","vitest/prefer-strict-equal":"error","vitest/prefer-to-be":"error","vitest/prefer-to-contain":"error","vitest/prefer-to-have-length":"error","vitest/prefer-todo":"warn","vitest/require-hook":"error","vitest/require-to-throw-message":"error","vitest/require-top-level-describe":"off","vitest/valid-expect":"error","vitest/valid-expect-in-promise":"error","vitest/valid-title":"error"}),"vitestRules"),fr=r(async()=>{const e=await n(import("@vitest/eslint-plugin"));return[{files:m,ignores:j,...e.configs.recommended,name:"jimmy.codes/vitest",rules:await pr()}]},"vitestConfig"),ur=r(async({astro:e=!1,autoDetect:t=!0,ignores:o=[],jest:i=!1,nextjs:l=!1,overrides:T=[],playwright:S=!1,react:L=!1,storybook:G=!1,tanstackQuery:A=!1,testingLibrary:B=!1,typescript:I=!1,vitest:N=!1}={},...D)=>{const c=r((W,K)=>W||t&&K(),"resolveFlag"),h=c(I,$e),$=c(L,Ve),V=c(e,Ue),F=c(A,ze),J=c(B,Xe),X=c(S,He),z=c(G,Me),U=c(l,R),H=c(i,Je),M=c(N,Fe),Q=[Ce(),Be(),Ge(),lr(),he(),rr(),_e(),ke({typescript:h})],Y=[h&&ar(),$&&await Ze(),F&&await or(),V&&await ye(),H&&await Oe(),M&&await fr(),J&&await nr(),X&&await Ne(),z&&await tr(),U&&await Se()].filter(Boolean);return[...Q,...Y,De(),xe(),ve(o),T,D].flat()},"eslintConfig");module.exports=ur;
|
package/dist/index.d.cts
CHANGED
|
@@ -14009,21 +14009,60 @@ declare const eslintConfig: ({ astro, autoDetect, ignores, jest, nextjs, overrid
|
|
|
14009
14009
|
allowImplicit: true;
|
|
14010
14010
|
}];
|
|
14011
14011
|
"arrow-body-style": ["error", "always"];
|
|
14012
|
+
"class-methods-use-this": "error";
|
|
14013
|
+
"consistent-return": "error";
|
|
14012
14014
|
curly: ["error", "all"];
|
|
14015
|
+
"default-case": "error";
|
|
14016
|
+
"default-case-last": "error";
|
|
14013
14017
|
"no-console": "warn";
|
|
14018
|
+
"no-implicit-coercion": "error";
|
|
14019
|
+
"no-implicit-globals": "error";
|
|
14020
|
+
"no-loop-func": "error";
|
|
14021
|
+
"no-magic-numbers": ["error", {
|
|
14022
|
+
ignore: number[];
|
|
14023
|
+
}];
|
|
14024
|
+
"no-new-wrappers": "error";
|
|
14025
|
+
"no-param-reassign": ["error", {
|
|
14026
|
+
props: true;
|
|
14027
|
+
}];
|
|
14028
|
+
"no-promise-executor-return": "error";
|
|
14014
14029
|
"no-self-compare": "error";
|
|
14015
14030
|
"no-template-curly-in-string": "error";
|
|
14031
|
+
"no-throw-literal": "error";
|
|
14016
14032
|
"no-unmodified-loop-condition": "error";
|
|
14017
14033
|
"no-unreachable-loop": "error";
|
|
14018
14034
|
"no-use-before-define": ["error", {
|
|
14019
14035
|
allowNamedExports: false;
|
|
14020
14036
|
classes: false;
|
|
14021
|
-
functions:
|
|
14037
|
+
functions: true;
|
|
14022
14038
|
variables: true;
|
|
14023
14039
|
}];
|
|
14040
|
+
"no-useless-computed-key": "error";
|
|
14041
|
+
"no-useless-constructor": "error";
|
|
14024
14042
|
"no-useless-rename": "error";
|
|
14043
|
+
"no-useless-return": "error";
|
|
14044
|
+
"no-var": "error";
|
|
14025
14045
|
"object-shorthand": "error";
|
|
14026
14046
|
"prefer-arrow-callback": "error";
|
|
14047
|
+
"prefer-const": "error";
|
|
14048
|
+
"prefer-destructuring": ["error", {
|
|
14049
|
+
AssignmentExpression: {
|
|
14050
|
+
array: false;
|
|
14051
|
+
object: false;
|
|
14052
|
+
};
|
|
14053
|
+
VariableDeclarator: {
|
|
14054
|
+
array: false;
|
|
14055
|
+
object: true;
|
|
14056
|
+
};
|
|
14057
|
+
}];
|
|
14058
|
+
"prefer-object-spread": "error";
|
|
14059
|
+
"prefer-rest-params": "error";
|
|
14060
|
+
"prefer-spread": "error";
|
|
14061
|
+
"prefer-template": "error";
|
|
14062
|
+
radix: "error";
|
|
14063
|
+
"require-await": "error";
|
|
14064
|
+
strict: ["error", "safe"];
|
|
14065
|
+
"symbol-description": "error";
|
|
14027
14066
|
};
|
|
14028
14067
|
} | {
|
|
14029
14068
|
name: string;
|
package/dist/index.d.mts
CHANGED
|
@@ -14009,21 +14009,60 @@ declare const eslintConfig: ({ astro, autoDetect, ignores, jest, nextjs, overrid
|
|
|
14009
14009
|
allowImplicit: true;
|
|
14010
14010
|
}];
|
|
14011
14011
|
"arrow-body-style": ["error", "always"];
|
|
14012
|
+
"class-methods-use-this": "error";
|
|
14013
|
+
"consistent-return": "error";
|
|
14012
14014
|
curly: ["error", "all"];
|
|
14015
|
+
"default-case": "error";
|
|
14016
|
+
"default-case-last": "error";
|
|
14013
14017
|
"no-console": "warn";
|
|
14018
|
+
"no-implicit-coercion": "error";
|
|
14019
|
+
"no-implicit-globals": "error";
|
|
14020
|
+
"no-loop-func": "error";
|
|
14021
|
+
"no-magic-numbers": ["error", {
|
|
14022
|
+
ignore: number[];
|
|
14023
|
+
}];
|
|
14024
|
+
"no-new-wrappers": "error";
|
|
14025
|
+
"no-param-reassign": ["error", {
|
|
14026
|
+
props: true;
|
|
14027
|
+
}];
|
|
14028
|
+
"no-promise-executor-return": "error";
|
|
14014
14029
|
"no-self-compare": "error";
|
|
14015
14030
|
"no-template-curly-in-string": "error";
|
|
14031
|
+
"no-throw-literal": "error";
|
|
14016
14032
|
"no-unmodified-loop-condition": "error";
|
|
14017
14033
|
"no-unreachable-loop": "error";
|
|
14018
14034
|
"no-use-before-define": ["error", {
|
|
14019
14035
|
allowNamedExports: false;
|
|
14020
14036
|
classes: false;
|
|
14021
|
-
functions:
|
|
14037
|
+
functions: true;
|
|
14022
14038
|
variables: true;
|
|
14023
14039
|
}];
|
|
14040
|
+
"no-useless-computed-key": "error";
|
|
14041
|
+
"no-useless-constructor": "error";
|
|
14024
14042
|
"no-useless-rename": "error";
|
|
14043
|
+
"no-useless-return": "error";
|
|
14044
|
+
"no-var": "error";
|
|
14025
14045
|
"object-shorthand": "error";
|
|
14026
14046
|
"prefer-arrow-callback": "error";
|
|
14047
|
+
"prefer-const": "error";
|
|
14048
|
+
"prefer-destructuring": ["error", {
|
|
14049
|
+
AssignmentExpression: {
|
|
14050
|
+
array: false;
|
|
14051
|
+
object: false;
|
|
14052
|
+
};
|
|
14053
|
+
VariableDeclarator: {
|
|
14054
|
+
array: false;
|
|
14055
|
+
object: true;
|
|
14056
|
+
};
|
|
14057
|
+
}];
|
|
14058
|
+
"prefer-object-spread": "error";
|
|
14059
|
+
"prefer-rest-params": "error";
|
|
14060
|
+
"prefer-spread": "error";
|
|
14061
|
+
"prefer-template": "error";
|
|
14062
|
+
radix: "error";
|
|
14063
|
+
"require-await": "error";
|
|
14064
|
+
strict: ["error", "safe"];
|
|
14065
|
+
"symbol-description": "error";
|
|
14027
14066
|
};
|
|
14028
14067
|
} | {
|
|
14029
14068
|
name: string;
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var W=Object.defineProperty;var r=(e,t)=>W(e,"name",{value:t,configurable:!0});import u from"globals";import{parser as K,configs as l}from"typescript-eslint";import j from"@eslint-community/eslint-plugin-eslint-comments/configs";import{createTypeScriptImportResolver as Z}from"eslint-import-resolver-typescript";import d from"eslint-plugin-import-x";import h from"eslint-plugin-n";import ee from"@eslint/js";import v from"eslint-plugin-jsdoc";import w from"eslint-plugin-perfectionist";import re from"eslint-config-prettier";import{isPackageExists as i}from"local-pkg";import*as b from"eslint-plugin-regexp";import k from"eslint-plugin-unicorn";const c="?([cm])[jt]s?(x)",te=["**/node_modules","**/dist","**/package-lock.json","**/yarn.lock","**/pnpm-lock.yaml","**/bun.lockb","**/output","**/coverage","**/temp","**/.temp","**/tmp","**/.tmp","**/.history","**/.vitepress/cache","**/.nuxt","**/.next","**/.vercel","**/.changeset","**/.idea","**/.cache","**/.output","**/.vite-inspect","**/.yarn","**/storybook-static","**/.eslint-config-inspector","**/playwright-report","**/.astro","**/.vinxi","**/app.config.timestamp_*.js","**/CHANGELOG*.md","**/*.min.*","**/LICENSE*","**/__snapshots__","**/auto-import?(s).d.ts","**/components.d.ts","**/vite.config.ts.*.mjs","**/*.gen.*","!.storybook"],P="**/*.?([cm])js",p="**/*.?([cm])jsx",oe="**/*.?([cm])ts",g="**/*.?([cm])tsx",f=[`**/__tests__/**/*.${c}`,`**/*.spec.${c}`,`**/*.test.${c}`,`**/*.bench.${c}`,`**/*.benchmark.${c}`],C=[`**/e2e/**/*.spec.${c}`,`**/e2e/**/*.test.${c}`],y=[...C,`**/cypress/**/*.spec.${c}`,`**/cypress/**/*.test.${c}`],se=[P,p,oe,g],ne="**/*.cjs",ie="**/*.astro",ae=["@testing-library/react"],o=r(async e=>{const t=await e;return t.default??t},"interopDefault"),ce=r(async()=>{const e=[ie],[t,s,n]=await Promise.all([import("eslint-plugin-astro"),import("astro-eslint-parser"),o(import("eslint-plugin-jsx-a11y"))]);return[{files:e,languageOptions:{globals:{...u.node,Astro:!1,Fragment:!1},parser:s,parserOptions:{extraFileExtensions:[".astro"],parser:K},sourceType:"module"},name:"jimmy.codes/astro",plugins:{astro:t,"jsx-a11y":n},processor:"astro/client-side-ts",rules:{...n.configs.recommended.rules,"astro/missing-client-only-directive-value":"error","astro/no-conflict-set-directives":"error","astro/no-deprecated-astro-canonicalurl":"error","astro/no-deprecated-astro-fetchcontent":"error","astro/no-deprecated-astro-resolve":"error","astro/no-deprecated-getentrybyslug":"error","astro/no-exports-from-components":"off","astro/no-unused-define-vars-in-style":"error","astro/valid-compile":"error"}},{files:e,languageOptions:{parserOptions:l.disableTypeChecked.languageOptions?.parserOptions},name:"jimmy.codes/astro/disable-type-checked",rules:l.disableTypeChecked.rules},{name:"jimmy.codes/astro/imports",settings:{"import-x/core-modules":["astro:content"]}}]},"astroConfig"),le=r(()=>[{files:[ne],languageOptions:{globals:u.commonjs},name:"jimmy.codes/commonjs"}],"commonjsConfig"),pe={...j.recommended.rules,"@eslint-community/eslint-comments/no-unused-disable":"off","@eslint-community/eslint-comments/require-description":"error"},fe=r(()=>[{...j.recommended,name:"jimmy.codes/eslint-comments",rules:pe}],"eslintCommentsConfig"),me=r(e=>[{ignores:[...te,...e],name:"jimmy.codes/ignores"}],"ignoresConfig"),ue={...d.configs.recommended.rules,"import-x/consistent-type-specifier-style":["error","prefer-top-level"],"import-x/extensions":["error","never",{checkTypedImports:!0,svg:"always"}],"import-x/first":"error","import-x/namespace":"off","import-x/newline-after-import":"error","import-x/no-absolute-path":"error","import-x/no-duplicates":"error","import-x/no-empty-named-blocks":"error","import-x/no-named-as-default":"error","import-x/no-named-as-default-member":"error","import-x/no-self-import":"error","import-x/no-unresolved":["error",{ignore:[String.raw`\.svg$`]}],"import-x/no-useless-path-segments":"error"},de=r(()=>{const{rules:e,settings:t}=d.configs.typescript;return[{name:"jimmy.codes/imports/typescript",rules:e,settings:{"import-x/extensions":t["import-x/extensions"],"import-x/external-module-folders":t["import-x/external-module-folders"],"import-x/parsers":t["import-x/parsers"],"import-x/resolver-next":[Z({alwaysTryTypes:!0})]}}]},"importsTypescriptConfig"),ge=r(({typescript:e=!1}={})=>[{name:"jimmy.codes/imports",plugins:{"import-x":d,n:h},rules:ue},...e?de():[]],"importsConfig"),ye={...ee.configs.recommended.rules,"array-callback-return":["error",{allowImplicit:!0}],"arrow-body-style":["error","always"],curly:["error","all"],"no-console":"warn","no-self-compare":"error","no-template-curly-in-string":"error","no-unmodified-loop-condition":"error","no-unreachable-loop":"error","no-use-before-define":["error",{allowNamedExports:!1,classes:!1,functions:!1,variables:!0}],"no-useless-rename":"error","object-shorthand":"error","prefer-arrow-callback":"error"},xe=r(()=>[{linterOptions:{reportUnusedDisableDirectives:!0},name:"jimmy.codes/javascript",rules:ye}],"javascriptConfig"),je=r(async()=>{const e=await o(import("eslint-plugin-jest"));return{...e.configs["flat/recommended"].rules,...e.configs["flat/style"].rules,"jest/consistent-test-it":["error",{fn:"test",withinDescribe:"it"}],"jest/expect-expect":"error","jest/no-alias-methods":"error","jest/no-commented-out-tests":"error","jest/no-conditional-in-test":"error","jest/no-confusing-set-timeout":"error","jest/no-duplicate-hooks":"error","jest/no-hooks":"off","jest/no-large-snapshots":"off","jest/no-restricted-jest-methods":"off","jest/no-restricted-matchers":"off","jest/no-test-return-statement":"error","jest/no-untyped-mock-factory":"off","jest/prefer-called-with":"error","jest/prefer-comparison-matcher":"error","jest/prefer-each":"error","jest/prefer-equality-matcher":"error","jest/prefer-expect-assertions":"off","jest/prefer-expect-resolves":"error","jest/prefer-hooks-in-order":"error","jest/prefer-hooks-on-top":"error","jest/prefer-lowercase-title":"off","jest/prefer-mock-promise-shorthand":"error","jest/prefer-snapshot-hint":"error","jest/prefer-spy-on":"off","jest/prefer-strict-equal":"error","jest/prefer-todo":"warn","jest/require-hook":"error","jest/require-to-throw-message":"error","jest/require-top-level-describe":"off","jest/unbound-method":"off"}},"jestRules"),he=r(async()=>{const e=await o(import("eslint-plugin-jest"));return[{files:f,ignores:y,...e.configs["flat/recommended"],name:"jimmy.codes/jest",rules:await je()}]},"jestConfig"),ve=r(()=>({...v.configs["flat/recommended-typescript-error"].rules,"jsdoc/require-jsdoc":"off","jsdoc/require-param":"off","jsdoc/require-returns":"off","jsdoc/tag-lines":["error","always",{applyToEndTag:!1}]}),"jsdocRules"),we=r(()=>[{...v.configs["flat/recommended-typescript-error"],name:"jimmy.codes/jsdoc",rules:ve()}],"jsdocConfig"),E=r((e={})=>Object.fromEntries(Object.entries(e).map(([t,s])=>[t,s==="warn"?"error":s])),"warningAsErrors"),be=r(async()=>{const e=await o(import("@next/eslint-plugin-next"));return E(e.configs.recommended.rules)},"nextjsRules"),ke=r(async()=>{const e=await o(import("@next/eslint-plugin-next"));return[{files:se,name:"jimmy.codes/nextjs",plugins:{"@next/next":e},rules:await be()}]},"nextjsConfig"),Pe={"n/no-process-exit":"off","n/prefer-node-protocol":"error"},Ce=r(()=>[{name:"jimmy.codes/node",plugins:{n:h},rules:Pe}],"nodeConfig"),Ee={...w.configs["recommended-natural"].rules,"perfectionist/sort-imports":["error",{customGroups:{type:{},value:{}},environment:"node",groups:["side-effect-style","builtin","type","external","internal-type","internal",["parent-type","sibling-type","index-type"],["parent","sibling","index"],"object","style","unknown"],internalPattern:["^~/.*","^@/.*"],order:"asc",type:"natural"}],"perfectionist/sort-modules":"off"},Oe=r(()=>[{name:"jimmy.codes/perfectionist",plugins:{perfectionist:w},rules:Ee}],"perfectionistConfig"),Re=r(async()=>({...(await o(import("eslint-plugin-playwright"))).configs["flat/recommended"].rules,"playwright/expect-expect":"error","playwright/max-nested-describe":"error","playwright/no-conditional-expect":"error","playwright/no-conditional-in-test":"error","playwright/no-element-handle":"error","playwright/no-eval":"error","playwright/no-force-option":"error","playwright/no-nested-step":"error","playwright/no-page-pause":"error","playwright/no-skipped-test":"error","playwright/no-slowed-test":"error","playwright/no-useless-await":"error","playwright/no-useless-not":"error","playwright/no-wait-for-selector":"error","playwright/no-wait-for-timeout":"error"}),"playwrightRules"),Te=r(async()=>[{...(await o(import("eslint-plugin-playwright"))).configs["flat/recommended"],files:C,name:"jimmy.codes/playwright",rules:await Re()}],"playwrightConfig"),_e=r(()=>[{name:"jimmy.codes/prettier",...re}],"prettierConfig"),qe=r(()=>i("typescript"),"hasTypescript"),Se=r(()=>i("react"),"hasReact"),Le=r(()=>i("vitest"),"hasVitest"),Ge=r(()=>i("jest"),"hasJest"),Ae=r(()=>ae.some(e=>i(e)),"hasTestingLibrary"),Be=r(()=>i("@tanstack/react-query"),"hasReactQuery"),Ie=r(()=>i("astro"),"hasAstro"),Ne=r(()=>i("@playwright/test"),"hasPlaywright"),$e=r(()=>i("storybook"),"hasStorybook"),O=r(()=>i("next"),"hasNext"),De=r(()=>i("vite"),"hasVite"),Fe=r(e=>e===2?"error":e===1?"warn":"off","toStringSeverity"),R=r((e={})=>Object.fromEntries(Object.entries(e).map(([t,s])=>[t,typeof s=="number"?Fe(s):s])),"normalizeRuleEntries"),Je=["dynamic","dynamicParams","revalidate","fetchCache","runtime","preferredRegion","maxDuration","config","generateStaticParams","metadata","generateMetadata","viewport","generateViewport"],Ve=r(async()=>{const[e,t]=await Promise.all([o(import("eslint-plugin-react")),o(import("eslint-plugin-jsx-a11y"))]),s=O(),n=De();return{...t.configs.recommended.rules,...R(e.configs.flat.recommended?.rules),...R(e.configs.flat["jsx-runtime"]?.rules),"react-compiler/react-compiler":"error","react-hooks/exhaustive-deps":"error","react-hooks/rules-of-hooks":"error","react-refresh/only-export-components":["warn",{allowConstantExport:n,allowExportNames:s?Je:[]}],"react/boolean-prop-naming":"off","react/button-has-type":"error","react/checked-requires-onchange-or-readonly":"error","react/default-props-match-prop-types":"error","react/destructuring-assignment":"off","react/forbid-component-props":"off","react/forbid-dom-props":"off","react/forbid-elements":"off","react/forbid-foreign-prop-types":"off","react/forbid-prop-types":"off","react/forward-ref-uses-ref":"error","react/function-component-definition":"off","react/hook-use-state":"error","react/iframe-missing-sandbox":"error","react/jsx-boolean-value":["error","never"],"react/jsx-curly-brace-presence":"error","react/jsx-filename-extension":"off","react/jsx-fragments":["error","syntax"],"react/jsx-handler-names":"off","react/jsx-max-depth":"off","react/jsx-no-bind":"off","react/jsx-no-constructed-context-values":"error","react/jsx-no-leaked-render":"error","react/jsx-no-literals":"off","react/jsx-no-script-url":"error","react/jsx-no-useless-fragment":"error","react/jsx-one-expression-per-line":"off","react/jsx-pascal-case":["error",{allowNamespace:!0}],"react/jsx-props-no-spread-multi":"off","react/jsx-props-no-spreading":"off","react/jsx-sort-default-props":"off","react/jsx-sort-props":"off","react/no-access-state-in-setstate":"error","react/no-adjacent-inline-elements":"off","react/no-array-index-key":"off","react/no-arrow-function-lifecycle":"error","react/no-danger":"off","react/no-did-mount-set-state":"error","react/no-did-update-set-state":"error","react/no-invalid-html-attribute":"error","react/no-multi-comp":"off","react/no-namespace":"error","react/no-object-type-as-default-prop":"error","react/no-redundant-should-component-update":"error","react/no-set-state":"off","react/no-this-in-sfc":"error","react/no-typos":"error","react/no-unstable-nested-components":"error","react/no-unused-class-component-methods":"error","react/no-unused-prop-types":"error","react/no-unused-state":"error","react/no-will-update-set-state":"error","react/prefer-es6-class":"off","react/prefer-exact-props":"off","react/prefer-read-only-props":"off","react/prefer-stateless-function":"off","react/require-default-props":"off","react/require-optimization":"off","react/self-closing-comp":"error","react/sort-comp":"off","react/sort-default-props":"off","react/sort-prop-types":"off","react/state-in-constructor":"off","react/static-property-placement":"off","react/style-prop-object":"error","react/void-dom-elements-no-children":"error"}},"reactRules"),Xe=r(async()=>{const[e,t,s,n,m]=await Promise.all([o(import("eslint-plugin-react")),o(import("eslint-plugin-jsx-a11y")),import("eslint-plugin-react-hooks"),o(import("eslint-plugin-react-refresh")),o(import("eslint-plugin-react-compiler"))]);return[{files:[p,g],languageOptions:{globals:{...u.browser},parserOptions:{ecmaFeatures:{jsx:!0},jsxPragma:null}},name:"jimmy.codes/react",plugins:{"jsx-a11y":t,react:e,"react-compiler":m,"react-hooks":s,"react-refresh":n},rules:await Ve(),settings:{react:{version:"detect"}}}]},"reactConfig"),Ue={...b.configs["flat/recommended"].rules,"regexp/confusing-quantifier":"error","regexp/no-empty-alternative":"error","regexp/no-lazy-ends":"error","regexp/no-potentially-useless-backreference":"error","regexp/no-useless-flag":"error","regexp/optimal-lookaround-quantifier":"error"},ze=r(()=>[{name:"jimmy.codes/regexp",plugins:{regexp:b},rules:Ue}],"regexpConfig"),He=r(async()=>{const{configs:e}=await o(import("eslint-plugin-storybook")),[t,s,n]=e["flat/recommended"];return[{name:"jimmy.codes/storybook/setup",plugins:t?.plugins},{files:s?.files,name:"jimmy.codes/storybook/stories-rules",rules:{...E(s?.rules),"import-x/no-anonymous-default-export":"off","unicorn/no-anonymous-default-export":"off"}},{files:n?.files,name:"jimmy.codes/storybook/main-rules",rules:{...n?.rules}}]},"storybookConfig"),Me=r(async()=>{const e=await o(import("@tanstack/eslint-plugin-query"));return[{files:[p,g],name:"jimmy.codes/react/query",plugins:{"@tanstack/query":e},rules:{"@tanstack/query/exhaustive-deps":"error","@tanstack/query/no-rest-destructuring":"warn","@tanstack/query/stable-query-client":"error"}}]},"tanstackQueryConfig"),Qe=r(async()=>{const[e,t]=await Promise.all([import("eslint-plugin-jest-dom"),o(import("eslint-plugin-testing-library"))]);return{...t.configs["flat/react"].rules,...e.configs["flat/recommended"].rules}},"testingLibraryRules"),Ye=r(async()=>{const[e,t]=await Promise.all([import("eslint-plugin-jest-dom"),o(import("eslint-plugin-testing-library"))]);return[{files:f,ignores:y,name:"jimmy.codes/testing-library",plugins:{"jest-dom":e,"testing-library":t},rules:await Qe()}]},"testingLibraryConfig"),We={"@typescript-eslint/consistent-type-exports":["error",{fixMixedExportsWithInlineTypeSpecifier:!1}],"@typescript-eslint/consistent-type-imports":["error",{fixStyle:"separate-type-imports"}],"@typescript-eslint/no-deprecated":"warn","@typescript-eslint/no-misused-promises":["error",{checksVoidReturn:{attributes:!1}}],"@typescript-eslint/no-unused-vars":["error",{args:"all",argsIgnorePattern:"^_",caughtErrors:"all",caughtErrorsIgnorePattern:"^_",destructuredArrayIgnorePattern:"^_",ignoreRestSiblings:!0,varsIgnorePattern:"^_"}],"@typescript-eslint/no-use-before-define":["error",{allowNamedExports:!1,classes:!1,functions:!1,variables:!0}],"@typescript-eslint/restrict-template-expressions":["error",{allowNumber:!0}],"no-use-before-define":"off"},Ke=r(()=>[...l.strictTypeChecked,...l.stylisticTypeChecked.filter(e=>e.name==="typescript-eslint/stylistic-type-checked"),{languageOptions:{parserOptions:{projectService:!0,tsconfigRootDir:process.cwd()}},name:"jimmy.codes/typescript",rules:We},{files:[P,p],...l.disableTypeChecked},{files:f,name:"jimmy.codes/typescript/testing",rules:{"@typescript-eslint/no-unsafe-argument":"off","@typescript-eslint/no-unsafe-assignment":"off"}}],"typescriptConfig"),Ze={...k.configs["flat/recommended"].rules,"unicorn/filename-case":"off","unicorn/import-style":"off","unicorn/no-abusive-eslint-disable":"off","unicorn/no-anonymous-default-export":"off","unicorn/no-array-callback-reference":"off","unicorn/no-array-reduce":"off","unicorn/no-null":"off","unicorn/no-process-exit":"off","unicorn/no-useless-undefined":["error",{checkArguments:!1,checkArrowFunctionBody:!1}],"unicorn/prefer-node-protocol":"off","unicorn/prevent-abbreviations":"off"},er=r(()=>[{...k.configs["flat/recommended"],name:"jimmy.codes/unicorn",rules:Ze}],"unicornConfig"),rr=r(async()=>({...(await o(import("@vitest/eslint-plugin"))).configs.recommended.rules,"vitest/consistent-test-it":["error",{fn:"test",withinDescribe:"it"}],"vitest/no-alias-methods":"error","vitest/no-commented-out-tests":"error","vitest/no-conditional-in-test":"error","vitest/no-disabled-tests":"warn","vitest/no-duplicate-hooks":"error","vitest/no-focused-tests":"error","vitest/no-hooks":"off","vitest/no-identical-title":"error","vitest/no-interpolation-in-snapshots":"error","vitest/no-large-snapshots":"off","vitest/no-mocks-import":"error","vitest/no-restricted-matchers":"off","vitest/no-restricted-vi-methods":"off","vitest/no-standalone-expect":"error","vitest/no-test-prefixes":"error","vitest/no-test-return-statement":"error","vitest/prefer-called-with":"error","vitest/prefer-comparison-matcher":"error","vitest/prefer-each":"error","vitest/prefer-equality-matcher":"error","vitest/prefer-expect-assertions":"off","vitest/prefer-expect-resolves":"error","vitest/prefer-hooks-in-order":"error","vitest/prefer-hooks-on-top":"error","vitest/prefer-lowercase-title":"off","vitest/prefer-mock-promise-shorthand":"error","vitest/prefer-snapshot-hint":"error","vitest/prefer-spy-on":"off","vitest/prefer-strict-boolean-matchers":"error","vitest/prefer-strict-equal":"error","vitest/prefer-to-be":"error","vitest/prefer-to-contain":"error","vitest/prefer-to-have-length":"error","vitest/prefer-todo":"warn","vitest/require-hook":"error","vitest/require-to-throw-message":"error","vitest/require-top-level-describe":"off","vitest/valid-expect":"error","vitest/valid-expect-in-promise":"error","vitest/valid-title":"error"}),"vitestRules"),tr=r(async()=>{const e=await o(import("@vitest/eslint-plugin"));return[{files:f,ignores:y,...e.configs.recommended,name:"jimmy.codes/vitest",rules:await rr()}]},"vitestConfig"),or=r(async({astro:e=!1,autoDetect:t=!0,ignores:s=[],jest:n=!1,nextjs:m=!1,overrides:T=[],playwright:_=!1,react:q=!1,storybook:S=!1,tanstackQuery:L=!1,testingLibrary:G=!1,typescript:A=!1,vitest:B=!1}={},...I)=>{const a=r((Q,Y)=>Q||t&&Y(),"resolveFlag"),x=a(A,qe),N=a(q,Se),$=a(e,Ie),D=a(L,Be),F=a(G,Ae),J=a(_,Ne),V=a(S,$e),X=a(m,O),U=a(n,Ge),z=a(B,Le),H=[xe(),Oe(),Ce(),er(),fe(),ze(),we(),ge({typescript:x})],M=[x&&Ke(),N&&await Xe(),D&&await Me(),$&&await ce(),U&&await he(),z&&await tr(),F&&await Ye(),J&&await Te(),V&&await He(),X&&await ke()].filter(Boolean);return[...H,...M,_e(),le(),me(s),T,I].flat()},"eslintConfig");export{or as default};
|
|
1
|
+
var W=Object.defineProperty;var r=(e,t)=>W(e,"name",{value:t,configurable:!0});import u from"globals";import{parser as K,configs as l}from"typescript-eslint";import j from"@eslint-community/eslint-plugin-eslint-comments/configs";import{createTypeScriptImportResolver as Z}from"eslint-import-resolver-typescript";import d from"eslint-plugin-import-x";import h from"eslint-plugin-n";import ee from"@eslint/js";import b from"eslint-plugin-jsdoc";import w from"eslint-plugin-perfectionist";import re from"eslint-config-prettier";import{isPackageExists as i}from"local-pkg";import*as v from"eslint-plugin-regexp";import k from"eslint-plugin-unicorn";const c="?([cm])[jt]s?(x)",te=["**/node_modules","**/dist","**/package-lock.json","**/yarn.lock","**/pnpm-lock.yaml","**/bun.lockb","**/output","**/coverage","**/temp","**/.temp","**/tmp","**/.tmp","**/.history","**/.vitepress/cache","**/.nuxt","**/.next","**/.vercel","**/.changeset","**/.idea","**/.cache","**/.output","**/.vite-inspect","**/.yarn","**/storybook-static","**/.eslint-config-inspector","**/playwright-report","**/.astro","**/.vinxi","**/app.config.timestamp_*.js","**/CHANGELOG*.md","**/*.min.*","**/LICENSE*","**/__snapshots__","**/auto-import?(s).d.ts","**/components.d.ts","**/vite.config.ts.*.mjs","**/*.gen.*","!.storybook"],P="**/*.?([cm])js",p="**/*.?([cm])jsx",oe="**/*.?([cm])ts",g="**/*.?([cm])tsx",f=[`**/__tests__/**/*.${c}`,`**/*.spec.${c}`,`**/*.test.${c}`,`**/*.bench.${c}`,`**/*.benchmark.${c}`],C=[`**/e2e/**/*.spec.${c}`,`**/e2e/**/*.test.${c}`],y=[...C,`**/cypress/**/*.spec.${c}`,`**/cypress/**/*.test.${c}`],se=[P,p,oe,g],ne="**/*.cjs",ie="**/*.astro",ae=["@testing-library/react"],o=r(async e=>{const t=await e;return t.default??t},"interopDefault"),ce=r(async()=>{const e=[ie],[t,s,n]=await Promise.all([import("eslint-plugin-astro"),import("astro-eslint-parser"),o(import("eslint-plugin-jsx-a11y"))]);return[{files:e,languageOptions:{globals:{...u.node,Astro:!1,Fragment:!1},parser:s,parserOptions:{extraFileExtensions:[".astro"],parser:K},sourceType:"module"},name:"jimmy.codes/astro",plugins:{astro:t,"jsx-a11y":n},processor:"astro/client-side-ts",rules:{...n.configs.recommended.rules,"astro/missing-client-only-directive-value":"error","astro/no-conflict-set-directives":"error","astro/no-deprecated-astro-canonicalurl":"error","astro/no-deprecated-astro-fetchcontent":"error","astro/no-deprecated-astro-resolve":"error","astro/no-deprecated-getentrybyslug":"error","astro/no-exports-from-components":"off","astro/no-unused-define-vars-in-style":"error","astro/valid-compile":"error"}},{files:e,languageOptions:{parserOptions:l.disableTypeChecked.languageOptions?.parserOptions},name:"jimmy.codes/astro/disable-type-checked",rules:l.disableTypeChecked.rules},{name:"jimmy.codes/astro/imports",settings:{"import-x/core-modules":["astro:content"]}}]},"astroConfig"),le=r(()=>[{files:[ne],languageOptions:{globals:u.commonjs},name:"jimmy.codes/commonjs"}],"commonjsConfig"),pe={...j.recommended.rules,"@eslint-community/eslint-comments/no-unused-disable":"off","@eslint-community/eslint-comments/require-description":"error"},fe=r(()=>[{...j.recommended,name:"jimmy.codes/eslint-comments",rules:pe}],"eslintCommentsConfig"),me=r(e=>[{ignores:[...te,...e],name:"jimmy.codes/ignores"}],"ignoresConfig"),ue={...d.configs.recommended.rules,"import-x/consistent-type-specifier-style":["error","prefer-top-level"],"import-x/extensions":["error","never",{checkTypedImports:!0,svg:"always"}],"import-x/first":"error","import-x/namespace":"off","import-x/newline-after-import":"error","import-x/no-absolute-path":"error","import-x/no-duplicates":"error","import-x/no-empty-named-blocks":"error","import-x/no-named-as-default":"error","import-x/no-named-as-default-member":"error","import-x/no-self-import":"error","import-x/no-unresolved":["error",{ignore:[String.raw`\.svg$`]}],"import-x/no-useless-path-segments":"error"},de=r(()=>{const{rules:e,settings:t}=d.configs.typescript;return[{name:"jimmy.codes/imports/typescript",rules:e,settings:{"import-x/extensions":t["import-x/extensions"],"import-x/external-module-folders":t["import-x/external-module-folders"],"import-x/parsers":t["import-x/parsers"],"import-x/resolver-next":[Z({alwaysTryTypes:!0})]}}]},"importsTypescriptConfig"),ge=r(({typescript:e=!1}={})=>[{name:"jimmy.codes/imports",plugins:{"import-x":d,n:h},rules:ue},...e?de():[]],"importsConfig"),ye={"array-callback-return":["error",{allowImplicit:!0}],"arrow-body-style":["error","always"],"class-methods-use-this":"error","consistent-return":"error",curly:["error","all"],"default-case":"error","default-case-last":"error","no-console":"warn","no-implicit-coercion":"error","no-implicit-globals":"error","no-loop-func":"error","no-magic-numbers":["error",{ignore:[0,1,-1,2]}],"no-new-wrappers":"error","no-param-reassign":["error",{props:!0}],"no-promise-executor-return":"error","no-self-compare":"error","no-template-curly-in-string":"error","no-throw-literal":"error","no-unmodified-loop-condition":"error","no-unreachable-loop":"error","no-use-before-define":["error",{allowNamedExports:!1,classes:!1,functions:!0,variables:!0}],"no-useless-computed-key":"error","no-useless-constructor":"error","no-useless-rename":"error","no-useless-return":"error","no-var":"error","object-shorthand":"error","prefer-arrow-callback":"error","prefer-const":"error","prefer-destructuring":["error",{AssignmentExpression:{array:!1,object:!1},VariableDeclarator:{array:!1,object:!0}}],"prefer-object-spread":"error","prefer-rest-params":"error","prefer-spread":"error","prefer-template":"error",radix:"error","require-await":"error",strict:["error","safe"],"symbol-description":"error"},xe={...ee.configs.recommended.rules,...ye},je=r(()=>[{linterOptions:{reportUnusedDisableDirectives:!0},name:"jimmy.codes/javascript",rules:xe}],"javascriptConfig"),he=r(async()=>{const e=await o(import("eslint-plugin-jest"));return{...e.configs["flat/recommended"].rules,...e.configs["flat/style"].rules,"jest/consistent-test-it":["error",{fn:"test",withinDescribe:"it"}],"jest/expect-expect":"error","jest/no-alias-methods":"error","jest/no-commented-out-tests":"error","jest/no-conditional-in-test":"error","jest/no-confusing-set-timeout":"error","jest/no-duplicate-hooks":"error","jest/no-hooks":"off","jest/no-large-snapshots":"off","jest/no-restricted-jest-methods":"off","jest/no-restricted-matchers":"off","jest/no-test-return-statement":"error","jest/no-untyped-mock-factory":"off","jest/prefer-called-with":"error","jest/prefer-comparison-matcher":"error","jest/prefer-each":"error","jest/prefer-equality-matcher":"error","jest/prefer-expect-assertions":"off","jest/prefer-expect-resolves":"error","jest/prefer-hooks-in-order":"error","jest/prefer-hooks-on-top":"error","jest/prefer-lowercase-title":"off","jest/prefer-mock-promise-shorthand":"error","jest/prefer-snapshot-hint":"error","jest/prefer-spy-on":"off","jest/prefer-strict-equal":"error","jest/prefer-todo":"warn","jest/require-hook":"error","jest/require-to-throw-message":"error","jest/require-top-level-describe":"off","jest/unbound-method":"off"}},"jestRules"),be=r(async()=>{const e=await o(import("eslint-plugin-jest"));return[{files:f,ignores:y,...e.configs["flat/recommended"],name:"jimmy.codes/jest",rules:await he()}]},"jestConfig"),we=r(()=>({...b.configs["flat/recommended-typescript-error"].rules,"jsdoc/require-jsdoc":"off","jsdoc/require-param":"off","jsdoc/require-returns":"off","jsdoc/tag-lines":["error","always",{applyToEndTag:!1}]}),"jsdocRules"),ve=r(()=>[{...b.configs["flat/recommended-typescript-error"],name:"jimmy.codes/jsdoc",rules:we()}],"jsdocConfig"),E=r((e={})=>Object.fromEntries(Object.entries(e).map(([t,s])=>[t,s==="warn"?"error":s])),"warningAsErrors"),ke=r(async()=>{const e=await o(import("@next/eslint-plugin-next"));return E(e.configs.recommended.rules)},"nextjsRules"),Pe=r(async()=>{const e=await o(import("@next/eslint-plugin-next"));return[{files:se,name:"jimmy.codes/nextjs",plugins:{"@next/next":e},rules:await ke()}]},"nextjsConfig"),Ce={"n/no-process-exit":"off","n/prefer-node-protocol":"error"},Ee=r(()=>[{name:"jimmy.codes/node",plugins:{n:h},rules:Ce}],"nodeConfig"),Re={...w.configs["recommended-natural"].rules,"perfectionist/sort-imports":["error",{customGroups:{type:{},value:{}},environment:"node",groups:["side-effect-style","builtin","type","external","internal-type","internal",["parent-type","sibling-type","index-type"],["parent","sibling","index"],"object","style","unknown"],internalPattern:["^~/.*","^@/.*"],order:"asc",type:"natural"}],"perfectionist/sort-modules":"off"},Oe=r(()=>[{name:"jimmy.codes/perfectionist",plugins:{perfectionist:w},rules:Re}],"perfectionistConfig"),Te=r(async()=>({...(await o(import("eslint-plugin-playwright"))).configs["flat/recommended"].rules,"playwright/expect-expect":"error","playwright/max-nested-describe":"error","playwright/no-conditional-expect":"error","playwright/no-conditional-in-test":"error","playwright/no-element-handle":"error","playwright/no-eval":"error","playwright/no-force-option":"error","playwright/no-nested-step":"error","playwright/no-page-pause":"error","playwright/no-skipped-test":"error","playwright/no-slowed-test":"error","playwright/no-useless-await":"error","playwright/no-useless-not":"error","playwright/no-wait-for-selector":"error","playwright/no-wait-for-timeout":"error"}),"playwrightRules"),_e=r(async()=>[{...(await o(import("eslint-plugin-playwright"))).configs["flat/recommended"],files:C,name:"jimmy.codes/playwright",rules:await Te()}],"playwrightConfig"),qe=r(()=>[{name:"jimmy.codes/prettier",...re}],"prettierConfig"),Se=r(()=>i("typescript"),"hasTypescript"),Le=r(()=>i("react"),"hasReact"),Ge=r(()=>i("vitest"),"hasVitest"),Ae=r(()=>i("jest"),"hasJest"),Be=r(()=>ae.some(e=>i(e)),"hasTestingLibrary"),Ie=r(()=>i("@tanstack/react-query"),"hasReactQuery"),Ne=r(()=>i("astro"),"hasAstro"),De=r(()=>i("@playwright/test"),"hasPlaywright"),$e=r(()=>i("storybook"),"hasStorybook"),R=r(()=>i("next"),"hasNext"),Ve=r(()=>i("vite"),"hasVite"),Fe=r(e=>e===2?"error":e===1?"warn":"off","toStringSeverity"),O=r((e={})=>Object.fromEntries(Object.entries(e).map(([t,s])=>[t,typeof s=="number"?Fe(s):s])),"normalizeRuleEntries"),Je=["dynamic","dynamicParams","revalidate","fetchCache","runtime","preferredRegion","maxDuration","config","generateStaticParams","metadata","generateMetadata","viewport","generateViewport"],Xe=r(async()=>{const[e,t]=await Promise.all([o(import("eslint-plugin-react")),o(import("eslint-plugin-jsx-a11y"))]),s=R(),n=Ve();return{...t.configs.recommended.rules,...O(e.configs.flat.recommended?.rules),...O(e.configs.flat["jsx-runtime"]?.rules),"react-compiler/react-compiler":"error","react-hooks/exhaustive-deps":"error","react-hooks/rules-of-hooks":"error","react-refresh/only-export-components":["warn",{allowConstantExport:n,allowExportNames:s?Je:[]}],"react/boolean-prop-naming":"off","react/button-has-type":"error","react/checked-requires-onchange-or-readonly":"error","react/default-props-match-prop-types":"error","react/destructuring-assignment":"off","react/forbid-component-props":"off","react/forbid-dom-props":"off","react/forbid-elements":"off","react/forbid-foreign-prop-types":"off","react/forbid-prop-types":"off","react/forward-ref-uses-ref":"error","react/function-component-definition":"off","react/hook-use-state":"error","react/iframe-missing-sandbox":"error","react/jsx-boolean-value":["error","never"],"react/jsx-curly-brace-presence":"error","react/jsx-filename-extension":"off","react/jsx-fragments":["error","syntax"],"react/jsx-handler-names":"off","react/jsx-max-depth":"off","react/jsx-no-bind":"off","react/jsx-no-constructed-context-values":"error","react/jsx-no-leaked-render":"error","react/jsx-no-literals":"off","react/jsx-no-script-url":"error","react/jsx-no-useless-fragment":"error","react/jsx-one-expression-per-line":"off","react/jsx-pascal-case":["error",{allowNamespace:!0}],"react/jsx-props-no-spread-multi":"off","react/jsx-props-no-spreading":"off","react/jsx-sort-default-props":"off","react/jsx-sort-props":"off","react/no-access-state-in-setstate":"error","react/no-adjacent-inline-elements":"off","react/no-array-index-key":"off","react/no-arrow-function-lifecycle":"error","react/no-danger":"off","react/no-did-mount-set-state":"error","react/no-did-update-set-state":"error","react/no-invalid-html-attribute":"error","react/no-multi-comp":"off","react/no-namespace":"error","react/no-object-type-as-default-prop":"error","react/no-redundant-should-component-update":"error","react/no-set-state":"off","react/no-this-in-sfc":"error","react/no-typos":"error","react/no-unstable-nested-components":"error","react/no-unused-class-component-methods":"error","react/no-unused-prop-types":"error","react/no-unused-state":"error","react/no-will-update-set-state":"error","react/prefer-es6-class":"off","react/prefer-exact-props":"off","react/prefer-read-only-props":"off","react/prefer-stateless-function":"off","react/require-default-props":"off","react/require-optimization":"off","react/self-closing-comp":"error","react/sort-comp":"off","react/sort-default-props":"off","react/sort-prop-types":"off","react/state-in-constructor":"off","react/static-property-placement":"off","react/style-prop-object":"error","react/void-dom-elements-no-children":"error"}},"reactRules"),Ue=r(async()=>{const[e,t,s,n,m]=await Promise.all([o(import("eslint-plugin-react")),o(import("eslint-plugin-jsx-a11y")),import("eslint-plugin-react-hooks"),o(import("eslint-plugin-react-refresh")),o(import("eslint-plugin-react-compiler"))]);return[{files:[p,g],languageOptions:{globals:{...u.browser},parserOptions:{ecmaFeatures:{jsx:!0},jsxPragma:null}},name:"jimmy.codes/react",plugins:{"jsx-a11y":t,react:e,"react-compiler":m,"react-hooks":s,"react-refresh":n},rules:await Xe(),settings:{react:{version:"detect"}}}]},"reactConfig"),ze={...v.configs["flat/recommended"].rules,"regexp/confusing-quantifier":"error","regexp/no-empty-alternative":"error","regexp/no-lazy-ends":"error","regexp/no-potentially-useless-backreference":"error","regexp/no-useless-flag":"error","regexp/optimal-lookaround-quantifier":"error"},He=r(()=>[{name:"jimmy.codes/regexp",plugins:{regexp:v},rules:ze}],"regexpConfig"),Me=r(async()=>{const{configs:e}=await o(import("eslint-plugin-storybook")),[t,s,n]=e["flat/recommended"];return[{name:"jimmy.codes/storybook/setup",plugins:t?.plugins},{files:s?.files,name:"jimmy.codes/storybook/stories-rules",rules:{...E(s?.rules),"import-x/no-anonymous-default-export":"off","unicorn/no-anonymous-default-export":"off"}},{files:n?.files,name:"jimmy.codes/storybook/main-rules",rules:{...n?.rules}}]},"storybookConfig"),Qe=r(async()=>{const e=await o(import("@tanstack/eslint-plugin-query"));return[{files:[p,g],name:"jimmy.codes/react/query",plugins:{"@tanstack/query":e},rules:{"@tanstack/query/exhaustive-deps":"error","@tanstack/query/no-rest-destructuring":"warn","@tanstack/query/stable-query-client":"error"}}]},"tanstackQueryConfig"),Ye=r(async()=>{const[e,t]=await Promise.all([import("eslint-plugin-jest-dom"),o(import("eslint-plugin-testing-library"))]);return{...t.configs["flat/react"].rules,...e.configs["flat/recommended"].rules}},"testingLibraryRules"),We=r(async()=>{const[e,t]=await Promise.all([import("eslint-plugin-jest-dom"),o(import("eslint-plugin-testing-library"))]);return[{files:f,ignores:y,name:"jimmy.codes/testing-library",plugins:{"jest-dom":e,"testing-library":t},rules:await Ye()}]},"testingLibraryConfig"),Ke={"@typescript-eslint/consistent-type-exports":["error",{fixMixedExportsWithInlineTypeSpecifier:!1}],"@typescript-eslint/consistent-type-imports":["error",{fixStyle:"separate-type-imports"}],"@typescript-eslint/no-deprecated":"warn","@typescript-eslint/no-misused-promises":["error",{checksVoidReturn:{attributes:!1}}],"@typescript-eslint/no-unused-vars":["error",{args:"all",argsIgnorePattern:"^_",caughtErrors:"all",caughtErrorsIgnorePattern:"^_",destructuredArrayIgnorePattern:"^_",ignoreRestSiblings:!0,varsIgnorePattern:"^_"}],"@typescript-eslint/no-use-before-define":["error",{allowNamedExports:!1,classes:!1,functions:!1,variables:!0}],"@typescript-eslint/restrict-template-expressions":["error",{allowNumber:!0}],"no-use-before-define":"off"},Ze=r(()=>[...l.strictTypeChecked,...l.stylisticTypeChecked.filter(e=>e.name==="typescript-eslint/stylistic-type-checked"),{languageOptions:{parserOptions:{projectService:!0,tsconfigRootDir:process.cwd()}},name:"jimmy.codes/typescript",rules:Ke},{files:[P,p],...l.disableTypeChecked},{files:f,name:"jimmy.codes/typescript/testing",rules:{"@typescript-eslint/no-unsafe-argument":"off","@typescript-eslint/no-unsafe-assignment":"off"}}],"typescriptConfig"),er={...k.configs["flat/recommended"].rules,"unicorn/filename-case":"off","unicorn/import-style":"off","unicorn/no-abusive-eslint-disable":"off","unicorn/no-anonymous-default-export":"off","unicorn/no-array-callback-reference":"off","unicorn/no-array-reduce":"off","unicorn/no-null":"off","unicorn/no-process-exit":"off","unicorn/no-useless-undefined":["error",{checkArguments:!1,checkArrowFunctionBody:!1}],"unicorn/prefer-node-protocol":"off","unicorn/prevent-abbreviations":"off"},rr=r(()=>[{...k.configs["flat/recommended"],name:"jimmy.codes/unicorn",rules:er}],"unicornConfig"),tr=r(async()=>({...(await o(import("@vitest/eslint-plugin"))).configs.recommended.rules,"vitest/consistent-test-it":["error",{fn:"test",withinDescribe:"it"}],"vitest/no-alias-methods":"error","vitest/no-commented-out-tests":"error","vitest/no-conditional-in-test":"error","vitest/no-disabled-tests":"warn","vitest/no-duplicate-hooks":"error","vitest/no-focused-tests":"error","vitest/no-hooks":"off","vitest/no-identical-title":"error","vitest/no-interpolation-in-snapshots":"error","vitest/no-large-snapshots":"off","vitest/no-mocks-import":"error","vitest/no-restricted-matchers":"off","vitest/no-restricted-vi-methods":"off","vitest/no-standalone-expect":"error","vitest/no-test-prefixes":"error","vitest/no-test-return-statement":"error","vitest/prefer-called-with":"error","vitest/prefer-comparison-matcher":"error","vitest/prefer-each":"error","vitest/prefer-equality-matcher":"error","vitest/prefer-expect-assertions":"off","vitest/prefer-expect-resolves":"error","vitest/prefer-hooks-in-order":"error","vitest/prefer-hooks-on-top":"error","vitest/prefer-lowercase-title":"off","vitest/prefer-mock-promise-shorthand":"error","vitest/prefer-snapshot-hint":"error","vitest/prefer-spy-on":"off","vitest/prefer-strict-boolean-matchers":"error","vitest/prefer-strict-equal":"error","vitest/prefer-to-be":"error","vitest/prefer-to-contain":"error","vitest/prefer-to-have-length":"error","vitest/prefer-todo":"warn","vitest/require-hook":"error","vitest/require-to-throw-message":"error","vitest/require-top-level-describe":"off","vitest/valid-expect":"error","vitest/valid-expect-in-promise":"error","vitest/valid-title":"error"}),"vitestRules"),or=r(async()=>{const e=await o(import("@vitest/eslint-plugin"));return[{files:f,ignores:y,...e.configs.recommended,name:"jimmy.codes/vitest",rules:await tr()}]},"vitestConfig"),sr=r(async({astro:e=!1,autoDetect:t=!0,ignores:s=[],jest:n=!1,nextjs:m=!1,overrides:T=[],playwright:_=!1,react:q=!1,storybook:S=!1,tanstackQuery:L=!1,testingLibrary:G=!1,typescript:A=!1,vitest:B=!1}={},...I)=>{const a=r((Q,Y)=>Q||t&&Y(),"resolveFlag"),x=a(A,Se),N=a(q,Le),D=a(e,Ne),$=a(L,Ie),V=a(G,Be),F=a(_,De),J=a(S,$e),X=a(m,R),U=a(n,Ae),z=a(B,Ge),H=[je(),Oe(),Ee(),rr(),fe(),He(),ve(),ge({typescript:x})],M=[x&&Ze(),N&&await Ue(),$&&await Qe(),D&&await ce(),U&&await be(),z&&await or(),V&&await We(),F&&await _e(),J&&await Me(),X&&await Pe()].filter(Boolean);return[...H,...M,qe(),le(),me(s),T,I].flat()},"eslintConfig");export{sr as default};
|