@2digits/eslint-config 4.8.11 → 4.9.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 CHANGED
@@ -332,6 +332,11 @@ interface RuleOptions {
332
332
  * @see https://eslint.org/docs/latest/rules/default-param-last
333
333
  */
334
334
  'default-param-last'?: Linter.RuleEntry<[]>;
335
+ /**
336
+ * Bans a list of dependencies from being used
337
+ * @see https://github.com/es-tooling/eslint-plugin-depend/blob/main/docs/rules/ban-dependencies.md
338
+ */
339
+ 'depend/ban-dependencies'?: Linter.RuleEntry<DependBanDependencies>;
335
340
  /**
336
341
  * Enforce consistent newlines before and after dots
337
342
  * @see https://eslint.org/docs/latest/rules/dot-location
@@ -3078,7 +3083,7 @@ interface RuleOptions {
3078
3083
  */
3079
3084
  'react-dom/no-missing-button-type'?: Linter.RuleEntry<[]>;
3080
3085
  /**
3081
- * Enforces explicit `sandbox` attribute for `iframe` elements.
3086
+ * Enforces explicit `sandbox` prop for `iframe` elements.
3082
3087
  * @see https://eslint-react.xyz/docs/rules/dom-no-missing-iframe-sandbox
3083
3088
  */
3084
3089
  'react-dom/no-missing-iframe-sandbox'?: Linter.RuleEntry<[]>;
@@ -3138,7 +3143,7 @@ interface RuleOptions {
3138
3143
  */
3139
3144
  'react-dom/prefer-namespace-import'?: Linter.RuleEntry<[]>;
3140
3145
  /**
3141
- * Enforces that the 'key' attribute is placed before the spread attribute in JSX elements.
3146
+ * Enforces that the 'key' prop is placed before the spread prop in JSX elements.
3142
3147
  * @see https://eslint-react.xyz/docs/rules/jsx-key-before-spread
3143
3148
  */
3144
3149
  'react-extra/jsx-key-before-spread'?: Linter.RuleEntry<[]>;
@@ -3343,7 +3348,7 @@ interface RuleOptions {
3343
3348
  */
3344
3349
  'react-extra/no-set-state-in-component-did-update'?: Linter.RuleEntry<[]>;
3345
3350
  /**
3346
- * Disallows calling `this.setState` in `componentWillUpdate` outside of functions, such as callbacks.
3351
+ * Disallow calling `this.setState` in `componentWillUpdate` outside of functions, such as callbacks.
3347
3352
  * @see https://eslint-react.xyz/docs/rules/no-set-state-in-component-will-update
3348
3353
  */
3349
3354
  'react-extra/no-set-state-in-component-will-update'?: Linter.RuleEntry<[]>;
@@ -3452,16 +3457,120 @@ interface RuleOptions {
3452
3457
  * @see https://eslint-react.xyz/docs/rules/hooks-extra-no-direct-set-state-in-use-effect
3453
3458
  */
3454
3459
  'react-hooks-extra/no-direct-set-state-in-use-effect'?: Linter.RuleEntry<[]>;
3460
+ /**
3461
+ * Verifies that automatic effect dependencies are compiled if opted-in
3462
+ */
3463
+ 'react-hooks/automatic-effect-dependencies'?: Linter.RuleEntry<ReactHooksAutomaticEffectDependencies>;
3464
+ /**
3465
+ * Validates against calling capitalized functions/methods instead of using JSX
3466
+ */
3467
+ 'react-hooks/capitalized-calls'?: Linter.RuleEntry<ReactHooksCapitalizedCalls>;
3468
+ /**
3469
+ * Validates against higher order functions defining nested components or hooks. Components and hooks should be defined at the module level
3470
+ */
3471
+ 'react-hooks/component-hook-factories'?: Linter.RuleEntry<ReactHooksComponentHookFactories>;
3472
+ /**
3473
+ * Validates the compiler configuration options
3474
+ */
3475
+ 'react-hooks/config'?: Linter.RuleEntry<ReactHooksConfig>;
3476
+ /**
3477
+ * Validates usage of error boundaries instead of try/catch for errors in child components
3478
+ */
3479
+ 'react-hooks/error-boundaries'?: Linter.RuleEntry<ReactHooksErrorBoundaries>;
3455
3480
  /**
3456
3481
  * verifies the list of dependencies for Hooks like useEffect and similar
3457
3482
  * @see https://github.com/facebook/react/issues/14920
3458
3483
  */
3459
3484
  'react-hooks/exhaustive-deps'?: Linter.RuleEntry<ReactHooksExhaustiveDeps>;
3485
+ /**
3486
+ * Validates usage of fbt
3487
+ */
3488
+ 'react-hooks/fbt'?: Linter.RuleEntry<ReactHooksFbt>;
3489
+ /**
3490
+ * Validates usage of `fire`
3491
+ */
3492
+ 'react-hooks/fire'?: Linter.RuleEntry<ReactHooksFire>;
3493
+ /**
3494
+ * Validates configuration of [gating mode](https://react.dev/reference/react-compiler/gating)
3495
+ */
3496
+ 'react-hooks/gating'?: Linter.RuleEntry<ReactHooksGating>;
3497
+ /**
3498
+ * Validates against assignment/mutation of globals during render, part of ensuring that [side effects must render outside of render](https://react.dev/reference/rules/components-and-hooks-must-be-pure#side-effects-must-run-outside-of-render)
3499
+ */
3500
+ 'react-hooks/globals'?: Linter.RuleEntry<ReactHooksGlobals>;
3501
+ /**
3502
+ * Validates the rules of hooks
3503
+ */
3504
+ 'react-hooks/hooks'?: Linter.RuleEntry<ReactHooksHooks>;
3505
+ /**
3506
+ * Validates against mutating props, state, and other values that [are immutable](https://react.dev/reference/rules/components-and-hooks-must-be-pure#props-and-state-are-immutable)
3507
+ */
3508
+ 'react-hooks/immutability'?: Linter.RuleEntry<ReactHooksImmutability>;
3509
+ /**
3510
+ * Validates against usage of libraries which are incompatible with memoization (manual or automatic)
3511
+ */
3512
+ 'react-hooks/incompatible-library'?: Linter.RuleEntry<ReactHooksIncompatibleLibrary>;
3513
+ /**
3514
+ * Internal invariants
3515
+ */
3516
+ 'react-hooks/invariant'?: Linter.RuleEntry<ReactHooksInvariant>;
3517
+ /**
3518
+ * Validates that effect dependencies are memoized
3519
+ */
3520
+ 'react-hooks/memoized-effect-dependencies'?: Linter.RuleEntry<ReactHooksMemoizedEffectDependencies>;
3521
+ /**
3522
+ * Validates against deriving values from state in an effect
3523
+ */
3524
+ 'react-hooks/no-deriving-state-in-effects'?: Linter.RuleEntry<ReactHooksNoDerivingStateInEffects>;
3525
+ /**
3526
+ * Validates that existing manual memoized is preserved by the compiler. React Compiler will only compile components and hooks if its inference [matches or exceeds the existing manual memoization](https://react.dev/learn/react-compiler/introduction#what-should-i-do-about-usememo-usecallback-and-reactmemo)
3527
+ */
3528
+ 'react-hooks/preserve-manual-memoization'?: Linter.RuleEntry<ReactHooksPreserveManualMemoization>;
3529
+ /**
3530
+ * Validates that [components/hooks are pure](https://react.dev/reference/rules/components-and-hooks-must-be-pure) by checking that they do not call known-impure functions
3531
+ */
3532
+ 'react-hooks/purity'?: Linter.RuleEntry<ReactHooksPurity>;
3533
+ /**
3534
+ * Validates correct usage of refs, not reading/writing during render. See the "pitfalls" section in [`useRef()` usage](https://react.dev/reference/react/useRef#usage)
3535
+ */
3536
+ 'react-hooks/refs'?: Linter.RuleEntry<ReactHooksRefs>;
3537
+ /**
3538
+ * Validates against suppression of other rules
3539
+ */
3540
+ 'react-hooks/rule-suppression'?: Linter.RuleEntry<ReactHooksRuleSuppression>;
3460
3541
  /**
3461
3542
  * enforces the Rules of Hooks
3462
- * @see https://reactjs.org/docs/hooks-rules.html
3543
+ * @see https://react.dev/reference/rules/rules-of-hooks
3544
+ */
3545
+ 'react-hooks/rules-of-hooks'?: Linter.RuleEntry<ReactHooksRulesOfHooks>;
3546
+ /**
3547
+ * Validates against calling setState synchronously in an effect, which can lead to re-renders that degrade performance
3463
3548
  */
3464
- 'react-hooks/rules-of-hooks'?: Linter.RuleEntry<[]>;
3549
+ 'react-hooks/set-state-in-effect'?: Linter.RuleEntry<ReactHooksSetStateInEffect>;
3550
+ /**
3551
+ * Validates against setting state during render, which can trigger additional renders and potential infinite render loops
3552
+ */
3553
+ 'react-hooks/set-state-in-render'?: Linter.RuleEntry<ReactHooksSetStateInRender>;
3554
+ /**
3555
+ * Validates that components are static, not recreated every render. Components that are recreated dynamically can reset state and trigger excessive re-rendering
3556
+ */
3557
+ 'react-hooks/static-components'?: Linter.RuleEntry<ReactHooksStaticComponents>;
3558
+ /**
3559
+ * Validates against invalid syntax
3560
+ */
3561
+ 'react-hooks/syntax'?: Linter.RuleEntry<ReactHooksSyntax>;
3562
+ /**
3563
+ * Unimplemented features
3564
+ */
3565
+ 'react-hooks/todo'?: Linter.RuleEntry<ReactHooksTodo>;
3566
+ /**
3567
+ * Validates against syntax that we do not plan to support in React Compiler
3568
+ */
3569
+ 'react-hooks/unsupported-syntax'?: Linter.RuleEntry<ReactHooksUnsupportedSyntax>;
3570
+ /**
3571
+ * Validates usage of the useMemo() hook against common mistakes. See [`useMemo()` docs](https://react.dev/reference/react/useMemo) for more information.
3572
+ */
3573
+ 'react-hooks/use-memo'?: Linter.RuleEntry<ReactHooksUseMemo>;
3465
3574
  /**
3466
3575
  * Enforces naming conventions for components.
3467
3576
  * @see https://eslint-react.xyz/docs/rules/naming-convention-component-name
@@ -7780,6 +7889,12 @@ type Curly = ([] | ["all"] | [] | [("multi" | "multi-line" | "multi-or-nest")] |
7780
7889
  type DefaultCase = [] | [{
7781
7890
  commentPattern?: string;
7782
7891
  }];
7892
+ // ----- depend/ban-dependencies -----
7893
+ type DependBanDependencies = [] | [{
7894
+ presets?: string[];
7895
+ modules?: string[];
7896
+ allowed?: string[];
7897
+ }];
7783
7898
  // ----- dot-location -----
7784
7899
  type DotLocation = [] | [("object" | "property")];
7785
7900
  // ----- dot-notation -----
@@ -9718,12 +9833,14 @@ type NoRestrictedImports = ((string | {
9718
9833
  message?: string;
9719
9834
  importNames?: string[];
9720
9835
  allowImportNames?: string[];
9836
+ allowTypeImports?: boolean;
9721
9837
  })[] | [] | [{
9722
9838
  paths?: (string | {
9723
9839
  name: string;
9724
9840
  message?: string;
9725
9841
  importNames?: string[];
9726
9842
  allowImportNames?: string[];
9843
+ allowTypeImports?: boolean;
9727
9844
  })[];
9728
9845
  patterns?: (string[] | ({
9729
9846
  [k: string]: unknown | undefined;
@@ -10363,10 +10480,120 @@ type ReactExtraNoForbiddenProps = [] | [{
10363
10480
  type ReactExtraNoUselessFragment = [] | [{
10364
10481
  allowExpressions?: boolean;
10365
10482
  }];
10483
+ // ----- react-hooks/automatic-effect-dependencies -----
10484
+ type ReactHooksAutomaticEffectDependencies = [] | [{
10485
+ [k: string]: unknown | undefined;
10486
+ }];
10487
+ // ----- react-hooks/capitalized-calls -----
10488
+ type ReactHooksCapitalizedCalls = [] | [{
10489
+ [k: string]: unknown | undefined;
10490
+ }];
10491
+ // ----- react-hooks/component-hook-factories -----
10492
+ type ReactHooksComponentHookFactories = [] | [{
10493
+ [k: string]: unknown | undefined;
10494
+ }];
10495
+ // ----- react-hooks/config -----
10496
+ type ReactHooksConfig = [] | [{
10497
+ [k: string]: unknown | undefined;
10498
+ }];
10499
+ // ----- react-hooks/error-boundaries -----
10500
+ type ReactHooksErrorBoundaries = [] | [{
10501
+ [k: string]: unknown | undefined;
10502
+ }];
10366
10503
  // ----- react-hooks/exhaustive-deps -----
10367
10504
  type ReactHooksExhaustiveDeps = [] | [{
10368
10505
  additionalHooks?: string;
10369
10506
  enableDangerousAutofixThisMayCauseInfiniteLoops?: boolean;
10507
+ experimental_autoDependenciesHooks?: string[];
10508
+ requireExplicitEffectDeps?: boolean;
10509
+ }];
10510
+ // ----- react-hooks/fbt -----
10511
+ type ReactHooksFbt = [] | [{
10512
+ [k: string]: unknown | undefined;
10513
+ }];
10514
+ // ----- react-hooks/fire -----
10515
+ type ReactHooksFire = [] | [{
10516
+ [k: string]: unknown | undefined;
10517
+ }];
10518
+ // ----- react-hooks/gating -----
10519
+ type ReactHooksGating = [] | [{
10520
+ [k: string]: unknown | undefined;
10521
+ }];
10522
+ // ----- react-hooks/globals -----
10523
+ type ReactHooksGlobals = [] | [{
10524
+ [k: string]: unknown | undefined;
10525
+ }];
10526
+ // ----- react-hooks/hooks -----
10527
+ type ReactHooksHooks = [] | [{
10528
+ [k: string]: unknown | undefined;
10529
+ }];
10530
+ // ----- react-hooks/immutability -----
10531
+ type ReactHooksImmutability = [] | [{
10532
+ [k: string]: unknown | undefined;
10533
+ }];
10534
+ // ----- react-hooks/incompatible-library -----
10535
+ type ReactHooksIncompatibleLibrary = [] | [{
10536
+ [k: string]: unknown | undefined;
10537
+ }];
10538
+ // ----- react-hooks/invariant -----
10539
+ type ReactHooksInvariant = [] | [{
10540
+ [k: string]: unknown | undefined;
10541
+ }];
10542
+ // ----- react-hooks/memoized-effect-dependencies -----
10543
+ type ReactHooksMemoizedEffectDependencies = [] | [{
10544
+ [k: string]: unknown | undefined;
10545
+ }];
10546
+ // ----- react-hooks/no-deriving-state-in-effects -----
10547
+ type ReactHooksNoDerivingStateInEffects = [] | [{
10548
+ [k: string]: unknown | undefined;
10549
+ }];
10550
+ // ----- react-hooks/preserve-manual-memoization -----
10551
+ type ReactHooksPreserveManualMemoization = [] | [{
10552
+ [k: string]: unknown | undefined;
10553
+ }];
10554
+ // ----- react-hooks/purity -----
10555
+ type ReactHooksPurity = [] | [{
10556
+ [k: string]: unknown | undefined;
10557
+ }];
10558
+ // ----- react-hooks/refs -----
10559
+ type ReactHooksRefs = [] | [{
10560
+ [k: string]: unknown | undefined;
10561
+ }];
10562
+ // ----- react-hooks/rule-suppression -----
10563
+ type ReactHooksRuleSuppression = [] | [{
10564
+ [k: string]: unknown | undefined;
10565
+ }];
10566
+ // ----- react-hooks/rules-of-hooks -----
10567
+ type ReactHooksRulesOfHooks = [] | [{
10568
+ additionalHooks?: string;
10569
+ }];
10570
+ // ----- react-hooks/set-state-in-effect -----
10571
+ type ReactHooksSetStateInEffect = [] | [{
10572
+ [k: string]: unknown | undefined;
10573
+ }];
10574
+ // ----- react-hooks/set-state-in-render -----
10575
+ type ReactHooksSetStateInRender = [] | [{
10576
+ [k: string]: unknown | undefined;
10577
+ }];
10578
+ // ----- react-hooks/static-components -----
10579
+ type ReactHooksStaticComponents = [] | [{
10580
+ [k: string]: unknown | undefined;
10581
+ }];
10582
+ // ----- react-hooks/syntax -----
10583
+ type ReactHooksSyntax = [] | [{
10584
+ [k: string]: unknown | undefined;
10585
+ }];
10586
+ // ----- react-hooks/todo -----
10587
+ type ReactHooksTodo = [] | [{
10588
+ [k: string]: unknown | undefined;
10589
+ }];
10590
+ // ----- react-hooks/unsupported-syntax -----
10591
+ type ReactHooksUnsupportedSyntax = [] | [{
10592
+ [k: string]: unknown | undefined;
10593
+ }];
10594
+ // ----- react-hooks/use-memo -----
10595
+ type ReactHooksUseMemo = [] | [{
10596
+ [k: string]: unknown | undefined;
10370
10597
  }];
10371
10598
  // ----- react-naming-convention/component-name -----
10372
10599
  type ReactNamingConventionComponentName = [] | [(("PascalCase" | "CONSTANT_CASE") | {
@@ -13399,7 +13626,7 @@ type Yoda = [] | [("always" | "never")] | [("always" | "never"), {
13399
13626
  onlyEquality?: boolean;
13400
13627
  }];
13401
13628
  // Names of all the configs
13402
- type ConfigNames = '2digits:antfu' | '2digits:boolean' | '2digits:comments' | '2digits:css' | '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' | '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';
13629
+ 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' | '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';
13403
13630
  //#endregion
13404
13631
  //#region src/types.d.ts
13405
13632
  type Rules = RuleOptions;
@@ -13490,6 +13717,7 @@ interface ESLint2DigitsOptions {
13490
13717
  storybook?: SharedOptions<OptionsWithStorybook> | boolean;
13491
13718
  tanstack?: SharedOptions<OptionsOverrides> | boolean;
13492
13719
  drizzle?: SharedOptions<OptionsWithDrizzle> | boolean;
13720
+ depend?: SharedOptions | boolean;
13493
13721
  }
13494
13722
  declare function twoDigits(options?: ESLint2DigitsOptions, ...userConfig: Array<TypedFlatConfigItem>): Promise<Array<TypedFlatConfigItem>>;
13495
13723
  //#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{findUp as r}from"find-up";import{getPackageInfo as i,isPackageExists as a}from"local-pkg";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{fixupPluginRules as p}from"@eslint/compat";import m from"eslint-plugin-github-action";import h from"yaml-eslint-parser";import g from"eslint-config-flat-gitignore";import ee from"@eslint/js";import te from"@stylistic/eslint-plugin";import _ from"globals";import ne from"eslint-plugin-jsdoc";import re,{configs as v}from"eslint-plugin-jsonc";import ie from"jsonc-eslint-parser";import y from"@eslint/markdown";import{mergeProcessors as ae,processorPassThrough as oe}from"eslint-merge-processors";import b from"eslint-plugin-n";import x from"eslint-plugin-regexp";import se from"eslint-plugin-sonarjs";import S from"eslint-plugin-unicorn";import ce from"eslint-plugin-yml";const C=`**/*.?([cm])[jt]s?(x)`,w=`**/*.?([cm])ts`,T=`**/*.?([cm])tsx`,E=`.github/workflows/*.y?(a)ml`,D=`**/*.md`,O=`${D}/${C}`,k=`**/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 A(){return[{files:[C],name:`2digits:antfu`,plugins:{antfu:o},rules:{"antfu/if-newline":`error`,"antfu/top-level-function":`error`}}]}function j(){return[{files:[C],name:`2digits:boolean`,plugins:{boolean:s},rules:{...s.configs.recommended.rules}}]}const M={"@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`,"@2digits":`@2digits`,"@graphql-eslint":`gql`,sonarjs:`sonar`,drizzle:`drizzle`,"de-morgan":`boolean`},N=n(l.recommended.rules,M);function P(){return[{files:[C],name:`2digits:comments`,plugins:{comments:c},rules:{...N,"comments/no-unused-disable":`error`,"comments/disable-enable-pair":[`error`,{allowWholeFile:!0}]}}]}async function F(e){if(e?.customSyntax)return e.customSyntax;if(e?.tailwindMajor===3)return d;if(e?.tailwindMajor===4)return f;try{let e=(await i(`tailwindcss`))?.version??``,t=Number.parseInt(e.split(`.`)[0]||`0`,10);if(Number.isFinite(t)&&t>=4)return f}catch{}return d}async function I(e={}){let t=await F(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}}]}async function L(e){let t=await e;return t.default||t}async function R(e={}){let{overrides:t={},drizzleObjectName:n=[`drizzle`,`db`]}=e,r=await L(import(`eslint-plugin-drizzle`));return[{files:[C],name:`2digits:drizzle`,plugins:{drizzle:p(r)},rules:{"drizzle/enforce-update-with-where":[`error`,{drizzleObjectName:n}],"drizzle/enforce-delete-with-where":[`error`,{drizzleObjectName:n}],...t}}]}const z=Object.fromEntries(m.configs.recommended.flatMap(({rules:e})=>Object.entries({...e})));function B(){return[{name:`2digits:github-actions/setup`,plugins:{"github-action":m}},{name:`2digits:github-actions/recommended`,files:[E],ignores:[`!**/${E}`],languageOptions:{parser:h},rules:{...z}}]}async function V(e={}){let{overrides:t={},files:r=[`**/*.graphql`,`**/*.gql`]}=e,[i,a]=await Promise.all([L(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,M);return[{name:`2digits:graphql`,plugins:{gql:i},languageOptions:{parser:i.parser},files:r,rules:{...c,"gql/naming-convention":[`error`,{allowLeadingUnderscore:!0}],...t}}]}function H(e={}){let{gitIgnore:t,ignores:n=[]}=e;return[{ignores:[k,n].flat(),name:`2digits:ignores`},g({strict:!1,...t,name:`2digits:gitignore`})]}function U(e={}){let{overrides:t={}}=e;return[{files:[C],name:`2digits:javascript`,plugins:{stylistic:te},languageOptions:{ecmaVersion:2022,globals:{..._.browser,..._.es2021,..._.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 W(){return[{files:[C],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 G(){return[...v[`flat/base`].map(e=>({...e,name:`2digits:jsonc/base`})),{name:`2digits:jsonc/json`,files:[`**/*.json`],...K,rules:{...q(v[`flat/recommended-with-json`])}},{name:`2digits:jsonc/jsonc`,files:[`**/*.jsonc`],...K,rules:{...q(v[`flat/recommended-with-jsonc`])}},{name:`2digits:jsonc/json5`,files:[`**/*.json5`],...K,rules:{...q(v[`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$`}]}},...v[`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=[D];function le(){return[{name:`2digits:markdown/setup`,plugins:{markdown:y}},{name:`2digits:markdown/processor`,files:J,language:`markdown/gfm`,ignores:[`**/*.md/*.md`],processor:ae([y.processors.markdown,oe])},{name:`2digits:markdown/parser`,files:J,language:`markdown/gfm`,languageOptions:{parser:ue}},{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:[O],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 ue={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 de(e={}){let{files:t=[w,T],overrides:r={},parserOptions:i}=e,[a,o]=await Promise.all([L(import(`@next/eslint-plugin-next`)),L(import(`@typescript-eslint/parser`))]),s=n({...a.configs.recommended.rules,...a.configs[`core-web-vitals`].rules},M);return[{name:`2digits:next/setup`,plugins:{next:p(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 fe(){return[{files:[C],name:`2digits:node`,settings:{node:{version:`>= 22.0.0`}},plugins:{node:b},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 pe(){let e=await L(import(`eslint-plugin-pnpm`));return[{name:`2digits:pnpm/package-json`,files:[`package.json`,`**/package.json`],languageOptions:{parser:await L(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 L(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 me(){let[e,t]=await Promise.all([L(import(`eslint-config-prettier`)),L(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 he(e={}){let{files:t=[w,T],overrides:r={},parserOptions:i,tsconfigRootDir:a,reactCompiler:o=!0}=e,[s,c,l,u,d]=await Promise.all([L(import(`@eslint-react/eslint-plugin`)),L(import(`eslint-plugin-react-hooks`)),L(import(`@typescript-eslint/parser`)),o?L(import(`eslint-plugin-react-compiler`)):Promise.resolve(void 0),L(import(`@stylistic/eslint-plugin`))]),f=s.configs.all.plugins,p=n({...c.configs[`recommended-latest`].rules,...s.configs[`disable-conflict-eslint-plugin-react`].rules,...s.configs[`recommended-type-checked`].rules},M);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`,...r}}]}function ge(){return[{files:[C],name:`2digits:regexp`,plugins:{regexp:x},rules:{...x.configs[`flat/recommended`].rules}}]}function _e(){return[{files:[C],name:`2digits:sonar`,plugins:{sonar:se},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 Y(e={}){let{files:t=[`**/*.stories.tsx`],overrides:n={},parserOptions:r,storybookDirectory:i=`.storybook`}=e,[a,o]=await Promise.all([L(import(`eslint-plugin-storybook`)),L(import(`@typescript-eslint/parser`))]),s={parser:o,parserOptions:{ecmaFeatures:{jsx:!0},projectService:!0,...r},sourceType:`module`};return[{name:`2digits:storybook/setup`,plugins:{storybook:p(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`,...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 ve(e={}){let{overrides:t={}}=e,[n,{tailwindFunctions:i},a]=await Promise.all([L(import(`eslint-plugin-tailwindcss`)),L(import(`@2digits/constants`)),r([`tailwind.config.ts`,`tailwind.config.js`])]);return[{files:[C],name:`2digits:tailwind`,plugins:{tailwindcss:n},settings:{tailwindcss:{callees:i,config:a}},rules:{...n.configs.recommended.rules,...t}}]}async function ye(e={}){let{overrides:t={}}=e,r=await L(import(`@tanstack/eslint-plugin-query`)),i=n(r.configs[`flat/recommended`].at(0)?.rules??{},M);return[{files:[C],name:`2digits:tanstack`,plugins:{tanstack:r},rules:{...i,...t}}]}async function be(e={}){let{overrides:t={}}=e,n=await L(import(`eslint-plugin-turbo`));return[{files:[C],name:`2digits:turbo`,plugins:{turbo:n},rules:{"turbo/no-undeclared-env-vars":`error`,...t}}]}async function xe(e={}){let{overrides:n={},parserOptions:r={}}=e,[{plugin:i,configs:a,parser:o},s]=await Promise.all([L(import(`typescript-eslint`)),L(import(`@2digits/eslint-plugin`))]),c=t(a.strictTypeChecked,M),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:[C],ignores:[O],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:[O],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:[O],rules:{"no-unused-expressions":`off`}},{name:`2digits:typescript/disables/cjs`,files:[`**/*.js`,`**/*.cjs`,`**/*.cts`],ignores:[O],rules:{"ts/no-require-imports":`off`,"ts/no-var-requires":`off`}}]}function Se(){return[{files:[C],name:`2digits:unicorn`,plugins:{unicorn:S},rules:{...S.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 Ce(){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:h}};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 i;t.pnpm===void 0&&(i=r(`pnpm-workspace.yaml`));let o=new e(H(t.ignores),U(t.js),j(),fe(),P(),W(),Se(),_e(),ge(),A(),G(),Ce(),le(),B());Z(t.css)&&(o=o.append(I(Q(t.css)))),Z(t.turbo,a(`turbo`))&&(o=o.append(be(Q(t.turbo))));let{overrides:s,...c}=Q(t.ts);return Z(t.ts,a(`typescript`))&&(o=o.append(xe(Q(t.ts)))),Z(t.react,a(`react`))&&(o=o.append(he({...Q(t.react),...c}))),Z(t.next,a(`next`))&&(o=o.append(de({...Q(t.next),...c}))),Z(t.storybook,a(`storybook`))&&(o=o.append(Y({...Q(t.storybook),...c}))),Z(t.tailwind,a(`tailwindcss`))&&(o=o.append(ve(Q(t.tailwind)))),Z(t.tanstack,a(`react-query`)||a(`@tanstack/react-query`)||a(`@tanstack/react-query-devtools`))&&(o=o.append(ye(Q(t.tanstack)))),Z(t.drizzle,a(`drizzle-kit`)||a(`drizzle-orm`))&&(o=o.append(R(Q(t.drizzle)))),Z(t.graphql,a(`graphql`))&&(o=o.append(V(Q(t.graphql)))),Z(t.pnpm,!!await i)&&(o=o.append(pe())),o=o.append(...n),a(`prettier`)&&(o=o.append(me())),o.renamePlugins(M).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`,"@2digits":`@2digits`,"@graphql-eslint":`gql`,sonarjs:`sonar`,drizzle:`drizzle`,"de-morgan":`boolean`},F=n(l.recommended.rules,P);function I(){return[{files:[T],name:`2digits:comments`,plugins:{comments:c},rules:{...F,"comments/no-unused-disable":`error`,"comments/disable-enable-pair":[`error`,{allowWholeFile:!0}]}}]}async function L(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 R(e={}){let t=await L(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 z(){return[{files:[T],name:`2digits:depend`,plugins:{depend:p},rules:{"depend/ban-dependencies":`warn`}}]}async function B(e){let t=await e;return t.default||t}async function V(e={}){let{overrides:t={},drizzleObjectName:n=[`drizzle`,`db`]}=e,r=await B(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 H=Object.fromEntries(h.configs.recommended.flatMap(({rules:e})=>Object.entries({...e})));function U(){return[{name:`2digits:github-actions/setup`,plugins:{"github-action":h}},{name:`2digits:github-actions/recommended`,files:[O],ignores:[`!**/${O}`],languageOptions:{parser:g},rules:{...H}}]}async function W(e={}){let{overrides:t={},files:r=[`**/*.graphql`,`**/*.gql`]}=e,[i,a]=await Promise.all([B(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 G(e={}){let{gitIgnore:t,ignores:n=[]}=e;return[{ignores:[j,n].flat(),name:`2digits:ignores`},_({strict:!1,...t,name:`2digits:gitignore`})]}function le(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 ue(){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 de(){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 fe(){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:pe}},{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 pe={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 me(e={}){let{files:t=[E,D],overrides:r={},parserOptions:i}=e,[a,o]=await Promise.all([B(import(`@next/eslint-plugin-next`)),B(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 he(){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 ge(){let e=await B(import(`eslint-plugin-pnpm`));return[{name:`2digits:pnpm/package-json`,files:[`package.json`,`**/package.json`],languageOptions:{parser:await B(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 B(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 _e(){let[e,t]=await Promise.all([B(import(`eslint-config-prettier`)),B(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 ve(e={}){let{files:t=[E,D],overrides:r={},parserOptions:i,tsconfigRootDir:a,reactCompiler:o=!0}=e,[s,c,l,u,d]=await Promise.all([B(import(`@eslint-react/eslint-plugin`)),B(import(`eslint-plugin-react-hooks`)),B(import(`@typescript-eslint/parser`)),o?B(import(`eslint-plugin-react-compiler`)):Promise.resolve(void 0),B(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 ye(){return[{files:[T],name:`2digits:regexp`,plugins:{regexp:x},rules:{...x.configs[`flat/recommended`].rules}}]}function be(){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 xe(e={}){let{files:t=[`**/*.stories.tsx`],overrides:n={},parserOptions:r,storybookDirectory:i=`.storybook`}=e,[a,o]=await Promise.all([B(import(`eslint-plugin-storybook`)),B(import(`@typescript-eslint/parser`))]),s={parser:o,parserOptions:{ecmaFeatures:{jsx:!0},projectService:!0,...r},sourceType:`module`};return[{name:`2digits:storybook/setup`,plugins:{storybook:m(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`,...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 Se(e={}){let{overrides:t={}}=e,[n,{tailwindFunctions:r},i]=await Promise.all([B(import(`eslint-plugin-tailwindcss`)),B(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 Ce(e={}){let{overrides:t={}}=e,r=await B(import(`@tanstack/eslint-plugin-query`)),i=n(r.configs[`flat/recommended`].at(0)?.rules??{},P);return[{files:[T],name:`2digits:tanstack`,plugins:{tanstack:r},rules:{...i,...t}}]}async function we(e={}){let{overrides:t={}}=e,n=await B(import(`eslint-plugin-turbo`));return[{files:[T],name:`2digits:turbo`,plugins:{turbo:n},rules:{"turbo/no-undeclared-env-vars":`error`,...t}}]}async function Y(e={}){let{overrides:n={},parserOptions:r={}}=e,[{plugin:i,configs:a,parser:o},s]=await Promise.all([B(import(`typescript-eslint`)),B(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 Te(){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 Ee(){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}};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(G(t.ignores),le(t.js),N(),he(),I(),ue(),Te(),be(),ye(),M(),de(),Ee(),fe(),U());Z(t.css)&&(o=o.append(R(Q(t.css)))),Z(t.depend,!0)&&(o=o.append(z())),Z(t.turbo,i(`turbo`))&&(o=o.append(we(Q(t.turbo))));let{overrides:s,...c}=Q(t.ts);return Z(t.ts,i(`typescript`))&&(o=o.append(Y(Q(t.ts)))),Z(t.react,i(`react`))&&(o=o.append(ve({...Q(t.react),...c}))),Z(t.next,i(`next`))&&(o=o.append(me({...Q(t.next),...c}))),Z(t.storybook,i(`storybook`))&&(o=o.append(xe({...Q(t.storybook),...c}))),Z(t.tailwind,i(`tailwindcss`))&&(o=o.append(Se(Q(t.tailwind)))),Z(t.tanstack,i(`react-query`)||i(`@tanstack/react-query`)||i(`@tanstack/react-query-devtools`))&&(o=o.append(Ce(Q(t.tanstack)))),Z(t.drizzle,i(`drizzle-kit`)||i(`drizzle-orm`))&&(o=o.append(V(Q(t.drizzle)))),Z(t.graphql,i(`graphql`))&&(o=o.append(W(Q(t.graphql)))),Z(t.pnpm,!!await r)&&(o=o.append(ge())),o=o.append(...n),i(`prettier`)&&(o=o.append(_e())),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.8.11",
3
+ "version": "4.9.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,10 +27,10 @@
27
27
  "public": true,
28
28
  "dependencies": {
29
29
  "@eslint-community/eslint-plugin-eslint-comments": "4.5.0",
30
- "@eslint-react/eslint-plugin": "2.0.4",
30
+ "@eslint-react/eslint-plugin": "2.0.6",
31
31
  "@eslint/compat": "1.4.0",
32
32
  "@eslint/css": "0.11.1",
33
- "@eslint/js": "9.36.0",
33
+ "@eslint/js": "9.37.0",
34
34
  "@eslint/markdown": "7.3.0",
35
35
  "@graphql-eslint/eslint-plugin": "4.4.0",
36
36
  "@next/eslint-plugin-next": "15.5.4",
@@ -38,46 +38,48 @@
38
38
  "@tanstack/eslint-plugin-query": "5.91.0",
39
39
  "@typescript-eslint/parser": "8.45.0",
40
40
  "@typescript-eslint/utils": "8.45.0",
41
+ "empathic": "2.0.0",
41
42
  "eslint-config-flat-gitignore": "2.1.0",
42
43
  "eslint-config-prettier": "10.1.8",
43
44
  "eslint-flat-config-utils": "2.1.4",
44
45
  "eslint-merge-processors": "2.0.0",
45
46
  "eslint-plugin-antfu": "3.1.1",
46
47
  "eslint-plugin-de-morgan": "2.0.0",
48
+ "eslint-plugin-depend": "1.3.1",
47
49
  "eslint-plugin-drizzle": "0.2.3",
48
50
  "eslint-plugin-github-action": "0.0.16",
49
- "eslint-plugin-jsdoc": "60.7.0",
50
- "eslint-plugin-jsonc": "2.20.1",
51
+ "eslint-plugin-jsdoc": "60.8.1",
52
+ "eslint-plugin-jsonc": "2.21.0",
51
53
  "eslint-plugin-n": "17.23.1",
52
54
  "eslint-plugin-pnpm": "1.2.0",
53
55
  "eslint-plugin-react-compiler": "19.1.0-rc.2",
54
- "eslint-plugin-react-hooks": "5.2.0",
56
+ "eslint-plugin-react-hooks": "6.1.1",
55
57
  "eslint-plugin-regexp": "2.10.0",
56
58
  "eslint-plugin-sonarjs": "3.0.5",
57
59
  "eslint-plugin-storybook": "9.1.10",
58
60
  "eslint-plugin-tailwindcss": "3.18.2",
59
61
  "eslint-plugin-turbo": "2.5.8",
60
62
  "eslint-plugin-unicorn": "61.0.2",
61
- "eslint-plugin-yml": "1.18.0",
62
- "find-up": "8.0.0",
63
+ "eslint-plugin-yml": "1.19.0",
63
64
  "globals": "16.4.0",
64
65
  "graphql-config": "5.1.5",
65
66
  "jsonc-eslint-parser": "2.4.1",
66
67
  "local-pkg": "1.1.2",
68
+ "pkg-types": "2.3.0",
67
69
  "tailwind-csstree": "0.1.4",
68
70
  "typescript-eslint": "8.45.0",
69
71
  "yaml-eslint-parser": "1.3.0",
70
72
  "@2digits/constants": "1.1.10",
71
- "@2digits/eslint-plugin": "3.1.24"
73
+ "@2digits/eslint-plugin": "3.1.25"
72
74
  },
73
75
  "devDependencies": {
74
76
  "@eslint/config-inspector": "1.3.0",
75
- "@types/react": "19.1.17",
77
+ "@types/react": "19.2.0",
76
78
  "dedent": "1.7.0",
77
- "eslint": "9.36.0",
79
+ "eslint": "9.37.0",
78
80
  "eslint-typegen": "2.3.0",
79
- "execa": "9.6.0",
80
- "react": "19.1.1",
81
+ "react": "19.2.0",
82
+ "tinyexec": "1.0.1",
81
83
  "tinyglobby": "0.2.15",
82
84
  "tsdown": "0.15.6",
83
85
  "typescript": "5.9.3",