@2digits/eslint-config 5.3.1 → 5.3.3

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
@@ -6,10 +6,6 @@ import { Linter } from "eslint";
6
6
  //#region src/constants.d.ts
7
7
  declare const PluginNameMap: {
8
8
  readonly '@next/next': 'next';
9
- readonly '@eslint-react/naming-convention': 'react-naming-convention';
10
- readonly '@eslint-react/dom': 'react-dom';
11
- readonly '@eslint-react/web-api': 'react-web-api';
12
- readonly '@eslint-react/rsc': 'react-rsc';
13
9
  readonly '@eslint-react': 'react-extra';
14
10
  readonly 'react-hooks': 'react-hooks';
15
11
  readonly 'react-compiler': 'react-compiler';
@@ -3162,101 +3158,96 @@ interface RuleOptions {
3162
3158
  * Surfaces diagnostics from React Forget
3163
3159
  */
3164
3160
  'react-compiler/react-compiler'?: Linter.RuleEntry<ReactCompilerReactCompiler>;
3161
+ /**
3162
+ * Disallows higher order functions that define components or hooks inside them.
3163
+ * @see https://eslint-react.xyz/docs/rules/component-hook-factories
3164
+ */
3165
+ 'react-extra/component-hook-factories'?: Linter.RuleEntry<[]>;
3165
3166
  /**
3166
3167
  * Disallows DOM elements from using 'dangerouslySetInnerHTML'.
3167
3168
  * @see https://eslint-react.xyz/docs/rules/dom-no-dangerously-set-innerhtml
3168
3169
  */
3169
- 'react-dom/no-dangerously-set-innerhtml'?: Linter.RuleEntry<[]>;
3170
+ 'react-extra/dom-no-dangerously-set-innerhtml'?: Linter.RuleEntry<[]>;
3170
3171
  /**
3171
3172
  * Disallows DOM elements from using 'dangerouslySetInnerHTML' and 'children' at the same time.
3172
3173
  * @see https://eslint-react.xyz/docs/rules/dom-no-dangerously-set-innerhtml-with-children
3173
3174
  */
3174
- 'react-dom/no-dangerously-set-innerhtml-with-children'?: Linter.RuleEntry<[]>;
3175
+ 'react-extra/dom-no-dangerously-set-innerhtml-with-children'?: Linter.RuleEntry<[]>;
3175
3176
  /**
3176
3177
  * Disallows 'findDOMNode'.
3177
3178
  * @see https://eslint-react.xyz/docs/rules/dom-no-find-dom-node
3178
3179
  */
3179
- 'react-dom/no-find-dom-node'?: Linter.RuleEntry<[]>;
3180
+ 'react-extra/dom-no-find-dom-node'?: Linter.RuleEntry<[]>;
3180
3181
  /**
3181
3182
  * Disallows 'flushSync'.
3182
3183
  * @see https://eslint-react.xyz/docs/rules/dom-no-flush-sync
3183
3184
  */
3184
- 'react-dom/no-flush-sync'?: Linter.RuleEntry<[]>;
3185
+ 'react-extra/dom-no-flush-sync'?: Linter.RuleEntry<[]>;
3185
3186
  /**
3186
3187
  * Replaces usage of 'ReactDOM.hydrate()' with 'hydrateRoot()'.
3187
3188
  * @see https://eslint-react.xyz/docs/rules/dom-no-hydrate
3188
3189
  */
3189
- 'react-dom/no-hydrate'?: Linter.RuleEntry<[]>;
3190
+ 'react-extra/dom-no-hydrate'?: Linter.RuleEntry<[]>;
3190
3191
  /**
3191
3192
  * Enforces an explicit 'type' attribute for 'button' elements.
3192
3193
  * @see https://eslint-react.xyz/docs/rules/dom-no-missing-button-type
3193
3194
  */
3194
- 'react-dom/no-missing-button-type'?: Linter.RuleEntry<[]>;
3195
+ 'react-extra/dom-no-missing-button-type'?: Linter.RuleEntry<[]>;
3195
3196
  /**
3196
3197
  * Enforces an explicit 'sandbox' attribute for 'iframe' elements.
3197
3198
  * @see https://eslint-react.xyz/docs/rules/dom-no-missing-iframe-sandbox
3198
3199
  */
3199
- 'react-dom/no-missing-iframe-sandbox'?: Linter.RuleEntry<[]>;
3200
- /**
3201
- * Enforces the absence of a 'namespace' in React elements.
3202
- * @see https://eslint-react.xyz/docs/rules/dom-no-namespace
3203
- */
3204
- 'react-dom/no-namespace'?: Linter.RuleEntry<[]>;
3200
+ 'react-extra/dom-no-missing-iframe-sandbox'?: Linter.RuleEntry<[]>;
3205
3201
  /**
3206
3202
  * Replaces usage of 'ReactDOM.render()' with 'createRoot(node).render()'.
3207
3203
  * @see https://eslint-react.xyz/docs/rules/dom-no-render
3208
3204
  */
3209
- 'react-dom/no-render'?: Linter.RuleEntry<[]>;
3205
+ 'react-extra/dom-no-render'?: Linter.RuleEntry<[]>;
3210
3206
  /**
3211
3207
  * Disallows the return value of 'ReactDOM.render'.
3212
3208
  * @see https://eslint-react.xyz/docs/rules/dom-no-render-return-value
3213
3209
  */
3214
- 'react-dom/no-render-return-value'?: Linter.RuleEntry<[]>;
3210
+ 'react-extra/dom-no-render-return-value'?: Linter.RuleEntry<[]>;
3215
3211
  /**
3216
3212
  * Disallows 'javascript:' URLs as attribute values.
3217
3213
  * @see https://eslint-react.xyz/docs/rules/dom-no-script-url
3218
3214
  */
3219
- 'react-dom/no-script-url'?: Linter.RuleEntry<[]>;
3215
+ 'react-extra/dom-no-script-url'?: Linter.RuleEntry<[]>;
3220
3216
  /**
3221
3217
  * Disallows the use of string style prop in JSX. Use an object instead.
3222
3218
  * @see https://eslint-react.xyz/docs/rules/dom-no-string-style-prop
3223
3219
  */
3224
- 'react-dom/no-string-style-prop'?: Linter.RuleEntry<[]>;
3220
+ 'react-extra/dom-no-string-style-prop'?: Linter.RuleEntry<[]>;
3225
3221
  /**
3226
3222
  * Disallows unknown 'DOM' properties.
3227
3223
  * @see https://eslint-react.xyz/docs/rules/dom-no-unknown-property
3228
3224
  */
3229
- 'react-dom/no-unknown-property'?: Linter.RuleEntry<ReactDomNoUnknownProperty>;
3225
+ 'react-extra/dom-no-unknown-property'?: Linter.RuleEntry<ReactExtraDomNoUnknownProperty>;
3230
3226
  /**
3231
3227
  * Enforces that the 'sandbox' attribute for 'iframe' elements is not set to unsafe combinations.
3232
3228
  * @see https://eslint-react.xyz/docs/rules/dom-no-unsafe-iframe-sandbox
3233
3229
  */
3234
- 'react-dom/no-unsafe-iframe-sandbox'?: Linter.RuleEntry<[]>;
3230
+ 'react-extra/dom-no-unsafe-iframe-sandbox'?: Linter.RuleEntry<[]>;
3235
3231
  /**
3236
3232
  * Disallows 'target="_blank"' without 'rel="noreferrer noopener"'.
3237
3233
  * @see https://eslint-react.xyz/docs/rules/dom-no-unsafe-target-blank
3238
3234
  */
3239
- 'react-dom/no-unsafe-target-blank'?: Linter.RuleEntry<[]>;
3235
+ 'react-extra/dom-no-unsafe-target-blank'?: Linter.RuleEntry<[]>;
3240
3236
  /**
3241
3237
  * Replaces usage of 'useFormState' with 'useActionState'.
3242
3238
  * @see https://eslint-react.xyz/docs/rules/dom-no-use-form-state
3243
3239
  */
3244
- 'react-dom/no-use-form-state'?: Linter.RuleEntry<[]>;
3240
+ 'react-extra/dom-no-use-form-state'?: Linter.RuleEntry<[]>;
3245
3241
  /**
3246
3242
  * Disallows 'children' in void DOM elements.
3247
3243
  * @see https://eslint-react.xyz/docs/rules/dom-no-void-elements-with-children
3248
3244
  */
3249
- 'react-dom/no-void-elements-with-children'?: Linter.RuleEntry<[]>;
3245
+ 'react-extra/dom-no-void-elements-with-children'?: Linter.RuleEntry<[]>;
3250
3246
  /**
3251
3247
  * Enforces importing React DOM via a namespace import.
3252
3248
  * @see https://eslint-react.xyz/docs/rules/dom-prefer-namespace-import
3253
3249
  */
3254
- 'react-dom/prefer-namespace-import'?: Linter.RuleEntry<[]>;
3255
- /**
3256
- * Disallows higher order functions that define components or hooks inside them.
3257
- * @see https://eslint-react.xyz/docs/rules/component-hook-factories
3258
- */
3259
- 'react-extra/component-hook-factories'?: Linter.RuleEntry<[]>;
3250
+ 'react-extra/dom-prefer-namespace-import'?: Linter.RuleEntry<[]>;
3260
3251
  /**
3261
3252
  * Validates usage of Error Boundaries instead of try/catch for errors in child components.
3262
3253
  * @see https://eslint-react.xyz/docs/rules/error-boundaries
@@ -3273,30 +3264,60 @@ interface RuleOptions {
3273
3264
  */
3274
3265
  'react-extra/immutability'?: Linter.RuleEntry<[]>;
3275
3266
  /**
3276
- * Prevents unintentional '$' sign before expression.
3277
- * @see https://eslint-react.xyz/docs/rules/jsx-dollar
3267
+ * Disallows passing 'children' as a prop.
3268
+ * @see https://eslint-react.xyz/docs/rules/no-children-prop
3278
3269
  */
3279
- 'react-extra/jsx-dollar'?: Linter.RuleEntry<[]>;
3270
+ 'react-extra/jsx-no-children-prop'?: Linter.RuleEntry<[]>;
3280
3271
  /**
3281
- * Enforces 'key' prop placement before spread props.
3282
- * @see https://eslint-react.xyz/docs/rules/jsx-key-before-spread
3272
+ * Disallows passing 'children' as a prop when children are also passed as nested content.
3273
+ * @see https://eslint-react.xyz/docs/rules/no-children-prop-with-children
3283
3274
  */
3284
- 'react-extra/jsx-key-before-spread'?: Linter.RuleEntry<[]>;
3275
+ 'react-extra/jsx-no-children-prop-with-children'?: Linter.RuleEntry<[]>;
3285
3276
  /**
3286
- * Prevents comment strings (ex: beginning with '//' or '/*') from being accidentally inserted into a JSX element's text nodes.
3287
- * @see https://eslint-react.xyz/docs/rules/jsx-no-comment-textnodes
3277
+ * Prevents comment strings from being accidentally inserted into a JSX element's text nodes.
3278
+ * @see https://eslint-react.xyz/docs/rules/no-comment-textnodes
3288
3279
  */
3289
3280
  'react-extra/jsx-no-comment-textnodes'?: Linter.RuleEntry<[]>;
3290
3281
  /**
3291
- * Enforces shorthand syntax for boolean props.
3292
- * @see https://eslint-react.xyz/docs/rules/jsx-shorthand-boolean
3282
+ * Prevent patterns that cause deoptimization when using the automatic JSX runtime.
3283
+ * @see https://eslint-react.xyz/docs/rules/no-key-after-spread
3284
+ */
3285
+ 'react-extra/jsx-no-key-after-spread'?: Linter.RuleEntry<[]>;
3286
+ /**
3287
+ * Catches `$` before `{expr}` in JSX — typically from template literal `${expr}` being copy-pasted into JSX without removing the `$`. The `$` "leaks" into the rendered output.
3288
+ * @see https://eslint-react.xyz/docs/rules/no-leaked-dollar
3289
+ */
3290
+ 'react-extra/jsx-no-leaked-dollar'?: Linter.RuleEntry<[]>;
3291
+ /**
3292
+ * Catches `;` at the start of JSX text nodes — typically from accidentally placing a statement-ending `;` inside JSX. The `;` "leaks" into the rendered output.
3293
+ * @see https://eslint-react.xyz/docs/rules/no-leaked-semicolon
3293
3294
  */
3294
- 'react-extra/jsx-shorthand-boolean'?: Linter.RuleEntry<ReactExtraJsxShorthandBoolean>;
3295
+ 'react-extra/jsx-no-leaked-semicolon'?: Linter.RuleEntry<[]>;
3295
3296
  /**
3296
- * Enforces shorthand syntax for fragment elements.
3297
- * @see https://eslint-react.xyz/docs/rules/jsx-shorthand-fragment
3297
+ * Disallow JSX namespace syntax, as React does not support them.
3298
+ * @see https://eslint-react.xyz/docs/rules/no-namespace
3298
3299
  */
3299
- 'react-extra/jsx-shorthand-fragment'?: Linter.RuleEntry<ReactExtraJsxShorthandFragment>;
3300
+ 'react-extra/jsx-no-namespace'?: Linter.RuleEntry<[]>;
3301
+ /**
3302
+ * Disallows useless fragment elements.
3303
+ * @see https://eslint-react.xyz/docs/rules/no-useless-fragment
3304
+ */
3305
+ 'react-extra/jsx-no-useless-fragment'?: Linter.RuleEntry<ReactExtraJsxNoUselessFragment>;
3306
+ /**
3307
+ * Enforces the context name to be a valid component name with the suffix 'Context'.
3308
+ * @see https://eslint-react.xyz/docs/rules/naming-convention-context-name
3309
+ */
3310
+ 'react-extra/naming-convention-context-name'?: Linter.RuleEntry<[]>;
3311
+ /**
3312
+ * Enforces identifier names assigned from 'useId' calls to be either 'id' or end with 'Id'.
3313
+ * @see https://eslint-react.xyz/docs/rules/naming-convention-id-name
3314
+ */
3315
+ 'react-extra/naming-convention-id-name'?: Linter.RuleEntry<[]>;
3316
+ /**
3317
+ * Enforces identifier names assigned from 'useRef' calls to be either 'ref' or end with 'Ref'.
3318
+ * @see https://eslint-react.xyz/docs/rules/naming-convention-ref-name
3319
+ */
3320
+ 'react-extra/naming-convention-ref-name'?: Linter.RuleEntry<[]>;
3300
3321
  /**
3301
3322
  * Disallows accessing 'this.state' inside 'setState' calls.
3302
3323
  * @see https://eslint-react.xyz/docs/rules/no-access-state-in-setstate
@@ -3327,11 +3348,6 @@ interface RuleOptions {
3327
3348
  * @see https://eslint-react.xyz/docs/rules/no-children-only
3328
3349
  */
3329
3350
  'react-extra/no-children-only'?: Linter.RuleEntry<[]>;
3330
- /**
3331
- * Disallows passing 'children' as a prop.
3332
- * @see https://eslint-react.xyz/docs/rules/no-children-prop
3333
- */
3334
- 'react-extra/no-children-prop'?: Linter.RuleEntry<[]>;
3335
3351
  /**
3336
3352
  * Disallows the use of 'Children.toArray' from the 'react' package.
3337
3353
  * @see https://eslint-react.xyz/docs/rules/no-children-to-array
@@ -3433,7 +3449,7 @@ interface RuleOptions {
3433
3449
  */
3434
3450
  'react-extra/no-nested-component-definitions'?: Linter.RuleEntry<[]>;
3435
3451
  /**
3436
- * Disallows nesting lazy component declarations inside other components.
3452
+ * Disallows nesting lazy component declarations inside other components or hooks.
3437
3453
  * @see https://eslint-react.xyz/docs/rules/no-nested-lazy-component-declarations
3438
3454
  */
3439
3455
  'react-extra/no-nested-lazy-component-declarations'?: Linter.RuleEntry<[]>;
@@ -3517,11 +3533,6 @@ interface RuleOptions {
3517
3533
  * @see https://eslint-react.xyz/docs/rules/no-use-context
3518
3534
  */
3519
3535
  'react-extra/no-use-context'?: Linter.RuleEntry<[]>;
3520
- /**
3521
- * Disallows useless fragment elements.
3522
- * @see https://eslint-react.xyz/docs/rules/no-useless-fragment
3523
- */
3524
- 'react-extra/no-useless-fragment'?: Linter.RuleEntry<ReactExtraNoUselessFragment>;
3525
3536
  /**
3526
3537
  * Enforces destructuring assignment for component props and context.
3527
3538
  * @see https://eslint-react.xyz/docs/rules/prefer-destructuring-assignment
@@ -3542,6 +3553,11 @@ interface RuleOptions {
3542
3553
  * @see https://eslint-react.xyz/docs/rules/refs
3543
3554
  */
3544
3555
  'react-extra/refs'?: Linter.RuleEntry<[]>;
3556
+ /**
3557
+ * Validates and transforms React Client/Server Function definitions.
3558
+ * @see https://eslint-react.xyz/docs/rules/function-definition
3559
+ */
3560
+ 'react-extra/rsc-function-definition'?: Linter.RuleEntry<[]>;
3545
3561
  /**
3546
3562
  * Enforces the Rules of Hooks.
3547
3563
  * @see https://react.dev/reference/rules/rules-of-hooks
@@ -3557,16 +3573,6 @@ interface RuleOptions {
3557
3573
  * @see https://eslint-react.xyz/docs/rules/set-state-in-render
3558
3574
  */
3559
3575
  'react-extra/set-state-in-render'?: Linter.RuleEntry<[]>;
3560
- /**
3561
- * Enforces the Rules of Props.
3562
- * @see https://eslint-react.xyz/docs/rules/unstable-rules-of-props
3563
- */
3564
- 'react-extra/unstable-rules-of-props'?: Linter.RuleEntry<[]>;
3565
- /**
3566
- * Enforces the Rules of State.
3567
- * @see https://eslint-react.xyz/docs/rules/unstable-rules-of-state
3568
- */
3569
- 'react-extra/unstable-rules-of-state'?: Linter.RuleEntry<[]>;
3570
3576
  /**
3571
3577
  * Validates against syntax that React Compiler does not support.
3572
3578
  * @see https://eslint-react.xyz/docs/rules/unsupported-syntax
@@ -3582,46 +3588,311 @@ interface RuleOptions {
3582
3588
  * @see https://eslint-react.xyz/docs/rules/use-state
3583
3589
  */
3584
3590
  'react-extra/use-state'?: Linter.RuleEntry<ReactExtraUseState>;
3585
- /**
3586
- * Enforces the context name to be a valid component name with the suffix 'Context'.
3587
- * @see https://eslint-react.xyz/docs/rules/naming-convention-context-name
3588
- */
3589
- 'react-naming-convention/context-name'?: Linter.RuleEntry<[]>;
3590
- /**
3591
- * Enforces identifier names assigned from 'useId' calls to be either 'id' or end with 'Id'.
3592
- * @see https://eslint-react.xyz/docs/rules/naming-convention-id-name
3593
- */
3594
- 'react-naming-convention/id-name'?: Linter.RuleEntry<[]>;
3595
- /**
3596
- * Enforces identifier names assigned from 'useRef' calls to be either 'ref' or end with 'Ref'.
3597
- * @see https://eslint-react.xyz/docs/rules/naming-convention-ref-name
3598
- */
3599
- 'react-naming-convention/ref-name'?: Linter.RuleEntry<[]>;
3600
- /**
3601
- * Validates and transforms React Client/Server Function definitions.
3602
- * @see https://eslint-react.xyz/docs/rules/function-definition
3603
- */
3604
- 'react-rsc/function-definition'?: Linter.RuleEntry<[]>;
3605
3591
  /**
3606
3592
  * Enforces that every 'addEventListener' in a component or custom hook has a corresponding 'removeEventListener'.
3607
3593
  * @see https://eslint-react.xyz/docs/rules/web-api-no-leaked-event-listener
3608
3594
  */
3609
- 'react-web-api/no-leaked-event-listener'?: Linter.RuleEntry<[]>;
3595
+ 'react-extra/web-api-no-leaked-event-listener'?: Linter.RuleEntry<[]>;
3610
3596
  /**
3611
3597
  * Enforces that every 'setInterval' in a component or custom hook has a corresponding 'clearInterval'.
3612
3598
  * @see https://eslint-react.xyz/docs/rules/web-api-no-leaked-interval
3613
3599
  */
3614
- 'react-web-api/no-leaked-interval'?: Linter.RuleEntry<[]>;
3600
+ 'react-extra/web-api-no-leaked-interval'?: Linter.RuleEntry<[]>;
3615
3601
  /**
3616
3602
  * Enforces that every 'ResizeObserver' created in a component or custom hook has a corresponding 'ResizeObserver.disconnect()'.
3617
3603
  * @see https://eslint-react.xyz/docs/rules/web-api-no-leaked-resize-observer
3618
3604
  */
3619
- 'react-web-api/no-leaked-resize-observer'?: Linter.RuleEntry<[]>;
3605
+ 'react-extra/web-api-no-leaked-resize-observer'?: Linter.RuleEntry<[]>;
3620
3606
  /**
3621
3607
  * Enforces that every 'setTimeout' in a component or custom hook has a corresponding 'clearTimeout'.
3622
3608
  * @see https://eslint-react.xyz/docs/rules/web-api-no-leaked-timeout
3623
3609
  */
3624
- 'react-web-api/no-leaked-timeout'?: Linter.RuleEntry<[]>;
3610
+ 'react-extra/web-api-no-leaked-timeout'?: Linter.RuleEntry<[]>;
3611
+ /**
3612
+ * Disallows higher order functions that define components or hooks inside them.
3613
+ * @see https://eslint-react.xyz/docs/rules/component-hook-factories
3614
+ */
3615
+ 'react-extra/x-component-hook-factories'?: Linter.RuleEntry<[]>;
3616
+ /**
3617
+ * Validates usage of Error Boundaries instead of try/catch for errors in child components.
3618
+ * @see https://eslint-react.xyz/docs/rules/error-boundaries
3619
+ */
3620
+ 'react-extra/x-error-boundaries'?: Linter.RuleEntry<[]>;
3621
+ /**
3622
+ * Verifies the list of dependencies for Hooks like 'useEffect' and similar.
3623
+ * @see https://github.com/facebook/react/issues/14920
3624
+ */
3625
+ 'react-extra/x-exhaustive-deps'?: Linter.RuleEntry<ReactExtraXExhaustiveDeps>;
3626
+ /**
3627
+ * Validates against mutating props, state, and other values that are immutable.
3628
+ * @see https://eslint-react.xyz/docs/rules/immutability
3629
+ */
3630
+ 'react-extra/x-immutability'?: Linter.RuleEntry<[]>;
3631
+ /**
3632
+ * Disallows accessing 'this.state' inside 'setState' calls.
3633
+ * @see https://eslint-react.xyz/docs/rules/no-access-state-in-setstate
3634
+ */
3635
+ 'react-extra/x-no-access-state-in-setstate'?: Linter.RuleEntry<[]>;
3636
+ /**
3637
+ * Disallows using an item's index in the array as its key.
3638
+ * @see https://eslint-react.xyz/docs/rules/no-array-index-key
3639
+ */
3640
+ 'react-extra/x-no-array-index-key'?: Linter.RuleEntry<[]>;
3641
+ /**
3642
+ * Disallows the use of 'Children.count' from the 'react' package.
3643
+ * @see https://eslint-react.xyz/docs/rules/no-children-count
3644
+ */
3645
+ 'react-extra/x-no-children-count'?: Linter.RuleEntry<[]>;
3646
+ /**
3647
+ * Disallows the use of 'Children.forEach' from the 'react' package.
3648
+ * @see https://eslint-react.xyz/docs/rules/no-children-for-each
3649
+ */
3650
+ 'react-extra/x-no-children-for-each'?: Linter.RuleEntry<[]>;
3651
+ /**
3652
+ * Disallows the use of 'Children.map' from the 'react' package.
3653
+ * @see https://eslint-react.xyz/docs/rules/no-children-map
3654
+ */
3655
+ 'react-extra/x-no-children-map'?: Linter.RuleEntry<[]>;
3656
+ /**
3657
+ * Disallows the use of 'Children.only' from the 'react' package.
3658
+ * @see https://eslint-react.xyz/docs/rules/no-children-only
3659
+ */
3660
+ 'react-extra/x-no-children-only'?: Linter.RuleEntry<[]>;
3661
+ /**
3662
+ * Disallows the use of 'Children.toArray' from the 'react' package.
3663
+ * @see https://eslint-react.xyz/docs/rules/no-children-to-array
3664
+ */
3665
+ 'react-extra/x-no-children-to-array'?: Linter.RuleEntry<[]>;
3666
+ /**
3667
+ * Disallows class components except for error boundaries.
3668
+ * @see https://eslint-react.xyz/docs/rules/no-class-component
3669
+ */
3670
+ 'react-extra/x-no-class-component'?: Linter.RuleEntry<[]>;
3671
+ /**
3672
+ * Disallows 'cloneElement'.
3673
+ * @see https://eslint-react.xyz/docs/rules/no-clone-element
3674
+ */
3675
+ 'react-extra/x-no-clone-element'?: Linter.RuleEntry<[]>;
3676
+ /**
3677
+ * Replaces usage of 'componentWillMount' with 'UNSAFE_componentWillMount'.
3678
+ * @see https://eslint-react.xyz/docs/rules/no-component-will-mount
3679
+ */
3680
+ 'react-extra/x-no-component-will-mount'?: Linter.RuleEntry<[]>;
3681
+ /**
3682
+ * Replaces usage of 'componentWillReceiveProps' with 'UNSAFE_componentWillReceiveProps'.
3683
+ * @see https://eslint-react.xyz/docs/rules/no-component-will-receive-props
3684
+ */
3685
+ 'react-extra/x-no-component-will-receive-props'?: Linter.RuleEntry<[]>;
3686
+ /**
3687
+ * Replaces usage of 'componentWillUpdate' with 'UNSAFE_componentWillUpdate'.
3688
+ * @see https://eslint-react.xyz/docs/rules/no-component-will-update
3689
+ */
3690
+ 'react-extra/x-no-component-will-update'?: Linter.RuleEntry<[]>;
3691
+ /**
3692
+ * Replaces usage of '<Context.Provider>' with '<Context>'.
3693
+ * @see https://eslint-react.xyz/docs/rules/no-context-provider
3694
+ */
3695
+ 'react-extra/x-no-context-provider'?: Linter.RuleEntry<[]>;
3696
+ /**
3697
+ * Disallows 'createRef' in function components.
3698
+ * @see https://eslint-react.xyz/docs/rules/no-create-ref
3699
+ */
3700
+ 'react-extra/x-no-create-ref'?: Linter.RuleEntry<[]>;
3701
+ /**
3702
+ * Disallows direct mutation of 'this.state'.
3703
+ * @see https://eslint-react.xyz/docs/rules/no-direct-mutation-state
3704
+ */
3705
+ 'react-extra/x-no-direct-mutation-state'?: Linter.RuleEntry<[]>;
3706
+ /**
3707
+ * Prevents duplicate 'key' props on sibling elements when rendering lists.
3708
+ * @see https://eslint-react.xyz/docs/rules/no-duplicate-key
3709
+ */
3710
+ 'react-extra/x-no-duplicate-key'?: Linter.RuleEntry<[]>;
3711
+ /**
3712
+ * Replaces usage of 'forwardRef' with passing 'ref' as a prop.
3713
+ * @see https://eslint-react.xyz/docs/rules/no-forward-ref
3714
+ */
3715
+ 'react-extra/x-no-forward-ref'?: Linter.RuleEntry<[]>;
3716
+ /**
3717
+ * Prevents implicitly passing the 'children' prop to components.
3718
+ * @see https://eslint-react.xyz/docs/rules/no-implicit-children
3719
+ */
3720
+ 'react-extra/x-no-implicit-children'?: Linter.RuleEntry<[]>;
3721
+ /**
3722
+ * Prevents implicitly passing the 'key' prop to components.
3723
+ * @see https://eslint-react.xyz/docs/rules/no-implicit-key
3724
+ */
3725
+ 'react-extra/x-no-implicit-key'?: Linter.RuleEntry<[]>;
3726
+ /**
3727
+ * Prevents implicitly passing the 'ref' prop to components.
3728
+ * @see https://eslint-react.xyz/docs/rules/no-implicit-ref
3729
+ */
3730
+ 'react-extra/x-no-implicit-ref'?: Linter.RuleEntry<[]>;
3731
+ /**
3732
+ * Prevents problematic leaked values from being rendered.
3733
+ * @see https://eslint-react.xyz/docs/rules/no-leaked-conditional-rendering
3734
+ */
3735
+ 'react-extra/x-no-leaked-conditional-rendering'?: Linter.RuleEntry<[]>;
3736
+ /**
3737
+ * Enforces that all components have a 'displayName' that can be used in DevTools.
3738
+ * @see https://eslint-react.xyz/docs/rules/no-missing-component-display-name
3739
+ */
3740
+ 'react-extra/x-no-missing-component-display-name'?: Linter.RuleEntry<[]>;
3741
+ /**
3742
+ * Enforces that all contexts have a 'displayName' that can be used in DevTools.
3743
+ * @see https://eslint-react.xyz/docs/rules/no-missing-context-display-name
3744
+ */
3745
+ 'react-extra/x-no-missing-context-display-name'?: Linter.RuleEntry<[]>;
3746
+ /**
3747
+ * Disallows missing 'key' on items in list rendering.
3748
+ * @see https://eslint-react.xyz/docs/rules/no-missing-key
3749
+ */
3750
+ 'react-extra/x-no-missing-key'?: Linter.RuleEntry<[]>;
3751
+ /**
3752
+ * Prevents incorrect usage of 'captureOwnerStack'.
3753
+ * @see https://eslint-react.xyz/docs/rules/no-misused-capture-owner-stack
3754
+ */
3755
+ 'react-extra/x-no-misused-capture-owner-stack'?: Linter.RuleEntry<[]>;
3756
+ /**
3757
+ * Disallows nesting component definitions inside other components.
3758
+ * @see https://eslint-react.xyz/docs/rules/no-nested-component-definitions
3759
+ */
3760
+ 'react-extra/x-no-nested-component-definitions'?: Linter.RuleEntry<[]>;
3761
+ /**
3762
+ * Disallows nesting lazy component declarations inside other components or hooks.
3763
+ * @see https://eslint-react.xyz/docs/rules/no-nested-lazy-component-declarations
3764
+ */
3765
+ 'react-extra/x-no-nested-lazy-component-declarations'?: Linter.RuleEntry<[]>;
3766
+ /**
3767
+ * Disallows 'shouldComponentUpdate' when extending 'React.PureComponent'.
3768
+ * @see https://eslint-react.xyz/docs/rules/no-redundant-should-component-update
3769
+ */
3770
+ 'react-extra/x-no-redundant-should-component-update'?: Linter.RuleEntry<[]>;
3771
+ /**
3772
+ * Disallows calling 'this.setState' in 'componentDidMount' outside functions such as callbacks.
3773
+ * @see https://eslint-react.xyz/docs/rules/no-set-state-in-component-did-mount
3774
+ */
3775
+ 'react-extra/x-no-set-state-in-component-did-mount'?: Linter.RuleEntry<[]>;
3776
+ /**
3777
+ * Disallows calling 'this.setState' in 'componentDidUpdate' outside functions such as callbacks.
3778
+ * @see https://eslint-react.xyz/docs/rules/no-set-state-in-component-did-update
3779
+ */
3780
+ 'react-extra/x-no-set-state-in-component-did-update'?: Linter.RuleEntry<[]>;
3781
+ /**
3782
+ * Disallows calling 'this.setState' in 'componentWillUpdate' outside functions such as callbacks.
3783
+ * @see https://eslint-react.xyz/docs/rules/no-set-state-in-component-will-update
3784
+ */
3785
+ 'react-extra/x-no-set-state-in-component-will-update'?: Linter.RuleEntry<[]>;
3786
+ /**
3787
+ * Disallows unnecessary usage of 'useCallback'.
3788
+ * @see https://eslint-react.xyz/docs/rules/no-unnecessary-use-callback
3789
+ */
3790
+ 'react-extra/x-no-unnecessary-use-callback'?: Linter.RuleEntry<[]>;
3791
+ /**
3792
+ * Disallows unnecessary usage of 'useMemo'.
3793
+ * @see https://eslint-react.xyz/docs/rules/no-unnecessary-use-memo
3794
+ */
3795
+ 'react-extra/x-no-unnecessary-use-memo'?: Linter.RuleEntry<[]>;
3796
+ /**
3797
+ * Enforces that a function with the 'use' prefix uses at least one Hook inside it.
3798
+ * @see https://eslint-react.xyz/docs/rules/no-unnecessary-use-prefix
3799
+ */
3800
+ 'react-extra/x-no-unnecessary-use-prefix'?: Linter.RuleEntry<[]>;
3801
+ /**
3802
+ * Warns about the use of 'UNSAFE_componentWillMount' in class components.
3803
+ * @see https://eslint-react.xyz/docs/rules/no-unsafe-component-will-mount
3804
+ */
3805
+ 'react-extra/x-no-unsafe-component-will-mount'?: Linter.RuleEntry<[]>;
3806
+ /**
3807
+ * Warns about the use of 'UNSAFE_componentWillReceiveProps' in class components.
3808
+ * @see https://eslint-react.xyz/docs/rules/no-unsafe-component-will-receive-props
3809
+ */
3810
+ 'react-extra/x-no-unsafe-component-will-receive-props'?: Linter.RuleEntry<[]>;
3811
+ /**
3812
+ * Warns about the use of 'UNSAFE_componentWillUpdate' in class components.
3813
+ * @see https://eslint-react.xyz/docs/rules/no-unsafe-component-will-update
3814
+ */
3815
+ 'react-extra/x-no-unsafe-component-will-update'?: Linter.RuleEntry<[]>;
3816
+ /**
3817
+ * Prevents non-stable values (i.e., object literals) from being used as a value for 'Context.Provider'.
3818
+ * @see https://eslint-react.xyz/docs/rules/no-unstable-context-value
3819
+ */
3820
+ 'react-extra/x-no-unstable-context-value'?: Linter.RuleEntry<[]>;
3821
+ /**
3822
+ * Prevents using referential-type values as default props in object destructuring.
3823
+ * @see https://eslint-react.xyz/docs/rules/no-unstable-default-props
3824
+ */
3825
+ 'react-extra/x-no-unstable-default-props'?: Linter.RuleEntry<ReactExtraXNoUnstableDefaultProps>;
3826
+ /**
3827
+ * Warns about unused class component methods and properties.
3828
+ * @see https://eslint-react.xyz/docs/rules/no-unused-class-component-members
3829
+ */
3830
+ 'react-extra/x-no-unused-class-component-members'?: Linter.RuleEntry<[]>;
3831
+ /**
3832
+ * Warns about component props that are defined but never used.
3833
+ * @see https://eslint-react.xyz/docs/rules/no-unused-props
3834
+ */
3835
+ 'react-extra/x-no-unused-props'?: Linter.RuleEntry<[]>;
3836
+ /**
3837
+ * Warns about unused class component state.
3838
+ * @see https://eslint-react.xyz/docs/rules/no-unused-state
3839
+ */
3840
+ 'react-extra/x-no-unused-state'?: Linter.RuleEntry<[]>;
3841
+ /**
3842
+ * Replaces usage of 'useContext' with 'use'.
3843
+ * @see https://eslint-react.xyz/docs/rules/no-use-context
3844
+ */
3845
+ 'react-extra/x-no-use-context'?: Linter.RuleEntry<[]>;
3846
+ /**
3847
+ * Enforces destructuring assignment for component props and context.
3848
+ * @see https://eslint-react.xyz/docs/rules/prefer-destructuring-assignment
3849
+ */
3850
+ 'react-extra/x-prefer-destructuring-assignment'?: Linter.RuleEntry<[]>;
3851
+ /**
3852
+ * Enforces importing React via a namespace import.
3853
+ * @see https://eslint-react.xyz/docs/rules/prefer-namespace-import
3854
+ */
3855
+ 'react-extra/x-prefer-namespace-import'?: Linter.RuleEntry<[]>;
3856
+ /**
3857
+ * Validates that components and hooks are pure by checking that they do not call known-impure functions during render.
3858
+ * @see https://eslint-react.xyz/docs/rules/purity
3859
+ */
3860
+ 'react-extra/x-purity'?: Linter.RuleEntry<[]>;
3861
+ /**
3862
+ * Validates correct usage of refs by checking that 'ref.current' is not read or written during render.
3863
+ * @see https://eslint-react.xyz/docs/rules/refs
3864
+ */
3865
+ 'react-extra/x-refs'?: Linter.RuleEntry<[]>;
3866
+ /**
3867
+ * Enforces the Rules of Hooks.
3868
+ * @see https://react.dev/reference/rules/rules-of-hooks
3869
+ */
3870
+ 'react-extra/x-rules-of-hooks'?: Linter.RuleEntry<ReactExtraXRulesOfHooks>;
3871
+ /**
3872
+ * Validates against setting state synchronously in an effect, which can lead to re-renders that degrade performance.
3873
+ * @see https://eslint-react.xyz/docs/rules/set-state-in-effect
3874
+ */
3875
+ 'react-extra/x-set-state-in-effect'?: Linter.RuleEntry<[]>;
3876
+ /**
3877
+ * Validates against unconditionally setting state during render, which can trigger additional renders and potential infinite render loops.
3878
+ * @see https://eslint-react.xyz/docs/rules/set-state-in-render
3879
+ */
3880
+ 'react-extra/x-set-state-in-render'?: Linter.RuleEntry<[]>;
3881
+ /**
3882
+ * Validates against syntax that React Compiler does not support.
3883
+ * @see https://eslint-react.xyz/docs/rules/unsupported-syntax
3884
+ */
3885
+ 'react-extra/x-unsupported-syntax'?: Linter.RuleEntry<[]>;
3886
+ /**
3887
+ * Validates that 'useMemo' is called with a callback that returns a value.
3888
+ * @see https://eslint-react.xyz/docs/rules/use-memo
3889
+ */
3890
+ 'react-extra/x-use-memo'?: Linter.RuleEntry<[]>;
3891
+ /**
3892
+ * Enforces correct usage of 'useState', including destructuring, symmetric naming of the value and setter, and wrapping expensive initializers in a lazy initializer function.
3893
+ * @see https://eslint-react.xyz/docs/rules/use-state
3894
+ */
3895
+ 'react-extra/x-use-state'?: Linter.RuleEntry<ReactExtraXUseState>;
3625
3896
  /**
3626
3897
  * disallow confusing quantifiers
3627
3898
  * @see https://ota-meshi.github.io/eslint-plugin-regexp/rules/confusing-quantifier.html
@@ -10876,8 +11147,8 @@ type Quotes = [] | [("single" | "double" | "backtick")] | [("single" | "double"
10876
11147
  type Radix = [] | [("always" | "as-needed")]; // ----- react-compiler/react-compiler -----
10877
11148
  type ReactCompilerReactCompiler = [] | [{
10878
11149
  [k: string]: unknown | undefined;
10879
- }]; // ----- react-dom/no-unknown-property -----
10880
- type ReactDomNoUnknownProperty = [] | [{
11150
+ }]; // ----- react-extra/dom-no-unknown-property -----
11151
+ type ReactExtraDomNoUnknownProperty = [] | [{
10881
11152
  ignore?: string[];
10882
11153
  requireDataLowercase?: boolean;
10883
11154
  }]; // ----- react-extra/exhaustive-deps -----
@@ -10886,15 +11157,13 @@ type ReactExtraExhaustiveDeps = [] | [{
10886
11157
  enableDangerousAutofixThisMayCauseInfiniteLoops?: boolean;
10887
11158
  experimental_autoDependenciesHooks?: string[];
10888
11159
  requireExplicitEffectDeps?: boolean;
10889
- }]; // ----- react-extra/jsx-shorthand-boolean -----
10890
- type ReactExtraJsxShorthandBoolean = [] | [(-1 | 1)]; // ----- react-extra/jsx-shorthand-fragment -----
10891
- type ReactExtraJsxShorthandFragment = [] | [(-1 | 1)]; // ----- react-extra/no-unstable-default-props -----
10892
- type ReactExtraNoUnstableDefaultProps = [] | [{
10893
- safeDefaultProps?: string[];
10894
- }]; // ----- react-extra/no-useless-fragment -----
10895
- type ReactExtraNoUselessFragment = [] | [{
11160
+ }]; // ----- react-extra/jsx-no-useless-fragment -----
11161
+ type ReactExtraJsxNoUselessFragment = [] | [{
10896
11162
  allowEmptyFragment?: boolean;
10897
11163
  allowExpressions?: boolean;
11164
+ }]; // ----- react-extra/no-unstable-default-props -----
11165
+ type ReactExtraNoUnstableDefaultProps = [] | [{
11166
+ safeDefaultProps?: string[];
10898
11167
  }]; // ----- react-extra/rules-of-hooks -----
10899
11168
  type ReactExtraRulesOfHooks = [] | [{
10900
11169
  additionalHooks?: string;
@@ -10903,6 +11172,23 @@ type ReactExtraUseState = [] | [{
10903
11172
  enforceAssignment?: boolean;
10904
11173
  enforceLazyInitialization?: boolean;
10905
11174
  enforceSetterName?: boolean;
11175
+ }]; // ----- react-extra/x-exhaustive-deps -----
11176
+ type ReactExtraXExhaustiveDeps = [] | [{
11177
+ additionalHooks?: string;
11178
+ enableDangerousAutofixThisMayCauseInfiniteLoops?: boolean;
11179
+ experimental_autoDependenciesHooks?: string[];
11180
+ requireExplicitEffectDeps?: boolean;
11181
+ }]; // ----- react-extra/x-no-unstable-default-props -----
11182
+ type ReactExtraXNoUnstableDefaultProps = [] | [{
11183
+ safeDefaultProps?: string[];
11184
+ }]; // ----- react-extra/x-rules-of-hooks -----
11185
+ type ReactExtraXRulesOfHooks = [] | [{
11186
+ additionalHooks?: string;
11187
+ }]; // ----- react-extra/x-use-state -----
11188
+ type ReactExtraXUseState = [] | [{
11189
+ enforceAssignment?: boolean;
11190
+ enforceLazyInitialization?: boolean;
11191
+ enforceSetterName?: boolean;
10906
11192
  }]; // ----- regexp/hexadecimal-escape -----
10907
11193
  type RegexpHexadecimalEscape = [] | [("always" | "never")]; // ----- regexp/letter-case -----
10908
11194
  type RegexpLetterCase = [] | [{
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,{configs as c}from"eslint-plugin-de-morgan";import l from"@eslint-community/eslint-plugin-eslint-comments";import u from"@eslint-community/eslint-plugin-eslint-comments/configs";import d from"@eslint/css";import{tailwind3 as f,tailwind4 as p}from"tailwind-csstree";import m from"eslint-plugin-depend";import{fixupPluginRules as h}from"@eslint/compat";import g,{configs as _}from"eslint-plugin-github-action";import*as v from"yaml-eslint-parser";import y from"eslint-config-flat-gitignore";import ee from"@eslint/js";import te from"@stylistic/eslint-plugin";import b from"globals";import x from"eslint-plugin-jsdoc";import S,{configs as C}from"eslint-plugin-jsonc";import*as w from"jsonc-eslint-parser";import T from"@eslint/markdown";import{mergeProcessors as ne,processorPassThrough as re}from"eslint-merge-processors";import ie from"eslint-plugin-n";import ae,{configs as oe}from"eslint-plugin-regexp";import se from"eslint-plugin-sonarjs";import*as E from"empathic/find";import ce,{configs as le}from"eslint-plugin-toml";import D from"eslint-plugin-unicorn";import O from"eslint-plugin-yml";const k=`**/*.?([cm])[jt]s?(x)`,A=`**/*.?([cm])ts`,j=`**/*.?([cm])tsx`,M=`.github/workflows/*.y?(a)ml`,N=`**/*.md`,P=`${N}/${k}`,F=`**/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 I(){return[{files:[k],name:`2digits:antfu`,plugins:{antfu:o},rules:{"antfu/top-level-function":`error`}}]}function L(){return[{files:[k],name:`2digits:boolean`,plugins:{boolean:s},rules:{...c.recommended.rules}}]}const R={"@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`},z=[`storybook`,`@storybook/nextjs`,`@storybook/nextjs-vite`,`@storybook/react-vite`,`@storybook/react-webpack5`,`@storybook/react-native-web-vite`],B=n(u.recommended.rules,R);function V(){return[{files:[k],name:`2digits:comments`,plugins:{comments:l},rules:{...B,"comments/no-unused-disable":`error`,"comments/disable-enable-pair":[`error`,{allowWholeFile:!0}]}}]}async function H(e){if(e?.customSyntax)return e.customSyntax;if(e?.tailwindMajor===3)return f;if(e?.tailwindMajor===4)return p;try{let e=(await r(`tailwindcss`))?.version??``,t=Number.parseInt(e.split(`.`)[0]??`0`,10);if(Number.isFinite(t)&&t>=4)return p}catch{}return f}async function U(e={}){let t=await H(e);return[{name:`2digits:css`,files:[`**/*.css`],language:`css/css`,plugins:{css:d},languageOptions:{tolerant:!0,customSyntax:t},rules:{...d.configs.recommended.rules,...e.overrides}}]}function W(){return[{files:[k],name:`2digits:depend`,plugins:{depend:m},rules:{"depend/ban-dependencies":`warn`}}]}async function G(e){let t=await e;return t.default??t}async function ue(e={}){let{overrides:t={},drizzleObjectName:n=[`drizzle`,`db`]}=e,r=await G(import(`eslint-plugin-drizzle`));return[{files:[k],name:`2digits:drizzle`,plugins:{drizzle:h(r)},rules:{"drizzle/enforce-update-with-where":[`error`,{drizzleObjectName:n}],"drizzle/enforce-delete-with-where":[`error`,{drizzleObjectName:n}],...t}}]}const de=Object.fromEntries(_.recommended.flatMap(({rules:e})=>Object.entries({...e})));function fe(){return[{name:`2digits:github-actions/setup`,plugins:{"github-action":g}},{name:`2digits:github-actions/recommended`,files:[M],ignores:[`!**/${M}`],languageOptions:{parser:v},rules:{...de}}]}async function pe(e={}){let{overrides:t={},files:r=[`**/*.graphql`,`**/*.gql`]}=e,[i,a]=await Promise.all([G(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,R);return[{name:`2digits:graphql`,plugins:{gql:i},languageOptions:{parser:i.parser},files:r,rules:{...c,"gql/naming-convention":[`error`,{allowLeadingUnderscore:!0}],...t}}]}function me(e={}){let{gitIgnore:t,ignores:n=[]}=e;return[{ignores:[F,n].flat(),name:`2digits:ignores`},y({strict:!1,...t,name:`2digits:gitignore`})]}function he(e={}){let{overrides:t={}}=e;return[{files:[k],name:`2digits:javascript`,plugins:{stylistic:te},languageOptions:{ecmaVersion:2022,globals:{...b.browser,...b.es2021,...b.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-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 ge(){return[{files:[k],name:`2digits:jsdoc`,plugins:{jsdoc:x},rules:{"jsdoc/check-access":`error`,"jsdoc/check-param-names":`error`,"jsdoc/check-property-names":`error`,"jsdoc/check-tag-names":[`error`,{typed:!0}],"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":`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":`error`,"jsdoc/require-yields-check":`error`}}]}function _e(){return[...C[`flat/base`].map(e=>({...e,name:`2digits:jsonc/base`})),{name:`2digits:jsonc/json`,files:[`**/*.json`],...K,rules:{...q(C[`flat/recommended-with-json`])}},{name:`2digits:jsonc/jsonc`,files:[`**/*.jsonc`],...K,rules:{...q(C[`flat/recommended-with-jsonc`])}},{name:`2digits:jsonc/json5`,files:[`**/*.json5`],...K,rules:{...q(C[`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:{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$`}]}},...C[`flat/prettier`].map(e=>({...e,name:`2digits:jsonc/prettier`}))]}const K={languageOptions:{parser:w},plugins:{jsonc:S}};function q(e){return Object.fromEntries(e.flatMap(({rules:e})=>Object.entries(e??{})))}const J=[N];function ve(){return[{name:`2digits:markdown/setup`,plugins:{markdown:T}},{name:`2digits:markdown/processor`,files:J,language:`markdown/gfm`,ignores:[`**/*.md/*.md`],processor:ne([T.processors.markdown,re])},{name:`2digits:markdown/parser`,files:J,language:`markdown/gfm`,languageOptions:{parser:be}},{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 ye(){let e=await G(import(`typescript-eslint`)),t=await G(import(`@eslint-react/eslint-plugin`)),r=n({...e.configs.disableTypeChecked.rules,...t.configs[`disable-type-checked`].rules},R);return[{name:`2digits:markdown/disables`,files:[P],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 be={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 xe(e={}){let{files:t=[A,j],overrides:r={},parserOptions:i}=e,[a,o]=await Promise.all([G(import(`@next/eslint-plugin-next`)),G(import(`@typescript-eslint/parser`))]),s=n({...a.configs.recommended.rules,...a.configs[`core-web-vitals`].rules},R);return[{name:`2digits:next/setup`,plugins:{next:h(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 Se={node:`24.14.1`};function Ce(){return[{files:[k],name:`2digits:node`,settings:{node:{version:Se.node}},plugins:{node:ie},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 we(){let e=await G(import(`eslint-plugin-pnpm`));return[{name:`2digits:pnpm/package-json`,files:[`package.json`,`**/package.json`],languageOptions:{parser:w},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 G(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 Te(){let[e,t]=await Promise.all([G(import(`eslint-config-prettier`)),G(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 Ee(e={}){let{files:t=[A,j],overrides:r={},parserOptions:i,tsconfigRootDir:a,reactCompiler:o=!0}=e,[s,c,l,u]=await Promise.all([G(import(`@eslint-react/eslint-plugin`)),G(import(`@typescript-eslint/parser`)),o?G(import(`eslint-plugin-react-compiler`)):Promise.resolve(void 0),G(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},R);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 De(){return[{files:[k],name:`2digits:regexp`,plugins:{regexp:ae},rules:{...oe[`flat/recommended`].rules}}]}function Oe(){return[{files:[k],name:`2digits:sonar`,plugins:{sonar:se},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 ke(e={}){let{files:t=[`**/*.stories.tsx`],overrides:n={},parserOptions:r,storybookDirectory:i=`.storybook`}=e,[a,o]=await Promise.all([G(import(`eslint-plugin-storybook`)),G(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:{"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 Ae(e={}){let{overrides:t={}}=e,[n,{tailwindFunctions:r},i]=await Promise.all([G(import(`eslint-plugin-tailwindcss`)),G(import(`@2digits/constants`)),a().catch(()=>void 0)]),o=E.file(`tailwind.config.ts`,{last:i})??E.file(`tailwind.config.js`,{last:i});return[{files:[k],name:`2digits:tailwind`,plugins:{tailwindcss:n},settings:{tailwindcss:{callees:r,config:o}},rules:{...n.configs.recommended.rules,...t}}]}async function je(e={}){let{overrides:t={}}=e,r=await G(import(`@tanstack/eslint-plugin-query`)),i=n(r.configs[`flat/recommended`].at(0)?.rules??{},R);return[{files:[k],name:`2digits:tanstack-query`,plugins:{"tanstack-query":r},rules:{...i,"tanstack-query/prefer-query-options":`error`,...t}}]}async function Y(e={}){let{overrides:t={}}=e,r=await G(import(`@tanstack/eslint-plugin-router`)),i=n(r.configs[`flat/recommended`].at(0)?.rules??{},R);return[{files:[k],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 Me=Object.fromEntries(le.standard.flatMap(({rules:e})=>Object.entries({...e})));function Ne(){return[{name:`2digits:toml`,files:[`**/*.toml`],language:`toml/toml`,plugins:{toml:ce},rules:{...Me,"toml/array-bracket-spacing":[`error`,`never`],"toml/array-element-newline":[`error`,`consistent`],"toml/indent":[`error`,2,{keyValuePairs:0,subTables:0}]}}]}async function Pe(e={}){let{overrides:t={}}=e,n=await G(import(`eslint-plugin-turbo`));return[{files:[k],name:`2digits:turbo`,plugins:{turbo:n},rules:{"turbo/no-undeclared-env-vars":`error`,...t}}]}async function Fe(e={}){let{overrides:n={},parserOptions:r={}}=e,[{plugin:i,configs:a,parser:o},s]=await Promise.all([G(import(`typescript-eslint`)),G(import(`@2digits/eslint-plugin`))]),c=t(a.strictTypeChecked,R),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:[k],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 Ie(){return[{files:[k],name:`2digits:unicorn`,plugins:{unicorn:D},rules:{...D.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`,"unicorn/no-nested-ternary":`off`}}]}function Le(){return[{name:`2digits:yaml/setup`,plugins:{yml:O}},{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:v}};async function Re(e={}){let{overrides:t={}}=e,n=await G(import(`eslint-plugin-zod`));return[{files:[k],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(me(t.ignores),he(t.js),L(),Ce(),V(),ge(),Ie(),Oe(),De(),I(),_e(),Ne(),Le(),ve(),fe());Z(t.css)&&(o=o.append(U(Q(t.css)))),Z(t.depend,!0)&&(o=o.append(W())),Z(t.turbo,i(`turbo`))&&(o=o.append(Pe(Q(t.turbo))));let{overrides:s,...c}=Q(t.ts);return Z(t.ts,i(`typescript`))&&(o=o.append(Fe(Q(t.ts)))),Z(t.react,i(`react`))&&(o=o.append(Ee({...Q(t.react),...c}))),Z(t.next,i(`next`))&&(o=o.append(xe({...Q(t.next),...c}))),Z(t.storybook,z.some(e=>i(e)))&&(o=o.append(ke({...Q(t.storybook),...c}))),Z(t.tailwind,i(`tailwindcss`))&&(o=o.append(Ae(Q(t.tailwind)))),Z(t.tanstackQuery,i(`react-query`)||i(`@tanstack/react-query`)||i(`@tanstack/react-query-devtools`))&&(o=o.append(je(Q(t.tanstackQuery)))),Z(t.tanstackRouter,i(`@tanstack/react-router`))&&(o=o.append(Y(Q(t.tanstackRouter)))),Z(t.drizzle,i(`drizzle-kit`)||i(`drizzle-orm`))&&(o=o.append(ue(Q(t.drizzle)))),Z(t.zod,i(`zod`))&&(o=o.append(Re(Q(t.zod)))),Z(t.graphql,i(`graphql`))&&(o=o.append(pe(Q(t.graphql)))),Z(t.pnpm,!!await r)&&(o=o.append(we())),o=o.append(...n),i(`prettier`)&&(o=o.append(Te())),o=o.append(ye()),o.renamePlugins(R).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,{configs as c}from"eslint-plugin-de-morgan";import l from"@eslint-community/eslint-plugin-eslint-comments";import u from"@eslint-community/eslint-plugin-eslint-comments/configs";import d from"@eslint/css";import{tailwind3 as f,tailwind4 as p}from"tailwind-csstree";import m from"eslint-plugin-depend";import{fixupPluginRules as h}from"@eslint/compat";import g,{configs as _}from"eslint-plugin-github-action";import*as v from"yaml-eslint-parser";import y from"eslint-config-flat-gitignore";import ee from"@eslint/js";import te from"@stylistic/eslint-plugin";import b from"globals";import x from"eslint-plugin-jsdoc";import S,{configs as C}from"eslint-plugin-jsonc";import*as w from"jsonc-eslint-parser";import T from"@eslint/markdown";import{mergeProcessors as ne,processorPassThrough as re}from"eslint-merge-processors";import ie from"eslint-plugin-n";import ae,{configs as oe}from"eslint-plugin-regexp";import se from"eslint-plugin-sonarjs";import*as E from"empathic/find";import ce,{configs as le}from"eslint-plugin-toml";import D from"eslint-plugin-unicorn";import O from"eslint-plugin-yml";const k=`**/*.?([cm])[jt]s?(x)`,A=`**/*.?([cm])ts`,j=`**/*.?([cm])tsx`,M=`.github/workflows/*.y?(a)ml`,N=`**/*.md`,P=`${N}/${k}`,F=`**/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 I(){return[{files:[k],name:`2digits:antfu`,plugins:{antfu:o},rules:{"antfu/top-level-function":`error`}}]}function L(){return[{files:[k],name:`2digits:boolean`,plugins:{boolean:s},rules:{...c.recommended.rules}}]}const R={"@next/next":`next`,"@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`},z=[`storybook`,`@storybook/nextjs`,`@storybook/nextjs-vite`,`@storybook/react-vite`,`@storybook/react-webpack5`,`@storybook/react-native-web-vite`],B=n(u.recommended.rules,R);function V(){return[{files:[k],name:`2digits:comments`,plugins:{comments:l},rules:{...B,"comments/no-unused-disable":`error`,"comments/disable-enable-pair":[`error`,{allowWholeFile:!0}]}}]}async function H(e){if(e?.customSyntax)return e.customSyntax;if(e?.tailwindMajor===3)return f;if(e?.tailwindMajor===4)return p;try{let e=(await r(`tailwindcss`))?.version??``,t=Number.parseInt(e.split(`.`)[0]??`0`,10);if(Number.isFinite(t)&&t>=4)return p}catch{}return f}async function U(e={}){let t=await H(e);return[{name:`2digits:css`,files:[`**/*.css`],language:`css/css`,plugins:{css:d},languageOptions:{tolerant:!0,customSyntax:t},rules:{...d.configs.recommended.rules,...e.overrides}}]}function W(){return[{files:[k],name:`2digits:depend`,plugins:{depend:m},rules:{"depend/ban-dependencies":`warn`}}]}async function G(e){let t=await e;return t.default??t}async function ue(e={}){let{overrides:t={},drizzleObjectName:n=[`drizzle`,`db`]}=e,r=await G(import(`eslint-plugin-drizzle`));return[{files:[k],name:`2digits:drizzle`,plugins:{drizzle:h(r)},rules:{"drizzle/enforce-update-with-where":[`error`,{drizzleObjectName:n}],"drizzle/enforce-delete-with-where":[`error`,{drizzleObjectName:n}],...t}}]}const de=Object.fromEntries(_.recommended.flatMap(({rules:e})=>Object.entries({...e})));function fe(){return[{name:`2digits:github-actions/setup`,plugins:{"github-action":g}},{name:`2digits:github-actions/recommended`,files:[M],ignores:[`!**/${M}`],languageOptions:{parser:v},rules:{...de}}]}async function pe(e={}){let{overrides:t={},files:r=[`**/*.graphql`,`**/*.gql`]}=e,[i,a]=await Promise.all([G(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,R);return[{name:`2digits:graphql`,plugins:{gql:i},languageOptions:{parser:i.parser},files:r,rules:{...c,"gql/naming-convention":[`error`,{allowLeadingUnderscore:!0}],...t}}]}function me(e={}){let{gitIgnore:t,ignores:n=[]}=e;return[{ignores:[F,n].flat(),name:`2digits:ignores`},y({strict:!1,...t,name:`2digits:gitignore`})]}function he(e={}){let{overrides:t={}}=e;return[{files:[k],name:`2digits:javascript`,plugins:{stylistic:te},languageOptions:{ecmaVersion:2022,globals:{...b.browser,...b.es2021,...b.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-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 ge(){return[{files:[k],name:`2digits:jsdoc`,plugins:{jsdoc:x},rules:{"jsdoc/check-access":`error`,"jsdoc/check-param-names":`error`,"jsdoc/check-property-names":`error`,"jsdoc/check-tag-names":[`error`,{typed:!0}],"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":`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":`error`,"jsdoc/require-yields-check":`error`}}]}function _e(){return[...C[`flat/base`].map(e=>({...e,name:`2digits:jsonc/base`})),{name:`2digits:jsonc/json`,files:[`**/*.json`],...K,rules:{...q(C[`flat/recommended-with-json`])}},{name:`2digits:jsonc/jsonc`,files:[`**/*.jsonc`],...K,rules:{...q(C[`flat/recommended-with-jsonc`])}},{name:`2digits:jsonc/json5`,files:[`**/*.json5`],...K,rules:{...q(C[`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:{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$`}]}},...C[`flat/prettier`].map(e=>({...e,name:`2digits:jsonc/prettier`}))]}const K={languageOptions:{parser:w},plugins:{jsonc:S}};function q(e){return Object.fromEntries(e.flatMap(({rules:e})=>Object.entries(e??{})))}const J=[N];function ve(){return[{name:`2digits:markdown/setup`,plugins:{markdown:T}},{name:`2digits:markdown/processor`,files:J,language:`markdown/gfm`,ignores:[`**/*.md/*.md`],processor:ne([T.processors.markdown,re])},{name:`2digits:markdown/parser`,files:J,language:`markdown/gfm`,languageOptions:{parser:be}},{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 ye(){let e=await G(import(`typescript-eslint`)),t=await G(import(`@eslint-react/eslint-plugin`)),r=n({...e.configs.disableTypeChecked.rules,...t.configs[`disable-type-checked`].rules},R);return[{name:`2digits:markdown/disables`,files:[P],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 be={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 xe(e={}){let{files:t=[A,j],overrides:r={},parserOptions:i}=e,[a,o]=await Promise.all([G(import(`@next/eslint-plugin-next`)),G(import(`@typescript-eslint/parser`))]),s=n({...a.configs.recommended.rules,...a.configs[`core-web-vitals`].rules},R);return[{name:`2digits:next/setup`,plugins:{next:h(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 Se={node:`24.14.1`};function Ce(){return[{files:[k],name:`2digits:node`,settings:{node:{version:Se.node}},plugins:{node:ie},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 we(){let e=await G(import(`eslint-plugin-pnpm`));return[{name:`2digits:pnpm/package-json`,files:[`package.json`,`**/package.json`],languageOptions:{parser:w},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 G(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 Te(){let[e,t]=await Promise.all([G(import(`eslint-config-prettier`)),G(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 Ee(e={}){let{files:t=[A,j],overrides:r={},parserOptions:i,tsconfigRootDir:a,reactCompiler:o=!0}=e,[s,c,l,u]=await Promise.all([G(import(`@eslint-react/eslint-plugin`)),G(import(`@typescript-eslint/parser`)),o?G(import(`eslint-plugin-react-compiler`)):Promise.resolve(void 0),G(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},R);return[{name:`2digits:react/setup`,plugins:{stylistic:u,"react-extra":d[`@eslint-react`],...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-extra/dom-no-missing-button-type":`error`,"react-extra/dom-no-missing-iframe-sandbox":`error`,"react-extra/dom-no-unsafe-target-blank":`error`,"react-extra/naming-convention-context-name":`error`,"react-extra/naming-convention-id-name":`error`,"react-extra/naming-convention-ref-name":`error`,"react-extra/prefer-namespace-import":`error`,"react-extra/jsx-no-useless-fragment":`off`,"stylistic/jsx-curly-newline":`off`,"stylistic/jsx-newline":[`error`,{prevent:!1}],"stylistic/jsx-self-closing-comp":`error`,...r}}]}function De(){return[{files:[k],name:`2digits:regexp`,plugins:{regexp:ae},rules:{...oe[`flat/recommended`].rules}}]}function Oe(){return[{files:[k],name:`2digits:sonar`,plugins:{sonar:se},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 ke(e={}){let{files:t=[`**/*.stories.tsx`],overrides:n={},parserOptions:r,storybookDirectory:i=`.storybook`}=e,[a,o]=await Promise.all([G(import(`eslint-plugin-storybook`)),G(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:{"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 Ae(e={}){let{overrides:t={}}=e,[n,{tailwindFunctions:r},i]=await Promise.all([G(import(`eslint-plugin-tailwindcss`)),G(import(`@2digits/constants`)),a().catch(()=>void 0)]),o=E.file(`tailwind.config.ts`,{last:i})??E.file(`tailwind.config.js`,{last:i});return[{files:[k],name:`2digits:tailwind`,plugins:{tailwindcss:n},settings:{tailwindcss:{callees:r,config:o}},rules:{...n.configs.recommended.rules,...t}}]}async function je(e={}){let{overrides:t={}}=e,r=await G(import(`@tanstack/eslint-plugin-query`)),i=n(r.configs[`flat/recommended`].at(0)?.rules??{},R);return[{files:[k],name:`2digits:tanstack-query`,plugins:{"tanstack-query":r},rules:{...i,"tanstack-query/prefer-query-options":`error`,...t}}]}async function Y(e={}){let{overrides:t={}}=e,r=await G(import(`@tanstack/eslint-plugin-router`)),i=n(r.configs[`flat/recommended`].at(0)?.rules??{},R);return[{files:[k],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 Me=Object.fromEntries(le.standard.flatMap(({rules:e})=>Object.entries({...e})));function Ne(){return[{name:`2digits:toml`,files:[`**/*.toml`],language:`toml/toml`,plugins:{toml:ce},rules:{...Me,"toml/array-bracket-spacing":[`error`,`never`],"toml/array-element-newline":[`error`,`consistent`],"toml/indent":[`error`,2,{keyValuePairs:0,subTables:0}]}}]}async function Pe(e={}){let{overrides:t={}}=e,n=await G(import(`eslint-plugin-turbo`));return[{files:[k],name:`2digits:turbo`,plugins:{turbo:n},rules:{"turbo/no-undeclared-env-vars":`error`,...t}}]}async function Fe(e={}){let{overrides:n={},parserOptions:r={}}=e,[{plugin:i,configs:a,parser:o},s]=await Promise.all([G(import(`typescript-eslint`)),G(import(`@2digits/eslint-plugin`))]),c=t(a.strictTypeChecked,R),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:[k],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 Ie(){return[{files:[k],name:`2digits:unicorn`,plugins:{unicorn:D},rules:{...D.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`,"unicorn/no-nested-ternary":`off`}}]}function Le(){return[{name:`2digits:yaml/setup`,plugins:{yml:O}},{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:v}};async function Re(e={}){let{overrides:t={}}=e,n=await G(import(`eslint-plugin-zod`));return[{files:[k],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(me(t.ignores),he(t.js),L(),Ce(),V(),ge(),Ie(),Oe(),De(),I(),_e(),Ne(),Le(),ve(),fe());Z(t.css)&&(o=o.append(U(Q(t.css)))),Z(t.depend,!0)&&(o=o.append(W())),Z(t.turbo,i(`turbo`))&&(o=o.append(Pe(Q(t.turbo))));let{overrides:s,...c}=Q(t.ts);return Z(t.ts,i(`typescript`))&&(o=o.append(Fe(Q(t.ts)))),Z(t.react,i(`react`))&&(o=o.append(Ee({...Q(t.react),...c}))),Z(t.next,i(`next`))&&(o=o.append(xe({...Q(t.next),...c}))),Z(t.storybook,z.some(e=>i(e)))&&(o=o.append(ke({...Q(t.storybook),...c}))),Z(t.tailwind,i(`tailwindcss`))&&(o=o.append(Ae(Q(t.tailwind)))),Z(t.tanstackQuery,i(`react-query`)||i(`@tanstack/react-query`)||i(`@tanstack/react-query-devtools`))&&(o=o.append(je(Q(t.tanstackQuery)))),Z(t.tanstackRouter,i(`@tanstack/react-router`))&&(o=o.append(Y(Q(t.tanstackRouter)))),Z(t.drizzle,i(`drizzle-kit`)||i(`drizzle-orm`))&&(o=o.append(ue(Q(t.drizzle)))),Z(t.zod,i(`zod`))&&(o=o.append(Re(Q(t.zod)))),Z(t.graphql,i(`graphql`))&&(o=o.append(pe(Q(t.graphql)))),Z(t.pnpm,!!await r)&&(o=o.append(we())),o=o.append(...n),i(`prettier`)&&(o=o.append(Te())),o=o.append(ye()),o.renamePlugins(R).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.3.1",
3
+ "version": "5.3.3",
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
  "keywords": [
6
6
  "eslint-config"
@@ -24,15 +24,15 @@
24
24
  },
25
25
  "dependencies": {
26
26
  "@eslint-community/eslint-plugin-eslint-comments": "4.7.1",
27
- "@eslint-react/eslint-plugin": "3.0.0",
28
- "@eslint/compat": "2.0.3",
27
+ "@eslint-react/eslint-plugin": "4.2.3",
28
+ "@eslint/compat": "2.0.4",
29
29
  "@eslint/css": "1.1.0",
30
30
  "@eslint/js": "10.0.1",
31
31
  "@eslint/markdown": "8.0.1",
32
32
  "@graphql-eslint/eslint-plugin": "4.4.0",
33
33
  "@next/eslint-plugin-next": "16.2.2",
34
34
  "@stylistic/eslint-plugin": "5.10.0",
35
- "@tanstack/eslint-plugin-query": "5.96.1",
35
+ "@tanstack/eslint-plugin-query": "5.96.2",
36
36
  "@tanstack/eslint-plugin-router": "1.161.6",
37
37
  "@typescript-eslint/parser": "8.58.0",
38
38
  "@typescript-eslint/utils": "8.58.0",
@@ -53,13 +53,13 @@
53
53
  "eslint-plugin-react-compiler": "19.1.0-rc.2",
54
54
  "eslint-plugin-regexp": "3.1.0",
55
55
  "eslint-plugin-sonarjs": "4.0.2",
56
- "eslint-plugin-storybook": "10.3.3",
56
+ "eslint-plugin-storybook": "10.3.4",
57
57
  "eslint-plugin-tailwindcss": "3.18.2",
58
58
  "eslint-plugin-toml": "1.3.1",
59
59
  "eslint-plugin-turbo": "2.9.3",
60
60
  "eslint-plugin-unicorn": "64.0.0",
61
61
  "eslint-plugin-yml": "3.3.1",
62
- "eslint-plugin-zod": "3.5.0",
62
+ "eslint-plugin-zod": "3.5.1",
63
63
  "globals": "17.4.0",
64
64
  "graphql-config": "5.1.6",
65
65
  "jsonc-eslint-parser": "3.1.0",
@@ -69,15 +69,15 @@
69
69
  "typescript-eslint": "8.58.0",
70
70
  "yaml-eslint-parser": "2.0.0",
71
71
  "@2digits/constants": "1.1.18",
72
- "@2digits/eslint-plugin": "4.0.8"
72
+ "@2digits/eslint-plugin": "4.0.9"
73
73
  },
74
74
  "devDependencies": {
75
75
  "@arethetypeswrong/core": "0.18.2",
76
76
  "@eslint/config-inspector": "1.5.0",
77
77
  "@types/react": "19.2.14",
78
- "@typescript/native-preview": "7.0.0-dev.20260401.1",
78
+ "@typescript/native-preview": "7.0.0-dev.20260404.1",
79
79
  "dedent": "1.7.2",
80
- "eslint": "10.1.0",
80
+ "eslint": "10.2.0",
81
81
  "eslint-typegen": "2.3.1",
82
82
  "publint": "0.3.18",
83
83
  "react": "19.2.4",
@@ -90,7 +90,7 @@
90
90
  "@2digits/tsconfig": "0.8.7"
91
91
  },
92
92
  "peerDependencies": {
93
- "eslint": "10.1.0"
93
+ "eslint": "10.2.0"
94
94
  },
95
95
  "engines": {
96
96
  "node": "24.14.1"