@jimmy.codes/eslint-config 3.30.1 → 4.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 +19 -17
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +12 -64
- package/dist/index.d.mts +12 -64
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
[](https://semantic-release.gitbook.io/semantic-release)
|
|
7
7
|
[](https://github.com/prettier/prettier)
|
|
8
8
|
|
|
9
|
-
> 🔍
|
|
9
|
+
> 🔍 Another opinionated [ESLint](https://eslint.org) config
|
|
10
10
|
|
|
11
11
|
## 🛠️ Usage
|
|
12
12
|
|
|
@@ -15,13 +15,13 @@
|
|
|
15
15
|
|
|
16
16
|
### 🔨 Getting Started
|
|
17
17
|
|
|
18
|
-
First install the package
|
|
18
|
+
First, install the package:
|
|
19
19
|
|
|
20
20
|
```
|
|
21
21
|
pnpm add -D @jimmy.codes/eslint-config
|
|
22
22
|
```
|
|
23
23
|
|
|
24
|
-
Then
|
|
24
|
+
Then, in your `eslint.config.js`, simply add:
|
|
25
25
|
|
|
26
26
|
```mjs
|
|
27
27
|
import eslintConfig from "@jimmy.codes/eslint-config";
|
|
@@ -29,11 +29,19 @@ import eslintConfig from "@jimmy.codes/eslint-config";
|
|
|
29
29
|
export default eslintConfig();
|
|
30
30
|
```
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
This automatically applies rules based on your installed dependencies.
|
|
33
33
|
|
|
34
34
|
### 🔧 Configuration
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
By default, this config automatically enables rules based on your installed dependencies (e.g., `react`, `vitest`). Set `autoDetect: false` to disable this behavior.
|
|
37
|
+
|
|
38
|
+
```ts
|
|
39
|
+
import eslintConfig from "@jimmy.codes/eslint-config";
|
|
40
|
+
|
|
41
|
+
export default eslintConfig({ autoDetect: false });
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
You can also manually enable or disable specific rule sets:
|
|
37
45
|
|
|
38
46
|
```ts
|
|
39
47
|
import eslintConfig from "@jimmy.codes/eslint-config";
|
|
@@ -52,17 +60,9 @@ export default eslintConfig({
|
|
|
52
60
|
});
|
|
53
61
|
```
|
|
54
62
|
|
|
55
|
-
|
|
63
|
+
#### Extending/Overriding the Configuration
|
|
56
64
|
|
|
57
|
-
|
|
58
|
-
import eslintConfig from "@jimmy.codes/eslint-config";
|
|
59
|
-
|
|
60
|
-
export default eslintConfig({ autoDetect: false });
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
#### Extending/overriding the Configuration
|
|
64
|
-
|
|
65
|
-
You can also extend or override the configuration:
|
|
65
|
+
You can extend or override the configuration using the `overrides` option:
|
|
66
66
|
|
|
67
67
|
```ts
|
|
68
68
|
import eslintConfig from "@jimmy.codes/eslint-config";
|
|
@@ -85,7 +85,7 @@ export default eslintConfig({
|
|
|
85
85
|
});
|
|
86
86
|
```
|
|
87
87
|
|
|
88
|
-
|
|
88
|
+
Alternatively, you can pass additional configurations as separate arguments:
|
|
89
89
|
|
|
90
90
|
```ts
|
|
91
91
|
import eslintConfig from "@jimmy.codes/eslint-config";
|
|
@@ -107,7 +107,9 @@ export default eslintConfig(
|
|
|
107
107
|
);
|
|
108
108
|
```
|
|
109
109
|
|
|
110
|
-
|
|
110
|
+
> This approach is useful if you prefer to separate rule overrides into multiple objects instead of nesting them inside `overrides`.
|
|
111
|
+
|
|
112
|
+
#### Ignoring Files
|
|
111
113
|
|
|
112
114
|
You can also extend what is ignored:
|
|
113
115
|
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var ee=Object.create;var d=Object.defineProperty;var re=Object.getOwnPropertyDescriptor;var te=Object.getOwnPropertyNames;var se=Object.getPrototypeOf,oe=Object.prototype.hasOwnProperty;var t=(e,r)=>d(e,"name",{value:r,configurable:!0});var ne=(e,r,s,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of te(r))!oe.call(e,a)&&a!==s&&d(e,a,{get:()=>r[a],enumerable:!(n=re(r,a))||n.enumerable});return e};var o=(e,r,s)=>(s=e!=null?ee(se(e)):{},ne(r||!e||!e.__esModule?d(s,"default",{value:e,enumerable:!0}):s,e));var g=require("globals"),p=require("typescript-eslint"),O=require("@eslint-community/eslint-plugin-eslint-comments/configs"),ie=require("eslint-import-resolver-typescript"),y=require("eslint-plugin-import-x"),q=require("eslint-plugin-n"),ae=require("@eslint/js"),C=require("eslint-plugin-jsdoc"),T=require("eslint-plugin-perfectionist"),ce=require("eslint-config-prettier"),c=require("local-pkg"),le=require("eslint-plugin-regexp"),R=require("eslint-plugin-unicorn");function pe(e){var r=Object.create(null);return e&&Object.keys(e).forEach(function(s){if(s!=="default"){var n=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(r,s,n.get?n:{enumerable:!0,get:t(function(){return e[s]},"get")})}}),r.default=e,Object.freeze(r)}t(pe,"_interopNamespaceDefault");var _=pe(le);const l="?([cm])[jt]s?(x)",fe=["**/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"],L="**/*.?([cm])js",u="**/*.?([cm])jsx",ue="**/*.?([cm])ts",j="**/*.?([cm])tsx",m=[`**/__tests__/**/*.${l}`,`**/*.spec.${l}`,`**/*.test.${l}`,`**/*.bench.${l}`,`**/*.benchmark.${l}`],S=[`**/e2e/**/*.spec.${l}`,`**/e2e/**/*.test.${l}`],x=[...S,`**/cypress/**/*.spec.${l}`,`**/cypress/**/*.test.${l}`],me=[L,u,ue,j],de="**/*.cjs",ge="**/*.astro",ye=["@testing-library/react"],i=t(async e=>{const r=await e;return r.default??r},"interopDefault"),je=t(async()=>{const e=[ge],[r,s,n]=await Promise.all([import("eslint-plugin-astro"),import("astro-eslint-parser"),i(import("eslint-plugin-jsx-a11y"))]);return[{files:e,languageOptions:{globals:{...g.node,Astro:!1,Fragment:!1},parser:s,parserOptions:{extraFileExtensions:[".astro"],parser:p.parser},sourceType:"module"},name:"jimmy.codes/astro",plugins:{astro:r,"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:p.configs.disableTypeChecked.languageOptions?.parserOptions},name:"jimmy.codes/astro/disable-type-checked",rules:p.configs.disableTypeChecked.rules},{name:"jimmy.codes/astro/imports",settings:{"import-x/core-modules":["astro:content"]}}]},"astroConfig"),xe=t(()=>[{files:[de],languageOptions:{globals:g.commonjs},name:"jimmy.codes/commonjs"}],"commonjsConfig"),he={...O.recommended.rules,"@eslint-community/eslint-comments/no-unused-disable":"off","@eslint-community/eslint-comments/require-description":"error"},ve=t(()=>[{...O.recommended,name:"jimmy.codes/eslint-comments",rules:he}],"eslintCommentsConfig"),be=t(e=>[{ignores:[...fe,...e],name:"jimmy.codes/ignores"}],"ignoresConfig"),we={...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"},ke=t(()=>{const{rules:e,settings:r}=y.configs.typescript;return[{name:"jimmy.codes/imports/typescript",rules:e,settings:{"import-x/extensions":r["import-x/extensions"],"import-x/external-module-folders":r["import-x/external-module-folders"],"import-x/parsers":r["import-x/parsers"],"import-x/resolver-next":[ie.createTypeScriptImportResolver({alwaysTryTypes:!0})]}}]},"importsTypescriptConfig"),Pe=t(({typescript:e=!1}={})=>[{name:"jimmy.codes/imports",plugins:{"import-x":y,n:q},rules:we},...e?ke():[]],"importsConfig"),Ee={...ae.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"},Oe=t(()=>[{linterOptions:{reportUnusedDisableDirectives:!0},name:"jimmy.codes/javascript",rules:Ee}],"javascriptConfig"),qe=t(()=>({...C.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"),Ce=t(()=>[{...C.configs["flat/recommended-typescript-error"],name:"jimmy.codes/jsdoc",rules:qe()}],"jsdocConfig"),G=t((e={})=>Object.fromEntries(Object.entries(e).map(([r,s])=>[r,s==="warn"?"error":s])),"warningAsErrors"),Te=t(async()=>{const e=await i(import("@next/eslint-plugin-next"));return G(e.configs.recommended.rules)},"nextjsRules"),Re=t(async()=>{const e=await i(import("@next/eslint-plugin-next"));return[{files:me,name:"jimmy.codes/nextjs",plugins:{"@next/next":e},rules:await Te()}]},"nextjsConfig"),_e={"n/no-process-exit":"off","n/prefer-node-protocol":"error"},Le=t(()=>[{name:"jimmy.codes/node",plugins:{n:q},rules:_e}],"nodeConfig"),Se={...T.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"},Ge=t(()=>[{name:"jimmy.codes/perfectionist",plugins:{perfectionist:T},rules:Se}],"perfectionistConfig"),Ae=t(async()=>({...(await i(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=t(async()=>[{...(await i(import("eslint-plugin-playwright"))).configs["flat/recommended"],files:S,name:"jimmy.codes/playwright",rules:await Ae()}],"playwrightConfig"),Ne=t(()=>[{name:"jimmy.codes/prettier",...ce}],"prettierConfig"),Be=t(()=>c.isPackageExists("typescript"),"hasTypescript"),$e=t(()=>c.isPackageExists("react"),"hasReact"),A=t(()=>c.isPackageExists("vitest"),"hasVitest"),I=t(()=>c.isPackageExists("jest"),"hasJest"),Je=t(()=>A()||I(),"hasTesting"),Ve=t(()=>ye.some(e=>c.isPackageExists(e)),"hasTestingLibrary"),Fe=t(()=>c.isPackageExists("@tanstack/react-query"),"hasReactQuery"),Xe=t(()=>c.isPackageExists("astro"),"hasAstro"),ze=t(()=>c.isPackageExists("@playwright/test"),"hasPlaywright"),Qe=t(()=>c.isPackageExists("storybook"),"hasStorybook"),N=t(()=>c.isPackageExists("next"),"hasNext"),Ue=t(()=>c.isPackageExists("vite"),"hasVite"),He=t(e=>e===2?"error":e===1?"warn":"off","toStringSeverity"),B=t((e={})=>Object.fromEntries(Object.entries(e).map(([r,s])=>[r,typeof s=="number"?He(s):s])),"normalizeRuleEntries"),Me=["dynamic","dynamicParams","revalidate","fetchCache","runtime","preferredRegion","maxDuration","config","generateStaticParams","metadata","generateMetadata","viewport","generateViewport"],Ye=t(async()=>{const[e,r]=await Promise.all([i(import("eslint-plugin-react")),i(import("eslint-plugin-jsx-a11y"))]),s=N(),n=Ue();return{...r.configs.recommended.rules,...B(e.configs.flat.recommended?.rules),...B(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?Me:[]}],"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"),We=t(async()=>{const[e,r,s,n,a]=await Promise.all([i(import("eslint-plugin-react")),i(import("eslint-plugin-jsx-a11y")),import("eslint-plugin-react-hooks"),i(import("eslint-plugin-react-refresh")),i(import("eslint-plugin-react-compiler"))]);return[{files:[u,j],languageOptions:{globals:{...g.browser},parserOptions:{ecmaFeatures:{jsx:!0},jsxPragma:null}},name:"jimmy.codes/react",plugins:{"jsx-a11y":r,react:e,"react-compiler":a,"react-hooks":s,"react-refresh":n},rules:await Ye(),settings:{react:{version:"detect"}}}]},"reactConfig"),De={..._.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"},Ke=t(()=>[{name:"jimmy.codes/regexp",plugins:{regexp:_},rules:De}],"regexpConfig"),Ze=t(async()=>{const{configs:e}=await i(import("eslint-plugin-storybook")),[r,s,n]=e["flat/recommended"];return[{name:"jimmy.codes/storybook/setup",plugins:r?.plugins},{files:s?.files,name:"jimmy.codes/storybook/stories-rules",rules:{...G(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"),er=t(async()=>{const e=await i(import("@tanstack/eslint-plugin-query"));return[{files:[u,j],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"),rr=t(async()=>{const e=await i(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"),tr=t(async()=>({...(await i(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"),sr=t(async({framework:e="vitest"}={},r=!0)=>{const s=r?A():e==="vitest",n=e==="jest"||r&&I(),a=[];if(s){const f=await i(import("@vitest/eslint-plugin"));a.push({files:m,ignores:x,...f.configs.recommended,name:"jimmy.codes/vitest",rules:await tr()})}if(n){const f=await i(import("eslint-plugin-jest"));a.push({files:m,ignores:x,...f.configs["flat/recommended"],name:"jimmy.codes/jest",rules:await rr()})}return a},"testingConfig"),or=t(async()=>{const[e,r]=await Promise.all([import("eslint-plugin-jest-dom"),i(import("eslint-plugin-testing-library"))]);return{...r.configs["flat/react"].rules,...e.configs["flat/recommended"].rules}},"testingLibraryRules"),nr=t(async()=>{const[e,r]=await Promise.all([import("eslint-plugin-jest-dom"),i(import("eslint-plugin-testing-library"))]);return[{files:m,ignores:x,name:"jimmy.codes/testing-library",plugins:{"jest-dom":e,"testing-library":r},rules:await or()}]},"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=t(e=>[...p.configs.strictTypeChecked,...p.configs.stylisticTypeChecked.filter(r=>r.name==="typescript-eslint/stylistic-type-checked"),{languageOptions:{parserOptions:{...e?.project?{project:e.project}:{projectService:!0},tsconfigRootDir:process.cwd()}},name:"jimmy.codes/typescript",rules:ir},{files:[L,u],...p.configs.disableTypeChecked},{files:m,name:"jimmy.codes/typescript/testing",rules:{"@typescript-eslint/no-unsafe-argument":"off","@typescript-eslint/no-unsafe-assignment":"off"}}],"typescriptConfig"),cr={...R.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=t(()=>[{...R.configs["flat/recommended"],name:"jimmy.codes/unicorn",rules:cr}],"unicornConfig"),pr=t(e=>typeof e=="object"?e:void 0,"getTypescriptOptions"),fr=t((e,r)=>typeof e=="object"?e:{framework:r.vitest?"vitest":r.jest?"jest":"vitest",...r.testingLibrary&&{utilities:["testing-library"]}},"getTestingOptions"),ur=t(e=>typeof e=="object"?e:{utilities:[]},"getReactOptions"),mr=t(({utilities:e=[]},r,s)=>r||e.includes("@tanstack/query")||s&&Fe(),"shouldEnableTanstackQuery"),dr=t(({utilities:e=[]},r)=>e.includes("testing-library")||r&&Ve(),"shouldEnableTestingLibrary"),gr=t(async({astro:e=!1,autoDetect:r=!0,configs:s=[],ignores:n=[],jest:a=!1,nextjs:f=!1,overrides:$=[],playwright:J=!1,react:h=!1,storybook:V=!1,tanstackQuery:F=!1,testing:v=!1,testingLibrary:X=!1,typescript:b=!1,vitest:w=!1}={},...z)=>{const Q=ur(h),k=fr(v,{jest:a,testingLibrary:X,vitest:w}),P=pr(b),E=b||!!P||r&&Be(),U=h||r&&$e(),H=v||a||w||r&&Je(),M=e||r&&Xe(),Y=mr(Q,F,r),W=dr(k,r),D=J||r&&ze(),K=V||r&&Qe(),Z=f||r&&N();return[Oe(),Ge(),Le(),lr(),ve(),Ke(),Ce(),Pe({typescript:E}),E?ar(P):[],U?await We():[],Y?await er():[],M?await je():[],H?await sr(k,r):[],W?await nr():[],D?await Ie():[],K?await Ze():[],Z?await Re():[],Ne(),xe(),be(n),s,$,z].flat()},"eslintConfig");module.exports=gr;
|
|
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;
|
package/dist/index.d.cts
CHANGED
|
@@ -13291,44 +13291,6 @@ type Yoda = []|[("always" | "never")]|[("always" | "never"), {
|
|
|
13291
13291
|
}]
|
|
13292
13292
|
|
|
13293
13293
|
type Rules = RuleOptions;
|
|
13294
|
-
/**
|
|
13295
|
-
* @deprecated
|
|
13296
|
-
*/
|
|
13297
|
-
interface TypescriptOptions {
|
|
13298
|
-
/**
|
|
13299
|
-
* Location of `tsconfig.json` used for [type aware linting](https://typescript-eslint.io/getting-started/typed-linting)
|
|
13300
|
-
* @deprecated since this config uses `projectService` this is no longer needed and will be removed.
|
|
13301
|
-
*/
|
|
13302
|
-
project: string | string[];
|
|
13303
|
-
}
|
|
13304
|
-
type TestingFrameworks = "jest" | "vitest";
|
|
13305
|
-
type TestingUtilities = "testing-library";
|
|
13306
|
-
type ReactUtilities = "@tanstack/query";
|
|
13307
|
-
/**
|
|
13308
|
-
* @deprecated
|
|
13309
|
-
*/
|
|
13310
|
-
interface TestingOptions {
|
|
13311
|
-
/**
|
|
13312
|
-
* Which testing framework are you using?
|
|
13313
|
-
* @default "vitest"
|
|
13314
|
-
*/
|
|
13315
|
-
framework?: TestingFrameworks;
|
|
13316
|
-
/**
|
|
13317
|
-
* Enable additional rules for testing utilities such as:
|
|
13318
|
-
* - [Testing Library](https://testing-library.com)
|
|
13319
|
-
*/
|
|
13320
|
-
utilities?: TestingUtilities[];
|
|
13321
|
-
}
|
|
13322
|
-
/**
|
|
13323
|
-
* @deprecated
|
|
13324
|
-
*/
|
|
13325
|
-
interface ReactOptions {
|
|
13326
|
-
/**
|
|
13327
|
-
* Enable additional rules for utilities such as:
|
|
13328
|
-
* - [React Query](https://tanstack.com/query/latest/docs/framework/react/overview)
|
|
13329
|
-
*/
|
|
13330
|
-
utilities?: ReactUtilities[];
|
|
13331
|
-
}
|
|
13332
13294
|
type TypedConfigItem = Omit<Linter.Config<Linter.RulesRecord & Rules>, "plugins"> & {
|
|
13333
13295
|
/**
|
|
13334
13296
|
* An object containing a name-value mapping of plugin names to plugin objects. When `files` is specified, these plugins are only available to the matching files.
|
|
@@ -13343,19 +13305,14 @@ interface Options {
|
|
|
13343
13305
|
*/
|
|
13344
13306
|
astro?: boolean;
|
|
13345
13307
|
/**
|
|
13346
|
-
*
|
|
13308
|
+
* Automatically enables rules based on installed dependencies.
|
|
13309
|
+
* For example, if `react` is installed, React-specific rules will be applied.
|
|
13347
13310
|
* @default true
|
|
13348
13311
|
*/
|
|
13349
13312
|
autoDetect?: boolean;
|
|
13350
13313
|
/**
|
|
13351
|
-
*
|
|
13352
|
-
*
|
|
13353
|
-
*
|
|
13354
|
-
* @default []
|
|
13355
|
-
*/
|
|
13356
|
-
configs?: Linter.Config[] | TypedConfigItem[];
|
|
13357
|
-
/**
|
|
13358
|
-
* Glob patterns for files that should be ignored
|
|
13314
|
+
* Glob patterns for files that should be ignored.
|
|
13315
|
+
* Matches ESLint's ignore patterns.
|
|
13359
13316
|
* @see [Ignoring files](https://eslint.org/docs/latest/use/configure/ignore)
|
|
13360
13317
|
*/
|
|
13361
13318
|
ignores?: string[];
|
|
@@ -13370,7 +13327,8 @@ interface Options {
|
|
|
13370
13327
|
*/
|
|
13371
13328
|
nextjs?: boolean;
|
|
13372
13329
|
/**
|
|
13373
|
-
* Additional configs to
|
|
13330
|
+
* Additional configs to extend or override rules.
|
|
13331
|
+
* Accepts ESLint configuration objects.
|
|
13374
13332
|
* @default []
|
|
13375
13333
|
*/
|
|
13376
13334
|
overrides?: Linter.Config[] | TypedConfigItem[];
|
|
@@ -13383,24 +13341,17 @@ interface Options {
|
|
|
13383
13341
|
* Are React rules enabled?
|
|
13384
13342
|
* @default false
|
|
13385
13343
|
*/
|
|
13386
|
-
react?: boolean
|
|
13344
|
+
react?: boolean;
|
|
13387
13345
|
/**
|
|
13388
13346
|
* Are Storybook rules enabled?
|
|
13389
13347
|
* @default false
|
|
13390
13348
|
*/
|
|
13391
13349
|
storybook?: boolean;
|
|
13392
13350
|
/**
|
|
13393
|
-
* Are
|
|
13351
|
+
* Are TanStack Query rules enabled?
|
|
13394
13352
|
* @default false
|
|
13395
13353
|
*/
|
|
13396
13354
|
tanstackQuery?: boolean;
|
|
13397
|
-
/**
|
|
13398
|
-
* Are testing rules enabled?
|
|
13399
|
-
* @default false
|
|
13400
|
-
*
|
|
13401
|
-
* @deprecated please use {@link Options.jest}, {@link Options.vitest}, or {@link Options.testingLibrary} instead.
|
|
13402
|
-
*/
|
|
13403
|
-
testing?: boolean | TestingOptions;
|
|
13404
13355
|
/**
|
|
13405
13356
|
* Are Testing Library rules enabled?
|
|
13406
13357
|
* @default false
|
|
@@ -13410,7 +13361,7 @@ interface Options {
|
|
|
13410
13361
|
* Are TypeScript rules enabled?
|
|
13411
13362
|
* @default false
|
|
13412
13363
|
*/
|
|
13413
|
-
typescript?: boolean
|
|
13364
|
+
typescript?: boolean;
|
|
13414
13365
|
/**
|
|
13415
13366
|
* Are Vitest rules enabled?
|
|
13416
13367
|
* @default false
|
|
@@ -13418,7 +13369,7 @@ interface Options {
|
|
|
13418
13369
|
vitest?: boolean;
|
|
13419
13370
|
}
|
|
13420
13371
|
|
|
13421
|
-
declare const eslintConfig: ({ astro, autoDetect,
|
|
13372
|
+
declare const eslintConfig: ({ astro, autoDetect, ignores, jest, nextjs, overrides, playwright, react, storybook, tanstackQuery, testingLibrary, typescript, vitest, }?: Options, ...moreOverrides: Linter.Config[] | TypedConfigItem[]) => Promise<(TypedConfigItem | Linter.Config<Linter.RulesRecord> | _typescript_eslint_utils_ts_eslint.FlatConfig.Config | {
|
|
13422
13373
|
files: string[];
|
|
13423
13374
|
languageOptions: {
|
|
13424
13375
|
globals: {
|
|
@@ -15762,11 +15713,8 @@ declare const eslintConfig: ({ astro, autoDetect, configs, ignores, jest, nextjs
|
|
|
15762
15713
|
} | {
|
|
15763
15714
|
languageOptions: {
|
|
15764
15715
|
parserOptions: {
|
|
15765
|
-
tsconfigRootDir: string;
|
|
15766
|
-
project: string | string[];
|
|
15767
|
-
} | {
|
|
15768
|
-
tsconfigRootDir: string;
|
|
15769
15716
|
projectService: boolean;
|
|
15717
|
+
tsconfigRootDir: string;
|
|
15770
15718
|
};
|
|
15771
15719
|
};
|
|
15772
15720
|
name: string;
|
|
@@ -15840,4 +15788,4 @@ declare const eslintConfig: ({ astro, autoDetect, configs, ignores, jest, nextjs
|
|
|
15840
15788
|
settings?: Record<string, unknown>;
|
|
15841
15789
|
})[]>;
|
|
15842
15790
|
|
|
15843
|
-
export { type Options, type
|
|
15791
|
+
export { type Options, type Rules, type TypedConfigItem, eslintConfig as default };
|
package/dist/index.d.mts
CHANGED
|
@@ -13291,44 +13291,6 @@ type Yoda = []|[("always" | "never")]|[("always" | "never"), {
|
|
|
13291
13291
|
}]
|
|
13292
13292
|
|
|
13293
13293
|
type Rules = RuleOptions;
|
|
13294
|
-
/**
|
|
13295
|
-
* @deprecated
|
|
13296
|
-
*/
|
|
13297
|
-
interface TypescriptOptions {
|
|
13298
|
-
/**
|
|
13299
|
-
* Location of `tsconfig.json` used for [type aware linting](https://typescript-eslint.io/getting-started/typed-linting)
|
|
13300
|
-
* @deprecated since this config uses `projectService` this is no longer needed and will be removed.
|
|
13301
|
-
*/
|
|
13302
|
-
project: string | string[];
|
|
13303
|
-
}
|
|
13304
|
-
type TestingFrameworks = "jest" | "vitest";
|
|
13305
|
-
type TestingUtilities = "testing-library";
|
|
13306
|
-
type ReactUtilities = "@tanstack/query";
|
|
13307
|
-
/**
|
|
13308
|
-
* @deprecated
|
|
13309
|
-
*/
|
|
13310
|
-
interface TestingOptions {
|
|
13311
|
-
/**
|
|
13312
|
-
* Which testing framework are you using?
|
|
13313
|
-
* @default "vitest"
|
|
13314
|
-
*/
|
|
13315
|
-
framework?: TestingFrameworks;
|
|
13316
|
-
/**
|
|
13317
|
-
* Enable additional rules for testing utilities such as:
|
|
13318
|
-
* - [Testing Library](https://testing-library.com)
|
|
13319
|
-
*/
|
|
13320
|
-
utilities?: TestingUtilities[];
|
|
13321
|
-
}
|
|
13322
|
-
/**
|
|
13323
|
-
* @deprecated
|
|
13324
|
-
*/
|
|
13325
|
-
interface ReactOptions {
|
|
13326
|
-
/**
|
|
13327
|
-
* Enable additional rules for utilities such as:
|
|
13328
|
-
* - [React Query](https://tanstack.com/query/latest/docs/framework/react/overview)
|
|
13329
|
-
*/
|
|
13330
|
-
utilities?: ReactUtilities[];
|
|
13331
|
-
}
|
|
13332
13294
|
type TypedConfigItem = Omit<Linter.Config<Linter.RulesRecord & Rules>, "plugins"> & {
|
|
13333
13295
|
/**
|
|
13334
13296
|
* An object containing a name-value mapping of plugin names to plugin objects. When `files` is specified, these plugins are only available to the matching files.
|
|
@@ -13343,19 +13305,14 @@ interface Options {
|
|
|
13343
13305
|
*/
|
|
13344
13306
|
astro?: boolean;
|
|
13345
13307
|
/**
|
|
13346
|
-
*
|
|
13308
|
+
* Automatically enables rules based on installed dependencies.
|
|
13309
|
+
* For example, if `react` is installed, React-specific rules will be applied.
|
|
13347
13310
|
* @default true
|
|
13348
13311
|
*/
|
|
13349
13312
|
autoDetect?: boolean;
|
|
13350
13313
|
/**
|
|
13351
|
-
*
|
|
13352
|
-
*
|
|
13353
|
-
*
|
|
13354
|
-
* @default []
|
|
13355
|
-
*/
|
|
13356
|
-
configs?: Linter.Config[] | TypedConfigItem[];
|
|
13357
|
-
/**
|
|
13358
|
-
* Glob patterns for files that should be ignored
|
|
13314
|
+
* Glob patterns for files that should be ignored.
|
|
13315
|
+
* Matches ESLint's ignore patterns.
|
|
13359
13316
|
* @see [Ignoring files](https://eslint.org/docs/latest/use/configure/ignore)
|
|
13360
13317
|
*/
|
|
13361
13318
|
ignores?: string[];
|
|
@@ -13370,7 +13327,8 @@ interface Options {
|
|
|
13370
13327
|
*/
|
|
13371
13328
|
nextjs?: boolean;
|
|
13372
13329
|
/**
|
|
13373
|
-
* Additional configs to
|
|
13330
|
+
* Additional configs to extend or override rules.
|
|
13331
|
+
* Accepts ESLint configuration objects.
|
|
13374
13332
|
* @default []
|
|
13375
13333
|
*/
|
|
13376
13334
|
overrides?: Linter.Config[] | TypedConfigItem[];
|
|
@@ -13383,24 +13341,17 @@ interface Options {
|
|
|
13383
13341
|
* Are React rules enabled?
|
|
13384
13342
|
* @default false
|
|
13385
13343
|
*/
|
|
13386
|
-
react?: boolean
|
|
13344
|
+
react?: boolean;
|
|
13387
13345
|
/**
|
|
13388
13346
|
* Are Storybook rules enabled?
|
|
13389
13347
|
* @default false
|
|
13390
13348
|
*/
|
|
13391
13349
|
storybook?: boolean;
|
|
13392
13350
|
/**
|
|
13393
|
-
* Are
|
|
13351
|
+
* Are TanStack Query rules enabled?
|
|
13394
13352
|
* @default false
|
|
13395
13353
|
*/
|
|
13396
13354
|
tanstackQuery?: boolean;
|
|
13397
|
-
/**
|
|
13398
|
-
* Are testing rules enabled?
|
|
13399
|
-
* @default false
|
|
13400
|
-
*
|
|
13401
|
-
* @deprecated please use {@link Options.jest}, {@link Options.vitest}, or {@link Options.testingLibrary} instead.
|
|
13402
|
-
*/
|
|
13403
|
-
testing?: boolean | TestingOptions;
|
|
13404
13355
|
/**
|
|
13405
13356
|
* Are Testing Library rules enabled?
|
|
13406
13357
|
* @default false
|
|
@@ -13410,7 +13361,7 @@ interface Options {
|
|
|
13410
13361
|
* Are TypeScript rules enabled?
|
|
13411
13362
|
* @default false
|
|
13412
13363
|
*/
|
|
13413
|
-
typescript?: boolean
|
|
13364
|
+
typescript?: boolean;
|
|
13414
13365
|
/**
|
|
13415
13366
|
* Are Vitest rules enabled?
|
|
13416
13367
|
* @default false
|
|
@@ -13418,7 +13369,7 @@ interface Options {
|
|
|
13418
13369
|
vitest?: boolean;
|
|
13419
13370
|
}
|
|
13420
13371
|
|
|
13421
|
-
declare const eslintConfig: ({ astro, autoDetect,
|
|
13372
|
+
declare const eslintConfig: ({ astro, autoDetect, ignores, jest, nextjs, overrides, playwright, react, storybook, tanstackQuery, testingLibrary, typescript, vitest, }?: Options, ...moreOverrides: Linter.Config[] | TypedConfigItem[]) => Promise<(TypedConfigItem | Linter.Config<Linter.RulesRecord> | _typescript_eslint_utils_ts_eslint.FlatConfig.Config | {
|
|
13422
13373
|
files: string[];
|
|
13423
13374
|
languageOptions: {
|
|
13424
13375
|
globals: {
|
|
@@ -15762,11 +15713,8 @@ declare const eslintConfig: ({ astro, autoDetect, configs, ignores, jest, nextjs
|
|
|
15762
15713
|
} | {
|
|
15763
15714
|
languageOptions: {
|
|
15764
15715
|
parserOptions: {
|
|
15765
|
-
tsconfigRootDir: string;
|
|
15766
|
-
project: string | string[];
|
|
15767
|
-
} | {
|
|
15768
|
-
tsconfigRootDir: string;
|
|
15769
15716
|
projectService: boolean;
|
|
15717
|
+
tsconfigRootDir: string;
|
|
15770
15718
|
};
|
|
15771
15719
|
};
|
|
15772
15720
|
name: string;
|
|
@@ -15840,4 +15788,4 @@ declare const eslintConfig: ({ astro, autoDetect, configs, ignores, jest, nextjs
|
|
|
15840
15788
|
settings?: Record<string, unknown>;
|
|
15841
15789
|
})[]>;
|
|
15842
15790
|
|
|
15843
|
-
export { type Options, type
|
|
15791
|
+
export { type Options, type Rules, type TypedConfigItem, eslintConfig as default };
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var Z=Object.defineProperty;var r=(e,t)=>Z(e,"name",{value:t,configurable:!0});import u from"globals";import{parser as D,configs as p}from"typescript-eslint";import P from"@eslint-community/eslint-plugin-eslint-comments/configs";import{createTypeScriptImportResolver as ee}from"eslint-import-resolver-typescript";import d from"eslint-plugin-import-x";import C from"eslint-plugin-n";import re from"@eslint/js";import O from"eslint-plugin-jsdoc";import E from"eslint-plugin-perfectionist";import te from"eslint-config-prettier";import{isPackageExists as i}from"local-pkg";import*as T from"eslint-plugin-regexp";import R from"eslint-plugin-unicorn";const a="?([cm])[jt]s?(x)",oe=["**/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"],_="**/*.?([cm])js",f="**/*.?([cm])jsx",se="**/*.?([cm])ts",g="**/*.?([cm])tsx",m=[`**/__tests__/**/*.${a}`,`**/*.spec.${a}`,`**/*.test.${a}`,`**/*.bench.${a}`,`**/*.benchmark.${a}`],q=[`**/e2e/**/*.spec.${a}`,`**/e2e/**/*.test.${a}`],y=[...q,`**/cypress/**/*.spec.${a}`,`**/cypress/**/*.test.${a}`],ne=[_,f,se,g],ie="**/*.cjs",ae="**/*.astro",ce=["@testing-library/react"],s=r(async e=>{const t=await e;return t.default??t},"interopDefault"),le=r(async()=>{const e=[ae],[t,o,n]=await Promise.all([import("eslint-plugin-astro"),import("astro-eslint-parser"),s(import("eslint-plugin-jsx-a11y"))]);return[{files:e,languageOptions:{globals:{...u.node,Astro:!1,Fragment:!1},parser:o,parserOptions:{extraFileExtensions:[".astro"],parser:D},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:p.disableTypeChecked.languageOptions?.parserOptions},name:"jimmy.codes/astro/disable-type-checked",rules:p.disableTypeChecked.rules},{name:"jimmy.codes/astro/imports",settings:{"import-x/core-modules":["astro:content"]}}]},"astroConfig"),pe=r(()=>[{files:[ie],languageOptions:{globals:u.commonjs},name:"jimmy.codes/commonjs"}],"commonjsConfig"),fe={...P.recommended.rules,"@eslint-community/eslint-comments/no-unused-disable":"off","@eslint-community/eslint-comments/require-description":"error"},me=r(()=>[{...P.recommended,name:"jimmy.codes/eslint-comments",rules:fe}],"eslintCommentsConfig"),ue=r(e=>[{ignores:[...oe,...e],name:"jimmy.codes/ignores"}],"ignoresConfig"),de={...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"},ge=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":[ee({alwaysTryTypes:!0})]}}]},"importsTypescriptConfig"),ye=r(({typescript:e=!1}={})=>[{name:"jimmy.codes/imports",plugins:{"import-x":d,n:C},rules:de},...e?ge():[]],"importsConfig"),je={...re.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"},he=r(()=>[{linterOptions:{reportUnusedDisableDirectives:!0},name:"jimmy.codes/javascript",rules:je}],"javascriptConfig"),xe=r(()=>({...O.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(()=>[{...O.configs["flat/recommended-typescript-error"],name:"jimmy.codes/jsdoc",rules:xe()}],"jsdocConfig"),L=r((e={})=>Object.fromEntries(Object.entries(e).map(([t,o])=>[t,o==="warn"?"error":o])),"warningAsErrors"),be=r(async()=>{const e=await s(import("@next/eslint-plugin-next"));return L(e.configs.recommended.rules)},"nextjsRules"),we=r(async()=>{const e=await s(import("@next/eslint-plugin-next"));return[{files:ne,name:"jimmy.codes/nextjs",plugins:{"@next/next":e},rules:await be()}]},"nextjsConfig"),ke={"n/no-process-exit":"off","n/prefer-node-protocol":"error"},Pe=r(()=>[{name:"jimmy.codes/node",plugins:{n:C},rules:ke}],"nodeConfig"),Ce={...E.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:E},rules:Ce}],"perfectionistConfig"),Ee=r(async()=>({...(await s(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 s(import("eslint-plugin-playwright"))).configs["flat/recommended"],files:q,name:"jimmy.codes/playwright",rules:await Ee()}],"playwrightConfig"),Re=r(()=>[{name:"jimmy.codes/prettier",...te}],"prettierConfig"),_e=r(()=>i("typescript"),"hasTypescript"),qe=r(()=>i("react"),"hasReact"),S=r(()=>i("vitest"),"hasVitest"),G=r(()=>i("jest"),"hasJest"),Le=r(()=>S()||G(),"hasTesting"),Se=r(()=>ce.some(e=>i(e)),"hasTestingLibrary"),Ge=r(()=>i("@tanstack/react-query"),"hasReactQuery"),Ae=r(()=>i("astro"),"hasAstro"),Be=r(()=>i("@playwright/test"),"hasPlaywright"),Ie=r(()=>i("storybook"),"hasStorybook"),A=r(()=>i("next"),"hasNext"),Ne=r(()=>i("vite"),"hasVite"),$e=r(e=>e===2?"error":e===1?"warn":"off","toStringSeverity"),B=r((e={})=>Object.fromEntries(Object.entries(e).map(([t,o])=>[t,typeof o=="number"?$e(o):o])),"normalizeRuleEntries"),Je=["dynamic","dynamicParams","revalidate","fetchCache","runtime","preferredRegion","maxDuration","config","generateStaticParams","metadata","generateMetadata","viewport","generateViewport"],Ve=r(async()=>{const[e,t]=await Promise.all([s(import("eslint-plugin-react")),s(import("eslint-plugin-jsx-a11y"))]),o=A(),n=Ne();return{...t.configs.recommended.rules,...B(e.configs.flat.recommended?.rules),...B(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:o?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"),Fe=r(async()=>{const[e,t,o,n,c]=await Promise.all([s(import("eslint-plugin-react")),s(import("eslint-plugin-jsx-a11y")),import("eslint-plugin-react-hooks"),s(import("eslint-plugin-react-refresh")),s(import("eslint-plugin-react-compiler"))]);return[{files:[f,g],languageOptions:{globals:{...u.browser},parserOptions:{ecmaFeatures:{jsx:!0},jsxPragma:null}},name:"jimmy.codes/react",plugins:{"jsx-a11y":t,react:e,"react-compiler":c,"react-hooks":o,"react-refresh":n},rules:await Ve(),settings:{react:{version:"detect"}}}]},"reactConfig"),Xe={...T.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"},Qe=r(()=>[{name:"jimmy.codes/regexp",plugins:{regexp:T},rules:Xe}],"regexpConfig"),Ue=r(async()=>{const{configs:e}=await s(import("eslint-plugin-storybook")),[t,o,n]=e["flat/recommended"];return[{name:"jimmy.codes/storybook/setup",plugins:t?.plugins},{files:o?.files,name:"jimmy.codes/storybook/stories-rules",rules:{...L(o?.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"),ze=r(async()=>{const e=await s(import("@tanstack/eslint-plugin-query"));return[{files:[f,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"),He=r(async()=>{const e=await s(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"),Me=r(async()=>({...(await s(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"),Ye=r(async({framework:e="vitest"}={},t=!0)=>{const o=t?S():e==="vitest",n=e==="jest"||t&&G(),c=[];if(o){const l=await s(import("@vitest/eslint-plugin"));c.push({files:m,ignores:y,...l.configs.recommended,name:"jimmy.codes/vitest",rules:await Me()})}if(n){const l=await s(import("eslint-plugin-jest"));c.push({files:m,ignores:y,...l.configs["flat/recommended"],name:"jimmy.codes/jest",rules:await He()})}return c},"testingConfig"),We=r(async()=>{const[e,t]=await Promise.all([import("eslint-plugin-jest-dom"),s(import("eslint-plugin-testing-library"))]);return{...t.configs["flat/react"].rules,...e.configs["flat/recommended"].rules}},"testingLibraryRules"),Ke=r(async()=>{const[e,t]=await Promise.all([import("eslint-plugin-jest-dom"),s(import("eslint-plugin-testing-library"))]);return[{files:m,ignores:y,name:"jimmy.codes/testing-library",plugins:{"jest-dom":e,"testing-library":t},rules:await We()}]},"testingLibraryConfig"),Ze={"@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"},De=r(e=>[...p.strictTypeChecked,...p.stylisticTypeChecked.filter(t=>t.name==="typescript-eslint/stylistic-type-checked"),{languageOptions:{parserOptions:{...e?.project?{project:e.project}:{projectService:!0},tsconfigRootDir:process.cwd()}},name:"jimmy.codes/typescript",rules:Ze},{files:[_,f],...p.disableTypeChecked},{files:m,name:"jimmy.codes/typescript/testing",rules:{"@typescript-eslint/no-unsafe-argument":"off","@typescript-eslint/no-unsafe-assignment":"off"}}],"typescriptConfig"),er={...R.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(()=>[{...R.configs["flat/recommended"],name:"jimmy.codes/unicorn",rules:er}],"unicornConfig"),tr=r(e=>typeof e=="object"?e:void 0,"getTypescriptOptions"),or=r((e,t)=>typeof e=="object"?e:{framework:t.vitest?"vitest":t.jest?"jest":"vitest",...t.testingLibrary&&{utilities:["testing-library"]}},"getTestingOptions"),sr=r(e=>typeof e=="object"?e:{utilities:[]},"getReactOptions"),nr=r(({utilities:e=[]},t,o)=>t||e.includes("@tanstack/query")||o&&Ge(),"shouldEnableTanstackQuery"),ir=r(({utilities:e=[]},t)=>e.includes("testing-library")||t&&Se(),"shouldEnableTestingLibrary"),ar=r(async({astro:e=!1,autoDetect:t=!0,configs:o=[],ignores:n=[],jest:c=!1,nextjs:l=!1,overrides:I=[],playwright:N=!1,react:j=!1,storybook:$=!1,tanstackQuery:J=!1,testing:h=!1,testingLibrary:V=!1,typescript:x=!1,vitest:v=!1}={},...F)=>{const X=sr(j),b=or(h,{jest:c,testingLibrary:V,vitest:v}),w=tr(x),k=x||!!w||t&&_e(),Q=j||t&&qe(),U=h||c||v||t&&Le(),z=e||t&&Ae(),H=nr(X,J,t),M=ir(b,t),Y=N||t&&Be(),W=$||t&&Ie(),K=l||t&&A();return[he(),Oe(),Pe(),rr(),me(),Qe(),ve(),ye({typescript:k}),k?De(w):[],Q?await Fe():[],H?await ze():[],z?await le():[],U?await Ye(b,t):[],M?await Ke():[],Y?await Te():[],W?await Ue():[],K?await we():[],Re(),pe(),ue(n),o,I,F].flat()},"eslintConfig");export{ar 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 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};
|