@2digits/eslint-config 5.1.23 → 5.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -7,7 +7,6 @@ import { Linter } from "eslint";
7
7
  declare const PluginNameMap: {
8
8
  readonly '@next/next': "next";
9
9
  readonly '@eslint-react/naming-convention': "react-naming-convention";
10
- readonly '@eslint-react/hooks-extra': "react-hooks-extra";
11
10
  readonly '@eslint-react/dom': "react-dom";
12
11
  readonly '@eslint-react/web-api': "react-web-api";
13
12
  readonly '@eslint-react/rsc': "react-rsc";
@@ -3248,6 +3247,26 @@ interface RuleOptions {
3248
3247
  * @see https://eslint-react.xyz/docs/rules/dom-prefer-namespace-import
3249
3248
  */
3250
3249
  'react-dom/prefer-namespace-import'?: Linter.RuleEntry<[]>;
3250
+ /**
3251
+ * Disallows higher order functions that define components or hooks inside them.
3252
+ * @see https://eslint-react.xyz/docs/rules/component-hook-factories
3253
+ */
3254
+ 'react-extra/component-hook-factories'?: Linter.RuleEntry<[]>;
3255
+ /**
3256
+ * Validates usage of Error Boundaries instead of try/catch for errors in child components.
3257
+ * @see https://eslint-react.xyz/docs/rules/error-boundaries
3258
+ */
3259
+ 'react-extra/error-boundaries'?: Linter.RuleEntry<[]>;
3260
+ /**
3261
+ * Verifies the list of dependencies for Hooks like 'useEffect' and similar.
3262
+ * @see https://github.com/facebook/react/issues/14920
3263
+ */
3264
+ 'react-extra/exhaustive-deps'?: Linter.RuleEntry<ReactExtraExhaustiveDeps>;
3265
+ /**
3266
+ * Validates against mutating props, state, and other values that are immutable.
3267
+ * @see https://eslint-react.xyz/docs/rules/immutability
3268
+ */
3269
+ 'react-extra/immutability'?: Linter.RuleEntry<[]>;
3251
3270
  /**
3252
3271
  * Prevents unintentional '$' sign before expression.
3253
3272
  * @see https://eslint-react.xyz/docs/rules/jsx-dollar
@@ -3259,25 +3278,10 @@ interface RuleOptions {
3259
3278
  */
3260
3279
  'react-extra/jsx-key-before-spread'?: Linter.RuleEntry<[]>;
3261
3280
  /**
3262
- * Prevents comment strings (e.g., beginning with '//' or '/*') from being accidentally inserted into a JSX element's text nodes.
3281
+ * Prevents comment strings (ex: beginning with '//' or '/*') from being accidentally inserted into a JSX element's text nodes.
3263
3282
  * @see https://eslint-react.xyz/docs/rules/jsx-no-comment-textnodes
3264
3283
  */
3265
3284
  'react-extra/jsx-no-comment-textnodes'?: Linter.RuleEntry<[]>;
3266
- /**
3267
- * Disallows duplicate props in JSX elements.
3268
- * @see https://eslint-react.xyz/docs/rules/jsx-no-duplicate-props
3269
- */
3270
- 'react-extra/jsx-no-duplicate-props'?: Linter.RuleEntry<[]>;
3271
- /**
3272
- * Disallows immediately-invoked function expressions in JSX.
3273
- * @see https://eslint-react.xyz/docs/rules/jsx-no-iife
3274
- */
3275
- 'react-extra/jsx-no-iife'?: Linter.RuleEntry<[]>;
3276
- /**
3277
- * Prevents using variables in JSX that are not defined in the scope.
3278
- * @see https://eslint-react.xyz/docs/rules/jsx-no-undef
3279
- */
3280
- 'react-extra/jsx-no-undef'?: Linter.RuleEntry<[]>;
3281
3285
  /**
3282
3286
  * Enforces shorthand syntax for boolean props.
3283
3287
  * @see https://eslint-react.xyz/docs/rules/jsx-shorthand-boolean
@@ -3288,16 +3292,6 @@ interface RuleOptions {
3288
3292
  * @see https://eslint-react.xyz/docs/rules/jsx-shorthand-fragment
3289
3293
  */
3290
3294
  'react-extra/jsx-shorthand-fragment'?: Linter.RuleEntry<ReactExtraJsxShorthandFragment>;
3291
- /**
3292
- * Marks React variables as used when JSX is present.
3293
- * @see https://eslint-react.xyz/docs/rules/jsx-uses-react
3294
- */
3295
- 'react-extra/jsx-uses-react'?: Linter.RuleEntry<[]>;
3296
- /**
3297
- * Marks JSX element variables as used.
3298
- * @see https://eslint-react.xyz/docs/rules/jsx-uses-vars
3299
- */
3300
- 'react-extra/jsx-uses-vars'?: Linter.RuleEntry<[]>;
3301
3295
  /**
3302
3296
  * Disallows accessing 'this.state' inside 'setState' calls.
3303
3297
  * @see https://eslint-react.xyz/docs/rules/no-access-state-in-setstate
@@ -3373,11 +3367,6 @@ interface RuleOptions {
3373
3367
  * @see https://eslint-react.xyz/docs/rules/no-create-ref
3374
3368
  */
3375
3369
  'react-extra/no-create-ref'?: Linter.RuleEntry<[]>;
3376
- /**
3377
- * Disallows the 'defaultProps' property in favor of ES6 default parameters.
3378
- * @see https://eslint-react.xyz/docs/rules/no-default-props
3379
- */
3380
- 'react-extra/no-default-props'?: Linter.RuleEntry<[]>;
3381
3370
  /**
3382
3371
  * Disallows direct mutation of 'this.state'.
3383
3372
  * @see https://eslint-react.xyz/docs/rules/no-direct-mutation-state
@@ -3388,22 +3377,26 @@ interface RuleOptions {
3388
3377
  * @see https://eslint-react.xyz/docs/rules/no-duplicate-key
3389
3378
  */
3390
3379
  'react-extra/no-duplicate-key'?: Linter.RuleEntry<[]>;
3391
- /**
3392
- * Disallows certain props on components.
3393
- * @see https://eslint-react.xyz/docs/rules/no-forbidden-props
3394
- * @deprecated
3395
- */
3396
- 'react-extra/no-forbidden-props'?: Linter.RuleEntry<ReactExtraNoForbiddenProps>;
3397
3380
  /**
3398
3381
  * Replaces usage of 'forwardRef' with passing 'ref' as a prop.
3399
3382
  * @see https://eslint-react.xyz/docs/rules/no-forward-ref
3400
3383
  */
3401
3384
  'react-extra/no-forward-ref'?: Linter.RuleEntry<[]>;
3385
+ /**
3386
+ * Prevents implicitly passing the 'children' prop to components.
3387
+ * @see https://eslint-react.xyz/docs/rules/no-implicit-children
3388
+ */
3389
+ 'react-extra/no-implicit-children'?: Linter.RuleEntry<[]>;
3402
3390
  /**
3403
3391
  * Prevents implicitly passing the 'key' prop to components.
3404
3392
  * @see https://eslint-react.xyz/docs/rules/no-implicit-key
3405
3393
  */
3406
3394
  'react-extra/no-implicit-key'?: Linter.RuleEntry<[]>;
3395
+ /**
3396
+ * Prevents implicitly passing the 'ref' prop to components.
3397
+ * @see https://eslint-react.xyz/docs/rules/no-implicit-ref
3398
+ */
3399
+ 'react-extra/no-implicit-ref'?: Linter.RuleEntry<[]>;
3407
3400
  /**
3408
3401
  * Prevents problematic leaked values from being rendered.
3409
3402
  * @see https://eslint-react.xyz/docs/rules/no-leaked-conditional-rendering
@@ -3439,11 +3432,6 @@ interface RuleOptions {
3439
3432
  * @see https://eslint-react.xyz/docs/rules/no-nested-lazy-component-declarations
3440
3433
  */
3441
3434
  'react-extra/no-nested-lazy-component-declarations'?: Linter.RuleEntry<[]>;
3442
- /**
3443
- * Disallows 'propTypes' in favor of TypeScript or another type-checking solution.
3444
- * @see https://eslint-react.xyz/docs/rules/no-prop-types
3445
- */
3446
- 'react-extra/no-prop-types'?: Linter.RuleEntry<[]>;
3447
3435
  /**
3448
3436
  * Disallows 'shouldComponentUpdate' when extending 'React.PureComponent'.
3449
3437
  * @see https://eslint-react.xyz/docs/rules/no-redundant-should-component-update
@@ -3464,16 +3452,6 @@ interface RuleOptions {
3464
3452
  * @see https://eslint-react.xyz/docs/rules/no-set-state-in-component-will-update
3465
3453
  */
3466
3454
  'react-extra/no-set-state-in-component-will-update'?: Linter.RuleEntry<[]>;
3467
- /**
3468
- * Replaces string refs with callback refs.
3469
- * @see https://eslint-react.xyz/docs/rules/no-string-refs
3470
- */
3471
- 'react-extra/no-string-refs'?: Linter.RuleEntry<[]>;
3472
- /**
3473
- * Disallows unnecessary 'key' props on nested child elements when rendering lists.
3474
- * @see https://eslint-react.xyz/docs/rules/no-unnecessary-key
3475
- */
3476
- 'react-extra/no-unnecessary-key'?: Linter.RuleEntry<[]>;
3477
3455
  /**
3478
3456
  * Disallows unnecessary usage of 'useCallback'.
3479
3457
  * @see https://eslint-react.xyz/docs/rules/no-unnecessary-use-callback
@@ -3489,11 +3467,6 @@ interface RuleOptions {
3489
3467
  * @see https://eslint-react.xyz/docs/rules/no-unnecessary-use-prefix
3490
3468
  */
3491
3469
  'react-extra/no-unnecessary-use-prefix'?: Linter.RuleEntry<[]>;
3492
- /**
3493
- * Disallows unnecessary usage of 'useRef'.
3494
- * @see https://eslint-react.xyz/docs/rules/no-unnecessary-use-ref
3495
- */
3496
- 'react-extra/no-unnecessary-use-ref'?: Linter.RuleEntry<[]>;
3497
3470
  /**
3498
3471
  * Warns about the use of 'UNSAFE_componentWillMount' in class components.
3499
3472
  * @see https://eslint-react.xyz/docs/rules/no-unsafe-component-will-mount
@@ -3539,11 +3512,6 @@ interface RuleOptions {
3539
3512
  * @see https://eslint-react.xyz/docs/rules/no-use-context
3540
3513
  */
3541
3514
  'react-extra/no-use-context'?: Linter.RuleEntry<[]>;
3542
- /**
3543
- * Disallows useless 'forwardRef' calls on components that don't use 'ref's.
3544
- * @see https://eslint-react.xyz/docs/rules/no-useless-forward-ref
3545
- */
3546
- 'react-extra/no-useless-forward-ref'?: Linter.RuleEntry<[]>;
3547
3515
  /**
3548
3516
  * Disallows useless fragment elements.
3549
3517
  * @see https://eslint-react.xyz/docs/rules/no-useless-fragment
@@ -3560,158 +3528,60 @@ interface RuleOptions {
3560
3528
  */
3561
3529
  'react-extra/prefer-namespace-import'?: Linter.RuleEntry<[]>;
3562
3530
  /**
3563
- * Enforces read-only props in components.
3564
- * @see https://eslint-react.xyz/docs/rules/prefer-read-only-props
3565
- */
3566
- 'react-extra/prefer-read-only-props'?: Linter.RuleEntry<[]>;
3567
- /**
3568
- * Enforces wrapping function calls made inside 'useState' in an 'initializer function'.
3569
- * @see https://eslint-react.xyz/docs/rules/prefer-use-state-lazy-initialization
3570
- */
3571
- 'react-extra/prefer-use-state-lazy-initialization'?: Linter.RuleEntry<[]>;
3572
- /**
3573
- * Disallows direct calls to the ['set' function](https://react.dev/reference/react/useState#setstate) of 'useState' in 'useEffect'.
3574
- * @see https://eslint-react.xyz/docs/rules/hooks-extra-no-direct-set-state-in-use-effect
3575
- */
3576
- 'react-hooks-extra/no-direct-set-state-in-use-effect'?: Linter.RuleEntry<[]>;
3577
- /**
3578
- * Verifies that automatic effect dependencies are compiled if opted-in
3579
- */
3580
- 'react-hooks/automatic-effect-dependencies'?: Linter.RuleEntry<ReactHooksAutomaticEffectDependencies>;
3581
- /**
3582
- * Validates against calling capitalized functions/methods instead of using JSX
3583
- */
3584
- 'react-hooks/capitalized-calls'?: Linter.RuleEntry<ReactHooksCapitalizedCalls>;
3585
- /**
3586
- * Validates against higher order functions defining nested components or hooks. Components and hooks should be defined at the module level
3587
- */
3588
- 'react-hooks/component-hook-factories'?: Linter.RuleEntry<ReactHooksComponentHookFactories>;
3589
- /**
3590
- * Validates the compiler configuration options
3591
- */
3592
- 'react-hooks/config'?: Linter.RuleEntry<ReactHooksConfig>;
3593
- /**
3594
- * Validates usage of error boundaries instead of try/catch for errors in child components
3595
- */
3596
- 'react-hooks/error-boundaries'?: Linter.RuleEntry<ReactHooksErrorBoundaries>;
3597
- /**
3598
- * verifies the list of dependencies for Hooks like useEffect and similar
3599
- * @see https://github.com/facebook/react/issues/14920
3600
- */
3601
- 'react-hooks/exhaustive-deps'?: Linter.RuleEntry<ReactHooksExhaustiveDeps>;
3602
- /**
3603
- * Validates usage of fbt
3604
- */
3605
- 'react-hooks/fbt'?: Linter.RuleEntry<ReactHooksFbt>;
3606
- /**
3607
- * Validates usage of `fire`
3608
- */
3609
- 'react-hooks/fire'?: Linter.RuleEntry<ReactHooksFire>;
3610
- /**
3611
- * Validates configuration of [gating mode](https://react.dev/reference/react-compiler/gating)
3612
- */
3613
- 'react-hooks/gating'?: Linter.RuleEntry<ReactHooksGating>;
3614
- /**
3615
- * 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)
3616
- */
3617
- 'react-hooks/globals'?: Linter.RuleEntry<ReactHooksGlobals>;
3618
- /**
3619
- * Validates the rules of hooks
3531
+ * Validates that components and hooks are pure by checking that they do not call known-impure functions during render.
3532
+ * @see https://eslint-react.xyz/docs/rules/purity
3620
3533
  */
3621
- 'react-hooks/hooks'?: Linter.RuleEntry<ReactHooksHooks>;
3534
+ 'react-extra/purity'?: Linter.RuleEntry<[]>;
3622
3535
  /**
3623
- * 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)
3536
+ * Validates correct usage of refs by checking that 'ref.current' is not read or written during render.
3537
+ * @see https://eslint-react.xyz/docs/rules/refs
3624
3538
  */
3625
- 'react-hooks/immutability'?: Linter.RuleEntry<ReactHooksImmutability>;
3539
+ 'react-extra/refs'?: Linter.RuleEntry<[]>;
3626
3540
  /**
3627
- * Validates against usage of libraries which are incompatible with memoization (manual or automatic)
3628
- */
3629
- 'react-hooks/incompatible-library'?: Linter.RuleEntry<ReactHooksIncompatibleLibrary>;
3630
- /**
3631
- * Internal invariants
3632
- */
3633
- 'react-hooks/invariant'?: Linter.RuleEntry<ReactHooksInvariant>;
3634
- /**
3635
- * Validates that effect dependencies are memoized
3636
- */
3637
- 'react-hooks/memoized-effect-dependencies'?: Linter.RuleEntry<ReactHooksMemoizedEffectDependencies>;
3638
- /**
3639
- * Validates against deriving values from state in an effect
3640
- */
3641
- 'react-hooks/no-deriving-state-in-effects'?: Linter.RuleEntry<ReactHooksNoDerivingStateInEffects>;
3642
- /**
3643
- * 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)
3644
- */
3645
- 'react-hooks/preserve-manual-memoization'?: Linter.RuleEntry<ReactHooksPreserveManualMemoization>;
3646
- /**
3647
- * 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
3648
- */
3649
- 'react-hooks/purity'?: Linter.RuleEntry<ReactHooksPurity>;
3650
- /**
3651
- * Validates correct usage of refs, not reading/writing during render. See the "pitfalls" section in [`useRef()` usage](https://react.dev/reference/react/useRef#usage)
3652
- */
3653
- 'react-hooks/refs'?: Linter.RuleEntry<ReactHooksRefs>;
3654
- /**
3655
- * Validates against suppression of other rules
3656
- */
3657
- 'react-hooks/rule-suppression'?: Linter.RuleEntry<ReactHooksRuleSuppression>;
3658
- /**
3659
- * enforces the Rules of Hooks
3541
+ * Enforces the Rules of Hooks.
3660
3542
  * @see https://react.dev/reference/rules/rules-of-hooks
3661
3543
  */
3662
- 'react-hooks/rules-of-hooks'?: Linter.RuleEntry<ReactHooksRulesOfHooks>;
3544
+ 'react-extra/rules-of-hooks'?: Linter.RuleEntry<ReactExtraRulesOfHooks>;
3663
3545
  /**
3664
- * Validates against calling setState synchronously in an effect, which can lead to re-renders that degrade performance
3546
+ * Validates against setting state synchronously in an effect, which can lead to re-renders that degrade performance.
3547
+ * @see https://eslint-react.xyz/docs/rules/set-state-in-effect
3665
3548
  */
3666
- 'react-hooks/set-state-in-effect'?: Linter.RuleEntry<ReactHooksSetStateInEffect>;
3549
+ 'react-extra/set-state-in-effect'?: Linter.RuleEntry<[]>;
3667
3550
  /**
3668
- * Validates against setting state during render, which can trigger additional renders and potential infinite render loops
3551
+ * Validates against unconditionally setting state during render, which can trigger additional renders and potential infinite render loops.
3552
+ * @see https://eslint-react.xyz/docs/rules/set-state-in-render
3669
3553
  */
3670
- 'react-hooks/set-state-in-render'?: Linter.RuleEntry<ReactHooksSetStateInRender>;
3554
+ 'react-extra/set-state-in-render'?: Linter.RuleEntry<[]>;
3671
3555
  /**
3672
- * Validates that components are static, not recreated every render. Components that are recreated dynamically can reset state and trigger excessive re-rendering
3556
+ * Enforces the Rules of Props.
3557
+ * @see https://eslint-react.xyz/docs/rules/unstable-rules-of-props
3673
3558
  */
3674
- 'react-hooks/static-components'?: Linter.RuleEntry<ReactHooksStaticComponents>;
3559
+ 'react-extra/unstable-rules-of-props'?: Linter.RuleEntry<[]>;
3675
3560
  /**
3676
- * Validates against invalid syntax
3561
+ * Enforces the Rules of State.
3562
+ * @see https://eslint-react.xyz/docs/rules/unstable-rules-of-state
3677
3563
  */
3678
- 'react-hooks/syntax'?: Linter.RuleEntry<ReactHooksSyntax>;
3564
+ 'react-extra/unstable-rules-of-state'?: Linter.RuleEntry<[]>;
3679
3565
  /**
3680
- * Unimplemented features
3566
+ * Validates against syntax that React Compiler does not support.
3567
+ * @see https://eslint-react.xyz/docs/rules/unsupported-syntax
3681
3568
  */
3682
- 'react-hooks/todo'?: Linter.RuleEntry<ReactHooksTodo>;
3569
+ 'react-extra/unsupported-syntax'?: Linter.RuleEntry<[]>;
3683
3570
  /**
3684
- * Validates against syntax that we do not plan to support in React Compiler
3571
+ * Validates that 'useMemo' is called with a callback that returns a value.
3572
+ * @see https://eslint-react.xyz/docs/rules/use-memo
3685
3573
  */
3686
- 'react-hooks/unsupported-syntax'?: Linter.RuleEntry<ReactHooksUnsupportedSyntax>;
3574
+ 'react-extra/use-memo'?: Linter.RuleEntry<[]>;
3687
3575
  /**
3688
- * Validates usage of the useMemo() hook against common mistakes. See [`useMemo()` docs](https://react.dev/reference/react/useMemo) for more information.
3576
+ * Enforces correct usage of 'useState', including destructuring, symmetric naming of the value and setter, and wrapping expensive initializers in a lazy initializer function.
3577
+ * @see https://eslint-react.xyz/docs/rules/use-state
3689
3578
  */
3690
- 'react-hooks/use-memo'?: Linter.RuleEntry<ReactHooksUseMemo>;
3691
- /**
3692
- * Validates that useMemos always return a value and that the result of the useMemo is used by the component/hook. See [`useMemo()` docs](https://react.dev/reference/react/useMemo) for more information.
3693
- */
3694
- 'react-hooks/void-use-memo'?: Linter.RuleEntry<ReactHooksVoidUseMemo>;
3695
- /**
3696
- * Enforces naming conventions for components.
3697
- * @see https://eslint-react.xyz/docs/rules/naming-convention-component-name
3698
- */
3699
- 'react-naming-convention/component-name'?: Linter.RuleEntry<ReactNamingConventionComponentName>;
3579
+ 'react-extra/use-state'?: Linter.RuleEntry<ReactExtraUseState>;
3700
3580
  /**
3701
3581
  * Enforces the context name to be a valid component name with the suffix 'Context'.
3702
3582
  * @see https://eslint-react.xyz/docs/rules/naming-convention-context-name
3703
3583
  */
3704
3584
  'react-naming-convention/context-name'?: Linter.RuleEntry<[]>;
3705
- /**
3706
- * Enforces consistent file-naming conventions.
3707
- * @see https://eslint-react.xyz/docs/rules/naming-convention-filename
3708
- */
3709
- 'react-naming-convention/filename'?: Linter.RuleEntry<ReactNamingConventionFilename>;
3710
- /**
3711
- * Enforces consistent use of the JSX file extension.
3712
- * @see https://eslint-react.xyz/docs/rules/naming-convention-filename-extension
3713
- */
3714
- 'react-naming-convention/filename-extension'?: Linter.RuleEntry<ReactNamingConventionFilenameExtension>;
3715
3585
  /**
3716
3586
  * Enforces identifier names assigned from 'useId' calls to be either 'id' or end with 'Id'.
3717
3587
  * @see https://eslint-react.xyz/docs/rules/naming-convention-id-name
@@ -3723,12 +3593,7 @@ interface RuleOptions {
3723
3593
  */
3724
3594
  'react-naming-convention/ref-name'?: Linter.RuleEntry<[]>;
3725
3595
  /**
3726
- * Enforces destructuring and symmetric naming of the 'useState' hook value and setter.
3727
- * @see https://eslint-react.xyz/docs/rules/naming-convention-use-state
3728
- */
3729
- 'react-naming-convention/use-state'?: Linter.RuleEntry<ReactNamingConventionUseState>;
3730
- /**
3731
- * Validate and transform React Client/Server Function definitions.
3596
+ * Validates and transforms React Client/Server Function definitions.
3732
3597
  * @see https://eslint-react.xyz/docs/rules/function-definition
3733
3598
  */
3734
3599
  'react-rsc/function-definition'?: Linter.RuleEntry<[]>;
@@ -10982,132 +10847,28 @@ type ReactCompilerReactCompiler = [] | [{
10982
10847
  type ReactDomNoUnknownProperty = [] | [{
10983
10848
  ignore?: string[];
10984
10849
  requireDataLowercase?: boolean;
10850
+ }]; // ----- react-extra/exhaustive-deps -----
10851
+ type ReactExtraExhaustiveDeps = [] | [{
10852
+ additionalHooks?: string;
10853
+ enableDangerousAutofixThisMayCauseInfiniteLoops?: boolean;
10854
+ experimental_autoDependenciesHooks?: string[];
10855
+ requireExplicitEffectDeps?: boolean;
10985
10856
  }]; // ----- react-extra/jsx-shorthand-boolean -----
10986
10857
  type ReactExtraJsxShorthandBoolean = [] | [(-1 | 1)]; // ----- react-extra/jsx-shorthand-fragment -----
10987
- type ReactExtraJsxShorthandFragment = [] | [(-1 | 1)]; // ----- react-extra/no-forbidden-props -----
10988
- type ReactExtraNoForbiddenProps = [] | [{
10989
- forbid?: (string | {
10990
- excludedNodes?: string[];
10991
- prop: string;
10992
- } | {
10993
- includedNodes?: string[];
10994
- prop: string;
10995
- })[];
10996
- }]; // ----- react-extra/no-unstable-default-props -----
10858
+ type ReactExtraJsxShorthandFragment = [] | [(-1 | 1)]; // ----- react-extra/no-unstable-default-props -----
10997
10859
  type ReactExtraNoUnstableDefaultProps = [] | [{
10998
10860
  safeDefaultProps?: string[];
10999
10861
  }]; // ----- react-extra/no-useless-fragment -----
11000
10862
  type ReactExtraNoUselessFragment = [] | [{
11001
10863
  allowEmptyFragment?: boolean;
11002
10864
  allowExpressions?: boolean;
11003
- }]; // ----- react-hooks/automatic-effect-dependencies -----
11004
- type ReactHooksAutomaticEffectDependencies = [] | [{
11005
- [k: string]: unknown | undefined;
11006
- }]; // ----- react-hooks/capitalized-calls -----
11007
- type ReactHooksCapitalizedCalls = [] | [{
11008
- [k: string]: unknown | undefined;
11009
- }]; // ----- react-hooks/component-hook-factories -----
11010
- type ReactHooksComponentHookFactories = [] | [{
11011
- [k: string]: unknown | undefined;
11012
- }]; // ----- react-hooks/config -----
11013
- type ReactHooksConfig = [] | [{
11014
- [k: string]: unknown | undefined;
11015
- }]; // ----- react-hooks/error-boundaries -----
11016
- type ReactHooksErrorBoundaries = [] | [{
11017
- [k: string]: unknown | undefined;
11018
- }]; // ----- react-hooks/exhaustive-deps -----
11019
- type ReactHooksExhaustiveDeps = [] | [{
11020
- additionalHooks?: string;
11021
- enableDangerousAutofixThisMayCauseInfiniteLoops?: boolean;
11022
- experimental_autoDependenciesHooks?: string[];
11023
- requireExplicitEffectDeps?: boolean;
11024
- }]; // ----- react-hooks/fbt -----
11025
- type ReactHooksFbt = [] | [{
11026
- [k: string]: unknown | undefined;
11027
- }]; // ----- react-hooks/fire -----
11028
- type ReactHooksFire = [] | [{
11029
- [k: string]: unknown | undefined;
11030
- }]; // ----- react-hooks/gating -----
11031
- type ReactHooksGating = [] | [{
11032
- [k: string]: unknown | undefined;
11033
- }]; // ----- react-hooks/globals -----
11034
- type ReactHooksGlobals = [] | [{
11035
- [k: string]: unknown | undefined;
11036
- }]; // ----- react-hooks/hooks -----
11037
- type ReactHooksHooks = [] | [{
11038
- [k: string]: unknown | undefined;
11039
- }]; // ----- react-hooks/immutability -----
11040
- type ReactHooksImmutability = [] | [{
11041
- [k: string]: unknown | undefined;
11042
- }]; // ----- react-hooks/incompatible-library -----
11043
- type ReactHooksIncompatibleLibrary = [] | [{
11044
- [k: string]: unknown | undefined;
11045
- }]; // ----- react-hooks/invariant -----
11046
- type ReactHooksInvariant = [] | [{
11047
- [k: string]: unknown | undefined;
11048
- }]; // ----- react-hooks/memoized-effect-dependencies -----
11049
- type ReactHooksMemoizedEffectDependencies = [] | [{
11050
- [k: string]: unknown | undefined;
11051
- }]; // ----- react-hooks/no-deriving-state-in-effects -----
11052
- type ReactHooksNoDerivingStateInEffects = [] | [{
11053
- [k: string]: unknown | undefined;
11054
- }]; // ----- react-hooks/preserve-manual-memoization -----
11055
- type ReactHooksPreserveManualMemoization = [] | [{
11056
- [k: string]: unknown | undefined;
11057
- }]; // ----- react-hooks/purity -----
11058
- type ReactHooksPurity = [] | [{
11059
- [k: string]: unknown | undefined;
11060
- }]; // ----- react-hooks/refs -----
11061
- type ReactHooksRefs = [] | [{
11062
- [k: string]: unknown | undefined;
11063
- }]; // ----- react-hooks/rule-suppression -----
11064
- type ReactHooksRuleSuppression = [] | [{
11065
- [k: string]: unknown | undefined;
11066
- }]; // ----- react-hooks/rules-of-hooks -----
11067
- type ReactHooksRulesOfHooks = [] | [{
10865
+ }]; // ----- react-extra/rules-of-hooks -----
10866
+ type ReactExtraRulesOfHooks = [] | [{
11068
10867
  additionalHooks?: string;
11069
- }]; // ----- react-hooks/set-state-in-effect -----
11070
- type ReactHooksSetStateInEffect = [] | [{
11071
- [k: string]: unknown | undefined;
11072
- }]; // ----- react-hooks/set-state-in-render -----
11073
- type ReactHooksSetStateInRender = [] | [{
11074
- [k: string]: unknown | undefined;
11075
- }]; // ----- react-hooks/static-components -----
11076
- type ReactHooksStaticComponents = [] | [{
11077
- [k: string]: unknown | undefined;
11078
- }]; // ----- react-hooks/syntax -----
11079
- type ReactHooksSyntax = [] | [{
11080
- [k: string]: unknown | undefined;
11081
- }]; // ----- react-hooks/todo -----
11082
- type ReactHooksTodo = [] | [{
11083
- [k: string]: unknown | undefined;
11084
- }]; // ----- react-hooks/unsupported-syntax -----
11085
- type ReactHooksUnsupportedSyntax = [] | [{
11086
- [k: string]: unknown | undefined;
11087
- }]; // ----- react-hooks/use-memo -----
11088
- type ReactHooksUseMemo = [] | [{
11089
- [k: string]: unknown | undefined;
11090
- }]; // ----- react-hooks/void-use-memo -----
11091
- type ReactHooksVoidUseMemo = [] | [{
11092
- [k: string]: unknown | undefined;
11093
- }]; // ----- react-naming-convention/component-name -----
11094
- type ReactNamingConventionComponentName = [] | [(("PascalCase" | "CONSTANT_CASE") | {
11095
- allowAllCaps?: boolean;
11096
- excepts?: string[];
11097
- rule?: ("PascalCase" | "CONSTANT_CASE");
11098
- })]; // ----- react-naming-convention/filename -----
11099
- type ReactNamingConventionFilename = [] | [(("PascalCase" | "camelCase" | "kebab-case" | "snake_case") | {
11100
- excepts?: string[];
11101
- extensions?: string[];
11102
- rule?: ("PascalCase" | "camelCase" | "kebab-case" | "snake_case");
11103
- })]; // ----- react-naming-convention/filename-extension -----
11104
- type ReactNamingConventionFilenameExtension = [] | [(("always" | "as-needed") | {
11105
- allow?: ("always" | "as-needed");
11106
- extensions?: string[];
11107
- ignoreFilesWithoutCode?: boolean;
11108
- })]; // ----- react-naming-convention/use-state -----
11109
- type ReactNamingConventionUseState = [] | [{
10868
+ }]; // ----- react-extra/use-state -----
10869
+ type ReactExtraUseState = [] | [{
11110
10870
  enforceAssignment?: boolean;
10871
+ enforceLazyInitialization?: boolean;
11111
10872
  enforceSetterName?: boolean;
11112
10873
  }]; // ----- regexp/hexadecimal-escape -----
11113
10874
  type RegexpHexadecimalEscape = [] | [("always" | "never")]; // ----- regexp/letter-case -----
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*as g from"yaml-eslint-parser";import ee from"eslint-config-flat-gitignore";import te from"@eslint/js";import ne from"@stylistic/eslint-plugin";import _ from"globals";import re from"eslint-plugin-jsdoc";import v,{configs as y}from"eslint-plugin-jsonc";import*as b from"jsonc-eslint-parser";import x from"@eslint/markdown";import{mergeProcessors as ie,processorPassThrough as ae}from"eslint-merge-processors";import oe from"eslint-plugin-n";import S from"eslint-plugin-regexp";import C from"eslint-plugin-sonarjs";import*as w from"empathic/find";import T from"eslint-plugin-toml";import E from"eslint-plugin-unicorn";import se from"eslint-plugin-yml";const D=`**/*.?([cm])[jt]s?(x)`,O=`**/*.?([cm])ts`,k=`**/*.?([cm])tsx`,A=`.github/workflows/*.y?(a)ml`,j=`**/*.md`,ce=`${j}/${D}`,M=`**/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 N(){return[{files:[D],name:`2digits:antfu`,plugins:{antfu:o},rules:{"antfu/top-level-function":`error`}}]}function P(){return[{files:[D],name:`2digits:boolean`,plugins:{boolean:s},rules:{...s.configs.recommended.rules}}]}const F={"@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/rsc":`react-rsc`,"@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:`zod`,toml:`toml`},I=[`storybook`,`@storybook/nextjs`,`@storybook/nextjs-vite`,`@storybook/react-vite`,`@storybook/react-webpack5`,`@storybook/react-native-web-vite`],L=n(l.recommended.rules,F);function R(){return[{files:[D],name:`2digits:comments`,plugins:{comments:c},rules:{...L,"comments/no-unused-disable":`error`,"comments/disable-enable-pair":[`error`,{allowWholeFile:!0}]}}]}async function z(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 B(e={}){let t=await z(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 V(){return[{files:[D],name:`2digits:depend`,plugins:{depend:p},rules:{"depend/ban-dependencies":`warn`}}]}async function H(e){let t=await e;return t.default||t}async function U(e={}){let{overrides:t={},drizzleObjectName:n=[`drizzle`,`db`]}=e,r=await H(import(`eslint-plugin-drizzle`));return[{files:[D],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 W=Object.fromEntries(h.configs.recommended.flatMap(({rules:e})=>Object.entries({...e})));function G(){return[{name:`2digits:github-actions/setup`,plugins:{"github-action":h}},{name:`2digits:github-actions/recommended`,files:[A],ignores:[`!**/${A}`],languageOptions:{parser:g},rules:{...W}}]}async function le(e={}){let{overrides:t={},files:r=[`**/*.graphql`,`**/*.gql`]}=e,[i,a]=await Promise.all([H(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,F);return[{name:`2digits:graphql`,plugins:{gql:i},languageOptions:{parser:i.parser},files:r,rules:{...c,"gql/naming-convention":[`error`,{allowLeadingUnderscore:!0}],...t}}]}function ue(e={}){let{gitIgnore:t,ignores:n=[]}=e;return[{ignores:[M,n].flat(),name:`2digits:ignores`},ee({strict:!1,...t,name:`2digits:gitignore`})]}function de(e={}){let{overrides:t={}}=e;return[{files:[D],name:`2digits:javascript`,plugins:{stylistic:ne},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:{...te.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-assignment":`off`,"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 fe(){return[{files:[D],name:`2digits:jsdoc`,plugins:{jsdoc:re},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 pe(){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:b},plugins:{jsonc:v}};function q(e){return Object.fromEntries(e.flatMap(({rules:e})=>Object.entries(e??{})))}const J=[j];function me(){return[{name:`2digits:markdown/setup`,plugins:{markdown:x}},{name:`2digits:markdown/processor`,files:J,language:`markdown/gfm`,ignores:[`**/*.md/*.md`],processor:ie([x.processors.markdown,ae])},{name:`2digits:markdown/parser`,files:J,language:`markdown/gfm`,languageOptions:{parser:ge}},{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`}}]}async function he(){let e=await H(import(`typescript-eslint`)),t=await H(import(`@eslint-react/eslint-plugin`)),r=n({...e.configs.disableTypeChecked.rules,...t.configs[`disable-type-checked`].rules},F);return[{name:`2digits:markdown/disables`,files:[ce],languageOptions:{parser:e.parser,parserOptions:{project:!1,projectService:!1,ecmaFeatures:{impliedStrict:!0}}},rules:{...r,"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 ge={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 _e(e={}){let{files:t=[O,k],overrides:r={},parserOptions:i}=e,[a,o]=await Promise.all([H(import(`@next/eslint-plugin-next`)),H(import(`@typescript-eslint/parser`))]),s=n({...a.configs.recommended.rules,...a.configs[`core-web-vitals`].rules},F);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}},{files:[`**/middleware.ts`,`**/proxy.ts`],name:`2digits:next/proxy`,rules:{"unicorn/prefer-string-raw":`off`}}]}var ve={node:`24.14.0`};function ye(){return[{files:[D],name:`2digits:node`,settings:{node:{version:ve.node}},plugins:{node:oe},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 be(){let e=await H(import(`eslint-plugin-pnpm`));return[{name:`2digits:pnpm/package-json`,files:[`package.json`,`**/package.json`],languageOptions:{parser:b},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 H(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`,"pnpm/yaml-enforce-settings":[`error`,{autofix:!0,settings:{catalogMode:`strict`,savePrefix:``,preferWorkspacePackages:!0,cleanupUnusedCatalogs:!0}}]}}]}async function xe(){let[e,t]=await Promise.all([H(import(`eslint-config-prettier`)),H(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 Se(e={}){let{files:t=[O,k],overrides:r={},parserOptions:i,tsconfigRootDir:a,reactCompiler:o=!0}=e,[s,c,l,u,d]=await Promise.all([H(import(`@eslint-react/eslint-plugin`)),H(import(`eslint-plugin-react-hooks`)),H(import(`@typescript-eslint/parser`)),o?H(import(`eslint-plugin-react-compiler`)):Promise.resolve(void 0),H(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},F);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`],"react-rsc":f[`@eslint-react/rsc`],...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-extra/no-unnecessary-use-ref":`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 Ce(){return[{files:[D],name:`2digits:regexp`,plugins:{regexp:S},rules:{...S.configs[`flat/recommended`].rules}}]}function we(){return[{files:[D],name:`2digits:sonar`,plugins:{sonar:C},rules:{"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 Te(e={}){let{files:t=[`**/*.stories.tsx`],overrides:n={},parserOptions:r,storybookDirectory:i=`.storybook`}=e,[a,o]=await Promise.all([H(import(`eslint-plugin-storybook`)),H(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 Ee(e={}){let{overrides:t={}}=e,[n,{tailwindFunctions:r},i]=await Promise.all([H(import(`eslint-plugin-tailwindcss`)),H(import(`@2digits/constants`)),a().catch(()=>void 0)]),o=w.file(`tailwind.config.ts`,{last:i})??w.file(`tailwind.config.js`,{last:i});return[{files:[D],name:`2digits:tailwind`,plugins:{tailwindcss:n},settings:{tailwindcss:{callees:r,config:o}},rules:{...n.configs.recommended.rules,...t}}]}async function De(e={}){let{overrides:t={}}=e,r=await H(import(`@tanstack/eslint-plugin-query`)),i=n(r.configs[`flat/recommended`].at(0)?.rules??{},F);return[{files:[D],name:`2digits:tanstack-query`,plugins:{"tanstack-query":r},rules:{...i,...t}}]}async function Oe(e={}){let{overrides:t={}}=e,r=await H(import(`@tanstack/eslint-plugin-router`)),i=n(r.configs[`flat/recommended`].at(0)?.rules??{},F);return[{files:[D],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}}]}const ke=Object.fromEntries(T.configs.standard.flatMap(({rules:e})=>Object.entries({...e})));function Y(){return[{name:`2digits:toml`,files:[`**/*.toml`],language:`toml/toml`,plugins:{toml:T},rules:{...ke,"toml/array-bracket-spacing":[`error`,`never`],"toml/indent":[`error`,2,{keyValuePairs:1,subTables:1}]}}]}async function Ae(e={}){let{overrides:t={}}=e,n=await H(import(`eslint-plugin-turbo`));return[{files:[D],name:`2digits:turbo`,plugins:{turbo:n},rules:{"turbo/no-undeclared-env-vars":`error`,...t}}]}async function je(e={}){let{overrides:n={},parserOptions:r={}}=e,[{plugin:i,configs:a,parser:o},s]=await Promise.all([H(import(`typescript-eslint`)),H(import(`@2digits/eslint-plugin`))]),c=t(a.strictTypeChecked,F),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:[D],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`],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)`],rules:{"no-unused-expressions":`off`}},{name:`2digits:typescript/disables/cjs`,files:[`**/*.js`,`**/*.cjs`,`**/*.cts`],rules:{"ts/no-require-imports":`off`,"ts/no-var-requires":`off`}}]}function Me(){return[{files:[D],name:`2digits:unicorn`,plugins:{unicorn:E},rules:{...E.configs.recommended.rules,"unicorn/no-array-callback-reference":`off`,"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 Ne(){return[{name:`2digits:yaml/setup`,plugins:{yml:se}},{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 Pe(e={}){let{overrides:t={}}=e,n=await H(import(`eslint-plugin-zod`));return[{files:[D],name:`2digits:zod`,plugins:{zod:n},rules:{"zod/array-style":[`error`,{style:`function`}],"zod/no-any-schema":`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-string-schema-with-uuid":`error`,"zod/no-throw-in-refine":`error`,"zod/prefer-enum-over-literal-union":`error`,"zod/prefer-meta":`error`,"zod/prefer-meta-last":`error`,"zod/prefer-string-schema-with-trim":`error`,"zod/consistent-import":[`error`,{syntax:`namespace`}],"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(ue(t.ignores),de(t.js),P(),ye(),R(),fe(),Me(),we(),Ce(),N(),pe(),Y(),Ne(),me(),G());Z(t.css)&&(o=o.append(B(Q(t.css)))),Z(t.depend,!0)&&(o=o.append(V())),Z(t.turbo,i(`turbo`))&&(o=o.append(Ae(Q(t.turbo))));let{overrides:s,...c}=Q(t.ts);return Z(t.ts,i(`typescript`))&&(o=o.append(je(Q(t.ts)))),Z(t.react,i(`react`))&&(o=o.append(Se({...Q(t.react),...c}))),Z(t.next,i(`next`))&&(o=o.append(_e({...Q(t.next),...c}))),Z(t.storybook,I.some(e=>i(e)))&&(o=o.append(Te({...Q(t.storybook),...c}))),Z(t.tailwind,i(`tailwindcss`))&&(o=o.append(Ee(Q(t.tailwind)))),Z(t.tanstackQuery,i(`react-query`)||i(`@tanstack/react-query`)||i(`@tanstack/react-query-devtools`))&&(o=o.append(De(Q(t.tanstackQuery)))),Z(t.tanstackRouter,i(`@tanstack/react-router`))&&(o=o.append(Oe(Q(t.tanstackRouter)))),Z(t.drizzle,i(`drizzle-kit`)||i(`drizzle-orm`))&&(o=o.append(U(Q(t.drizzle)))),Z(t.zod,i(`zod`))&&(o=o.append(Pe(Q(t.zod)))),Z(t.graphql,i(`graphql`))&&(o=o.append(le(Q(t.graphql)))),Z(t.pnpm,!!await r)&&(o=o.append(be())),o=o.append(...n),i(`prettier`)&&(o=o.append(xe())),o=o.append(he()),o.renamePlugins(F).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 ee from"eslint-plugin-depend";import{fixupPluginRules as p}from"@eslint/compat";import m from"eslint-plugin-github-action";import*as h from"yaml-eslint-parser";import te from"eslint-config-flat-gitignore";import ne from"@eslint/js";import re from"@stylistic/eslint-plugin";import g from"globals";import ie from"eslint-plugin-jsdoc";import _,{configs as v}from"eslint-plugin-jsonc";import*as y 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-toml";import T from"eslint-plugin-unicorn";import ce from"eslint-plugin-yml";const E=`**/*.?([cm])[jt]s?(x)`,D=`**/*.?([cm])ts`,O=`**/*.?([cm])tsx`,k=`.github/workflows/*.y?(a)ml`,A=`**/*.md`,j=`${A}/${E}`,M=`**/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 N(){return[{files:[E],name:`2digits:antfu`,plugins:{antfu:o},rules:{"antfu/top-level-function":`error`}}]}function P(){return[{files:[E],name:`2digits:boolean`,plugins:{boolean:s},rules:{...s.configs.recommended.rules}}]}const F={"@next/next":`next`,"@eslint-react/naming-convention":`react-naming-convention`,"@eslint-react/dom":`react-dom`,"@eslint-react/web-api":`react-web-api`,"@eslint-react/rsc":`react-rsc`,"@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:`zod`,toml:`toml`},I=[`storybook`,`@storybook/nextjs`,`@storybook/nextjs-vite`,`@storybook/react-vite`,`@storybook/react-webpack5`,`@storybook/react-native-web-vite`],L=n(l.recommended.rules,F);function R(){return[{files:[E],name:`2digits:comments`,plugins:{comments:c},rules:{...L,"comments/no-unused-disable":`error`,"comments/disable-enable-pair":[`error`,{allowWholeFile:!0}]}}]}async function z(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 B(e={}){let t=await z(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 V(){return[{files:[E],name:`2digits:depend`,plugins:{depend:ee},rules:{"depend/ban-dependencies":`warn`}}]}async function H(e){let t=await e;return t.default||t}async function U(e={}){let{overrides:t={},drizzleObjectName:n=[`drizzle`,`db`]}=e,r=await H(import(`eslint-plugin-drizzle`));return[{files:[E],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 W=Object.fromEntries(m.configs.recommended.flatMap(({rules:e})=>Object.entries({...e})));function G(){return[{name:`2digits:github-actions/setup`,plugins:{"github-action":m}},{name:`2digits:github-actions/recommended`,files:[k],ignores:[`!**/${k}`],languageOptions:{parser:h},rules:{...W}}]}async function le(e={}){let{overrides:t={},files:r=[`**/*.graphql`,`**/*.gql`]}=e,[i,a]=await Promise.all([H(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,F);return[{name:`2digits:graphql`,plugins:{gql:i},languageOptions:{parser:i.parser},files:r,rules:{...c,"gql/naming-convention":[`error`,{allowLeadingUnderscore:!0}],...t}}]}function ue(e={}){let{gitIgnore:t,ignores:n=[]}=e;return[{ignores:[M,n].flat(),name:`2digits:ignores`},te({strict:!1,...t,name:`2digits:gitignore`})]}function de(e={}){let{overrides:t={}}=e;return[{files:[E],name:`2digits:javascript`,plugins:{stylistic:re},languageOptions:{ecmaVersion:2022,globals:{...g.browser,...g.es2021,...g.node,document:`readonly`,navigator:`readonly`,window:`readonly`},parserOptions:{ecmaFeatures:{jsx:!0},ecmaVersion:2022,sourceType:`module`},sourceType:`module`},linterOptions:{reportUnusedDisableDirectives:!0},rules:{...ne.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-assignment":`off`,"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 fe(){return[{files:[E],name:`2digits:jsdoc`,plugins:{jsdoc:ie},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 pe(){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:y},plugins:{jsonc:_}};function q(e){return Object.fromEntries(e.flatMap(({rules:e})=>Object.entries(e??{})))}const J=[A];function me(){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:ge}},{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`}}]}async function he(){let e=await H(import(`typescript-eslint`)),t=await H(import(`@eslint-react/eslint-plugin`)),r=n({...e.configs.disableTypeChecked.rules,...t.configs[`disable-type-checked`].rules},F);return[{name:`2digits:markdown/disables`,files:[j],languageOptions:{parser:e.parser,parserOptions:{project:!1,projectService:!1,ecmaFeatures:{impliedStrict:!0}}},rules:{...r,"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 ge={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 _e(e={}){let{files:t=[D,O],overrides:r={},parserOptions:i}=e,[a,o]=await Promise.all([H(import(`@next/eslint-plugin-next`)),H(import(`@typescript-eslint/parser`))]),s=n({...a.configs.recommended.rules,...a.configs[`core-web-vitals`].rules},F);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}},{files:[`**/middleware.ts`,`**/proxy.ts`],name:`2digits:next/proxy`,rules:{"unicorn/prefer-string-raw":`off`}}]}var ve={node:`24.14.0`};function ye(){return[{files:[E],name:`2digits:node`,settings:{node:{version:ve.node}},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 be(){let e=await H(import(`eslint-plugin-pnpm`));return[{name:`2digits:pnpm/package-json`,files:[`package.json`,`**/package.json`],languageOptions:{parser:y},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 H(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`,"pnpm/yaml-enforce-settings":[`error`,{autofix:!0,settings:{catalogMode:`strict`,savePrefix:``,preferWorkspacePackages:!0,cleanupUnusedCatalogs:!0}}]}}]}async function xe(){let[e,t]=await Promise.all([H(import(`eslint-config-prettier`)),H(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 Se(e={}){let{files:t=[D,O],overrides:r={},parserOptions:i,tsconfigRootDir:a,reactCompiler:o=!0}=e,[s,c,l,u]=await Promise.all([H(import(`@eslint-react/eslint-plugin`)),H(import(`@typescript-eslint/parser`)),o?H(import(`eslint-plugin-react-compiler`)):Promise.resolve(void 0),H(import(`@stylistic/eslint-plugin`))]),d=s.configs.all.plugins,f=n({...s.configs[`disable-conflict-eslint-plugin-react`].rules,...s.configs[`disable-conflict-eslint-plugin-react-hooks`].rules,...s.configs[`strict-type-checked`].rules},F);return[{name:`2digits:react/setup`,plugins:{stylistic:u,"react-dom":d[`@eslint-react/dom`],"react-web-api":d[`@eslint-react/web-api`],"react-extra":d[`@eslint-react`],"react-naming-convention":d[`@eslint-react/naming-convention`],"react-rsc":d[`@eslint-react/rsc`],...o?{"react-compiler":l}:{}},settings:{react:{version:`detect`}}},{name:`2digits:react/rules`,files:t,languageOptions:{parser:c,parserOptions:{ecmaFeatures:{jsx:!0},tsconfigRootDir:a,projectService:!0,...i},sourceType:`module`},rules:{...f,...o?{"react-compiler/react-compiler":`error`}:{},"react-extra/exhaustive-deps":`error`,"react-extra/purity":`error`,"react-extra/no-unused-class-component-members":`error`,"react-extra/no-unnecessary-use-callback":`error`,"react-extra/no-unnecessary-use-prefix":`error`,"react-extra/no-unnecessary-use-memo":`error`,"react-extra/set-state-in-effect":`error`,"react-extra/use-state":`error`,"react-extra/no-unstable-context-value":`error`,"react-extra/no-unstable-default-props":`error`,"react-extra/no-unused-props":`error`,"react-extra/no-context-provider":`error`,"react-extra/no-forward-ref":`error`,"react-extra/no-use-context":`error`,"react-extra/immutability":`error`,"react-extra/refs":`error`,"react-extra/no-duplicate-key":`error`,"react-dom/no-missing-button-type":`error`,"react-dom/no-missing-iframe-sandbox":`error`,"react-dom/no-unsafe-target-blank":`error`,"react-naming-convention/context-name":`error`,"react-naming-convention/id-name":`error`,"react-naming-convention/ref-name":`error`,"react-extra/jsx-shorthand-boolean":`error`,"react-extra/jsx-shorthand-fragment":`error`,"react-extra/prefer-namespace-import":`error`,"react-extra/no-useless-fragment":`off`,"stylistic/jsx-curly-newline":`off`,"stylistic/jsx-newline":[`error`,{prevent:!1}],"stylistic/jsx-self-closing-comp":`error`,...r}}]}function Ce(){return[{files:[E],name:`2digits:regexp`,plugins:{regexp:x},rules:{...x.configs[`flat/recommended`].rules}}]}function we(){return[{files:[E],name:`2digits:sonar`,plugins:{sonar:S},rules:{"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 Te(e={}){let{files:t=[`**/*.stories.tsx`],overrides:n={},parserOptions:r,storybookDirectory:i=`.storybook`}=e,[a,o]=await Promise.all([H(import(`eslint-plugin-storybook`)),H(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 Ee(e={}){let{overrides:t={}}=e,[n,{tailwindFunctions:r},i]=await Promise.all([H(import(`eslint-plugin-tailwindcss`)),H(import(`@2digits/constants`)),a().catch(()=>void 0)]),o=C.file(`tailwind.config.ts`,{last:i})??C.file(`tailwind.config.js`,{last:i});return[{files:[E],name:`2digits:tailwind`,plugins:{tailwindcss:n},settings:{tailwindcss:{callees:r,config:o}},rules:{...n.configs.recommended.rules,...t}}]}async function De(e={}){let{overrides:t={}}=e,r=await H(import(`@tanstack/eslint-plugin-query`)),i=n(r.configs[`flat/recommended`].at(0)?.rules??{},F);return[{files:[E],name:`2digits:tanstack-query`,plugins:{"tanstack-query":r},rules:{...i,...t}}]}async function Oe(e={}){let{overrides:t={}}=e,r=await H(import(`@tanstack/eslint-plugin-router`)),i=n(r.configs[`flat/recommended`].at(0)?.rules??{},F);return[{files:[E],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}}]}const ke=Object.fromEntries(w.configs.standard.flatMap(({rules:e})=>Object.entries({...e})));function Y(){return[{name:`2digits:toml`,files:[`**/*.toml`],language:`toml/toml`,plugins:{toml:w},rules:{...ke,"toml/array-bracket-spacing":[`error`,`never`],"toml/indent":[`error`,2,{keyValuePairs:1,subTables:1}]}}]}async function Ae(e={}){let{overrides:t={}}=e,n=await H(import(`eslint-plugin-turbo`));return[{files:[E],name:`2digits:turbo`,plugins:{turbo:n},rules:{"turbo/no-undeclared-env-vars":`error`,...t}}]}async function je(e={}){let{overrides:n={},parserOptions:r={}}=e,[{plugin:i,configs:a,parser:o},s]=await Promise.all([H(import(`typescript-eslint`)),H(import(`@2digits/eslint-plugin`))]),c=t(a.strictTypeChecked,F),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:[E],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`],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)`],rules:{"no-unused-expressions":`off`}},{name:`2digits:typescript/disables/cjs`,files:[`**/*.js`,`**/*.cjs`,`**/*.cts`],rules:{"ts/no-require-imports":`off`,"ts/no-var-requires":`off`}}]}function Me(){return[{files:[E],name:`2digits:unicorn`,plugins:{unicorn:T},rules:{...T.configs.recommended.rules,"unicorn/no-array-callback-reference":`off`,"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 Ne(){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}};async function Pe(e={}){let{overrides:t={}}=e,n=await H(import(`eslint-plugin-zod`));return[{files:[E],name:`2digits:zod`,plugins:{zod:n},rules:{"zod/array-style":[`error`,{style:`function`}],"zod/no-any-schema":`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-string-schema-with-uuid":`error`,"zod/no-throw-in-refine":`error`,"zod/prefer-enum-over-literal-union":`error`,"zod/prefer-meta":`error`,"zod/prefer-meta-last":`error`,"zod/prefer-string-schema-with-trim":`error`,"zod/consistent-import":[`error`,{syntax:`namespace`}],"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(ue(t.ignores),de(t.js),P(),ye(),R(),fe(),Me(),we(),Ce(),N(),pe(),Y(),Ne(),me(),G());Z(t.css)&&(o=o.append(B(Q(t.css)))),Z(t.depend,!0)&&(o=o.append(V())),Z(t.turbo,i(`turbo`))&&(o=o.append(Ae(Q(t.turbo))));let{overrides:s,...c}=Q(t.ts);return Z(t.ts,i(`typescript`))&&(o=o.append(je(Q(t.ts)))),Z(t.react,i(`react`))&&(o=o.append(Se({...Q(t.react),...c}))),Z(t.next,i(`next`))&&(o=o.append(_e({...Q(t.next),...c}))),Z(t.storybook,I.some(e=>i(e)))&&(o=o.append(Te({...Q(t.storybook),...c}))),Z(t.tailwind,i(`tailwindcss`))&&(o=o.append(Ee(Q(t.tailwind)))),Z(t.tanstackQuery,i(`react-query`)||i(`@tanstack/react-query`)||i(`@tanstack/react-query-devtools`))&&(o=o.append(De(Q(t.tanstackQuery)))),Z(t.tanstackRouter,i(`@tanstack/react-router`))&&(o=o.append(Oe(Q(t.tanstackRouter)))),Z(t.drizzle,i(`drizzle-kit`)||i(`drizzle-orm`))&&(o=o.append(U(Q(t.drizzle)))),Z(t.zod,i(`zod`))&&(o=o.append(Pe(Q(t.zod)))),Z(t.graphql,i(`graphql`))&&(o=o.append(le(Q(t.graphql)))),Z(t.pnpm,!!await r)&&(o=o.append(be())),o=o.append(...n),i(`prettier`)&&(o=o.append(xe())),o=o.append(he()),o.renamePlugins(F).toConfigs()}export{$ as default,$ as twoDigits};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@2digits/eslint-config",
3
- "version": "5.1.23",
3
+ "version": "5.2.0",
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": {
@@ -25,18 +25,18 @@
25
25
  "public": true,
26
26
  "dependencies": {
27
27
  "@eslint-community/eslint-plugin-eslint-comments": "4.7.1",
28
- "@eslint-react/eslint-plugin": "2.13.0",
28
+ "@eslint-react/eslint-plugin": "3.0.0",
29
29
  "@eslint/compat": "2.0.3",
30
30
  "@eslint/css": "1.0.0",
31
31
  "@eslint/js": "10.0.1",
32
32
  "@eslint/markdown": "7.5.1",
33
33
  "@graphql-eslint/eslint-plugin": "4.4.0",
34
- "@next/eslint-plugin-next": "16.1.6",
34
+ "@next/eslint-plugin-next": "16.1.7",
35
35
  "@stylistic/eslint-plugin": "5.10.0",
36
36
  "@tanstack/eslint-plugin-query": "5.91.4",
37
- "@tanstack/eslint-plugin-router": "1.161.5",
38
- "@typescript-eslint/parser": "8.57.0",
39
- "@typescript-eslint/utils": "8.57.0",
37
+ "@tanstack/eslint-plugin-router": "1.161.6",
38
+ "@typescript-eslint/parser": "8.57.1",
39
+ "@typescript-eslint/utils": "8.57.1",
40
40
  "empathic": "2.0.0",
41
41
  "eslint-config-flat-gitignore": "2.2.1",
42
42
  "eslint-config-prettier": "10.1.8",
@@ -52,7 +52,6 @@
52
52
  "eslint-plugin-n": "17.24.0",
53
53
  "eslint-plugin-pnpm": "1.6.0",
54
54
  "eslint-plugin-react-compiler": "19.1.0-rc.2",
55
- "eslint-plugin-react-hooks": "7.0.1",
56
55
  "eslint-plugin-regexp": "3.1.0",
57
56
  "eslint-plugin-sonarjs": "4.0.2",
58
57
  "eslint-plugin-storybook": "10.2.19",
@@ -67,8 +66,8 @@
67
66
  "jsonc-eslint-parser": "3.1.0",
68
67
  "local-pkg": "1.1.2",
69
68
  "pkg-types": "2.3.0",
70
- "tailwind-csstree": "0.1.4",
71
- "typescript-eslint": "8.57.0",
69
+ "tailwind-csstree": "0.1.5",
70
+ "typescript-eslint": "8.57.1",
72
71
  "yaml-eslint-parser": "2.0.0",
73
72
  "@2digits/constants": "1.1.16",
74
73
  "@2digits/eslint-plugin": "4.0.5"
@@ -77,7 +76,7 @@
77
76
  "@arethetypeswrong/core": "0.18.2",
78
77
  "@eslint/config-inspector": "1.5.0",
79
78
  "@types/react": "19.2.14",
80
- "@typescript/native-preview": "7.0.0-dev.20260315.1",
79
+ "@typescript/native-preview": "7.0.0-dev.20260317.1",
81
80
  "dedent": "1.7.2",
82
81
  "eslint": "10.0.3",
83
82
  "eslint-typegen": "2.3.1",
@@ -85,7 +84,7 @@
85
84
  "react": "19.2.4",
86
85
  "tinyexec": "1.0.4",
87
86
  "tinyglobby": "0.2.15",
88
- "tsdown": "0.21.3",
87
+ "tsdown": "0.21.4",
89
88
  "typescript": "5.9.3",
90
89
  "vitest": "4.1.0",
91
90
  "zod": "4.3.6",