@2digits/eslint-config 2.3.3 → 2.3.5
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.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +146 -81
- package/dist/index.d.ts +146 -81
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +20 -20
package/dist/index.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ import { FlatGitignoreOptions } from 'eslint-config-flat-gitignore';
|
|
|
10
10
|
interface RuleOptions {
|
|
11
11
|
/**
|
|
12
12
|
* Enforce giving proper names to type parameters when there are two or more
|
|
13
|
-
* @see https://github.com/2digits-agency/configs/blob/@2digits/eslint-plugin@2.1.
|
|
13
|
+
* @see https://github.com/2digits-agency/configs/blob/@2digits/eslint-plugin@2.1.4/packages/eslint/src/rules/type-param-names.ts
|
|
14
14
|
*/
|
|
15
15
|
'@2digits/type-param-names'?: Linter.RuleEntry<[]>
|
|
16
16
|
/**
|
|
@@ -785,6 +785,11 @@ Backward pagination arguments
|
|
|
785
785
|
* @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/check-values.md#repos-sticky-header
|
|
786
786
|
*/
|
|
787
787
|
'jsdoc/check-values'?: Linter.RuleEntry<JsdocCheckValues>
|
|
788
|
+
/**
|
|
789
|
+
* Converts non-JSDoc comments preceding or following nodes into JSDoc ones
|
|
790
|
+
* @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/convert-to-jsdoc-comments.md#repos-sticky-header
|
|
791
|
+
*/
|
|
792
|
+
'jsdoc/convert-to-jsdoc-comments'?: Linter.RuleEntry<JsdocConvertToJsdocComments>
|
|
788
793
|
/**
|
|
789
794
|
* Expects specific tags to be empty of any content.
|
|
790
795
|
* @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/empty-tags.md#repos-sticky-header
|
|
@@ -959,6 +964,11 @@ Backward pagination arguments
|
|
|
959
964
|
* @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-returns-type.md#repos-sticky-header
|
|
960
965
|
*/
|
|
961
966
|
'jsdoc/require-returns-type'?: Linter.RuleEntry<JsdocRequireReturnsType>
|
|
967
|
+
/**
|
|
968
|
+
* Requires template tags for each generic type parameter
|
|
969
|
+
* @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-template.md#repos-sticky-header
|
|
970
|
+
*/
|
|
971
|
+
'jsdoc/require-template'?: Linter.RuleEntry<JsdocRequireTemplate>
|
|
962
972
|
/**
|
|
963
973
|
* Requires that throw statements are documented.
|
|
964
974
|
* @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-throws.md#repos-sticky-header
|
|
@@ -2398,289 +2408,304 @@ Backward pagination arguments
|
|
|
2398
2408
|
'react-compiler/react-compiler'?: Linter.RuleEntry<ReactCompilerReactCompiler>
|
|
2399
2409
|
/**
|
|
2400
2410
|
* disallow passing 'children' to void DOM elements
|
|
2401
|
-
* @see https://eslint-react.xyz/rules/dom-no-children-in-void-dom-elements
|
|
2411
|
+
* @see https://eslint-react.xyz/docs/rules/dom-no-children-in-void-dom-elements
|
|
2402
2412
|
*/
|
|
2403
2413
|
'react-dom/no-children-in-void-dom-elements'?: Linter.RuleEntry<[]>
|
|
2404
2414
|
/**
|
|
2405
2415
|
* disallow when a DOM component is using 'dangerouslySetInnerHTML'
|
|
2406
|
-
* @see https://eslint-react.xyz/rules/dom-no-dangerously-set-innerhtml
|
|
2416
|
+
* @see https://eslint-react.xyz/docs/rules/dom-no-dangerously-set-innerhtml
|
|
2407
2417
|
*/
|
|
2408
2418
|
'react-dom/no-dangerously-set-innerhtml'?: Linter.RuleEntry<[]>
|
|
2409
2419
|
/**
|
|
2410
2420
|
* disallow when a DOM component is using both 'children' and 'dangerouslySetInnerHTML'
|
|
2411
|
-
* @see https://eslint-react.xyz/rules/dom-no-dangerously-set-innerhtml-with-children
|
|
2421
|
+
* @see https://eslint-react.xyz/docs/rules/dom-no-dangerously-set-innerhtml-with-children
|
|
2412
2422
|
*/
|
|
2413
2423
|
'react-dom/no-dangerously-set-innerhtml-with-children'?: Linter.RuleEntry<[]>
|
|
2414
2424
|
/**
|
|
2415
2425
|
* disallow 'findDOMNode'
|
|
2416
|
-
* @see https://eslint-react.xyz/rules/dom-no-find-dom-node
|
|
2426
|
+
* @see https://eslint-react.xyz/docs/rules/dom-no-find-dom-node
|
|
2417
2427
|
*/
|
|
2418
2428
|
'react-dom/no-find-dom-node'?: Linter.RuleEntry<[]>
|
|
2419
2429
|
/**
|
|
2420
2430
|
* enforce that button component have an explicit 'type' attribute
|
|
2421
|
-
* @see https://eslint-react.xyz/rules/dom-no-missing-button-type
|
|
2431
|
+
* @see https://eslint-react.xyz/docs/rules/dom-no-missing-button-type
|
|
2422
2432
|
*/
|
|
2423
2433
|
'react-dom/no-missing-button-type'?: Linter.RuleEntry<[]>
|
|
2424
2434
|
/**
|
|
2425
2435
|
* enforce that 'iframe' component have an explicit 'sandbox' attribute
|
|
2426
|
-
* @see https://eslint-react.xyz/rules/dom-no-missing-iframe-sandbox
|
|
2436
|
+
* @see https://eslint-react.xyz/docs/rules/dom-no-missing-iframe-sandbox
|
|
2427
2437
|
*/
|
|
2428
2438
|
'react-dom/no-missing-iframe-sandbox'?: Linter.RuleEntry<[]>
|
|
2429
2439
|
/**
|
|
2430
2440
|
* enforce that namespaces are not used in React elements
|
|
2431
|
-
* @see https://eslint-react.xyz/rules/dom-no-namespace
|
|
2441
|
+
* @see https://eslint-react.xyz/docs/rules/dom-no-namespace
|
|
2432
2442
|
*/
|
|
2433
2443
|
'react-dom/no-namespace'?: Linter.RuleEntry<[]>
|
|
2434
2444
|
/**
|
|
2435
2445
|
* disallow usage of the return value of 'ReactDOM.render'
|
|
2436
|
-
* @see https://eslint-react.xyz/rules/dom-no-render-return-value
|
|
2446
|
+
* @see https://eslint-react.xyz/docs/rules/dom-no-render-return-value
|
|
2437
2447
|
*/
|
|
2438
2448
|
'react-dom/no-render-return-value'?: Linter.RuleEntry<[]>
|
|
2439
2449
|
/**
|
|
2440
2450
|
* disallow 'javascript:' URLs as JSX event handler prop's value
|
|
2441
|
-
* @see https://eslint-react.xyz/rules/dom-no-script-url
|
|
2451
|
+
* @see https://eslint-react.xyz/docs/rules/dom-no-script-url
|
|
2442
2452
|
*/
|
|
2443
2453
|
'react-dom/no-script-url'?: Linter.RuleEntry<[]>
|
|
2444
2454
|
/**
|
|
2445
2455
|
* disallow unsafe iframe 'sandbox' attribute combinations
|
|
2446
|
-
* @see https://eslint-react.xyz/rules/dom-no-unsafe-iframe-sandbox
|
|
2456
|
+
* @see https://eslint-react.xyz/docs/rules/dom-no-unsafe-iframe-sandbox
|
|
2447
2457
|
*/
|
|
2448
2458
|
'react-dom/no-unsafe-iframe-sandbox'?: Linter.RuleEntry<[]>
|
|
2449
2459
|
/**
|
|
2450
|
-
* disallow 'target="_blank"' on an external link without 'rel="noreferrer noopener"'
|
|
2451
|
-
* @see https://eslint-react.xyz/rules/dom-no-unsafe-target-blank
|
|
2460
|
+
* disallow 'target="_blank"' on an external link without 'rel="noreferrer noopener"'
|
|
2461
|
+
* @see https://eslint-react.xyz/docs/rules/dom-no-unsafe-target-blank
|
|
2452
2462
|
*/
|
|
2453
2463
|
'react-dom/no-unsafe-target-blank'?: Linter.RuleEntry<[]>
|
|
2454
2464
|
/**
|
|
2455
2465
|
* enforce boolean attributes notation in JSX
|
|
2456
|
-
* @see https://eslint-react.xyz/rules/avoid-shorthand-boolean
|
|
2466
|
+
* @see https://eslint-react.xyz/docs/rules/avoid-shorthand-boolean
|
|
2457
2467
|
*/
|
|
2458
2468
|
'react-extra/avoid-shorthand-boolean'?: Linter.RuleEntry<[]>
|
|
2459
2469
|
/**
|
|
2460
2470
|
* enforce using fragment component instead of shorthand fragment syntax
|
|
2461
|
-
* @see https://eslint-react.xyz/rules/avoid-shorthand-fragment
|
|
2471
|
+
* @see https://eslint-react.xyz/docs/rules/avoid-shorthand-fragment
|
|
2462
2472
|
*/
|
|
2463
2473
|
'react-extra/avoid-shorthand-fragment'?: Linter.RuleEntry<[]>
|
|
2464
2474
|
/**
|
|
2465
2475
|
* require all 'forwardRef' components include a 'ref' parameter
|
|
2466
|
-
* @see https://eslint-react.xyz/rules/ensure-forward-ref-using-ref
|
|
2476
|
+
* @see https://eslint-react.xyz/docs/rules/ensure-forward-ref-using-ref
|
|
2467
2477
|
*/
|
|
2468
2478
|
'react-extra/ensure-forward-ref-using-ref'?: Linter.RuleEntry<[]>
|
|
2469
2479
|
/**
|
|
2470
2480
|
* disallow accessing 'this.state' within 'setState'
|
|
2471
|
-
* @see https://eslint-react.xyz/rules/no-access-state-in-setstate
|
|
2481
|
+
* @see https://eslint-react.xyz/docs/rules/no-access-state-in-setstate
|
|
2472
2482
|
*/
|
|
2473
2483
|
'react-extra/no-access-state-in-setstate'?: Linter.RuleEntry<[]>
|
|
2474
2484
|
/**
|
|
2475
2485
|
* disallow using Array index as key
|
|
2476
|
-
* @see https://eslint-react.xyz/rules/no-array-index-key
|
|
2486
|
+
* @see https://eslint-react.xyz/docs/rules/no-array-index-key
|
|
2477
2487
|
*/
|
|
2478
2488
|
'react-extra/no-array-index-key'?: Linter.RuleEntry<[]>
|
|
2479
2489
|
/**
|
|
2480
2490
|
* disallow 'Children.count'
|
|
2481
|
-
* @see https://eslint-react.xyz/rules/no-children-count
|
|
2491
|
+
* @see https://eslint-react.xyz/docs/rules/no-children-count
|
|
2482
2492
|
*/
|
|
2483
2493
|
'react-extra/no-children-count'?: Linter.RuleEntry<[]>
|
|
2484
2494
|
/**
|
|
2485
2495
|
* disallow 'Children.forEach'
|
|
2486
|
-
* @see https://eslint-react.xyz/rules/no-children-for-each
|
|
2496
|
+
* @see https://eslint-react.xyz/docs/rules/no-children-for-each
|
|
2487
2497
|
*/
|
|
2488
2498
|
'react-extra/no-children-for-each'?: Linter.RuleEntry<[]>
|
|
2489
2499
|
/**
|
|
2490
2500
|
* disallow 'Children.map'
|
|
2491
|
-
* @see https://eslint-react.xyz/rules/no-children-map
|
|
2501
|
+
* @see https://eslint-react.xyz/docs/rules/no-children-map
|
|
2492
2502
|
*/
|
|
2493
2503
|
'react-extra/no-children-map'?: Linter.RuleEntry<[]>
|
|
2494
2504
|
/**
|
|
2495
2505
|
* disallow 'Children.only'
|
|
2496
|
-
* @see https://eslint-react.xyz/rules/no-children-only
|
|
2506
|
+
* @see https://eslint-react.xyz/docs/rules/no-children-only
|
|
2497
2507
|
*/
|
|
2498
2508
|
'react-extra/no-children-only'?: Linter.RuleEntry<[]>
|
|
2499
2509
|
/**
|
|
2500
2510
|
* disallow passing of 'children' as props
|
|
2501
|
-
* @see https://eslint-react.xyz/rules/no-children-prop
|
|
2511
|
+
* @see https://eslint-react.xyz/docs/rules/no-children-prop
|
|
2502
2512
|
*/
|
|
2503
2513
|
'react-extra/no-children-prop'?: Linter.RuleEntry<[]>
|
|
2504
2514
|
/**
|
|
2505
2515
|
* disallow 'Children.toArray'
|
|
2506
|
-
* @see https://eslint-react.xyz/rules/no-children-to-array
|
|
2516
|
+
* @see https://eslint-react.xyz/docs/rules/no-children-to-array
|
|
2507
2517
|
*/
|
|
2508
2518
|
'react-extra/no-children-to-array'?: Linter.RuleEntry<[]>
|
|
2509
2519
|
/**
|
|
2510
2520
|
* disallow class component
|
|
2511
|
-
* @see https://eslint-react.xyz/rules/no-class-component
|
|
2521
|
+
* @see https://eslint-react.xyz/docs/rules/no-class-component
|
|
2512
2522
|
*/
|
|
2513
2523
|
'react-extra/no-class-component'?: Linter.RuleEntry<[]>
|
|
2514
2524
|
/**
|
|
2515
2525
|
* disallow 'cloneElement'
|
|
2516
|
-
* @see https://eslint-react.xyz/rules/no-clone-element
|
|
2526
|
+
* @see https://eslint-react.xyz/docs/rules/no-clone-element
|
|
2517
2527
|
*/
|
|
2518
2528
|
'react-extra/no-clone-element'?: Linter.RuleEntry<[]>
|
|
2519
2529
|
/**
|
|
2520
2530
|
* disallow comments from being inserted as text nodes
|
|
2521
|
-
* @see https://eslint-react.xyz/rules/no-comment-textnodes
|
|
2531
|
+
* @see https://eslint-react.xyz/docs/rules/no-comment-textnodes
|
|
2522
2532
|
*/
|
|
2523
2533
|
'react-extra/no-comment-textnodes'?: Linter.RuleEntry<[]>
|
|
2524
2534
|
/**
|
|
2525
2535
|
* disallow complicated conditional rendering
|
|
2526
|
-
* @see https://eslint-react.xyz/rules/no-complicated-conditional-rendering
|
|
2536
|
+
* @see https://eslint-react.xyz/docs/rules/no-complicated-conditional-rendering
|
|
2527
2537
|
* @deprecated
|
|
2528
2538
|
*/
|
|
2529
2539
|
'react-extra/no-complicated-conditional-rendering'?: Linter.RuleEntry<[]>
|
|
2530
2540
|
/**
|
|
2531
2541
|
* disallow usage of 'componentWillMount'
|
|
2532
|
-
* @see https://eslint-react.xyz/rules/no-component-will-mount
|
|
2542
|
+
* @see https://eslint-react.xyz/docs/rules/no-component-will-mount
|
|
2533
2543
|
*/
|
|
2534
2544
|
'react-extra/no-component-will-mount'?: Linter.RuleEntry<[]>
|
|
2535
2545
|
/**
|
|
2536
2546
|
* disallow usage of 'componentWillReceiveProps'
|
|
2537
|
-
* @see https://eslint-react.xyz/rules/no-component-will-receive-props
|
|
2547
|
+
* @see https://eslint-react.xyz/docs/rules/no-component-will-receive-props
|
|
2538
2548
|
*/
|
|
2539
2549
|
'react-extra/no-component-will-receive-props'?: Linter.RuleEntry<[]>
|
|
2540
2550
|
/**
|
|
2541
2551
|
* disallow usage of 'componentWillUpdate'
|
|
2542
|
-
* @see https://eslint-react.xyz/rules/no-component-will-update
|
|
2552
|
+
* @see https://eslint-react.xyz/docs/rules/no-component-will-update
|
|
2543
2553
|
*/
|
|
2544
2554
|
'react-extra/no-component-will-update'?: Linter.RuleEntry<[]>
|
|
2545
2555
|
/**
|
|
2546
2556
|
* disallow 'createRef' in function components
|
|
2547
|
-
* @see https://eslint-react.xyz/rules/no-create-ref
|
|
2557
|
+
* @see https://eslint-react.xyz/docs/rules/no-create-ref
|
|
2548
2558
|
*/
|
|
2549
2559
|
'react-extra/no-create-ref'?: Linter.RuleEntry<[]>
|
|
2550
2560
|
/**
|
|
2551
2561
|
* disallow direct mutation of state
|
|
2552
|
-
* @see https://eslint-react.xyz/rules/no-direct-mutation-state
|
|
2562
|
+
* @see https://eslint-react.xyz/docs/rules/no-direct-mutation-state
|
|
2553
2563
|
*/
|
|
2554
2564
|
'react-extra/no-direct-mutation-state'?: Linter.RuleEntry<[]>
|
|
2555
2565
|
/**
|
|
2556
2566
|
* disallow duplicate keys in 'key' prop when rendering list
|
|
2557
|
-
* @see https://eslint-react.xyz/rules/no-duplicate-key
|
|
2567
|
+
* @see https://eslint-react.xyz/docs/rules/no-duplicate-key
|
|
2558
2568
|
*/
|
|
2559
2569
|
'react-extra/no-duplicate-key'?: Linter.RuleEntry<[]>
|
|
2560
2570
|
/**
|
|
2561
2571
|
* disallow spreading 'key' from objects.
|
|
2562
|
-
* @see https://eslint-react.xyz/rules/no-implicit-key
|
|
2572
|
+
* @see https://eslint-react.xyz/docs/rules/no-implicit-key
|
|
2563
2573
|
* @deprecated
|
|
2564
2574
|
*/
|
|
2565
2575
|
'react-extra/no-implicit-key'?: Linter.RuleEntry<[]>
|
|
2566
2576
|
/**
|
|
2567
2577
|
* disallow problematic leaked values from being rendered
|
|
2568
|
-
* @see https://eslint-react.xyz/rules/no-leaked-conditional-rendering
|
|
2578
|
+
* @see https://eslint-react.xyz/docs/rules/no-leaked-conditional-rendering
|
|
2569
2579
|
*/
|
|
2570
2580
|
'react-extra/no-leaked-conditional-rendering'?: Linter.RuleEntry<[]>
|
|
2571
2581
|
/**
|
|
2572
2582
|
* require 'displayName' for memo and forwardRef components
|
|
2573
|
-
* @see https://eslint-react.xyz/rules/no-missing-component-display-name
|
|
2583
|
+
* @see https://eslint-react.xyz/docs/rules/no-missing-component-display-name
|
|
2574
2584
|
*/
|
|
2575
2585
|
'react-extra/no-missing-component-display-name'?: Linter.RuleEntry<[]>
|
|
2576
2586
|
/**
|
|
2577
2587
|
* require 'key' prop when rendering list
|
|
2578
|
-
* @see https://eslint-react.xyz/rules/no-missing-key
|
|
2588
|
+
* @see https://eslint-react.xyz/docs/rules/no-missing-key
|
|
2579
2589
|
*/
|
|
2580
2590
|
'react-extra/no-missing-key'?: Linter.RuleEntry<[]>
|
|
2581
2591
|
/**
|
|
2582
2592
|
* disallow usage of unstable nested components
|
|
2583
|
-
* @see https://eslint-react.xyz/rules/no-nested-components
|
|
2593
|
+
* @see https://eslint-react.xyz/docs/rules/no-nested-components
|
|
2584
2594
|
*/
|
|
2585
2595
|
'react-extra/no-nested-components'?: Linter.RuleEntry<[]>
|
|
2586
2596
|
/**
|
|
2587
2597
|
* disallow usage of 'shouldComponentUpdate' in class component extends 'React.PureComponent'
|
|
2588
|
-
* @see https://eslint-react.xyz/rules/no-redundant-should-component-update
|
|
2598
|
+
* @see https://eslint-react.xyz/docs/rules/no-redundant-should-component-update
|
|
2589
2599
|
*/
|
|
2590
2600
|
'react-extra/no-redundant-should-component-update'?: Linter.RuleEntry<[]>
|
|
2591
2601
|
/**
|
|
2592
2602
|
* disallow 'setState' in 'componentDidMount'
|
|
2593
|
-
* @see https://eslint-react.xyz/rules/no-set-state-in-component-did-mount
|
|
2603
|
+
* @see https://eslint-react.xyz/docs/rules/no-set-state-in-component-did-mount
|
|
2594
2604
|
*/
|
|
2595
2605
|
'react-extra/no-set-state-in-component-did-mount'?: Linter.RuleEntry<[]>
|
|
2596
2606
|
/**
|
|
2597
2607
|
* disallow 'setState' in 'componentDidUpdate'
|
|
2598
|
-
* @see https://eslint-react.xyz/rules/no-set-state-in-component-did-update
|
|
2608
|
+
* @see https://eslint-react.xyz/docs/rules/no-set-state-in-component-did-update
|
|
2599
2609
|
*/
|
|
2600
2610
|
'react-extra/no-set-state-in-component-did-update'?: Linter.RuleEntry<[]>
|
|
2601
2611
|
/**
|
|
2602
2612
|
* disallow 'setState' in 'componentWillUpdate'
|
|
2603
|
-
* @see https://eslint-react.xyz/rules/no-set-state-in-component-will-update
|
|
2613
|
+
* @see https://eslint-react.xyz/docs/rules/no-set-state-in-component-will-update
|
|
2604
2614
|
*/
|
|
2605
2615
|
'react-extra/no-set-state-in-component-will-update'?: Linter.RuleEntry<[]>
|
|
2606
2616
|
/**
|
|
2607
2617
|
* disallow using deprecated string refs
|
|
2608
|
-
* @see https://eslint-react.xyz/rules/no-string-refs
|
|
2618
|
+
* @see https://eslint-react.xyz/docs/rules/no-string-refs
|
|
2609
2619
|
*/
|
|
2610
2620
|
'react-extra/no-string-refs'?: Linter.RuleEntry<[]>
|
|
2611
2621
|
/**
|
|
2612
2622
|
* disallow usage of 'UNSAFE_componentWillMount'
|
|
2613
|
-
* @see https://eslint-react.xyz/rules/no-unsafe-component-will-mount
|
|
2623
|
+
* @see https://eslint-react.xyz/docs/rules/no-unsafe-component-will-mount
|
|
2614
2624
|
*/
|
|
2615
2625
|
'react-extra/no-unsafe-component-will-mount'?: Linter.RuleEntry<[]>
|
|
2616
2626
|
/**
|
|
2617
2627
|
* disallow usage of 'UNSAFE_componentWillReceiveProps'
|
|
2618
|
-
* @see https://eslint-react.xyz/rules/no-unsafe-component-will-receive-props
|
|
2628
|
+
* @see https://eslint-react.xyz/docs/rules/no-unsafe-component-will-receive-props
|
|
2619
2629
|
*/
|
|
2620
2630
|
'react-extra/no-unsafe-component-will-receive-props'?: Linter.RuleEntry<[]>
|
|
2621
2631
|
/**
|
|
2622
2632
|
* disallow usage of 'UNSAFE_componentWillUpdate'
|
|
2623
|
-
* @see https://eslint-react.xyz/rules/no-unsafe-component-will-update
|
|
2633
|
+
* @see https://eslint-react.xyz/docs/rules/no-unsafe-component-will-update
|
|
2624
2634
|
*/
|
|
2625
2635
|
'react-extra/no-unsafe-component-will-update'?: Linter.RuleEntry<[]>
|
|
2626
2636
|
/**
|
|
2627
2637
|
* disallow passing constructed values to context providers
|
|
2628
|
-
* @see https://eslint-react.xyz/rules/no-unstable-context-value
|
|
2638
|
+
* @see https://eslint-react.xyz/docs/rules/no-unstable-context-value
|
|
2629
2639
|
*/
|
|
2630
2640
|
'react-extra/no-unstable-context-value'?: Linter.RuleEntry<[]>
|
|
2631
2641
|
/**
|
|
2632
2642
|
* disallow usage of unstable value as default param in function component
|
|
2633
|
-
* @see https://eslint-react.xyz/rules/no-unstable-default-props
|
|
2643
|
+
* @see https://eslint-react.xyz/docs/rules/no-unstable-default-props
|
|
2634
2644
|
*/
|
|
2635
2645
|
'react-extra/no-unstable-default-props'?: Linter.RuleEntry<[]>
|
|
2636
2646
|
/**
|
|
2637
2647
|
* disallow unused class component members
|
|
2638
|
-
* @see https://eslint-react.xyz/rules/no-unused-class-component-members
|
|
2648
|
+
* @see https://eslint-react.xyz/docs/rules/no-unused-class-component-members
|
|
2639
2649
|
*/
|
|
2640
2650
|
'react-extra/no-unused-class-component-members'?: Linter.RuleEntry<[]>
|
|
2641
2651
|
/**
|
|
2642
|
-
* Prevents unused state of class component
|
|
2643
|
-
* @see https://eslint-react.xyz/rules/no-unused-state
|
|
2652
|
+
* Prevents unused state of class component
|
|
2653
|
+
* @see https://eslint-react.xyz/docs/rules/no-unused-state
|
|
2644
2654
|
*/
|
|
2645
2655
|
'react-extra/no-unused-state'?: Linter.RuleEntry<[]>
|
|
2646
2656
|
/**
|
|
2647
2657
|
* disallow unnecessary fragments
|
|
2648
|
-
* @see https://eslint-react.xyz/rules/no-useless-fragment
|
|
2658
|
+
* @see https://eslint-react.xyz/docs/rules/no-useless-fragment
|
|
2649
2659
|
*/
|
|
2650
2660
|
'react-extra/no-useless-fragment'?: Linter.RuleEntry<[]>
|
|
2651
2661
|
/**
|
|
2652
2662
|
* enforce using destructuring assignment in component props and context
|
|
2653
|
-
* @see https://eslint-react.xyz/rules/prefer-destructuring-assignment
|
|
2663
|
+
* @see https://eslint-react.xyz/docs/rules/prefer-destructuring-assignment
|
|
2654
2664
|
*/
|
|
2655
2665
|
'react-extra/prefer-destructuring-assignment'?: Linter.RuleEntry<[]>
|
|
2666
|
+
/**
|
|
2667
|
+
* enforce that component props are read-only
|
|
2668
|
+
* @see https://eslint-react.xyz/docs/rules/prefer-read-only-props
|
|
2669
|
+
*/
|
|
2670
|
+
'react-extra/prefer-read-only-props'?: Linter.RuleEntry<[]>
|
|
2656
2671
|
/**
|
|
2657
2672
|
* enforce boolean attributes notation in JSX
|
|
2658
|
-
* @see https://eslint-react.xyz/rules/prefer-shorthand-boolean
|
|
2673
|
+
* @see https://eslint-react.xyz/docs/rules/prefer-shorthand-boolean
|
|
2659
2674
|
*/
|
|
2660
2675
|
'react-extra/prefer-shorthand-boolean'?: Linter.RuleEntry<[]>
|
|
2661
2676
|
/**
|
|
2662
2677
|
* enforce using fragment syntax instead of Fragment component
|
|
2663
|
-
* @see https://eslint-react.xyz/rules/prefer-shorthand-fragment
|
|
2678
|
+
* @see https://eslint-react.xyz/docs/rules/prefer-shorthand-fragment
|
|
2664
2679
|
*/
|
|
2665
2680
|
'react-extra/prefer-shorthand-fragment'?: Linter.RuleEntry<[]>
|
|
2666
2681
|
/**
|
|
2667
2682
|
* enforce custom hooks using other hooks
|
|
2668
|
-
* @see https://eslint-react.xyz/rules/hooks-extra-ensure-custom-hooks-using-other-hooks
|
|
2683
|
+
* @see https://eslint-react.xyz/docs/rules/hooks-extra-ensure-custom-hooks-using-other-hooks
|
|
2669
2684
|
*/
|
|
2670
2685
|
'react-hooks-extra/ensure-custom-hooks-using-other-hooks'?: Linter.RuleEntry<[]>
|
|
2671
2686
|
/**
|
|
2672
2687
|
* enforce 'useCallback' has non-empty dependencies array
|
|
2673
|
-
* @see https://eslint-react.xyz/rules/hooks-extra-ensure-use-callback-has-non-empty-deps
|
|
2688
|
+
* @see https://eslint-react.xyz/docs/rules/hooks-extra-ensure-use-callback-has-non-empty-deps
|
|
2674
2689
|
*/
|
|
2675
2690
|
'react-hooks-extra/ensure-use-callback-has-non-empty-deps'?: Linter.RuleEntry<[]>
|
|
2676
2691
|
/**
|
|
2677
2692
|
* enforce 'useMemo' has non-empty dependencies array
|
|
2678
|
-
* @see https://eslint-react.xyz/rules/hooks-extra-ensure-use-memo-has-non-empty-deps
|
|
2693
|
+
* @see https://eslint-react.xyz/docs/rules/hooks-extra-ensure-use-memo-has-non-empty-deps
|
|
2679
2694
|
*/
|
|
2680
2695
|
'react-hooks-extra/ensure-use-memo-has-non-empty-deps'?: Linter.RuleEntry<[]>
|
|
2696
|
+
/**
|
|
2697
|
+
* disallow direct calls to the 'set' function of 'useState' in 'useEffect'
|
|
2698
|
+
* @see https://eslint-react.xyz/docs/rules/hooks-extra-no-direct-set-state-in-use-effect
|
|
2699
|
+
*/
|
|
2700
|
+
'react-hooks-extra/no-direct-set-state-in-use-effect'?: Linter.RuleEntry<[]>
|
|
2701
|
+
/**
|
|
2702
|
+
* disallow direct calls to the 'set' function of 'useState' in 'useLayoutEffect'
|
|
2703
|
+
* @see https://eslint-react.xyz/docs/rules/hooks-extra-no-direct-set-state-in-use-layout-effect
|
|
2704
|
+
*/
|
|
2705
|
+
'react-hooks-extra/no-direct-set-state-in-use-layout-effect'?: Linter.RuleEntry<[]>
|
|
2681
2706
|
/**
|
|
2682
2707
|
* disallow function calls in 'useState' that aren't wrapped in an initializer function
|
|
2683
|
-
* @see https://eslint-react.xyz/rules/hooks-extra-prefer-use-state-lazy-initialization
|
|
2708
|
+
* @see https://eslint-react.xyz/docs/rules/hooks-extra-prefer-use-state-lazy-initialization
|
|
2684
2709
|
*/
|
|
2685
2710
|
'react-hooks-extra/prefer-use-state-lazy-initialization'?: Linter.RuleEntry<[]>
|
|
2686
2711
|
/**
|
|
@@ -2695,22 +2720,22 @@ Backward pagination arguments
|
|
|
2695
2720
|
'react-hooks/rules-of-hooks'?: Linter.RuleEntry<[]>
|
|
2696
2721
|
/**
|
|
2697
2722
|
* enforce component naming convention to 'PascalCase' or 'CONSTANT_CASE'
|
|
2698
|
-
* @see https://eslint-react.xyz/rules/naming-convention-component-name
|
|
2723
|
+
* @see https://eslint-react.xyz/docs/rules/naming-convention-component-name
|
|
2699
2724
|
*/
|
|
2700
2725
|
'react-naming-convention/component-name'?: Linter.RuleEntry<ReactNamingConventionComponentName>
|
|
2701
2726
|
/**
|
|
2702
2727
|
* enforce naming convention for JSX filenames
|
|
2703
|
-
* @see https://eslint-react.xyz/rules/naming-convention-filename
|
|
2728
|
+
* @see https://eslint-react.xyz/docs/rules/naming-convention-filename
|
|
2704
2729
|
*/
|
|
2705
2730
|
'react-naming-convention/filename'?: Linter.RuleEntry<ReactNamingConventionFilename>
|
|
2706
2731
|
/**
|
|
2707
2732
|
* enforce naming convention for JSX file extensions
|
|
2708
|
-
* @see https://eslint-react.xyz/rules/naming-convention-filename-extension
|
|
2733
|
+
* @see https://eslint-react.xyz/docs/rules/naming-convention-filename-extension
|
|
2709
2734
|
*/
|
|
2710
2735
|
'react-naming-convention/filename-extension'?: Linter.RuleEntry<ReactNamingConventionFilenameExtension>
|
|
2711
2736
|
/**
|
|
2712
2737
|
* enforce destructuring and symmetric naming of 'useState' hook value and setter variables
|
|
2713
|
-
* @see https://eslint-react.xyz/rules/naming-convention-use-state
|
|
2738
|
+
* @see https://eslint-react.xyz/docs/rules/naming-convention-use-state
|
|
2714
2739
|
*/
|
|
2715
2740
|
'react-naming-convention/use-state'?: Linter.RuleEntry<[]>
|
|
2716
2741
|
/**
|
|
@@ -3874,6 +3899,11 @@ Backward pagination arguments
|
|
|
3874
3899
|
* @see https://typescript-eslint.io/rules/no-empty-interface
|
|
3875
3900
|
*/
|
|
3876
3901
|
'ts/no-empty-interface'?: Linter.RuleEntry<TsNoEmptyInterface>
|
|
3902
|
+
/**
|
|
3903
|
+
* Disallow accidentally using the "empty object" type
|
|
3904
|
+
* @see https://typescript-eslint.io/rules/no-empty-object-type
|
|
3905
|
+
*/
|
|
3906
|
+
'ts/no-empty-object-type'?: Linter.RuleEntry<TsNoEmptyObjectType>
|
|
3877
3907
|
/**
|
|
3878
3908
|
* Disallow the `any` type
|
|
3879
3909
|
* @see https://typescript-eslint.io/rules/no-explicit-any
|
|
@@ -4043,6 +4073,11 @@ Backward pagination arguments
|
|
|
4043
4073
|
* @see https://typescript-eslint.io/rules/no-unnecessary-condition
|
|
4044
4074
|
*/
|
|
4045
4075
|
'ts/no-unnecessary-condition'?: Linter.RuleEntry<TsNoUnnecessaryCondition>
|
|
4076
|
+
/**
|
|
4077
|
+
* Disallow unnecessary assignment of constructor property parameter
|
|
4078
|
+
* @see https://typescript-eslint.io/rules/no-unnecessary-parameter-property-assignment
|
|
4079
|
+
*/
|
|
4080
|
+
'ts/no-unnecessary-parameter-property-assignment'?: Linter.RuleEntry<[]>
|
|
4046
4081
|
/**
|
|
4047
4082
|
* Disallow unnecessary namespace qualifiers
|
|
4048
4083
|
* @see https://typescript-eslint.io/rules/no-unnecessary-qualifier
|
|
@@ -4068,6 +4103,11 @@ Backward pagination arguments
|
|
|
4068
4103
|
* @see https://typescript-eslint.io/rules/no-unnecessary-type-constraint
|
|
4069
4104
|
*/
|
|
4070
4105
|
'ts/no-unnecessary-type-constraint'?: Linter.RuleEntry<[]>
|
|
4106
|
+
/**
|
|
4107
|
+
* Disallow type parameters that only appear once
|
|
4108
|
+
* @see https://typescript-eslint.io/rules/no-unnecessary-type-parameters
|
|
4109
|
+
*/
|
|
4110
|
+
'ts/no-unnecessary-type-parameters'?: Linter.RuleEntry<[]>
|
|
4071
4111
|
/**
|
|
4072
4112
|
* Disallow calling a function with a value with type `any`
|
|
4073
4113
|
* @see https://typescript-eslint.io/rules/no-unsafe-argument
|
|
@@ -5661,6 +5701,25 @@ type JsdocCheckValues = []|[{
|
|
|
5661
5701
|
licensePattern?: string
|
|
5662
5702
|
numericOnlyVariation?: boolean
|
|
5663
5703
|
}]
|
|
5704
|
+
// ----- jsdoc/convert-to-jsdoc-comments -----
|
|
5705
|
+
type JsdocConvertToJsdocComments = []|[{
|
|
5706
|
+
allowedPrefixes?: string[]
|
|
5707
|
+
contexts?: (string | {
|
|
5708
|
+
context?: string
|
|
5709
|
+
inlineCommentBlock?: boolean
|
|
5710
|
+
})[]
|
|
5711
|
+
contextsAfter?: (string | {
|
|
5712
|
+
context?: string
|
|
5713
|
+
inlineCommentBlock?: boolean
|
|
5714
|
+
})[]
|
|
5715
|
+
contextsBeforeAndAfter?: (string | {
|
|
5716
|
+
context?: string
|
|
5717
|
+
inlineCommentBlock?: boolean
|
|
5718
|
+
})[]
|
|
5719
|
+
enableFixer?: boolean
|
|
5720
|
+
enforceJsdocLineStyle?: ("multi" | "single")
|
|
5721
|
+
lineOrBlockStyle?: ("block" | "line" | "both")
|
|
5722
|
+
}]
|
|
5664
5723
|
// ----- jsdoc/empty-tags -----
|
|
5665
5724
|
type JsdocEmptyTags = []|[{
|
|
5666
5725
|
tags?: string[]
|
|
@@ -5948,6 +6007,10 @@ type JsdocRequireReturnsType = []|[{
|
|
|
5948
6007
|
context?: string
|
|
5949
6008
|
})[]
|
|
5950
6009
|
}]
|
|
6010
|
+
// ----- jsdoc/require-template -----
|
|
6011
|
+
type JsdocRequireTemplate = []|[{
|
|
6012
|
+
requireSeparateTemplates?: boolean
|
|
6013
|
+
}]
|
|
5951
6014
|
// ----- jsdoc/require-throws -----
|
|
5952
6015
|
type JsdocRequireThrows = []|[{
|
|
5953
6016
|
contexts?: (string | {
|
|
@@ -6760,18 +6823,11 @@ type NoRestrictedImports = ((string | {
|
|
|
6760
6823
|
importNames?: string[]
|
|
6761
6824
|
allowImportNames?: string[]
|
|
6762
6825
|
})[]
|
|
6763
|
-
patterns?: (string[] | {
|
|
6764
|
-
|
|
6765
|
-
|
|
6766
|
-
|
|
6767
|
-
|
|
6768
|
-
|
|
6769
|
-
group: [string, ...(string)[]]
|
|
6770
|
-
importNamePattern?: string
|
|
6771
|
-
allowImportNamePattern?: string
|
|
6772
|
-
message?: string
|
|
6773
|
-
caseSensitive?: boolean
|
|
6774
|
-
}[])
|
|
6826
|
+
patterns?: (string[] | ({
|
|
6827
|
+
[k: string]: unknown | undefined
|
|
6828
|
+
} | {
|
|
6829
|
+
[k: string]: unknown | undefined
|
|
6830
|
+
})[])
|
|
6775
6831
|
}])
|
|
6776
6832
|
// ----- no-restricted-modules -----
|
|
6777
6833
|
type NoRestrictedModules = ((string | {
|
|
@@ -8967,6 +9023,12 @@ type TsNoEmptyFunction = []|[{
|
|
|
8967
9023
|
type TsNoEmptyInterface = []|[{
|
|
8968
9024
|
allowSingleExtends?: boolean
|
|
8969
9025
|
}]
|
|
9026
|
+
// ----- ts/no-empty-object-type -----
|
|
9027
|
+
type TsNoEmptyObjectType = []|[{
|
|
9028
|
+
allowInterfaces?: ("always" | "never" | "with-single-extends")
|
|
9029
|
+
allowObjectTypes?: ("always" | "in-type-alias-with-name" | "never")
|
|
9030
|
+
allowWithName?: string
|
|
9031
|
+
}]
|
|
8970
9032
|
// ----- ts/no-explicit-any -----
|
|
8971
9033
|
type TsNoExplicitAny = []|[{
|
|
8972
9034
|
|
|
@@ -9000,10 +9062,6 @@ type TsNoExtraneousClass = []|[{
|
|
|
9000
9062
|
}]
|
|
9001
9063
|
// ----- ts/no-floating-promises -----
|
|
9002
9064
|
type TsNoFloatingPromises = []|[{
|
|
9003
|
-
|
|
9004
|
-
ignoreVoid?: boolean
|
|
9005
|
-
|
|
9006
|
-
ignoreIIFE?: boolean
|
|
9007
9065
|
allowForKnownSafePromises?: (string | {
|
|
9008
9066
|
from: "file"
|
|
9009
9067
|
name: (string | [string, ...(string)[]])
|
|
@@ -9016,6 +9074,12 @@ type TsNoFloatingPromises = []|[{
|
|
|
9016
9074
|
name: (string | [string, ...(string)[]])
|
|
9017
9075
|
package: string
|
|
9018
9076
|
})[]
|
|
9077
|
+
|
|
9078
|
+
checkThenables?: boolean
|
|
9079
|
+
|
|
9080
|
+
ignoreVoid?: boolean
|
|
9081
|
+
|
|
9082
|
+
ignoreIIFE?: boolean
|
|
9019
9083
|
}]
|
|
9020
9084
|
// ----- ts/no-inferrable-types -----
|
|
9021
9085
|
type TsNoInferrableTypes = []|[{
|
|
@@ -9100,7 +9164,8 @@ type TsNoRestrictedImports = ((string | {
|
|
|
9100
9164
|
|
|
9101
9165
|
allowImportNames?: [string, ...(string)[]]
|
|
9102
9166
|
|
|
9103
|
-
group
|
|
9167
|
+
group?: [string, ...(string)[]]
|
|
9168
|
+
regex?: string
|
|
9104
9169
|
importNamePattern?: string
|
|
9105
9170
|
allowImportNamePattern?: string
|
|
9106
9171
|
message?: string
|
package/dist/index.js
CHANGED
|
@@ -12,5 +12,5 @@ import { isPackageExists } from 'local-pkg';
|
|
|
12
12
|
function C(){return [{name:"2digits:comments",plugins:{"eslint-comments":v},rules:{"eslint-comments/no-aggregating-enable":"error","eslint-comments/no-duplicate-disable":"error","eslint-comments/no-unlimited-disable":"error","eslint-comments/no-unused-enable":"error","eslint-comments/no-unused-disable":"error"}}]}var p={"@next/next":"next","@eslint-react/naming-convention":"react-naming-convention","@eslint-react/hooks-extra":"react-hooks-extra","@eslint-react/dom":"react-dom","@eslint-react":"react-extra","react-hooks":"react-hooks","react-compiler":"react-compiler",react:"react","@typescript-eslint":"ts",node:"node","eslint-comments":"eslint-comments",storybook:"storybook",turbo:"turbo",jsdoc:"jsdoc",unicorn:"unicorn",tailwindcss:"tailwindcss","@tanstack/query":"tanstack","@2digits":"@2digits","@graphql-eslint":"gql",sonarjs:"sonar"};async function o(e){let t=await e;return t.default||t}async function S(e={}){let{overrides:t={},files:r=["**/*.graphql","**/*.gql"]}=e,i=await o(import('@graphql-eslint/eslint-plugin')),a=renamePluginsInRules(i.flatConfigs["operations-recommended"].rules,p);return [{name:"2digits:graphql",plugins:{gql:fixupPluginRules(i)},languageOptions:{parser:{...i,meta:{name:"graphql"}}},files:r,rules:{...a,...t}}]}var F="**/*.?([cm])[jt]s?(x)",h="**/*.?([cm])ts",O="**/*.?([cm])tsx",I="**/*.stories.tsx",P=["**/node_modules","**/dist","**/package-lock.json","**/yarn.lock","**/pnpm-lock.yaml","**/bun.lockb","**/output","**/coverage","**/temp","**/.temp","**/tmp","**/.tmp","**/.history","**/.vitepress/cache","**/.nuxt","**/.next","**/.vercel","**/.changeset","**/.idea","**/.cache","**/.output","**/.vite-inspect","**/.yarn","**/CHANGELOG*.md","**/*.min.*","**/LICENSE*","**/__snapshots__","**/auto-import?(s).d.ts","**/components.d.ts"];async function _(e={}){let{gitIgnore:t,ignores:r=[]}=e;return composer({ignores:[P,r].flat(),name:"2digits:ignores"},o(import('eslint-config-flat-gitignore')).then(i=>({...i(t),name:"2digits:gitignore"})))}function q(e={}){let{overrides:t={}}=e;return [{name:"2digits:javascript",languageOptions:{ecmaVersion:2022,globals:{...w.browser,...w.es2021,...w.node,document:"readonly",navigator:"readonly",window:"readonly"},parserOptions:{ecmaFeatures:{jsx:!0},ecmaVersion:2022,sourceType:"module"},sourceType:"module"},linterOptions:{reportUnusedDisableDirectives:!0},rules:{...Q.configs.recommended.rules,"accessor-pairs":["error",{enforceForClassMembers:!0,setWithoutGet:!0}],"array-callback-return":"error","block-scoped-var":"error","constructor-super":"error","default-case-last":"error","dot-notation":["error",{allowKeywords:!0}],eqeqeq:["error","smart"],"new-cap":["error",{capIsNew:!1,newIsCap:!0,properties:!0}],"no-alert":"error","no-array-constructor":"error","no-async-promise-executor":"error","no-caller":"error","no-case-declarations":"error","no-class-assign":"error","no-compare-neg-zero":"error","no-cond-assign":["error","always"],"no-const-assign":"error","no-control-regex":"error","no-debugger":"error","no-delete-var":"error","no-dupe-args":"error","no-dupe-class-members":"error","no-dupe-keys":"error","no-duplicate-case":"error","no-empty":["error",{allowEmptyCatch:!0}],"no-empty-character-class":"error","no-empty-pattern":"error","no-eval":"error","no-ex-assign":"error","no-extend-native":"error","no-extra-bind":"error","no-extra-boolean-cast":"error","no-fallthrough":"error","no-func-assign":"error","no-global-assign":"error","no-implied-eval":"error","no-import-assign":"error","no-invalid-regexp":"error","no-irregular-whitespace":"error","no-iterator":"error","no-labels":["error",{allowLoop:!1,allowSwitch:!1}],"no-lone-blocks":"error","no-loss-of-precision":"error","no-misleading-character-class":"error","no-multi-str":"error","no-new":"error","no-new-func":"error","no-new-native-nonconstructor":"error","no-new-wrappers":"error","no-obj-calls":"error","no-octal":"error","no-octal-escape":"error","no-proto":"error","no-prototype-builtins":"error","no-redeclare":["error",{builtinGlobals:!1}],"no-regex-spaces":"error","no-restricted-globals":["error",{message:"Use `globalThis` instead.",name:"global"},{message:"Use `globalThis` instead.",name:"self"}],"no-restricted-properties":["error",{message:"Use `Object.getPrototypeOf` or `Object.setPrototypeOf` instead.",property:"__proto__"},{message:"Use `Object.defineProperty` instead.",property:"__defineGetter__"},{message:"Use `Object.defineProperty` instead.",property:"__defineSetter__"},{message:"Use `Object.getOwnPropertyDescriptor` instead.",property:"__lookupGetter__"},{message:"Use `Object.getOwnPropertyDescriptor` instead.",property:"__lookupSetter__"}],"no-restricted-syntax":["error","DebuggerStatement","LabeledStatement","WithStatement","TSEnumDeclaration","TSExportAssignment"],"no-self-assign":["error",{props:!0}],"no-self-compare":"error","no-sequences":"error","no-shadow-restricted-names":"error","no-sparse-arrays":"error","no-template-curly-in-string":"error","no-this-before-super":"error","no-throw-literal":"error","no-undef":"error","no-undef-init":"error","no-unexpected-multiline":"error","no-unmodified-loop-condition":"error","no-unneeded-ternary":["error",{defaultAssignment:!1}],"no-unreachable":"error","no-unreachable-loop":"error","no-unsafe-finally":"error","no-unsafe-negation":"error","no-unused-expressions":["error",{allowShortCircuit:!0,allowTaggedTemplates:!0,allowTernary:!0}],"no-unused-vars":["error",{args:"none",caughtErrors:"none",ignoreRestSiblings:!0,vars:"all"}],"no-useless-backreference":"error","no-useless-call":"error","no-useless-catch":"error","no-useless-computed-key":"error","no-useless-constructor":"error","no-useless-rename":"error","no-var":"error","no-with":"error","object-shorthand":["error","always",{avoidQuotes:!0,ignoreConstructors:!1}],"one-var":["error",{initialized:"never"}],"prefer-arrow-callback":["error",{allowNamedFunctions:!0,allowUnboundThis:!0}],"prefer-const":["error",{destructuring:"all",ignoreReadBeforeAssign:!0}],"prefer-exponentiation-operator":"error","prefer-promise-reject-errors":"error","prefer-regex-literals":["error",{disallowRedundantWrapping:!0}],"prefer-rest-params":"error","prefer-spread":"error","prefer-template":"error","symbol-description":"error","unicode-bom":["error","never"],"use-isnan":["error",{enforceForIndexOf:!0,enforceForSwitchCase:!0}],"valid-typeof":["error",{requireStringLiterals:!0}],"vars-on-top":"error",yoda:["error","never"],...t}}]}async function W(){return [{name:"2digits:jsdoc",plugins:{jsdoc:await o(import('eslint-plugin-jsdoc'))},rules:{"jsdoc/check-access":"error","jsdoc/check-param-names":"error","jsdoc/check-property-names":"error","jsdoc/check-types":"error","jsdoc/empty-tags":"error","jsdoc/implements-on-classes":"error","jsdoc/no-defaults":"error","jsdoc/no-multi-asterisks":"error","jsdoc/require-param-name":"error","jsdoc/require-property":"error","jsdoc/require-property-description":"error","jsdoc/require-property-name":"error","jsdoc/require-returns-check":"error","jsdoc/require-returns-description":"error","jsdoc/require-yields-check":"error"}}]}async function D(e={}){let{files:t=[h,O],overrides:r={},tsconfigPath:i,parserOptions:a}=e,[c,m]=await Promise.all([o(import('@next/eslint-plugin-next')),o(import('@typescript-eslint/parser'))]),u=renamePluginsInRules({...c.configs.recommended.rules,...c.configs["core-web-vitals"].rules},p);return [{name:"2digits:next/setup",plugins:{next:fixupPluginRules(c)}},{name:"2digits:next/rules",files:t,languageOptions:{parser:m,parserOptions:{ecmaFeatures:{jsx:!0},project:i,...a},sourceType:"module"},rules:{...u,"next/no-html-link-for-pages":"off",...r}}]}function R(){return [{name:"2digits:node",settings:{node:{version:">= 20.0.0"}},plugins:{node:j},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 L(){let[e,t]=await Promise.all([o(import('eslint-config-prettier')),o(import('eslint-plugin-react'))]);return [{name:"2digits:prettier",plugins:{react:t},rules:{...e.rules,"tailwindcss/classnames-order":"off","react/jsx-newline":["error",{prevent:!1}]}}]}async function E(e={}){let{files:t=[h,O],overrides:r={},tsconfigPath:i,parserOptions:a,tsconfigRootDir:c,reactCompiler:m=!0}=e,[u,f,y,x,z]=await Promise.all([o(import('@eslint-react/eslint-plugin')),o(import('eslint-plugin-react-hooks')),o(import('eslint-plugin-react')),o(import('@typescript-eslint/parser')),m?o(import('eslint-plugin-react-compiler')):void 0]),b=u.configs.all.plugins,H=renamePluginsInRules({...y.configs.recommended.rules,...y.configs["jsx-runtime"].rules,...f.configs.recommended.rules,...u.configs["recommended-type-checked"].rules},p);return [{name:"2digits:react/setup",plugins:{react:y,"react-dom":b["@eslint-react/dom"],"react-extra":b["@eslint-react"],"react-hooks":fixupPluginRules(f),"react-hooks-extra":b["@eslint-react/hooks-extra"],"react-naming-convention":b["@eslint-react/naming-convention"],...m?{"react-compiler":z}:{}},settings:{react:{version:"detect"}}},{name:"2digits:react/rules",files:t,languageOptions:{parser:x,parserOptions:{ecmaFeatures:{jsx:!0},tsconfigRootDir:c,project:i,...a},sourceType:"module"},rules:{...H,...m?{"react-compiler/react-compiler":"error"}:{},"react-hooks-extra/ensure-use-memo-has-non-empty-deps":"error","react-hooks-extra/prefer-use-state-lazy-initialization":"error","react-hooks-extra/ensure-custom-hooks-using-other-hooks":"error","react-hooks-extra/ensure-use-callback-has-non-empty-deps":"error","react/jsx-curly-newline":"off","react/jsx-newline":["error",{prevent:!1}],...r}}]}var oe=renamePluginsInRules(T.configs.recommended.rules,p);function G(){return [{name:"2digits:sonar",plugins:{sonar:T},rules:{...oe,"sonar/no-redundant-jump":"off"}}]}async function N(e={}){let{files:t=[I],overrides:r={},parserOptions:i,tsconfigPath:a,storybookDirectory:c=".storybook"}=e,[m,u]=await Promise.all([o(import('eslint-plugin-storybook')),o(import('@typescript-eslint/parser'))]),f={parser:u,parserOptions:{ecmaFeatures:{jsx:!0},project:a,...i},sourceType:"module"};return [{name:"2digits:storybook/setup",plugins:{storybook:fixupPluginRules(m)}},{name:"2digits:storybook/rules",files:t,languageOptions:f,rules:{"storybook/await-interactions":"error","storybook/context-in-play-function":"error","storybook/csf-component":"error","storybook/default-exports":"error","storybook/hierarchy-separator":"error","storybook/no-redundant-story-name":"error","storybook/no-stories-of":"error","storybook/no-title-property-in-meta":"error","storybook/prefer-pascal-case":"error","storybook/story-exports":"error","storybook/use-storybook-expect":"error","storybook/use-storybook-testing-library":"error",...r}},{name:"2digits:storybook/disables",files:t,rules:{"react-hooks/rules-of-hooks":"off","react/display-name":"off"}},{name:"2digits:storybook/config",files:[`${c}/main.@(js|cjs|mjs|ts)`],languageOptions:f,rules:{"storybook/no-uninstalled-addons":"error"}}]}async function U(e={}){let{overrides:t={}}=e,[r,{tailwindFunctions:i},a]=await Promise.all([o(import('eslint-plugin-tailwindcss')),o(import('@2digits/constants')),findUp(["tailwind.config.ts","tailwind.config.js"])]);return [{name:"2digits:tailwind",plugins:{tailwindcss:r},settings:{tailwindcss:{callees:i,config:a}},rules:{...r.configs.recommended.rules,...t}}]}async function B(e={}){let{overrides:t={}}=e,r=await o(import('@tanstack/eslint-plugin-query'));return [{name:"2digits:tanstack",plugins:{tanstack:fixupPluginRules(r)},rules:{"tanstack/exhaustive-deps":"error","tanstack/stable-query-client":"error","tanstack/no-rest-destructuring":"error",...t}}]}async function A(e={}){let{overrides:t={}}=e;return [{name:"2digits:turbo",plugins:{turbo:await o(import('eslint-plugin-turbo'))},rules:{"turbo/no-undeclared-env-vars":"error",...t}}]}async function M(e={}){let{overrides:t={},parserOptions:r={},tsconfigPath:i=!0}=e,[{plugin:a,configs:c,parser:m},u]=await Promise.all([o(import('typescript-eslint')),o(import('@2digits/eslint-plugin'))]),f=renamePluginsInConfigs(c.strictTypeChecked,p),y=Object.fromEntries(f.flatMap(({rules:x})=>Object.entries(x??{})));return [{name:"2digits:typescript/setup",plugins:{ts:a,"@2digits":u},languageOptions:{parser:m,parserOptions:{sourceType:"module",tsconfigRootDir:process.cwd(),project:i,...r}}},{name:"2digits:typescript/rules",files:[F],rules:{...y,"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-interface":["error",{allowSingleExtends:!0}],"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:"^_"}],...u.configs.recommended.rules,...t}},{files:["**/*.d.ts"],name:"2digits:typescript/disables/dts",rules:{"unicorn/no-abusive-eslint-disable":"off","no-duplicate-imports":"off","no-restricted-syntax":"off","ts/no-unused-vars":"off"}},{files:["**/*.{test,spec}.ts?(x)"],name:"2digits:typescript/disables/test",rules:{"no-unused-expressions":"off"}},{files:["**/*.js","**/*.cjs","**/*.cts"],name:"2digits:typescript/disables/cjs",rules:{"ts/no-require-imports":"off","ts/no-var-requires":"off"}}]}function X(){return [{name:"2digits:unicorn",plugins:{unicorn:k},rules:{...k.configs.recommended.rules,"unicorn/filename-case":["off"],"unicorn/prefer-module":["off"],"unicorn/prevent-abbreviations":["off"],"unicorn/prefer-ternary":["error","only-single-line"],"unicorn/no-useless-undefined":["error",{checkArguments:!1,checkArrowFunctionBody:!1}],"unicorn/prefer-top-level-await":["off"]}}]}function g(e,t){return typeof e=="boolean"?e:e?.enable??t??!1}function d(e){if(typeof e=="boolean"||e===void 0)return {};let{enable:t,...r}=e;return r}function pe(e={},...t){let r=new FlatConfigComposer(_(e.ignores),q(e.js),R(),C(),W(),X(),G());g(e.turbo,isPackageExists("turbo"))&&(r=r.append(A(d(e.turbo))));let{overrides:i,...a}=d(e.ts);return g(e.ts,isPackageExists("typescript"))&&(r=r.append(M(d(e.ts)))),g(e.react,isPackageExists("react"))&&(r=r.append(E({...d(e.react),...a}))),g(e.next,isPackageExists("next"))&&(r=r.append(D({...d(e.next),...a}))),g(e.storybook,isPackageExists("storybook"))&&(r=r.append(N({...d(e.storybook),...a}))),g(e.tailwind,isPackageExists("tailwindcss"))&&(r=r.append(U(d(e.tailwind)))),g(e.tanstack,isPackageExists("react-query")||isPackageExists("@tanstack/react-query")||isPackageExists("@tanstack/react-query-devtools"))&&(r=r.append(B(d(e.tanstack)))),isPackageExists("graphql")&&(r=r.append(S(d(e.graphql)))),r=r.append(...t),isPackageExists("prettier")&&(r=r.append(L())),r.renamePlugins(p).toConfigs()}
|
|
13
13
|
|
|
14
14
|
export { C as comments, pe as default, S as graphql, _ as ignores, q as javascript, W as jsdoc, D as next, R as node, L as prettier, E as react, G as sonar, N as storybook, U as tailwind, B as tanstack, A as turbo, pe as twoDigits, M as typescript, X as unicorn };
|
|
15
|
-
//# sourceMappingURL=
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
16
16
|
//# sourceMappingURL=index.js.map
|