@2digits/eslint-config 4.12.8 → 4.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +37 -16
- package/dist/index.mjs +1 -1
- package/package.json +13 -12
package/dist/index.d.mts
CHANGED
|
@@ -3353,6 +3353,7 @@ interface RuleOptions {
|
|
|
3353
3353
|
/**
|
|
3354
3354
|
* Disallow certain props on components.
|
|
3355
3355
|
* @see https://eslint-react.xyz/docs/rules/no-forbidden-props
|
|
3356
|
+
* @deprecated
|
|
3356
3357
|
*/
|
|
3357
3358
|
'react-extra/no-forbidden-props'?: Linter.RuleEntry<ReactExtraNoForbiddenProps>;
|
|
3358
3359
|
/**
|
|
@@ -3474,7 +3475,7 @@ interface RuleOptions {
|
|
|
3474
3475
|
* Prevents using referential-type values as default props in object destructuring.
|
|
3475
3476
|
* @see https://eslint-react.xyz/docs/rules/no-unstable-default-props
|
|
3476
3477
|
*/
|
|
3477
|
-
'react-extra/no-unstable-default-props'?: Linter.RuleEntry<
|
|
3478
|
+
'react-extra/no-unstable-default-props'?: Linter.RuleEntry<ReactExtraNoUnstableDefaultProps>;
|
|
3478
3479
|
/**
|
|
3479
3480
|
* Warns unused class component methods and properties.
|
|
3480
3481
|
* @see https://eslint-react.xyz/docs/rules/no-unused-class-component-members
|
|
@@ -7790,69 +7791,79 @@ interface RuleOptions {
|
|
|
7790
7791
|
'yoda'?: Linter.RuleEntry<Yoda>;
|
|
7791
7792
|
/**
|
|
7792
7793
|
* Enforce consistent Zod array style
|
|
7793
|
-
* @see https://github.com/marcalexiei/eslint-plugin-zod-x
|
|
7794
|
+
* @see https://github.com/marcalexiei/eslint-plugin-zod-x/blob/HEAD/docs/rules/array-style.md
|
|
7794
7795
|
*/
|
|
7795
7796
|
'zod/array-style'?: Linter.RuleEntry<ZodArrayStyle>;
|
|
7796
7797
|
/**
|
|
7797
7798
|
* Enforce consistent source from Zod imports
|
|
7798
|
-
* @see https://github.com/marcalexiei/eslint-plugin-zod-x
|
|
7799
|
+
* @see https://github.com/marcalexiei/eslint-plugin-zod-x/blob/HEAD/docs/rules/consistent-import-source.md
|
|
7799
7800
|
*/
|
|
7800
7801
|
'zod/consistent-import-source'?: Linter.RuleEntry<ZodConsistentImportSource>;
|
|
7801
7802
|
/**
|
|
7802
7803
|
* Disallow usage of `z.any()` in Zod schemas
|
|
7803
|
-
* @see https://github.com/marcalexiei/eslint-plugin-zod-x
|
|
7804
|
+
* @see https://github.com/marcalexiei/eslint-plugin-zod-x/blob/HEAD/docs/rules/no-any.md
|
|
7804
7805
|
*/
|
|
7805
7806
|
'zod/no-any'?: Linter.RuleEntry<[]>;
|
|
7806
7807
|
/**
|
|
7807
7808
|
* Disallow usage of `z.custom()` without arguments
|
|
7808
|
-
* @see https://github.com/marcalexiei/eslint-plugin-zod-x
|
|
7809
|
+
* @see https://github.com/marcalexiei/eslint-plugin-zod-x/blob/HEAD/docs/rules/no-empty-custom-schema.md
|
|
7809
7810
|
*/
|
|
7810
7811
|
'zod/no-empty-custom-schema'?: Linter.RuleEntry<[]>;
|
|
7811
7812
|
/**
|
|
7812
7813
|
* Disallow usage of `z.number().int()` as it is considered legacy
|
|
7813
|
-
* @see https://github.com/marcalexiei/eslint-plugin-zod-x
|
|
7814
|
+
* @see https://github.com/marcalexiei/eslint-plugin-zod-x/blob/HEAD/docs/rules/no-number-schema-with-int.md
|
|
7814
7815
|
*/
|
|
7815
7816
|
'zod/no-number-schema-with-int'?: Linter.RuleEntry<[]>;
|
|
7816
7817
|
/**
|
|
7817
7818
|
* Disallow using both `.optional()` and `.default()` on the same Zod schema
|
|
7818
|
-
* @see https://github.com/marcalexiei/eslint-plugin-zod-x
|
|
7819
|
+
* @see https://github.com/marcalexiei/eslint-plugin-zod-x/blob/HEAD/docs/rules/no-optional-and-default-together.md
|
|
7819
7820
|
*/
|
|
7820
7821
|
'zod/no-optional-and-default-together'?: Linter.RuleEntry<ZodNoOptionalAndDefaultTogether>;
|
|
7821
7822
|
/**
|
|
7822
7823
|
* Disallow throwing errors directly inside Zod refine callbacks
|
|
7823
|
-
* @see https://github.com/marcalexiei/eslint-plugin-zod-x
|
|
7824
|
+
* @see https://github.com/marcalexiei/eslint-plugin-zod-x/blob/HEAD/docs/rules/no-throw-in-refine.md
|
|
7824
7825
|
*/
|
|
7825
7826
|
'zod/no-throw-in-refine'?: Linter.RuleEntry<[]>;
|
|
7826
7827
|
/**
|
|
7827
7828
|
* Enforce usage of `.meta()` over `.describe()`
|
|
7828
|
-
* @see https://github.com/marcalexiei/eslint-plugin-zod-x
|
|
7829
|
+
* @see https://github.com/marcalexiei/eslint-plugin-zod-x/blob/HEAD/docs/rules/prefer-meta.md
|
|
7829
7830
|
*/
|
|
7830
7831
|
'zod/prefer-meta'?: Linter.RuleEntry<[]>;
|
|
7831
7832
|
/**
|
|
7832
7833
|
* Enforce `.meta()` as last method
|
|
7833
|
-
* @see https://github.com/marcalexiei/eslint-plugin-zod-x
|
|
7834
|
+
* @see https://github.com/marcalexiei/eslint-plugin-zod-x/blob/HEAD/docs/rules/prefer-meta-last.md
|
|
7834
7835
|
*/
|
|
7835
7836
|
'zod/prefer-meta-last'?: Linter.RuleEntry<[]>;
|
|
7836
7837
|
/**
|
|
7837
7838
|
* Enforce importing zod as a namespace import (`import * as z from 'zod'`)
|
|
7838
|
-
* @see https://github.com/marcalexiei/eslint-plugin-zod-x
|
|
7839
|
+
* @see https://github.com/marcalexiei/eslint-plugin-zod-x/blob/HEAD/docs/rules/prefer-namespace-import.md
|
|
7839
7840
|
*/
|
|
7840
7841
|
'zod/prefer-namespace-import'?: Linter.RuleEntry<[]>;
|
|
7841
7842
|
/**
|
|
7842
7843
|
* Enforce usage of `.strictObject()` over `.object()` and/or `.looseObject()`
|
|
7843
|
-
* @see https://github.com/marcalexiei/eslint-plugin-zod-x
|
|
7844
|
+
* @see https://github.com/marcalexiei/eslint-plugin-zod-x/blob/HEAD/docs/rules/prefer-strict-object.md
|
|
7844
7845
|
*/
|
|
7845
7846
|
'zod/prefer-strict-object'?: Linter.RuleEntry<ZodPreferStrictObject>;
|
|
7847
|
+
/**
|
|
7848
|
+
* Require type parameter on `.brand()` functions
|
|
7849
|
+
* @see https://github.com/marcalexiei/eslint-plugin-zod-x/blob/HEAD/docs/rules/require-brand-type-parameter.md
|
|
7850
|
+
*/
|
|
7851
|
+
'zod/require-brand-type-parameter'?: Linter.RuleEntry<[]>;
|
|
7846
7852
|
/**
|
|
7847
7853
|
* Enforce that custom refinements include an error message
|
|
7848
|
-
* @see https://github.com/marcalexiei/eslint-plugin-zod-x
|
|
7854
|
+
* @see https://github.com/marcalexiei/eslint-plugin-zod-x/blob/HEAD/docs/rules/require-error-message.md
|
|
7849
7855
|
*/
|
|
7850
7856
|
'zod/require-error-message'?: Linter.RuleEntry<[]>;
|
|
7851
7857
|
/**
|
|
7852
7858
|
* Require schema suffix when declaring a Zod schema
|
|
7853
|
-
* @see https://github.com/marcalexiei/eslint-plugin-zod-x
|
|
7859
|
+
* @see https://github.com/marcalexiei/eslint-plugin-zod-x/blob/HEAD/docs/rules/require-schema-suffix.md
|
|
7854
7860
|
*/
|
|
7855
7861
|
'zod/require-schema-suffix'?: Linter.RuleEntry<ZodRequireSchemaSuffix>;
|
|
7862
|
+
/**
|
|
7863
|
+
* Enforce consistent style for error messages in Zod schema validation (using ESQuery patterns)
|
|
7864
|
+
* @see https://github.com/marcalexiei/eslint-plugin-zod-x/blob/HEAD/docs/rules/schema-error-property-style.md
|
|
7865
|
+
*/
|
|
7866
|
+
'zod/schema-error-property-style'?: Linter.RuleEntry<ZodSchemaErrorPropertyStyle>;
|
|
7856
7867
|
}
|
|
7857
7868
|
/* ======= Declarations ======= */
|
|
7858
7869
|
// ----- accessor-pairs -----
|
|
@@ -9202,6 +9213,9 @@ type JsdocSortTags = [] | [{
|
|
|
9202
9213
|
linesBetween?: number;
|
|
9203
9214
|
reportIntraTagGroupSpacing?: boolean;
|
|
9204
9215
|
reportTagGroupSpacing?: boolean;
|
|
9216
|
+
tagExceptions?: {
|
|
9217
|
+
[k: string]: number;
|
|
9218
|
+
};
|
|
9205
9219
|
tagSequence?: {
|
|
9206
9220
|
tags?: string[];
|
|
9207
9221
|
}[];
|
|
@@ -10989,6 +11003,10 @@ type ReactExtraNoForbiddenProps = [] | [{
|
|
|
10989
11003
|
prop: string;
|
|
10990
11004
|
})[];
|
|
10991
11005
|
}];
|
|
11006
|
+
// ----- react-extra/no-unstable-default-props -----
|
|
11007
|
+
type ReactExtraNoUnstableDefaultProps = [] | [{
|
|
11008
|
+
safeDefaultProps?: string[];
|
|
11009
|
+
}];
|
|
10992
11010
|
// ----- react-extra/no-useless-fragment -----
|
|
10993
11011
|
type ReactExtraNoUselessFragment = [] | [{
|
|
10994
11012
|
allowExpressions?: boolean;
|
|
@@ -14203,7 +14221,6 @@ type Yoda = [] | [("always" | "never")] | [("always" | "never"), {
|
|
|
14203
14221
|
// ----- zod/array-style -----
|
|
14204
14222
|
type ZodArrayStyle = [] | [{
|
|
14205
14223
|
style?: ("function" | "method");
|
|
14206
|
-
[k: string]: unknown | undefined;
|
|
14207
14224
|
}];
|
|
14208
14225
|
// ----- zod/consistent-import-source -----
|
|
14209
14226
|
type ZodConsistentImportSource = [] | [{
|
|
@@ -14216,12 +14233,16 @@ type ZodNoOptionalAndDefaultTogether = [] | [{
|
|
|
14216
14233
|
// ----- zod/prefer-strict-object -----
|
|
14217
14234
|
type ZodPreferStrictObject = [] | [{
|
|
14218
14235
|
allow?: ("object" | "looseObject")[];
|
|
14219
|
-
[k: string]: unknown | undefined;
|
|
14220
14236
|
}];
|
|
14221
14237
|
// ----- zod/require-schema-suffix -----
|
|
14222
14238
|
type ZodRequireSchemaSuffix = [] | [{
|
|
14223
14239
|
suffix?: string;
|
|
14224
14240
|
}];
|
|
14241
|
+
// ----- zod/schema-error-property-style -----
|
|
14242
|
+
type ZodSchemaErrorPropertyStyle = [] | [{
|
|
14243
|
+
selector?: string;
|
|
14244
|
+
example?: string;
|
|
14245
|
+
}];
|
|
14225
14246
|
// Names of all the configs
|
|
14226
14247
|
type ConfigNames = '2digits:antfu' | '2digits:boolean' | '2digits:comments' | '2digits:css' | '2digits:depend' | '2digits:drizzle' | '2digits:github-actions/setup' | '2digits:github-actions/recommended' | '2digits:graphql' | '2digits:ignores' | '2digits:gitignore' | '2digits:javascript' | '2digits:jsdoc' | '2digits:jsonc/base' | '2digits:jsonc/base' | '2digits:jsonc/json' | '2digits:jsonc/jsonc' | '2digits:jsonc/json5' | '2digits:jsonc/package.json' | '2digits:jsonc/tsconfig.json' | '2digits:jsonc/prettier' | '2digits:jsonc/prettier' | '2digits:jsonc/prettier' | '2digits:markdown/setup' | '2digits:markdown/processor' | '2digits:markdown/parser' | '2digits:markdown/rules' | '2digits:markdown/disables' | '2digits:next/setup' | '2digits:next/rules' | '2digits:node' | '2digits:pnpm/package-json' | '2digits:pnpm/pnpm-workspace-yaml' | '2digits:prettier' | '2digits:react/setup' | '2digits:react/rules' | '2digits:regexp' | '2digits:sonar' | '2digits:storybook/setup' | '2digits:storybook/rules' | '2digits:storybook/disables' | '2digits:storybook/config' | '2digits:tailwind' | '2digits:tanstack-query' | '2digits:tanstack-router' | '2digits:turbo' | '2digits:typescript/setup' | '2digits:typescript/rules' | '2digits:typescript/disables/dts' | '2digits:typescript/disables/test' | '2digits:typescript/disables/cjs' | '2digits:unicorn' | '2digits:yaml/setup' | '2digits:yaml/base' | '2digits:yaml/recommended' | '2digits:yaml/standard' | '2digits:yaml/prettier' | '2digits:zod';
|
|
14227
14248
|
//#endregion
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{FlatConfigComposer as e,renamePluginsInConfigs as t,renamePluginsInRules as n}from"eslint-flat-config-utils";import{getPackageInfo as r,isPackageExists as i}from"local-pkg";import{findWorkspaceDir as a}from"pkg-types";import o from"eslint-plugin-antfu";import s from"eslint-plugin-de-morgan";import c from"@eslint-community/eslint-plugin-eslint-comments";import l from"@eslint-community/eslint-plugin-eslint-comments/configs";import u from"@eslint/css";import{tailwind3 as d,tailwind4 as f}from"tailwind-csstree";import p from"eslint-plugin-depend";import{fixupPluginRules as m}from"@eslint/compat";import h from"eslint-plugin-github-action";import g from"yaml-eslint-parser";import _ from"eslint-config-flat-gitignore";import ee from"@eslint/js";import te from"@stylistic/eslint-plugin";import v from"globals";import ne from"eslint-plugin-jsdoc";import re,{configs as y}from"eslint-plugin-jsonc";import ie from"jsonc-eslint-parser";import b from"@eslint/markdown";import{mergeProcessors as ae,processorPassThrough as oe}from"eslint-merge-processors";import se from"eslint-plugin-n";import x from"eslint-plugin-regexp";import S from"eslint-plugin-sonarjs";import*as C from"empathic/find";import w from"eslint-plugin-unicorn";import ce from"eslint-plugin-yml";const T=`**/*.?([cm])[jt]s?(x)`,E=`**/*.?([cm])ts`,D=`**/*.?([cm])tsx`,O=`.github/workflows/*.y?(a)ml`,k=`**/*.md`,A=`${k}/${T}`,j=`**/node_modules,**/dist,**/package-lock.json,**/yarn.lock,**/pnpm-lock.yaml,**/bun.lockb,**/bun.lock,**/output,**/coverage,**/temp,**/.temp,**/tmp,**/.tmp,**/.history,**/.vitepress/cache,**/.nuxt,**/.next,**/.vercel,**/.changeset,**/.idea,**/.cache,**/.output,**/.vite-inspect,**/.yarn,**/CHANGELOG*.md,**/*.min.*,**/LICENSE*,**/__snapshots__,**/auto-import?(s).d.ts,**/components.d.ts`.split(`,`);function M(){return[{files:[T],name:`2digits:antfu`,plugins:{antfu:o},rules:{"antfu/if-newline":`error`,"antfu/top-level-function":`error`}}]}function N(){return[{files:[T],name:`2digits:boolean`,plugins:{boolean:s},rules:{...s.configs.recommended.rules}}]}const P={"@next/next":`next`,"@eslint-react/naming-convention":`react-naming-convention`,"@eslint-react/hooks-extra":`react-hooks-extra`,"@eslint-react/dom":`react-dom`,"@eslint-react/web-api":`react-web-api`,"@eslint-react":`react-extra`,"react-hooks":`react-hooks`,"react-compiler":`react-compiler`,"@stylistic/eslint-plugin":`stylistic`,"@typescript-eslint":`ts`,node:`node`,"@eslint-community/eslint-comments":`comments`,storybook:`storybook`,turbo:`turbo`,jsdoc:`jsdoc`,unicorn:`unicorn`,tailwindcss:`tailwindcss`,"@tanstack/query":`tanstack-query`,"@tanstack/router":`tanstack-router`,"@2digits":`@2digits`,"@graphql-eslint":`gql`,sonarjs:`sonar`,drizzle:`drizzle`,"de-morgan":`boolean`,antfu:`antfu`,css:`css`,depend:`depend`,"github-action":`github-action`,jsonc:`jsonc`,markdown:`markdown`,pnpm:`pnpm`,regexp:`regexp`,yml:`yml`,"zod-x":`zod`},F=[`storybook`,`@storybook/nextjs`,`@storybook/nextjs-vite`,`@storybook/react-vite`,`@storybook/react-webpack5`,`@storybook/react-native-web-vite`],I=n(l.recommended.rules,P);function L(){return[{files:[T],name:`2digits:comments`,plugins:{comments:c},rules:{...I,"comments/no-unused-disable":`error`,"comments/disable-enable-pair":[`error`,{allowWholeFile:!0}]}}]}async function R(e){if(e?.customSyntax)return e.customSyntax;if(e?.tailwindMajor===3)return d;if(e?.tailwindMajor===4)return f;try{let e=(await r(`tailwindcss`))?.version??``,t=Number.parseInt(e.split(`.`)[0]||`0`,10);if(Number.isFinite(t)&&t>=4)return f}catch{}return d}async function z(e={}){let t=await R(e);return[{name:`2digits:css`,files:[`**/*.css`],language:`css/css`,plugins:{css:u},languageOptions:{tolerant:!0,customSyntax:t},rules:{...u.configs.recommended.rules,...e.overrides}}]}function B(){return[{files:[T],name:`2digits:depend`,plugins:{depend:p},rules:{"depend/ban-dependencies":`warn`}}]}async function V(e){let t=await e;return t.default||t}async function H(e={}){let{overrides:t={},drizzleObjectName:n=[`drizzle`,`db`]}=e,r=await V(import(`eslint-plugin-drizzle`));return[{files:[T],name:`2digits:drizzle`,plugins:{drizzle:m(r)},rules:{"drizzle/enforce-update-with-where":[`error`,{drizzleObjectName:n}],"drizzle/enforce-delete-with-where":[`error`,{drizzleObjectName:n}],...t}}]}const U=Object.fromEntries(h.configs.recommended.flatMap(({rules:e})=>Object.entries({...e})));function W(){return[{name:`2digits:github-actions/setup`,plugins:{"github-action":h}},{name:`2digits:github-actions/recommended`,files:[O],ignores:[`!**/${O}`],languageOptions:{parser:g},rules:{...U}}]}async function G(e={}){let{overrides:t={},files:r=[`**/*.graphql`,`**/*.gql`]}=e,[i,a]=await Promise.all([V(import(`@graphql-eslint/eslint-plugin`)),import(`graphql-config`).then(({loadConfig:e})=>e({throwOnEmpty:!1,throwOnMissing:!1}).then(e=>e?.getDefault().schema))]),o=i.configs[`flat/operations-recommended`].rules,s={};if(a)s=o;else for(let e of Object.keys(o)){let t=e.replace(`@graphql-eslint/`,``);t in i.rules&&(i.rules[t].meta.docs?.requiresSchema||i.rules[t].meta.docs?.requiresSiblings)||(s[e]=o[e])}let c=n(s,P);return[{name:`2digits:graphql`,plugins:{gql:i},languageOptions:{parser:i.parser},files:r,rules:{...c,"gql/naming-convention":[`error`,{allowLeadingUnderscore:!0}],...t}}]}function le(e={}){let{gitIgnore:t,ignores:n=[]}=e;return[{ignores:[j,n].flat(),name:`2digits:ignores`},_({strict:!1,...t,name:`2digits:gitignore`})]}function ue(e={}){let{overrides:t={}}=e;return[{files:[T],name:`2digits:javascript`,plugins:{stylistic:te},languageOptions:{ecmaVersion:2022,globals:{...v.browser,...v.es2021,...v.node,document:`readonly`,navigator:`readonly`,window:`readonly`},parserOptions:{ecmaFeatures:{jsx:!0},ecmaVersion:2022,sourceType:`module`},sourceType:`module`},linterOptions:{reportUnusedDisableDirectives:!0},rules:{...ee.configs.recommended.rules,"accessor-pairs":[`error`,{enforceForClassMembers:!0,setWithoutGet:!0}],"array-callback-return":`error`,"block-scoped-var":`error`,"constructor-super":`error`,"default-case-last":`error`,"dot-notation":[`error`,{allowKeywords:!0}],eqeqeq:[`error`,`smart`],"new-cap":[`error`,{capIsNew:!1,newIsCap:!0,properties:!0}],"no-alert":`error`,"no-array-constructor":`error`,"no-async-promise-executor":`error`,"no-caller":`error`,"no-case-declarations":`error`,"no-class-assign":`error`,"no-compare-neg-zero":`error`,"no-cond-assign":[`error`,`always`],"no-const-assign":`error`,"no-control-regex":`error`,"no-debugger":`error`,"no-delete-var":`error`,"no-dupe-args":`error`,"no-dupe-class-members":`error`,"no-dupe-keys":`error`,"no-duplicate-case":`error`,"no-empty":[`error`,{allowEmptyCatch:!0}],"no-empty-character-class":`error`,"no-empty-pattern":`error`,"no-eval":`error`,"no-ex-assign":`error`,"no-extend-native":`error`,"no-extra-bind":`error`,"no-extra-boolean-cast":`error`,"no-fallthrough":`error`,"no-func-assign":`error`,"no-global-assign":`error`,"no-implied-eval":`error`,"no-import-assign":`error`,"no-invalid-regexp":`error`,"no-irregular-whitespace":`error`,"no-iterator":`error`,"no-labels":[`error`,{allowLoop:!1,allowSwitch:!1}],"no-lone-blocks":`error`,"no-loss-of-precision":`error`,"no-misleading-character-class":`error`,"no-multi-str":`error`,"no-new":`error`,"no-new-func":`error`,"no-new-native-nonconstructor":`error`,"no-new-wrappers":`error`,"no-obj-calls":`error`,"no-octal":`error`,"no-octal-escape":`error`,"no-proto":`error`,"no-prototype-builtins":`error`,"no-redeclare":[`error`,{builtinGlobals:!1}],"no-regex-spaces":`error`,"no-restricted-globals":[`error`,{message:"Use `globalThis` instead.",name:`global`},{message:"Use `globalThis` instead.",name:`self`}],"no-restricted-properties":[`error`,{message:"Use `Object.getPrototypeOf` or `Object.setPrototypeOf` instead.",property:`__proto__`},{message:"Use `Object.defineProperty` instead.",property:`__defineGetter__`},{message:"Use `Object.defineProperty` instead.",property:`__defineSetter__`},{message:"Use `Object.getOwnPropertyDescriptor` instead.",property:`__lookupGetter__`},{message:"Use `Object.getOwnPropertyDescriptor` instead.",property:`__lookupSetter__`}],"no-restricted-syntax":[`error`,`DebuggerStatement`,`LabeledStatement`,`WithStatement`,`TSEnumDeclaration`,`TSExportAssignment`],"no-self-assign":[`error`,{props:!0}],"no-self-compare":`error`,"no-sequences":`error`,"no-shadow-restricted-names":`error`,"no-sparse-arrays":`error`,"no-template-curly-in-string":`error`,"no-this-before-super":`error`,"no-throw-literal":`error`,"no-undef":`error`,"no-undef-init":`error`,"no-unexpected-multiline":`error`,"no-unmodified-loop-condition":`error`,"no-unneeded-ternary":[`error`,{defaultAssignment:!1}],"no-unreachable":`error`,"no-unreachable-loop":`error`,"no-unsafe-finally":`error`,"no-unsafe-negation":`error`,"no-unused-expressions":[`error`,{allowShortCircuit:!0,allowTaggedTemplates:!0,allowTernary:!0}],"no-unused-vars":[`error`,{args:`none`,caughtErrors:`none`,ignoreRestSiblings:!0,vars:`all`}],"no-useless-backreference":`error`,"no-useless-call":`error`,"no-useless-catch":`error`,"no-useless-computed-key":`error`,"no-useless-constructor":`error`,"no-useless-rename":`error`,"no-var":`error`,"no-with":`error`,"object-shorthand":[`error`,`always`,{avoidQuotes:!0,ignoreConstructors:!1}],"one-var":[`error`,{initialized:`never`}],"prefer-arrow-callback":[`error`,{allowNamedFunctions:!0,allowUnboundThis:!0}],"prefer-const":[`error`,{destructuring:`all`,ignoreReadBeforeAssign:!0}],"prefer-exponentiation-operator":`error`,"prefer-promise-reject-errors":`error`,"prefer-regex-literals":[`error`,{disallowRedundantWrapping:!0}],"prefer-rest-params":`error`,"prefer-spread":`error`,"prefer-template":`error`,"symbol-description":`error`,"unicode-bom":[`error`,`never`],"use-isnan":[`error`,{enforceForIndexOf:!0,enforceForSwitchCase:!0}],"valid-typeof":[`error`,{requireStringLiterals:!0}],"vars-on-top":`error`,yoda:[`error`,`never`],"stylistic/padding-line-between-statements":[`error`,{blankLine:`always`,prev:[`const`,`let`],next:`*`},{blankLine:`any`,prev:[`const`,`let`],next:[`const`,`let`]},{blankLine:`always`,prev:`*`,next:`return`}],...t}}]}function de(){return[{files:[T],name:`2digits:jsdoc`,plugins:{jsdoc:ne},rules:{"jsdoc/check-access":`error`,"jsdoc/check-param-names":`error`,"jsdoc/check-property-names":`error`,"jsdoc/check-types":`error`,"jsdoc/empty-tags":`error`,"jsdoc/implements-on-classes":`error`,"jsdoc/no-defaults":`error`,"jsdoc/no-multi-asterisks":`error`,"jsdoc/require-param-name":`error`,"jsdoc/require-property":`error`,"jsdoc/require-property-description":`error`,"jsdoc/require-property-name":`error`,"jsdoc/require-returns-check":`error`,"jsdoc/require-returns-description":`error`,"jsdoc/require-yields-check":`error`}}]}function fe(){return[...y[`flat/base`].map(e=>({...e,name:`2digits:jsonc/base`})),{name:`2digits:jsonc/json`,files:[`**/*.json`],...K,rules:{...q(y[`flat/recommended-with-json`])}},{name:`2digits:jsonc/jsonc`,files:[`**/*.jsonc`],...K,rules:{...q(y[`flat/recommended-with-jsonc`])}},{name:`2digits:jsonc/json5`,files:[`**/*.json5`],...K,rules:{...q(y[`flat/recommended-with-json5`])}},{name:`2digits:jsonc/package.json`,...K,files:[`**/package.json`],rules:{"jsonc/sort-array-values":[`error`,{order:{type:`asc`},pathPattern:`^files$`}],"jsonc/sort-keys":[`error`,{order:`$schema.publisher.name.displayName.version.private.description.funding.homepage.repository.bugs.categories.type.main.module.types.typesVersions.bin.files.exports.icon.unpkg.jsdelivr.sideEffects.activationEvents.contributes.scripts.keywords.author.license.workspaces.dependencies.devDependencies.peerDependencies.peerDependenciesMeta.optionalDependencies.packageManager.engines.pnpm.overrides.resolutions.husky.simple-git-hooks.lint-staged.eslintConfig.prettier`.split(`.`),pathPattern:`^$`},{order:{type:`asc`},pathPattern:`^(?:dev|peer|optional|bundled)?[Dd]ependencies(Meta)?$`},{order:[`types`,`import`,`module`,`require`,`default`],pathPattern:`^exports.*$`}]}},{name:`2digits:jsonc/tsconfig.json`,...K,files:[`**/tsconfig.json`,`**/tsconfig.*.json`,`**/tsconfig-*.json`,`**/jsconfig.json`,`**/jsconfig.*.json`,`**/jsconfig-*.json`],rules:{"jsonc/sort-keys":[`error`,{order:[`$schema`,`extends`,`compilerOptions`,`references`,`files`,`include`,`exclude`],pathPattern:`^$`},{order:`incremental.composite.tsBuildInfoFile.disableSourceOfProjectReferenceRedirect.disableSolutionSearching.disableReferencedProjectLoad.target.lib.jsx.experimentalDecorators.emitDecoratorMetadata.jsxFactory.jsxFragmentFactory.jsxImportSource.reactNamespace.noLib.useDefineForClassFields.moduleDetection.module.rootDir.moduleResolution.baseUrl.paths.rootDirs.typeRoots.types.allowUmdGlobalAccess.moduleSuffixes.allowImportingTsExtensions.resolvePackageJsonExports.resolvePackageJsonImports.customConditions.resolveJsonModule.allowArbitraryExtensions.noResolve.allowJs.checkJs.maxNodeModuleJsDepth.declaration.declarationMap.emitDeclarationOnly.sourceMap.inlineSourceMap.outFile.outDir.removeComments.noEmit.importHelpers.importsNotUsedAsValues.downlevelIteration.sourceRoot.mapRoot.inlineSources.emitBOM.newLine.stripInternal.noEmitHelpers.noEmitOnError.preserveConstEnums.declarationDir.preserveValueImports.isolatedModules.verbatimModuleSyntax.allowSyntheticDefaultImports.esModuleInterop.preserveSymlinks.forceConsistentCasingInFileNames.strict.strictBindCallApply.strictFunctionTypes.strictNullChecks.strictPropertyInitialization.allowUnreachableCode.allowUnusedLabels.alwaysStrict.exactOptionalPropertyTypes.noFallthroughCasesInSwitch.noImplicitAny.noImplicitOverride.noImplicitReturns.noImplicitThis.noPropertyAccessFromIndexSignature.noUncheckedIndexedAccess.noUnusedLocals.noUnusedParameters.useUnknownInCatchVariables.skipDefaultLibCheck.skipLibCheck`.split(`.`),pathPattern:`^compilerOptions$`}]}},...y[`flat/prettier`].map(e=>({...e,name:`2digits:jsonc/prettier`}))]}const K={languageOptions:{parser:ie},plugins:{jsonc:re}};function q(e){return Object.fromEntries(e.flatMap(({rules:e})=>Object.entries(e??{})))}const J=[k];function pe(){return[{name:`2digits:markdown/setup`,plugins:{markdown:b}},{name:`2digits:markdown/processor`,files:J,language:`markdown/gfm`,ignores:[`**/*.md/*.md`],processor:ae([b.processors.markdown,oe])},{name:`2digits:markdown/parser`,files:J,language:`markdown/gfm`,languageOptions:{parser:me}},{name:`2digits:markdown/rules`,files:J,language:`markdown/gfm`,rules:{"markdown/fenced-code-language":`error`,"markdown/heading-increment":`error`,"markdown/no-empty-links":`error`,"markdown/no-invalid-label-refs":`error`,"markdown/no-missing-label-refs":`error`}},{name:`2digits:markdown/disables`,files:[A],languageOptions:{parserOptions:{ecmaFeatures:{impliedStrict:!0}}},rules:{"no-alert":`off`,"no-console":`off`,"no-labels":`off`,"no-lone-blocks":`off`,"no-restricted-syntax":`off`,"no-undef":`off`,"no-unused-expressions":`off`,"no-unused-labels":`off`,"no-unused-vars":`off`,"node/prefer-global/process":`off`,"ts/consistent-type-imports":`off`,"ts/explicit-function-return-type":`off`,"ts/no-namespace":`off`,"ts/no-redeclare":`off`,"ts/no-require-imports":`off`,"ts/no-unused-expressions":`off`,"ts/no-unused-vars":`off`,"ts/no-use-before-define":`off`,"unicode-bom":`off`}}]}const me={meta:{name:`parser-plain`},parseForESLint:e=>({ast:{body:[],comments:[],loc:{end:e.length,start:0},range:[0,e.length],tokens:[],type:`Program`},scopeManager:null,services:{isPlain:!0},visitorKeys:{Program:[]}})};async function he(e={}){let{files:t=[E,D],overrides:r={},parserOptions:i}=e,[a,o]=await Promise.all([V(import(`@next/eslint-plugin-next`)),V(import(`@typescript-eslint/parser`))]),s=n({...a.configs.recommended.rules,...a.configs[`core-web-vitals`].rules},P);return[{name:`2digits:next/setup`,plugins:{next:m(a)}},{name:`2digits:next/rules`,files:t,languageOptions:{parser:o,parserOptions:{ecmaFeatures:{jsx:!0},projectService:!0,...i},sourceType:`module`},rules:{...s,"next/no-html-link-for-pages":`off`,...r}}]}function ge(){return[{files:[T],name:`2digits:node`,settings:{node:{version:`>= 22.0.0`}},plugins:{node:se},rules:{"node/handle-callback-err":[`error`,`^(err|error)$`],"node/no-deprecated-api":`error`,"node/no-exports-assign":`error`,"node/no-new-require":`error`,"node/no-path-concat":`error`,"node/no-unsupported-features/node-builtins":[`error`,{allowExperimental:!0}],"node/prefer-global/buffer":`error`,"node/prefer-global/process":`error`,"node/prefer-global/text-encoder":`error`,"node/prefer-global/url":`error`,"node/prefer-global/console":`error`,"node/prefer-global/url-search-params":`error`,"node/prefer-global/text-decoder":`error`,"node/process-exit-as-throw":`error`}}]}async function _e(){let e=await V(import(`eslint-plugin-pnpm`));return[{name:`2digits:pnpm/package-json`,files:[`package.json`,`**/package.json`],languageOptions:{parser:await V(import(`jsonc-eslint-parser`))},plugins:{pnpm:e},rules:{"pnpm/json-enforce-catalog":`error`,"pnpm/json-prefer-workspace-settings":`error`,"pnpm/json-valid-catalog":`error`}},{name:`2digits:pnpm/pnpm-workspace-yaml`,files:[`pnpm-workspace.yaml`],languageOptions:{parser:await V(import(`yaml-eslint-parser`))},plugins:{pnpm:e},rules:{"pnpm/yaml-no-duplicate-catalog-item":`error`,"pnpm/yaml-no-unused-catalog-item":`error`,"pnpm/yaml-valid-packages":`error`}}]}async function ve(){let[e,t]=await Promise.all([V(import(`eslint-config-prettier`)),V(import(`@stylistic/eslint-plugin`))]);return[{name:`2digits:prettier`,plugins:{stylistic:t},rules:{...e.rules,"tailwindcss/classnames-order":`off`,"stylistic/jsx-newline":[`error`,{prevent:!1}]}}]}async function ye(e={}){let{files:t=[E,D],overrides:r={},parserOptions:i,tsconfigRootDir:a,reactCompiler:o=!0}=e,[s,c,l,u,d]=await Promise.all([V(import(`@eslint-react/eslint-plugin`)),V(import(`eslint-plugin-react-hooks`)),V(import(`@typescript-eslint/parser`)),o?V(import(`eslint-plugin-react-compiler`)):Promise.resolve(void 0),V(import(`@stylistic/eslint-plugin`))]),f=s.configs.all.plugins,p=n({...s.configs[`disable-conflict-eslint-plugin-react`].rules,...s.configs[`recommended-type-checked`].rules},P);return[{name:`2digits:react/setup`,plugins:{stylistic:d,"react-dom":f[`@eslint-react/dom`],"react-web-api":f[`@eslint-react/web-api`],"react-extra":f[`@eslint-react`],"react-hooks":c,"react-hooks-extra":f[`@eslint-react/hooks-extra`],"react-naming-convention":f[`@eslint-react/naming-convention`],...o?{"react-compiler":u}:{}},settings:{react:{version:`detect`}}},{name:`2digits:react/rules`,files:t,languageOptions:{parser:l,parserOptions:{ecmaFeatures:{jsx:!0},tsconfigRootDir:a,projectService:!0,...i},sourceType:`module`},rules:{...p,...o?{"react-compiler/react-compiler":`error`}:{},"react-extra/no-unnecessary-use-callback":`error`,"react-extra/prefer-use-state-lazy-initialization":`error`,"react-extra/no-unnecessary-use-prefix":`error`,"react-extra/no-unnecessary-use-memo":`error`,"react-hooks-extra/no-direct-set-state-in-use-effect":`error`,"react-extra/no-useless-fragment":`off`,"react-extra/prefer-read-only-props":`off`,"react-extra/jsx-shorthand-boolean":`error`,"react-extra/jsx-shorthand-fragment":`error`,"react-extra/prefer-namespace-import":`error`,"react-naming-convention/use-state":`error`,"stylistic/jsx-curly-newline":`off`,"stylistic/jsx-newline":[`error`,{prevent:!1}],"stylistic/jsx-self-closing-comp":`error`,"react-hooks/rules-of-hooks":`error`,"react-hooks/exhaustive-deps":`warn`,...r}}]}function be(){return[{files:[T],name:`2digits:regexp`,plugins:{regexp:x},rules:{...x.configs[`flat/recommended`].rules}}]}function xe(){return[{files:[T],name:`2digits:sonar`,plugins:{sonar:S},rules:{"sonar/code-eval":`error`,"sonar/cognitive-complexity":`error`,"sonar/comma-or-logical-or-case":`error`,"sonar/concise-regex":`error`,"sonar/confidential-information-logging":`error`,"sonar/constructor-for-side-effects":`error`,"sonar/content-length":`error`,"sonar/content-security-policy":`error`,"sonar/cookie-no-httponly":`error`,"sonar/cors":`error`,"sonar/csrf":`error`,"sonar/max-switch-cases":`error`,"sonar/no-all-duplicated-branches":`error`,"sonar/no-collapsible-if":`error`,"sonar/no-collection-size-mischeck":`error`,"sonar/no-duplicate-string":[`error`,{threshold:5}],"sonar/no-duplicated-branches":`error`,"sonar/no-element-overwrite":`error`,"sonar/no-empty-collection":`error`,"sonar/no-extra-arguments":`error`,"sonar/no-for-in-iterable":`error`,"sonar/no-gratuitous-expressions":`error`,"sonar/no-identical-conditions":`error`,"sonar/no-identical-expressions":`error`,"sonar/no-identical-functions":`error`,"sonar/no-ignored-return":`error`,"sonar/no-inverted-boolean-check":`error`,"sonar/no-nested-switch":`error`,"sonar/no-nested-template-literals":`error`,"sonar/no-redundant-boolean":`error`,"sonar/no-same-line-conditional":`error`,"sonar/no-small-switch":`error`,"sonar/no-unused-collection":`error`,"sonar/no-use-of-empty-return-value":`error`,"sonar/no-useless-catch":`error`,"sonar/non-existent-operator":`error`,"sonar/prefer-immediate-return":`error`,"sonar/prefer-object-literal":`error`,"sonar/prefer-single-boolean-return":`error`,"sonar/prefer-while":`error`,"sonar/elseif-without-else":`off`,"sonar/no-redundant-jump":`off`}}]}async function Se(e={}){let{files:t=[`**/*.stories.tsx`],overrides:n={},parserOptions:r,storybookDirectory:i=`.storybook`}=e,[a,o]=await Promise.all([V(import(`eslint-plugin-storybook`)),V(import(`@typescript-eslint/parser`))]),s={parser:o,parserOptions:{ecmaFeatures:{jsx:!0},projectService:!0,...r},sourceType:`module`};return[{name:`2digits:storybook/setup`,plugins:{storybook:a}},{name:`2digits:storybook/rules`,files:t,languageOptions:s,rules:{"storybook/await-interactions":`error`,"storybook/context-in-play-function":`error`,"storybook/csf-component":`error`,"storybook/default-exports":`error`,"storybook/hierarchy-separator":`error`,"storybook/meta-inline-properties":`error`,"storybook/no-redundant-story-name":`error`,"storybook/no-stories-of":`error`,"storybook/no-title-property-in-meta":`error`,"storybook/no-uninstalled-addons":`error`,"storybook/prefer-pascal-case":`error`,"storybook/story-exports":`error`,"storybook/use-storybook-expect":`error`,"storybook/use-storybook-testing-library":`error`,"storybook/meta-satisfies-type":`error`,"storybook/no-renderer-packages":`error`,...n}},{name:`2digits:storybook/disables`,files:t,rules:{"react-hooks/rules-of-hooks":`off`,"react/display-name":`off`,"sonar/no-duplicate-string":`off`}},{name:`2digits:storybook/config`,files:[`${i}/main.@(js|cjs|mjs|ts)`],languageOptions:s,rules:{"storybook/no-uninstalled-addons":`error`}}]}async function Ce(e={}){let{overrides:t={}}=e,[n,{tailwindFunctions:r},i]=await Promise.all([V(import(`eslint-plugin-tailwindcss`)),V(import(`@2digits/constants`)),a().catch(()=>void 0)]),o=C.file(`tailwind.config.ts`,{last:i})??C.file(`tailwind.config.js`,{last:i});return[{files:[T],name:`2digits:tailwind`,plugins:{tailwindcss:n},settings:{tailwindcss:{callees:r,config:o}},rules:{...n.configs.recommended.rules,...t}}]}async function we(e={}){let{overrides:t={}}=e,r=await V(import(`@tanstack/eslint-plugin-query`)),i=n(r.configs[`flat/recommended`].at(0)?.rules??{},P);return[{files:[T],name:`2digits:tanstack-query`,plugins:{"tanstack-query":r},rules:{...i,...t}}]}async function Y(e={}){let{overrides:t={}}=e,r=await V(import(`@tanstack/eslint-plugin-router`)),i=n(r.configs[`flat/recommended`].at(0)?.rules??{},P);return[{files:[T],name:`2digits:tanstack-router`,plugins:{"tanstack-router":r},rules:{...i,"ts/only-throw-error":[`error`,{allow:[{from:`package`,package:`@tanstack/router-core`,name:`Redirect`}]}],...t}}]}async function Te(e={}){let{overrides:t={}}=e,n=await V(import(`eslint-plugin-turbo`));return[{files:[T],name:`2digits:turbo`,plugins:{turbo:n},rules:{"turbo/no-undeclared-env-vars":`error`,...t}}]}async function Ee(e={}){let{overrides:n={},parserOptions:r={}}=e,[{plugin:i,configs:a,parser:o},s]=await Promise.all([V(import(`typescript-eslint`)),V(import(`@2digits/eslint-plugin`))]),c=t(a.strictTypeChecked,P),l=Object.fromEntries(c.flatMap(({rules:e})=>Object.entries(e??{})));return[{name:`2digits:typescript/setup`,plugins:{ts:i,"@2digits":s}},{name:`2digits:typescript/rules`,files:[T],ignores:[A],languageOptions:{parser:o,parserOptions:{tsconfigRootDir:process.cwd(),projectService:!0,warnOnUnsupportedTypeScriptVersion:!1,...r},sourceType:`module`},rules:{...l,"ts/array-type":[`error`,{default:`generic`,readonly:`generic`}],"ts/restrict-template-expressions":[`error`,{allowNumber:!0}],"ts/ban-ts-comment":[`error`,{"ts-ignore":`allow-with-description`}],"ts/consistent-type-exports":[`error`],"ts/consistent-type-imports":[`error`,{prefer:`type-imports`,disallowTypeAnnotations:!1,fixStyle:`inline-type-imports`}],"ts/no-empty-object-type":[`error`,{allowInterfaces:`with-single-extends`,allowObjectTypes:`never`}],"ts/no-explicit-any":[`error`],"ts/no-import-type-side-effects":[`error`],"ts/no-misused-promises":`off`,"ts/no-confusing-void-expression":`off`,"ts/no-unused-vars":[`error`,{ignoreRestSiblings:!0,argsIgnorePattern:`^_`,varsIgnorePattern:`^_`}],"ts/unbound-method":`off`,...s.configs.recommended.rules,...n}},{name:`2digits:typescript/disables/dts`,files:[`**/*.d.ts`],ignores:[A],rules:{"unicorn/no-abusive-eslint-disable":`off`,"no-duplicate-imports":`off`,"no-restricted-syntax":`off`,"ts/no-unused-vars":`off`}},{name:`2digits:typescript/disables/test`,files:[`**/*.{test,spec}.ts?(x)`],ignores:[A],rules:{"no-unused-expressions":`off`}},{name:`2digits:typescript/disables/cjs`,files:[`**/*.js`,`**/*.cjs`,`**/*.cts`],ignores:[A],rules:{"ts/no-require-imports":`off`,"ts/no-var-requires":`off`}}]}function De(){return[{files:[T],name:`2digits:unicorn`,plugins:{unicorn:w},rules:{...w.configs.recommended.rules,"unicorn/filename-case":[`off`],"unicorn/prefer-module":[`off`],"unicorn/prevent-abbreviations":[`off`],"unicorn/prefer-ternary":[`error`,`only-single-line`],"unicorn/no-useless-undefined":[`error`,{checkArguments:!1,checkArrowFunctionBody:!1}],"unicorn/prefer-top-level-await":[`off`]}}]}function Oe(){return[{name:`2digits:yaml/setup`,plugins:{yml:ce}},{name:`2digits:yaml/base`,...X,rules:{"no-irregular-whitespace":`off`,"no-unused-vars":`off`,"spaced-comment":`off`}},{name:`2digits:yaml/recommended`,...X,rules:{"yml/no-empty-document":`error`,"yml/no-empty-key":`error`,"yml/no-empty-mapping-value":`error`,"yml/no-empty-sequence-entry":`error`,"yml/no-irregular-whitespace":`error`,"yml/no-tab-indent":`error`,"yml/vue-custom-block/no-parsing-error":`error`}},{name:`2digits:yaml/standard`,...X,rules:{"yml/block-mapping":`error`,"yml/block-sequence":`error`,"yml/plain-scalar":`error`,"yml/spaced-comment":`error`}},{name:`2digits:yaml/prettier`,...X,rules:{"yml/block-mapping-colon-indicator-newline":`off`,"yml/block-mapping-question-indicator-newline":`off`,"yml/block-sequence-hyphen-indicator-newline":`off`,"yml/flow-mapping-curly-newline":`off`,"yml/flow-mapping-curly-spacing":`off`,"yml/flow-sequence-bracket-newline":`off`,"yml/flow-sequence-bracket-spacing":`off`,"yml/indent":`off`,"yml/key-spacing":`off`,"yml/no-multiple-empty-lines":`off`,"yml/no-trailing-zeros":`off`,"yml/quotes":`off`}}]}const X={files:[`**/*.y?(a)ml`],languageOptions:{parser:g}};async function ke(e={}){let{overrides:t={}}=e,n=await V(import(`eslint-plugin-zod-x`));return[{files:[T],name:`2digits:zod`,plugins:{zod:n},rules:{"zod/array-style":[`error`,{style:`function`}],"zod/no-any":`error`,"zod/no-empty-custom-schema":`error`,"zod/no-throw-in-refine":`error`,"zod/prefer-meta":`error`,"zod/prefer-meta-last":`error`,"zod/prefer-namespace-import":`error`,"zod/require-schema-suffix":[`warn`,{suffix:`Schema`}],"zod/no-optional-and-default-together":[`warn`,{preferredMethod:`default`}],"zod/no-number-schema-with-int":`error`,...t}}]}function Z(e,t){return typeof e==`boolean`?e:e?.enable??t??!1}function Q(e){if(typeof e==`boolean`||e===void 0)return{};let{enable:t,...n}=e;return n}async function $(t={},...n){let r;t.pnpm===void 0&&(r=a());let o=new e(le(t.ignores),ue(t.js),N(),ge(),L(),de(),De(),xe(),be(),M(),fe(),Oe(),pe(),W());Z(t.css)&&(o=o.append(z(Q(t.css)))),Z(t.depend,!0)&&(o=o.append(B())),Z(t.turbo,i(`turbo`))&&(o=o.append(Te(Q(t.turbo))));let{overrides:s,...c}=Q(t.ts);return Z(t.ts,i(`typescript`))&&(o=o.append(Ee(Q(t.ts)))),Z(t.react,i(`react`))&&(o=o.append(ye({...Q(t.react),...c}))),Z(t.next,i(`next`))&&(o=o.append(he({...Q(t.next),...c}))),Z(t.storybook,F.some(e=>i(e)))&&(o=o.append(Se({...Q(t.storybook),...c}))),Z(t.tailwind,i(`tailwindcss`))&&(o=o.append(Ce(Q(t.tailwind)))),Z(t.tanstackQuery,i(`react-query`)||i(`@tanstack/react-query`)||i(`@tanstack/react-query-devtools`))&&(o=o.append(we(Q(t.tanstackQuery)))),Z(t.tanstackRouter,i(`@tanstack/react-router`))&&(o=o.append(Y(Q(t.tanstackRouter)))),Z(t.drizzle,i(`drizzle-kit`)||i(`drizzle-orm`))&&(o=o.append(H(Q(t.drizzle)))),Z(t.zod,i(`zod`))&&(o=o.append(ke(Q(t.zod)))),Z(t.graphql,i(`graphql`))&&(o=o.append(G(Q(t.graphql)))),Z(t.pnpm,!!await r)&&(o=o.append(_e())),o=o.append(...n),i(`prettier`)&&(o=o.append(ve())),o.renamePlugins(P).toConfigs()}export{$ as default,$ as twoDigits};
|
|
1
|
+
import{FlatConfigComposer as e,renamePluginsInConfigs as t,renamePluginsInRules as n}from"eslint-flat-config-utils";import{getPackageInfo as r,isPackageExists as i}from"local-pkg";import{findWorkspaceDir as a}from"pkg-types";import o from"eslint-plugin-antfu";import s from"eslint-plugin-de-morgan";import c from"@eslint-community/eslint-plugin-eslint-comments";import l from"@eslint-community/eslint-plugin-eslint-comments/configs";import u from"@eslint/css";import{tailwind3 as d,tailwind4 as f}from"tailwind-csstree";import p from"eslint-plugin-depend";import{fixupPluginRules as m}from"@eslint/compat";import h from"eslint-plugin-github-action";import g from"yaml-eslint-parser";import _ from"eslint-config-flat-gitignore";import ee from"@eslint/js";import te from"@stylistic/eslint-plugin";import v from"globals";import ne from"eslint-plugin-jsdoc";import re,{configs as y}from"eslint-plugin-jsonc";import ie from"jsonc-eslint-parser";import b from"@eslint/markdown";import{mergeProcessors as ae,processorPassThrough as oe}from"eslint-merge-processors";import se from"eslint-plugin-n";import x from"eslint-plugin-regexp";import S from"eslint-plugin-sonarjs";import*as C from"empathic/find";import w from"eslint-plugin-unicorn";import ce from"eslint-plugin-yml";const T=`**/*.?([cm])[jt]s?(x)`,E=`**/*.?([cm])ts`,D=`**/*.?([cm])tsx`,O=`.github/workflows/*.y?(a)ml`,k=`**/*.md`,A=`${k}/${T}`,j=`**/node_modules,**/dist,**/package-lock.json,**/yarn.lock,**/pnpm-lock.yaml,**/bun.lockb,**/bun.lock,**/output,**/coverage,**/temp,**/.temp,**/tmp,**/.tmp,**/.history,**/.vitepress/cache,**/.nuxt,**/.next,**/.vercel,**/.changeset,**/.idea,**/.cache,**/.output,**/.vite-inspect,**/.yarn,**/CHANGELOG*.md,**/*.min.*,**/LICENSE*,**/__snapshots__,**/auto-import?(s).d.ts,**/components.d.ts`.split(`,`);function M(){return[{files:[T],name:`2digits:antfu`,plugins:{antfu:o},rules:{"antfu/if-newline":`error`,"antfu/top-level-function":`error`}}]}function N(){return[{files:[T],name:`2digits:boolean`,plugins:{boolean:s},rules:{...s.configs.recommended.rules}}]}const P={"@next/next":`next`,"@eslint-react/naming-convention":`react-naming-convention`,"@eslint-react/hooks-extra":`react-hooks-extra`,"@eslint-react/dom":`react-dom`,"@eslint-react/web-api":`react-web-api`,"@eslint-react":`react-extra`,"react-hooks":`react-hooks`,"react-compiler":`react-compiler`,"@stylistic/eslint-plugin":`stylistic`,"@typescript-eslint":`ts`,node:`node`,"@eslint-community/eslint-comments":`comments`,storybook:`storybook`,turbo:`turbo`,jsdoc:`jsdoc`,unicorn:`unicorn`,tailwindcss:`tailwindcss`,"@tanstack/query":`tanstack-query`,"@tanstack/router":`tanstack-router`,"@2digits":`@2digits`,"@graphql-eslint":`gql`,sonarjs:`sonar`,drizzle:`drizzle`,"de-morgan":`boolean`,antfu:`antfu`,css:`css`,depend:`depend`,"github-action":`github-action`,jsonc:`jsonc`,markdown:`markdown`,pnpm:`pnpm`,regexp:`regexp`,yml:`yml`,"zod-x":`zod`},F=[`storybook`,`@storybook/nextjs`,`@storybook/nextjs-vite`,`@storybook/react-vite`,`@storybook/react-webpack5`,`@storybook/react-native-web-vite`],I=n(l.recommended.rules,P);function L(){return[{files:[T],name:`2digits:comments`,plugins:{comments:c},rules:{...I,"comments/no-unused-disable":`error`,"comments/disable-enable-pair":[`error`,{allowWholeFile:!0}]}}]}async function R(e){if(e?.customSyntax)return e.customSyntax;if(e?.tailwindMajor===3)return d;if(e?.tailwindMajor===4)return f;try{let e=(await r(`tailwindcss`))?.version??``,t=Number.parseInt(e.split(`.`)[0]||`0`,10);if(Number.isFinite(t)&&t>=4)return f}catch{}return d}async function z(e={}){let t=await R(e);return[{name:`2digits:css`,files:[`**/*.css`],language:`css/css`,plugins:{css:u},languageOptions:{tolerant:!0,customSyntax:t},rules:{...u.configs.recommended.rules,...e.overrides}}]}function B(){return[{files:[T],name:`2digits:depend`,plugins:{depend:p},rules:{"depend/ban-dependencies":`warn`}}]}async function V(e){let t=await e;return t.default||t}async function H(e={}){let{overrides:t={},drizzleObjectName:n=[`drizzle`,`db`]}=e,r=await V(import(`eslint-plugin-drizzle`));return[{files:[T],name:`2digits:drizzle`,plugins:{drizzle:m(r)},rules:{"drizzle/enforce-update-with-where":[`error`,{drizzleObjectName:n}],"drizzle/enforce-delete-with-where":[`error`,{drizzleObjectName:n}],...t}}]}const U=Object.fromEntries(h.configs.recommended.flatMap(({rules:e})=>Object.entries({...e})));function W(){return[{name:`2digits:github-actions/setup`,plugins:{"github-action":h}},{name:`2digits:github-actions/recommended`,files:[O],ignores:[`!**/${O}`],languageOptions:{parser:g},rules:{...U}}]}async function G(e={}){let{overrides:t={},files:r=[`**/*.graphql`,`**/*.gql`]}=e,[i,a]=await Promise.all([V(import(`@graphql-eslint/eslint-plugin`)),import(`graphql-config`).then(({loadConfig:e})=>e({throwOnEmpty:!1,throwOnMissing:!1}).then(e=>e?.getDefault().schema))]),o=i.configs[`flat/operations-recommended`].rules,s={};if(a)s=o;else for(let e of Object.keys(o)){let t=e.replace(`@graphql-eslint/`,``);t in i.rules&&(i.rules[t].meta.docs?.requiresSchema||i.rules[t].meta.docs?.requiresSiblings)||(s[e]=o[e])}let c=n(s,P);return[{name:`2digits:graphql`,plugins:{gql:i},languageOptions:{parser:i.parser},files:r,rules:{...c,"gql/naming-convention":[`error`,{allowLeadingUnderscore:!0}],...t}}]}function le(e={}){let{gitIgnore:t,ignores:n=[]}=e;return[{ignores:[j,n].flat(),name:`2digits:ignores`},_({strict:!1,...t,name:`2digits:gitignore`})]}function ue(e={}){let{overrides:t={}}=e;return[{files:[T],name:`2digits:javascript`,plugins:{stylistic:te},languageOptions:{ecmaVersion:2022,globals:{...v.browser,...v.es2021,...v.node,document:`readonly`,navigator:`readonly`,window:`readonly`},parserOptions:{ecmaFeatures:{jsx:!0},ecmaVersion:2022,sourceType:`module`},sourceType:`module`},linterOptions:{reportUnusedDisableDirectives:!0},rules:{...ee.configs.recommended.rules,"accessor-pairs":[`error`,{enforceForClassMembers:!0,setWithoutGet:!0}],"array-callback-return":`error`,"block-scoped-var":`error`,"constructor-super":`error`,"default-case-last":`error`,"dot-notation":[`error`,{allowKeywords:!0}],eqeqeq:[`error`,`smart`],"new-cap":[`error`,{capIsNew:!1,newIsCap:!0,properties:!0}],"no-alert":`error`,"no-array-constructor":`error`,"no-async-promise-executor":`error`,"no-caller":`error`,"no-case-declarations":`error`,"no-class-assign":`error`,"no-compare-neg-zero":`error`,"no-cond-assign":[`error`,`always`],"no-const-assign":`error`,"no-control-regex":`error`,"no-debugger":`error`,"no-delete-var":`error`,"no-dupe-args":`error`,"no-dupe-class-members":`error`,"no-dupe-keys":`error`,"no-duplicate-case":`error`,"no-empty":[`error`,{allowEmptyCatch:!0}],"no-empty-character-class":`error`,"no-empty-pattern":`error`,"no-eval":`error`,"no-ex-assign":`error`,"no-extend-native":`error`,"no-extra-bind":`error`,"no-extra-boolean-cast":`error`,"no-fallthrough":`error`,"no-func-assign":`error`,"no-global-assign":`error`,"no-implied-eval":`error`,"no-import-assign":`error`,"no-invalid-regexp":`error`,"no-irregular-whitespace":`error`,"no-iterator":`error`,"no-labels":[`error`,{allowLoop:!1,allowSwitch:!1}],"no-lone-blocks":`error`,"no-loss-of-precision":`error`,"no-misleading-character-class":`error`,"no-multi-str":`error`,"no-new":`error`,"no-new-func":`error`,"no-new-native-nonconstructor":`error`,"no-new-wrappers":`error`,"no-obj-calls":`error`,"no-octal":`error`,"no-octal-escape":`error`,"no-proto":`error`,"no-prototype-builtins":`error`,"no-redeclare":[`error`,{builtinGlobals:!1}],"no-regex-spaces":`error`,"no-restricted-globals":[`error`,{message:"Use `globalThis` instead.",name:`global`},{message:"Use `globalThis` instead.",name:`self`}],"no-restricted-properties":[`error`,{message:"Use `Object.getPrototypeOf` or `Object.setPrototypeOf` instead.",property:`__proto__`},{message:"Use `Object.defineProperty` instead.",property:`__defineGetter__`},{message:"Use `Object.defineProperty` instead.",property:`__defineSetter__`},{message:"Use `Object.getOwnPropertyDescriptor` instead.",property:`__lookupGetter__`},{message:"Use `Object.getOwnPropertyDescriptor` instead.",property:`__lookupSetter__`}],"no-restricted-syntax":[`error`,`DebuggerStatement`,`LabeledStatement`,`WithStatement`,`TSEnumDeclaration`,`TSExportAssignment`],"no-self-assign":[`error`,{props:!0}],"no-self-compare":`error`,"no-sequences":`error`,"no-shadow-restricted-names":`error`,"no-sparse-arrays":`error`,"no-template-curly-in-string":`error`,"no-this-before-super":`error`,"no-throw-literal":`error`,"no-undef":`error`,"no-undef-init":`error`,"no-unexpected-multiline":`error`,"no-unmodified-loop-condition":`error`,"no-unneeded-ternary":[`error`,{defaultAssignment:!1}],"no-unreachable":`error`,"no-unreachable-loop":`error`,"no-unsafe-finally":`error`,"no-unsafe-negation":`error`,"no-unused-expressions":[`error`,{allowShortCircuit:!0,allowTaggedTemplates:!0,allowTernary:!0}],"no-unused-vars":[`error`,{args:`none`,caughtErrors:`none`,ignoreRestSiblings:!0,vars:`all`}],"no-useless-backreference":`error`,"no-useless-call":`error`,"no-useless-catch":`error`,"no-useless-computed-key":`error`,"no-useless-constructor":`error`,"no-useless-rename":`error`,"no-var":`error`,"no-with":`error`,"object-shorthand":[`error`,`always`,{avoidQuotes:!0,ignoreConstructors:!1}],"one-var":[`error`,{initialized:`never`}],"prefer-arrow-callback":[`error`,{allowNamedFunctions:!0,allowUnboundThis:!0}],"prefer-const":[`error`,{destructuring:`all`,ignoreReadBeforeAssign:!0}],"prefer-exponentiation-operator":`error`,"prefer-promise-reject-errors":`error`,"prefer-regex-literals":[`error`,{disallowRedundantWrapping:!0}],"prefer-rest-params":`error`,"prefer-spread":`error`,"prefer-template":`error`,"symbol-description":`error`,"unicode-bom":[`error`,`never`],"use-isnan":[`error`,{enforceForIndexOf:!0,enforceForSwitchCase:!0}],"valid-typeof":[`error`,{requireStringLiterals:!0}],"vars-on-top":`error`,yoda:[`error`,`never`],"stylistic/padding-line-between-statements":[`error`,{blankLine:`always`,prev:[`const`,`let`],next:`*`},{blankLine:`any`,prev:[`const`,`let`],next:[`const`,`let`]},{blankLine:`always`,prev:`*`,next:`return`}],...t}}]}function de(){return[{files:[T],name:`2digits:jsdoc`,plugins:{jsdoc:ne},rules:{"jsdoc/check-access":`error`,"jsdoc/check-param-names":`error`,"jsdoc/check-property-names":`error`,"jsdoc/check-types":`error`,"jsdoc/empty-tags":`error`,"jsdoc/implements-on-classes":`error`,"jsdoc/no-defaults":`error`,"jsdoc/no-multi-asterisks":`error`,"jsdoc/require-param-name":`error`,"jsdoc/require-property":`error`,"jsdoc/require-property-description":`error`,"jsdoc/require-property-name":`error`,"jsdoc/require-returns-check":`error`,"jsdoc/require-returns-description":`error`,"jsdoc/require-yields-check":`error`}}]}function fe(){return[...y[`flat/base`].map(e=>({...e,name:`2digits:jsonc/base`})),{name:`2digits:jsonc/json`,files:[`**/*.json`],...K,rules:{...q(y[`flat/recommended-with-json`])}},{name:`2digits:jsonc/jsonc`,files:[`**/*.jsonc`],...K,rules:{...q(y[`flat/recommended-with-jsonc`])}},{name:`2digits:jsonc/json5`,files:[`**/*.json5`],...K,rules:{...q(y[`flat/recommended-with-json5`])}},{name:`2digits:jsonc/package.json`,...K,files:[`**/package.json`],rules:{"jsonc/sort-array-values":[`error`,{order:{type:`asc`},pathPattern:`^files$`}],"jsonc/sort-keys":[`error`,{order:`$schema.publisher.name.displayName.version.private.description.funding.homepage.repository.bugs.categories.type.main.module.types.typesVersions.bin.files.exports.icon.unpkg.jsdelivr.sideEffects.activationEvents.contributes.scripts.keywords.author.license.workspaces.dependencies.devDependencies.peerDependencies.peerDependenciesMeta.optionalDependencies.packageManager.engines.pnpm.overrides.resolutions.husky.simple-git-hooks.lint-staged.eslintConfig.prettier`.split(`.`),pathPattern:`^$`},{order:{type:`asc`},pathPattern:`^(?:dev|peer|optional|bundled)?[Dd]ependencies(Meta)?$`},{order:[`types`,`import`,`module`,`require`,`default`],pathPattern:`^exports.*$`}]}},{name:`2digits:jsonc/tsconfig.json`,...K,files:[`**/tsconfig.json`,`**/tsconfig.*.json`,`**/tsconfig-*.json`,`**/jsconfig.json`,`**/jsconfig.*.json`,`**/jsconfig-*.json`],rules:{"jsonc/sort-keys":[`error`,{order:[`$schema`,`extends`,`compilerOptions`,`references`,`files`,`include`,`exclude`],pathPattern:`^$`},{order:`incremental.composite.tsBuildInfoFile.disableSourceOfProjectReferenceRedirect.disableSolutionSearching.disableReferencedProjectLoad.target.lib.jsx.experimentalDecorators.emitDecoratorMetadata.jsxFactory.jsxFragmentFactory.jsxImportSource.reactNamespace.noLib.useDefineForClassFields.moduleDetection.module.rootDir.moduleResolution.baseUrl.paths.rootDirs.typeRoots.types.allowUmdGlobalAccess.moduleSuffixes.allowImportingTsExtensions.resolvePackageJsonExports.resolvePackageJsonImports.customConditions.resolveJsonModule.allowArbitraryExtensions.noResolve.allowJs.checkJs.maxNodeModuleJsDepth.declaration.declarationMap.emitDeclarationOnly.sourceMap.inlineSourceMap.outFile.outDir.removeComments.noEmit.importHelpers.importsNotUsedAsValues.downlevelIteration.sourceRoot.mapRoot.inlineSources.emitBOM.newLine.stripInternal.noEmitHelpers.noEmitOnError.preserveConstEnums.declarationDir.preserveValueImports.isolatedModules.verbatimModuleSyntax.allowSyntheticDefaultImports.esModuleInterop.preserveSymlinks.forceConsistentCasingInFileNames.strict.strictBindCallApply.strictFunctionTypes.strictNullChecks.strictPropertyInitialization.allowUnreachableCode.allowUnusedLabels.alwaysStrict.exactOptionalPropertyTypes.noFallthroughCasesInSwitch.noImplicitAny.noImplicitOverride.noImplicitReturns.noImplicitThis.noPropertyAccessFromIndexSignature.noUncheckedIndexedAccess.noUnusedLocals.noUnusedParameters.useUnknownInCatchVariables.skipDefaultLibCheck.skipLibCheck`.split(`.`),pathPattern:`^compilerOptions$`}]}},...y[`flat/prettier`].map(e=>({...e,name:`2digits:jsonc/prettier`}))]}const K={languageOptions:{parser:ie},plugins:{jsonc:re}};function q(e){return Object.fromEntries(e.flatMap(({rules:e})=>Object.entries(e??{})))}const J=[k];function pe(){return[{name:`2digits:markdown/setup`,plugins:{markdown:b}},{name:`2digits:markdown/processor`,files:J,language:`markdown/gfm`,ignores:[`**/*.md/*.md`],processor:ae([b.processors.markdown,oe])},{name:`2digits:markdown/parser`,files:J,language:`markdown/gfm`,languageOptions:{parser:me}},{name:`2digits:markdown/rules`,files:J,language:`markdown/gfm`,rules:{"markdown/fenced-code-language":`error`,"markdown/heading-increment":`error`,"markdown/no-empty-links":`error`,"markdown/no-invalid-label-refs":`error`,"markdown/no-missing-label-refs":`error`}},{name:`2digits:markdown/disables`,files:[A],languageOptions:{parserOptions:{ecmaFeatures:{impliedStrict:!0}}},rules:{"no-alert":`off`,"no-console":`off`,"no-labels":`off`,"no-lone-blocks":`off`,"no-restricted-syntax":`off`,"no-undef":`off`,"no-unused-expressions":`off`,"no-unused-labels":`off`,"no-unused-vars":`off`,"node/prefer-global/process":`off`,"ts/consistent-type-imports":`off`,"ts/explicit-function-return-type":`off`,"ts/no-namespace":`off`,"ts/no-redeclare":`off`,"ts/no-require-imports":`off`,"ts/no-unused-expressions":`off`,"ts/no-unused-vars":`off`,"ts/no-use-before-define":`off`,"unicode-bom":`off`}}]}const me={meta:{name:`parser-plain`},parseForESLint:e=>({ast:{body:[],comments:[],loc:{end:e.length,start:0},range:[0,e.length],tokens:[],type:`Program`},scopeManager:null,services:{isPlain:!0},visitorKeys:{Program:[]}})};async function he(e={}){let{files:t=[E,D],overrides:r={},parserOptions:i}=e,[a,o]=await Promise.all([V(import(`@next/eslint-plugin-next`)),V(import(`@typescript-eslint/parser`))]),s=n({...a.configs.recommended.rules,...a.configs[`core-web-vitals`].rules},P);return[{name:`2digits:next/setup`,plugins:{next:m(a)}},{name:`2digits:next/rules`,files:t,languageOptions:{parser:o,parserOptions:{ecmaFeatures:{jsx:!0},projectService:!0,...i},sourceType:`module`},rules:{...s,"next/no-html-link-for-pages":`off`,...r}}]}function ge(){return[{files:[T],name:`2digits:node`,settings:{node:{version:`>= 22.0.0`}},plugins:{node:se},rules:{"node/handle-callback-err":[`error`,`^(err|error)$`],"node/no-deprecated-api":`error`,"node/no-exports-assign":`error`,"node/no-new-require":`error`,"node/no-path-concat":`error`,"node/no-unsupported-features/node-builtins":[`error`,{allowExperimental:!0}],"node/prefer-global/buffer":`error`,"node/prefer-global/process":`error`,"node/prefer-global/text-encoder":`error`,"node/prefer-global/url":`error`,"node/prefer-global/console":`error`,"node/prefer-global/url-search-params":`error`,"node/prefer-global/text-decoder":`error`,"node/process-exit-as-throw":`error`}}]}async function _e(){let e=await V(import(`eslint-plugin-pnpm`));return[{name:`2digits:pnpm/package-json`,files:[`package.json`,`**/package.json`],languageOptions:{parser:await V(import(`jsonc-eslint-parser`))},plugins:{pnpm:e},rules:{"pnpm/json-enforce-catalog":`error`,"pnpm/json-prefer-workspace-settings":`error`,"pnpm/json-valid-catalog":`error`}},{name:`2digits:pnpm/pnpm-workspace-yaml`,files:[`pnpm-workspace.yaml`],languageOptions:{parser:await V(import(`yaml-eslint-parser`))},plugins:{pnpm:e},rules:{"pnpm/yaml-no-duplicate-catalog-item":`error`,"pnpm/yaml-no-unused-catalog-item":`error`,"pnpm/yaml-valid-packages":`error`}}]}async function ve(){let[e,t]=await Promise.all([V(import(`eslint-config-prettier`)),V(import(`@stylistic/eslint-plugin`))]);return[{name:`2digits:prettier`,plugins:{stylistic:t},rules:{...e.rules,"tailwindcss/classnames-order":`off`,"stylistic/jsx-newline":[`error`,{prevent:!1}]}}]}async function ye(e={}){let{files:t=[E,D],overrides:r={},parserOptions:i,tsconfigRootDir:a,reactCompiler:o=!0}=e,[s,c,l,u,d]=await Promise.all([V(import(`@eslint-react/eslint-plugin`)),V(import(`eslint-plugin-react-hooks`)),V(import(`@typescript-eslint/parser`)),o?V(import(`eslint-plugin-react-compiler`)):Promise.resolve(void 0),V(import(`@stylistic/eslint-plugin`))]),f=s.configs.all.plugins,p=n({...s.configs[`disable-conflict-eslint-plugin-react`].rules,...s.configs[`recommended-type-checked`].rules},P);return[{name:`2digits:react/setup`,plugins:{stylistic:d,"react-dom":f[`@eslint-react/dom`],"react-web-api":f[`@eslint-react/web-api`],"react-extra":f[`@eslint-react`],"react-hooks":c,"react-hooks-extra":f[`@eslint-react/hooks-extra`],"react-naming-convention":f[`@eslint-react/naming-convention`],...o?{"react-compiler":u}:{}},settings:{react:{version:`detect`}}},{name:`2digits:react/rules`,files:t,languageOptions:{parser:l,parserOptions:{ecmaFeatures:{jsx:!0},tsconfigRootDir:a,projectService:!0,...i},sourceType:`module`},rules:{...p,...o?{"react-compiler/react-compiler":`error`}:{},"react-extra/no-unnecessary-use-callback":`error`,"react-extra/prefer-use-state-lazy-initialization":`error`,"react-extra/no-unnecessary-use-prefix":`error`,"react-extra/no-unnecessary-use-memo":`error`,"react-hooks-extra/no-direct-set-state-in-use-effect":`error`,"react-extra/no-useless-fragment":`off`,"react-extra/prefer-read-only-props":`off`,"react-extra/jsx-shorthand-boolean":`error`,"react-extra/jsx-shorthand-fragment":`error`,"react-extra/prefer-namespace-import":`error`,"react-naming-convention/use-state":`error`,"stylistic/jsx-curly-newline":`off`,"stylistic/jsx-newline":[`error`,{prevent:!1}],"stylistic/jsx-self-closing-comp":`error`,"react-hooks/rules-of-hooks":`error`,"react-hooks/exhaustive-deps":`warn`,...r}}]}function be(){return[{files:[T],name:`2digits:regexp`,plugins:{regexp:x},rules:{...x.configs[`flat/recommended`].rules}}]}function xe(){return[{files:[T],name:`2digits:sonar`,plugins:{sonar:S},rules:{"sonar/code-eval":`error`,"sonar/cognitive-complexity":`error`,"sonar/comma-or-logical-or-case":`error`,"sonar/concise-regex":`error`,"sonar/confidential-information-logging":`error`,"sonar/constructor-for-side-effects":`error`,"sonar/content-length":`error`,"sonar/content-security-policy":`error`,"sonar/cookie-no-httponly":`error`,"sonar/cors":`error`,"sonar/csrf":`error`,"sonar/max-switch-cases":`error`,"sonar/no-all-duplicated-branches":`error`,"sonar/no-collapsible-if":`error`,"sonar/no-collection-size-mischeck":`error`,"sonar/no-duplicate-string":[`error`,{threshold:5}],"sonar/no-duplicated-branches":`error`,"sonar/no-element-overwrite":`error`,"sonar/no-empty-collection":`error`,"sonar/no-extra-arguments":`error`,"sonar/no-for-in-iterable":`error`,"sonar/no-gratuitous-expressions":`error`,"sonar/no-identical-conditions":`error`,"sonar/no-identical-expressions":`error`,"sonar/no-identical-functions":`error`,"sonar/no-ignored-return":`error`,"sonar/no-inverted-boolean-check":`error`,"sonar/no-nested-switch":`error`,"sonar/no-nested-template-literals":`error`,"sonar/no-redundant-boolean":`error`,"sonar/no-same-line-conditional":`error`,"sonar/no-small-switch":`error`,"sonar/no-unused-collection":`error`,"sonar/no-use-of-empty-return-value":`error`,"sonar/no-useless-catch":`error`,"sonar/non-existent-operator":`error`,"sonar/prefer-immediate-return":`error`,"sonar/prefer-object-literal":`error`,"sonar/prefer-single-boolean-return":`error`,"sonar/prefer-while":`error`,"sonar/elseif-without-else":`off`,"sonar/no-redundant-jump":`off`}}]}async function Se(e={}){let{files:t=[`**/*.stories.tsx`],overrides:n={},parserOptions:r,storybookDirectory:i=`.storybook`}=e,[a,o]=await Promise.all([V(import(`eslint-plugin-storybook`)),V(import(`@typescript-eslint/parser`))]),s={parser:o,parserOptions:{ecmaFeatures:{jsx:!0},projectService:!0,...r},sourceType:`module`};return[{name:`2digits:storybook/setup`,plugins:{storybook:a}},{name:`2digits:storybook/rules`,files:t,languageOptions:s,rules:{"storybook/await-interactions":`error`,"storybook/context-in-play-function":`error`,"storybook/csf-component":`error`,"storybook/default-exports":`error`,"storybook/hierarchy-separator":`error`,"storybook/meta-inline-properties":`error`,"storybook/no-redundant-story-name":`error`,"storybook/no-stories-of":`error`,"storybook/no-title-property-in-meta":`error`,"storybook/no-uninstalled-addons":`error`,"storybook/prefer-pascal-case":`error`,"storybook/story-exports":`error`,"storybook/use-storybook-expect":`error`,"storybook/use-storybook-testing-library":`error`,"storybook/meta-satisfies-type":`error`,"storybook/no-renderer-packages":`error`,...n}},{name:`2digits:storybook/disables`,files:t,rules:{"react-hooks/rules-of-hooks":`off`,"react/display-name":`off`,"sonar/no-duplicate-string":`off`}},{name:`2digits:storybook/config`,files:[`${i}/main.@(js|cjs|mjs|ts)`],languageOptions:s,rules:{"storybook/no-uninstalled-addons":`error`}}]}async function Ce(e={}){let{overrides:t={}}=e,[n,{tailwindFunctions:r},i]=await Promise.all([V(import(`eslint-plugin-tailwindcss`)),V(import(`@2digits/constants`)),a().catch(()=>void 0)]),o=C.file(`tailwind.config.ts`,{last:i})??C.file(`tailwind.config.js`,{last:i});return[{files:[T],name:`2digits:tailwind`,plugins:{tailwindcss:n},settings:{tailwindcss:{callees:r,config:o}},rules:{...n.configs.recommended.rules,...t}}]}async function we(e={}){let{overrides:t={}}=e,r=await V(import(`@tanstack/eslint-plugin-query`)),i=n(r.configs[`flat/recommended`].at(0)?.rules??{},P);return[{files:[T],name:`2digits:tanstack-query`,plugins:{"tanstack-query":r},rules:{...i,...t}}]}async function Y(e={}){let{overrides:t={}}=e,r=await V(import(`@tanstack/eslint-plugin-router`)),i=n(r.configs[`flat/recommended`].at(0)?.rules??{},P);return[{files:[T],name:`2digits:tanstack-router`,plugins:{"tanstack-router":r},rules:{...i,"ts/only-throw-error":[`error`,{allow:[{from:`package`,package:`@tanstack/router-core`,name:`Redirect`}]}],...t}}]}async function Te(e={}){let{overrides:t={}}=e,n=await V(import(`eslint-plugin-turbo`));return[{files:[T],name:`2digits:turbo`,plugins:{turbo:n},rules:{"turbo/no-undeclared-env-vars":`error`,...t}}]}async function Ee(e={}){let{overrides:n={},parserOptions:r={}}=e,[{plugin:i,configs:a,parser:o},s]=await Promise.all([V(import(`typescript-eslint`)),V(import(`@2digits/eslint-plugin`))]),c=t(a.strictTypeChecked,P),l=Object.fromEntries(c.flatMap(({rules:e})=>Object.entries(e??{})));return[{name:`2digits:typescript/setup`,plugins:{ts:i,"@2digits":s}},{name:`2digits:typescript/rules`,files:[T],ignores:[A],languageOptions:{parser:o,parserOptions:{tsconfigRootDir:process.cwd(),projectService:!0,warnOnUnsupportedTypeScriptVersion:!1,...r},sourceType:`module`},rules:{...l,"ts/array-type":[`error`,{default:`generic`,readonly:`generic`}],"ts/restrict-template-expressions":[`error`,{allowNumber:!0}],"ts/ban-ts-comment":[`error`,{"ts-ignore":`allow-with-description`}],"ts/consistent-type-exports":[`error`],"ts/consistent-type-imports":[`error`,{prefer:`type-imports`,disallowTypeAnnotations:!1,fixStyle:`inline-type-imports`}],"ts/no-empty-object-type":[`error`,{allowInterfaces:`with-single-extends`,allowObjectTypes:`never`}],"ts/no-explicit-any":[`error`],"ts/no-import-type-side-effects":[`error`],"ts/no-misused-promises":`off`,"ts/no-confusing-void-expression":`off`,"ts/no-unused-vars":[`error`,{ignoreRestSiblings:!0,argsIgnorePattern:`^_`,varsIgnorePattern:`^_`}],"ts/unbound-method":`off`,...s.configs.recommended.rules,...n}},{name:`2digits:typescript/disables/dts`,files:[`**/*.d.ts`],ignores:[A],rules:{"unicorn/no-abusive-eslint-disable":`off`,"no-duplicate-imports":`off`,"no-restricted-syntax":`off`,"ts/no-unused-vars":`off`}},{name:`2digits:typescript/disables/test`,files:[`**/*.{test,spec}.ts?(x)`],ignores:[A],rules:{"no-unused-expressions":`off`}},{name:`2digits:typescript/disables/cjs`,files:[`**/*.js`,`**/*.cjs`,`**/*.cts`],ignores:[A],rules:{"ts/no-require-imports":`off`,"ts/no-var-requires":`off`}}]}function De(){return[{files:[T],name:`2digits:unicorn`,plugins:{unicorn:w},rules:{...w.configs.recommended.rules,"unicorn/filename-case":[`off`],"unicorn/prefer-module":[`off`],"unicorn/prevent-abbreviations":[`off`],"unicorn/prefer-ternary":[`error`,`only-single-line`],"unicorn/no-useless-undefined":[`error`,{checkArguments:!1,checkArrowFunctionBody:!1}],"unicorn/prefer-top-level-await":[`off`]}}]}function Oe(){return[{name:`2digits:yaml/setup`,plugins:{yml:ce}},{name:`2digits:yaml/base`,...X,rules:{"no-irregular-whitespace":`off`,"no-unused-vars":`off`,"spaced-comment":`off`}},{name:`2digits:yaml/recommended`,...X,rules:{"yml/no-empty-document":`error`,"yml/no-empty-key":`error`,"yml/no-empty-mapping-value":`error`,"yml/no-empty-sequence-entry":`error`,"yml/no-irregular-whitespace":`error`,"yml/no-tab-indent":`error`,"yml/vue-custom-block/no-parsing-error":`error`}},{name:`2digits:yaml/standard`,...X,rules:{"yml/block-mapping":`error`,"yml/block-sequence":`error`,"yml/plain-scalar":`error`,"yml/spaced-comment":`error`}},{name:`2digits:yaml/prettier`,...X,rules:{"yml/block-mapping-colon-indicator-newline":`off`,"yml/block-mapping-question-indicator-newline":`off`,"yml/block-sequence-hyphen-indicator-newline":`off`,"yml/flow-mapping-curly-newline":`off`,"yml/flow-mapping-curly-spacing":`off`,"yml/flow-sequence-bracket-newline":`off`,"yml/flow-sequence-bracket-spacing":`off`,"yml/indent":`off`,"yml/key-spacing":`off`,"yml/no-multiple-empty-lines":`off`,"yml/no-trailing-zeros":`off`,"yml/quotes":`off`}}]}const X={files:[`**/*.y?(a)ml`],languageOptions:{parser:g}};async function ke(e={}){let{overrides:t={}}=e,n=await V(import(`eslint-plugin-zod-x`));return[{files:[T],name:`2digits:zod`,plugins:{zod:n},rules:{"zod/array-style":[`error`,{style:`function`}],"zod/no-any":`error`,"zod/no-empty-custom-schema":`error`,"zod/no-number-schema-with-int":`error`,"zod/no-optional-and-default-together":[`warn`,{preferredMethod:`default`}],"zod/no-throw-in-refine":`error`,"zod/prefer-meta":`error`,"zod/prefer-meta-last":`error`,"zod/prefer-namespace-import":`error`,"zod/require-brand-type-parameter":`error`,"zod/require-schema-suffix":[`warn`,{suffix:`Schema`}],"zod/schema-error-property-style":[`error`,{selector:`Literal,TemplateLiteral`,example:`"This is an error message"`}],...t}}]}function Z(e,t){return typeof e==`boolean`?e:e?.enable??t??!1}function Q(e){if(typeof e==`boolean`||e===void 0)return{};let{enable:t,...n}=e;return n}async function $(t={},...n){let r;t.pnpm===void 0&&(r=a());let o=new e(le(t.ignores),ue(t.js),N(),ge(),L(),de(),De(),xe(),be(),M(),fe(),Oe(),pe(),W());Z(t.css)&&(o=o.append(z(Q(t.css)))),Z(t.depend,!0)&&(o=o.append(B())),Z(t.turbo,i(`turbo`))&&(o=o.append(Te(Q(t.turbo))));let{overrides:s,...c}=Q(t.ts);return Z(t.ts,i(`typescript`))&&(o=o.append(Ee(Q(t.ts)))),Z(t.react,i(`react`))&&(o=o.append(ye({...Q(t.react),...c}))),Z(t.next,i(`next`))&&(o=o.append(he({...Q(t.next),...c}))),Z(t.storybook,F.some(e=>i(e)))&&(o=o.append(Se({...Q(t.storybook),...c}))),Z(t.tailwind,i(`tailwindcss`))&&(o=o.append(Ce(Q(t.tailwind)))),Z(t.tanstackQuery,i(`react-query`)||i(`@tanstack/react-query`)||i(`@tanstack/react-query-devtools`))&&(o=o.append(we(Q(t.tanstackQuery)))),Z(t.tanstackRouter,i(`@tanstack/react-router`))&&(o=o.append(Y(Q(t.tanstackRouter)))),Z(t.drizzle,i(`drizzle-kit`)||i(`drizzle-orm`))&&(o=o.append(H(Q(t.drizzle)))),Z(t.zod,i(`zod`))&&(o=o.append(ke(Q(t.zod)))),Z(t.graphql,i(`graphql`))&&(o=o.append(G(Q(t.graphql)))),Z(t.pnpm,!!await r)&&(o=o.append(_e())),o=o.append(...n),i(`prettier`)&&(o=o.append(ve())),o.renamePlugins(P).toConfigs()}export{$ as default,$ as twoDigits};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@2digits/eslint-config",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.13.1",
|
|
4
4
|
"description": "Effortlessly enforce best practices and catch errors with this comprehensive ESLint configuration for TypeScript, featuring popular plugins like @typescript-eslint, eslint-plugin-react, and eslint-plugin-unicorn.",
|
|
5
5
|
"homepage": "https://2d-configs.vercel.app/",
|
|
6
6
|
"repository": {
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"public": true,
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@eslint-community/eslint-plugin-eslint-comments": "4.5.0",
|
|
30
|
-
"@eslint-react/eslint-plugin": "2.3.
|
|
30
|
+
"@eslint-react/eslint-plugin": "2.3.4",
|
|
31
31
|
"@eslint/compat": "1.4.1",
|
|
32
32
|
"@eslint/css": "0.14.1",
|
|
33
33
|
"@eslint/js": "9.39.1",
|
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
"@stylistic/eslint-plugin": "5.5.0",
|
|
38
38
|
"@tanstack/eslint-plugin-query": "5.91.2",
|
|
39
39
|
"@tanstack/eslint-plugin-router": "1.133.19",
|
|
40
|
-
"@typescript-eslint/parser": "8.46.
|
|
41
|
-
"@typescript-eslint/utils": "8.46.
|
|
40
|
+
"@typescript-eslint/parser": "8.46.4",
|
|
41
|
+
"@typescript-eslint/utils": "8.46.4",
|
|
42
42
|
"empathic": "2.0.0",
|
|
43
43
|
"eslint-config-flat-gitignore": "2.1.0",
|
|
44
44
|
"eslint-config-prettier": "10.1.8",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"eslint-plugin-depend": "1.3.1",
|
|
50
50
|
"eslint-plugin-drizzle": "0.2.3",
|
|
51
51
|
"eslint-plugin-github-action": "0.0.16",
|
|
52
|
-
"eslint-plugin-jsdoc": "61.
|
|
52
|
+
"eslint-plugin-jsdoc": "61.2.0",
|
|
53
53
|
"eslint-plugin-jsonc": "2.21.0",
|
|
54
54
|
"eslint-plugin-n": "17.23.1",
|
|
55
55
|
"eslint-plugin-pnpm": "1.3.0",
|
|
@@ -57,26 +57,26 @@
|
|
|
57
57
|
"eslint-plugin-react-hooks": "7.0.1",
|
|
58
58
|
"eslint-plugin-regexp": "2.10.0",
|
|
59
59
|
"eslint-plugin-sonarjs": "3.0.5",
|
|
60
|
-
"eslint-plugin-storybook": "10.0.
|
|
60
|
+
"eslint-plugin-storybook": "10.0.7",
|
|
61
61
|
"eslint-plugin-tailwindcss": "3.18.2",
|
|
62
|
-
"eslint-plugin-turbo": "2.6.
|
|
62
|
+
"eslint-plugin-turbo": "2.6.1",
|
|
63
63
|
"eslint-plugin-unicorn": "62.0.0",
|
|
64
64
|
"eslint-plugin-yml": "1.19.0",
|
|
65
|
-
"eslint-plugin-zod-x": "1.
|
|
65
|
+
"eslint-plugin-zod-x": "1.8.2",
|
|
66
66
|
"globals": "16.5.0",
|
|
67
67
|
"graphql-config": "5.1.5",
|
|
68
68
|
"jsonc-eslint-parser": "2.4.1",
|
|
69
69
|
"local-pkg": "1.1.2",
|
|
70
70
|
"pkg-types": "2.3.0",
|
|
71
71
|
"tailwind-csstree": "0.1.4",
|
|
72
|
-
"typescript-eslint": "8.46.
|
|
72
|
+
"typescript-eslint": "8.46.4",
|
|
73
73
|
"yaml-eslint-parser": "1.3.0",
|
|
74
74
|
"@2digits/constants": "1.1.10",
|
|
75
|
-
"@2digits/eslint-plugin": "3.2.
|
|
75
|
+
"@2digits/eslint-plugin": "3.2.4"
|
|
76
76
|
},
|
|
77
77
|
"devDependencies": {
|
|
78
78
|
"@eslint/config-inspector": "1.3.0",
|
|
79
|
-
"@types/react": "19.2.
|
|
79
|
+
"@types/react": "19.2.3",
|
|
80
80
|
"dedent": "1.7.0",
|
|
81
81
|
"eslint": "9.39.1",
|
|
82
82
|
"eslint-typegen": "2.3.0",
|
|
@@ -94,6 +94,7 @@
|
|
|
94
94
|
"types": "tsc --noEmit",
|
|
95
95
|
"docs": "eslint-config-inspector build",
|
|
96
96
|
"docs:dev": "eslint-config-inspector",
|
|
97
|
-
"test": "vitest
|
|
97
|
+
"test": "vitest run",
|
|
98
|
+
"test:watch": "vitest"
|
|
98
99
|
}
|
|
99
100
|
}
|