@liwo/eslint-config 0.2.2 → 0.2.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/README.md +1 -1
- package/dist/index.d.ts +487 -275
- package/dist/index.js +36 -42
- package/package.json +10 -10
package/README.md
CHANGED
|
@@ -42,4 +42,4 @@ Thanks to the community and developers for their contributions!
|
|
|
42
42
|
|
|
43
43
|
This project is deployed on GitHub Pages and Netlify.
|
|
44
44
|
|
|
45
|
-
[](https://www.netlify.com/?source=liwo)
|
package/dist/index.d.ts
CHANGED
|
@@ -2584,101 +2584,6 @@ interface RuleOptions {
|
|
|
2584
2584
|
* @see https://eslint.org/docs/latest/rules/radix
|
|
2585
2585
|
*/
|
|
2586
2586
|
'radix'?: Linter.RuleEntry<Radix>;
|
|
2587
|
-
/**
|
|
2588
|
-
* Disallows DOM elements from using 'dangerouslySetInnerHTML'.
|
|
2589
|
-
* @see https://eslint-react.xyz/docs/rules/dom-no-dangerously-set-innerhtml
|
|
2590
|
-
*/
|
|
2591
|
-
'react-dom/no-dangerously-set-innerhtml'?: Linter.RuleEntry<[]>;
|
|
2592
|
-
/**
|
|
2593
|
-
* Disallows DOM elements from using 'dangerouslySetInnerHTML' and 'children' at the same time.
|
|
2594
|
-
* @see https://eslint-react.xyz/docs/rules/dom-no-dangerously-set-innerhtml-with-children
|
|
2595
|
-
*/
|
|
2596
|
-
'react-dom/no-dangerously-set-innerhtml-with-children'?: Linter.RuleEntry<[]>;
|
|
2597
|
-
/**
|
|
2598
|
-
* Disallows 'findDOMNode'.
|
|
2599
|
-
* @see https://eslint-react.xyz/docs/rules/dom-no-find-dom-node
|
|
2600
|
-
*/
|
|
2601
|
-
'react-dom/no-find-dom-node'?: Linter.RuleEntry<[]>;
|
|
2602
|
-
/**
|
|
2603
|
-
* Disallows 'flushSync'.
|
|
2604
|
-
* @see https://eslint-react.xyz/docs/rules/dom-no-flush-sync
|
|
2605
|
-
*/
|
|
2606
|
-
'react-dom/no-flush-sync'?: Linter.RuleEntry<[]>;
|
|
2607
|
-
/**
|
|
2608
|
-
* Replaces usage of 'ReactDOM.hydrate()' with 'hydrateRoot()'.
|
|
2609
|
-
* @see https://eslint-react.xyz/docs/rules/dom-no-hydrate
|
|
2610
|
-
*/
|
|
2611
|
-
'react-dom/no-hydrate'?: Linter.RuleEntry<[]>;
|
|
2612
|
-
/**
|
|
2613
|
-
* Enforces an explicit 'type' attribute for 'button' elements.
|
|
2614
|
-
* @see https://eslint-react.xyz/docs/rules/dom-no-missing-button-type
|
|
2615
|
-
*/
|
|
2616
|
-
'react-dom/no-missing-button-type'?: Linter.RuleEntry<[]>;
|
|
2617
|
-
/**
|
|
2618
|
-
* Enforces an explicit 'sandbox' attribute for 'iframe' elements.
|
|
2619
|
-
* @see https://eslint-react.xyz/docs/rules/dom-no-missing-iframe-sandbox
|
|
2620
|
-
*/
|
|
2621
|
-
'react-dom/no-missing-iframe-sandbox'?: Linter.RuleEntry<[]>;
|
|
2622
|
-
/**
|
|
2623
|
-
* Enforces the absence of a 'namespace' in React elements.
|
|
2624
|
-
* @see https://eslint-react.xyz/docs/rules/dom-no-namespace
|
|
2625
|
-
*/
|
|
2626
|
-
'react-dom/no-namespace'?: Linter.RuleEntry<[]>;
|
|
2627
|
-
/**
|
|
2628
|
-
* Replaces usage of 'ReactDOM.render()' with 'createRoot(node).render()'.
|
|
2629
|
-
* @see https://eslint-react.xyz/docs/rules/dom-no-render
|
|
2630
|
-
*/
|
|
2631
|
-
'react-dom/no-render'?: Linter.RuleEntry<[]>;
|
|
2632
|
-
/**
|
|
2633
|
-
* Disallows the return value of 'ReactDOM.render'.
|
|
2634
|
-
* @see https://eslint-react.xyz/docs/rules/dom-no-render-return-value
|
|
2635
|
-
*/
|
|
2636
|
-
'react-dom/no-render-return-value'?: Linter.RuleEntry<[]>;
|
|
2637
|
-
/**
|
|
2638
|
-
* Disallows 'javascript:' URLs as attribute values.
|
|
2639
|
-
* @see https://eslint-react.xyz/docs/rules/dom-no-script-url
|
|
2640
|
-
*/
|
|
2641
|
-
'react-dom/no-script-url'?: Linter.RuleEntry<[]>;
|
|
2642
|
-
/**
|
|
2643
|
-
* Disallows the use of string style prop in JSX. Use an object instead.
|
|
2644
|
-
* @see https://eslint-react.xyz/docs/rules/dom-no-string-style-prop
|
|
2645
|
-
*/
|
|
2646
|
-
'react-dom/no-string-style-prop'?: Linter.RuleEntry<[]>;
|
|
2647
|
-
/**
|
|
2648
|
-
* Disallows unknown 'DOM' properties.
|
|
2649
|
-
* @see https://eslint-react.xyz/docs/rules/dom-no-unknown-property
|
|
2650
|
-
*/
|
|
2651
|
-
'react-dom/no-unknown-property'?: Linter.RuleEntry<ReactDomNoUnknownProperty>;
|
|
2652
|
-
/**
|
|
2653
|
-
* Enforces that the 'sandbox' attribute for 'iframe' elements is not set to unsafe combinations.
|
|
2654
|
-
* @see https://eslint-react.xyz/docs/rules/dom-no-unsafe-iframe-sandbox
|
|
2655
|
-
*/
|
|
2656
|
-
'react-dom/no-unsafe-iframe-sandbox'?: Linter.RuleEntry<[]>;
|
|
2657
|
-
/**
|
|
2658
|
-
* Disallows 'target="_blank"' without 'rel="noreferrer noopener"'.
|
|
2659
|
-
* @see https://eslint-react.xyz/docs/rules/dom-no-unsafe-target-blank
|
|
2660
|
-
*/
|
|
2661
|
-
'react-dom/no-unsafe-target-blank'?: Linter.RuleEntry<[]>;
|
|
2662
|
-
/**
|
|
2663
|
-
* Replaces usage of 'useFormState' with 'useActionState'.
|
|
2664
|
-
* @see https://eslint-react.xyz/docs/rules/dom-no-use-form-state
|
|
2665
|
-
*/
|
|
2666
|
-
'react-dom/no-use-form-state'?: Linter.RuleEntry<[]>;
|
|
2667
|
-
/**
|
|
2668
|
-
* Disallows 'children' in void DOM elements.
|
|
2669
|
-
* @see https://eslint-react.xyz/docs/rules/dom-no-void-elements-with-children
|
|
2670
|
-
*/
|
|
2671
|
-
'react-dom/no-void-elements-with-children'?: Linter.RuleEntry<[]>;
|
|
2672
|
-
/**
|
|
2673
|
-
* Enforces importing React DOM via a namespace import.
|
|
2674
|
-
* @see https://eslint-react.xyz/docs/rules/dom-prefer-namespace-import
|
|
2675
|
-
*/
|
|
2676
|
-
'react-dom/prefer-namespace-import'?: Linter.RuleEntry<[]>;
|
|
2677
|
-
/**
|
|
2678
|
-
* Disallows direct calls to the ['set' function](https://react.dev/reference/react/useState#setstate) of 'useState' in 'useEffect'.
|
|
2679
|
-
* @see https://eslint-react.xyz/docs/rules/hooks-extra-no-direct-set-state-in-use-effect
|
|
2680
|
-
*/
|
|
2681
|
-
'react-hooks-extra/no-direct-set-state-in-use-effect'?: Linter.RuleEntry<[]>;
|
|
2682
2587
|
/**
|
|
2683
2588
|
* Validates against calling capitalized functions/methods instead of using JSX
|
|
2684
2589
|
* @see https://react.dev/reference/eslint-plugin-react-hooks/lints/capitalized-calls
|
|
@@ -2824,112 +2729,162 @@ interface RuleOptions {
|
|
|
2824
2729
|
* @see https://react.dev/reference/eslint-plugin-react-hooks/lints/void-use-memo
|
|
2825
2730
|
*/
|
|
2826
2731
|
'react-hooks/void-use-memo'?: Linter.RuleEntry<ReactHooksVoidUseMemo>;
|
|
2732
|
+
'react-refresh/only-export-components'?: Linter.RuleEntry<ReactRefreshOnlyExportComponents>;
|
|
2827
2733
|
/**
|
|
2828
|
-
*
|
|
2829
|
-
* @see https://eslint-react.xyz/docs/rules/
|
|
2734
|
+
* Disallows DOM elements from using 'dangerouslySetInnerHTML'.
|
|
2735
|
+
* @see https://eslint-react.xyz/docs/rules/dom-no-dangerously-set-innerhtml
|
|
2830
2736
|
*/
|
|
2831
|
-
'react-
|
|
2737
|
+
'react/dom-no-dangerously-set-innerhtml'?: Linter.RuleEntry<[]>;
|
|
2832
2738
|
/**
|
|
2833
|
-
*
|
|
2834
|
-
* @see https://eslint-react.xyz/docs/rules/
|
|
2739
|
+
* Disallows DOM elements from using 'dangerouslySetInnerHTML' and 'children' at the same time.
|
|
2740
|
+
* @see https://eslint-react.xyz/docs/rules/dom-no-dangerously-set-innerhtml-with-children
|
|
2835
2741
|
*/
|
|
2836
|
-
'react-
|
|
2742
|
+
'react/dom-no-dangerously-set-innerhtml-with-children'?: Linter.RuleEntry<[]>;
|
|
2837
2743
|
/**
|
|
2838
|
-
*
|
|
2839
|
-
* @see https://eslint-react.xyz/docs/rules/
|
|
2744
|
+
* Disallows 'findDOMNode'.
|
|
2745
|
+
* @see https://eslint-react.xyz/docs/rules/dom-no-find-dom-node
|
|
2840
2746
|
*/
|
|
2841
|
-
'react-
|
|
2747
|
+
'react/dom-no-find-dom-node'?: Linter.RuleEntry<[]>;
|
|
2842
2748
|
/**
|
|
2843
|
-
*
|
|
2844
|
-
* @see https://eslint-react.xyz/docs/rules/
|
|
2749
|
+
* Disallows 'flushSync'.
|
|
2750
|
+
* @see https://eslint-react.xyz/docs/rules/dom-no-flush-sync
|
|
2845
2751
|
*/
|
|
2846
|
-
'react-
|
|
2752
|
+
'react/dom-no-flush-sync'?: Linter.RuleEntry<[]>;
|
|
2847
2753
|
/**
|
|
2848
|
-
*
|
|
2849
|
-
* @see https://eslint-react.xyz/docs/rules/
|
|
2754
|
+
* Replaces usage of 'ReactDOM.hydrate()' with 'hydrateRoot()'.
|
|
2755
|
+
* @see https://eslint-react.xyz/docs/rules/dom-no-hydrate
|
|
2850
2756
|
*/
|
|
2851
|
-
'react-
|
|
2757
|
+
'react/dom-no-hydrate'?: Linter.RuleEntry<[]>;
|
|
2852
2758
|
/**
|
|
2853
|
-
* Enforces
|
|
2854
|
-
* @see https://eslint-react.xyz/docs/rules/
|
|
2759
|
+
* Enforces an explicit 'type' attribute for 'button' elements.
|
|
2760
|
+
* @see https://eslint-react.xyz/docs/rules/dom-no-missing-button-type
|
|
2855
2761
|
*/
|
|
2856
|
-
'react-
|
|
2762
|
+
'react/dom-no-missing-button-type'?: Linter.RuleEntry<[]>;
|
|
2857
2763
|
/**
|
|
2858
|
-
* Enforces
|
|
2859
|
-
* @see https://eslint-react.xyz/docs/rules/
|
|
2764
|
+
* Enforces an explicit 'sandbox' attribute for 'iframe' elements.
|
|
2765
|
+
* @see https://eslint-react.xyz/docs/rules/dom-no-missing-iframe-sandbox
|
|
2860
2766
|
*/
|
|
2861
|
-
'react-
|
|
2862
|
-
'react-refresh/only-export-components'?: Linter.RuleEntry<ReactRefreshOnlyExportComponents>;
|
|
2767
|
+
'react/dom-no-missing-iframe-sandbox'?: Linter.RuleEntry<[]>;
|
|
2863
2768
|
/**
|
|
2864
|
-
*
|
|
2865
|
-
* @see https://eslint-react.xyz/docs/rules/
|
|
2769
|
+
* Replaces usage of 'ReactDOM.render()' with 'createRoot(node).render()'.
|
|
2770
|
+
* @see https://eslint-react.xyz/docs/rules/dom-no-render
|
|
2866
2771
|
*/
|
|
2867
|
-
'react-
|
|
2772
|
+
'react/dom-no-render'?: Linter.RuleEntry<[]>;
|
|
2868
2773
|
/**
|
|
2869
|
-
*
|
|
2870
|
-
* @see https://eslint-react.xyz/docs/rules/
|
|
2774
|
+
* Disallows the return value of 'ReactDOM.render'.
|
|
2775
|
+
* @see https://eslint-react.xyz/docs/rules/dom-no-render-return-value
|
|
2871
2776
|
*/
|
|
2872
|
-
'react-
|
|
2777
|
+
'react/dom-no-render-return-value'?: Linter.RuleEntry<[]>;
|
|
2873
2778
|
/**
|
|
2874
|
-
*
|
|
2875
|
-
* @see https://eslint-react.xyz/docs/rules/
|
|
2779
|
+
* Disallows 'javascript:' URLs as attribute values.
|
|
2780
|
+
* @see https://eslint-react.xyz/docs/rules/dom-no-script-url
|
|
2876
2781
|
*/
|
|
2877
|
-
'react-
|
|
2782
|
+
'react/dom-no-script-url'?: Linter.RuleEntry<[]>;
|
|
2878
2783
|
/**
|
|
2879
|
-
*
|
|
2880
|
-
* @see https://eslint-react.xyz/docs/rules/
|
|
2784
|
+
* Disallows the use of string style prop in JSX. Use an object instead.
|
|
2785
|
+
* @see https://eslint-react.xyz/docs/rules/dom-no-string-style-prop
|
|
2786
|
+
*/
|
|
2787
|
+
'react/dom-no-string-style-prop'?: Linter.RuleEntry<[]>;
|
|
2788
|
+
/**
|
|
2789
|
+
* Disallows unknown 'DOM' properties.
|
|
2790
|
+
* @see https://eslint-react.xyz/docs/rules/dom-no-unknown-property
|
|
2791
|
+
*/
|
|
2792
|
+
'react/dom-no-unknown-property'?: Linter.RuleEntry<ReactDomNoUnknownProperty>;
|
|
2793
|
+
/**
|
|
2794
|
+
* Enforces that the 'sandbox' attribute for 'iframe' elements is not set to unsafe combinations.
|
|
2795
|
+
* @see https://eslint-react.xyz/docs/rules/dom-no-unsafe-iframe-sandbox
|
|
2796
|
+
*/
|
|
2797
|
+
'react/dom-no-unsafe-iframe-sandbox'?: Linter.RuleEntry<[]>;
|
|
2798
|
+
/**
|
|
2799
|
+
* Disallows 'target="_blank"' without 'rel="noreferrer noopener"'.
|
|
2800
|
+
* @see https://eslint-react.xyz/docs/rules/dom-no-unsafe-target-blank
|
|
2801
|
+
*/
|
|
2802
|
+
'react/dom-no-unsafe-target-blank'?: Linter.RuleEntry<[]>;
|
|
2803
|
+
/**
|
|
2804
|
+
* Replaces usage of 'useFormState' with 'useActionState'.
|
|
2805
|
+
* @see https://eslint-react.xyz/docs/rules/dom-no-use-form-state
|
|
2806
|
+
*/
|
|
2807
|
+
'react/dom-no-use-form-state'?: Linter.RuleEntry<[]>;
|
|
2808
|
+
/**
|
|
2809
|
+
* Disallows 'children' in void DOM elements.
|
|
2810
|
+
* @see https://eslint-react.xyz/docs/rules/dom-no-void-elements-with-children
|
|
2811
|
+
*/
|
|
2812
|
+
'react/dom-no-void-elements-with-children'?: Linter.RuleEntry<[]>;
|
|
2813
|
+
/**
|
|
2814
|
+
* Validates usage of Error Boundaries instead of try/catch for errors in child components.
|
|
2815
|
+
* @see https://eslint-react.xyz/docs/rules/error-boundaries
|
|
2881
2816
|
*/
|
|
2882
|
-
'react
|
|
2817
|
+
'react/error-boundaries'?: Linter.RuleEntry<[]>;
|
|
2883
2818
|
/**
|
|
2884
|
-
*
|
|
2885
|
-
* @see https://
|
|
2819
|
+
* Verifies the list of dependencies for Hooks like 'useEffect' and similar.
|
|
2820
|
+
* @see https://github.com/facebook/react/issues/14920
|
|
2821
|
+
*/
|
|
2822
|
+
'react/exhaustive-deps'?: Linter.RuleEntry<ReactExhaustiveDeps>;
|
|
2823
|
+
/**
|
|
2824
|
+
* Validates against assignment/mutation of globals during render, part of ensuring that side effects must run outside of render.
|
|
2825
|
+
* @see https://eslint-react.xyz/docs/rules/globals
|
|
2886
2826
|
*/
|
|
2887
|
-
'react/
|
|
2827
|
+
'react/globals'?: Linter.RuleEntry<[]>;
|
|
2888
2828
|
/**
|
|
2889
|
-
*
|
|
2890
|
-
* @see https://eslint-react.xyz/docs/rules/
|
|
2829
|
+
* Validates against mutating props, state, and other values that are immutable.
|
|
2830
|
+
* @see https://eslint-react.xyz/docs/rules/immutability
|
|
2831
|
+
*/
|
|
2832
|
+
'react/immutability'?: Linter.RuleEntry<[]>;
|
|
2833
|
+
/**
|
|
2834
|
+
* Disallows passing 'children' as a prop.
|
|
2835
|
+
* @see https://eslint-react.xyz/docs/rules/no-children-prop
|
|
2891
2836
|
*/
|
|
2892
|
-
'react/jsx-
|
|
2837
|
+
'react/jsx-no-children-prop'?: Linter.RuleEntry<[]>;
|
|
2893
2838
|
/**
|
|
2894
|
-
*
|
|
2895
|
-
* @see https://eslint-react.xyz/docs/rules/
|
|
2839
|
+
* Disallows passing 'children' as a prop when children are also passed as nested content.
|
|
2840
|
+
* @see https://eslint-react.xyz/docs/rules/no-children-prop-with-children
|
|
2841
|
+
*/
|
|
2842
|
+
'react/jsx-no-children-prop-with-children'?: Linter.RuleEntry<[]>;
|
|
2843
|
+
/**
|
|
2844
|
+
* Prevents comment strings from being accidentally inserted into a JSX element's text nodes.
|
|
2845
|
+
* @see https://eslint-react.xyz/docs/rules/no-comment-textnodes
|
|
2896
2846
|
*/
|
|
2897
2847
|
'react/jsx-no-comment-textnodes'?: Linter.RuleEntry<[]>;
|
|
2898
2848
|
/**
|
|
2899
|
-
*
|
|
2900
|
-
* @see https://eslint-react.xyz/docs/rules/
|
|
2849
|
+
* Prevent patterns that cause deoptimization when using the automatic JSX runtime.
|
|
2850
|
+
* @see https://eslint-react.xyz/docs/rules/no-key-after-spread
|
|
2851
|
+
*/
|
|
2852
|
+
'react/jsx-no-key-after-spread'?: Linter.RuleEntry<[]>;
|
|
2853
|
+
/**
|
|
2854
|
+
* Catches `$` before `{expr}` in JSX — typically from template literal `${expr}` being copy-pasted into JSX without removing the `$`. The `$` "leaks" into the rendered output.
|
|
2855
|
+
* @see https://eslint-react.xyz/docs/rules/no-leaked-dollar
|
|
2901
2856
|
*/
|
|
2902
|
-
'react/jsx-no-
|
|
2857
|
+
'react/jsx-no-leaked-dollar'?: Linter.RuleEntry<[]>;
|
|
2903
2858
|
/**
|
|
2904
|
-
*
|
|
2905
|
-
* @see https://eslint-react.xyz/docs/rules/
|
|
2859
|
+
* Catches `;` at the start of JSX text nodes — typically from accidentally placing a statement-ending `;` inside JSX. The `;` "leaks" into the rendered output.
|
|
2860
|
+
* @see https://eslint-react.xyz/docs/rules/no-leaked-semicolon
|
|
2906
2861
|
*/
|
|
2907
|
-
'react/jsx-no-
|
|
2862
|
+
'react/jsx-no-leaked-semicolon'?: Linter.RuleEntry<[]>;
|
|
2908
2863
|
/**
|
|
2909
|
-
*
|
|
2910
|
-
* @see https://eslint-react.xyz/docs/rules/
|
|
2864
|
+
* Disallow JSX namespace syntax, as React does not support them.
|
|
2865
|
+
* @see https://eslint-react.xyz/docs/rules/no-namespace
|
|
2911
2866
|
*/
|
|
2912
|
-
'react/jsx-no-
|
|
2867
|
+
'react/jsx-no-namespace'?: Linter.RuleEntry<[]>;
|
|
2913
2868
|
/**
|
|
2914
|
-
*
|
|
2915
|
-
* @see https://eslint-react.xyz/docs/rules/
|
|
2869
|
+
* Disallows useless fragment elements.
|
|
2870
|
+
* @see https://eslint-react.xyz/docs/rules/no-useless-fragment
|
|
2916
2871
|
*/
|
|
2917
|
-
'react/jsx-
|
|
2872
|
+
'react/jsx-no-useless-fragment'?: Linter.RuleEntry<ReactJsxNoUselessFragment>;
|
|
2918
2873
|
/**
|
|
2919
|
-
* Enforces
|
|
2920
|
-
* @see https://eslint-react.xyz/docs/rules/
|
|
2874
|
+
* Enforces the context name to be a valid component name with the suffix 'Context'.
|
|
2875
|
+
* @see https://eslint-react.xyz/docs/rules/naming-convention-context-name
|
|
2921
2876
|
*/
|
|
2922
|
-
'react/
|
|
2877
|
+
'react/naming-convention-context-name'?: Linter.RuleEntry<[]>;
|
|
2923
2878
|
/**
|
|
2924
|
-
*
|
|
2925
|
-
* @see https://eslint-react.xyz/docs/rules/
|
|
2879
|
+
* Enforces identifier names assigned from 'useId' calls to be either 'id' or end with 'Id'.
|
|
2880
|
+
* @see https://eslint-react.xyz/docs/rules/naming-convention-id-name
|
|
2926
2881
|
*/
|
|
2927
|
-
'react/
|
|
2882
|
+
'react/naming-convention-id-name'?: Linter.RuleEntry<[]>;
|
|
2928
2883
|
/**
|
|
2929
|
-
*
|
|
2930
|
-
* @see https://eslint-react.xyz/docs/rules/
|
|
2884
|
+
* Enforces identifier names assigned from 'useRef' calls to be either 'ref' or end with 'Ref'.
|
|
2885
|
+
* @see https://eslint-react.xyz/docs/rules/naming-convention-ref-name
|
|
2931
2886
|
*/
|
|
2932
|
-
'react/
|
|
2887
|
+
'react/naming-convention-ref-name'?: Linter.RuleEntry<[]>;
|
|
2933
2888
|
/**
|
|
2934
2889
|
* Disallows accessing 'this.state' inside 'setState' calls.
|
|
2935
2890
|
* @see https://eslint-react.xyz/docs/rules/no-access-state-in-setstate
|
|
@@ -2960,11 +2915,6 @@ interface RuleOptions {
|
|
|
2960
2915
|
* @see https://eslint-react.xyz/docs/rules/no-children-only
|
|
2961
2916
|
*/
|
|
2962
2917
|
'react/no-children-only'?: Linter.RuleEntry<[]>;
|
|
2963
|
-
/**
|
|
2964
|
-
* Disallows passing 'children' as a prop.
|
|
2965
|
-
* @see https://eslint-react.xyz/docs/rules/no-children-prop
|
|
2966
|
-
*/
|
|
2967
|
-
'react/no-children-prop'?: Linter.RuleEntry<[]>;
|
|
2968
2918
|
/**
|
|
2969
2919
|
* Disallows the use of 'Children.toArray' from the 'react' package.
|
|
2970
2920
|
* @see https://eslint-react.xyz/docs/rules/no-children-to-array
|
|
@@ -3005,11 +2955,6 @@ interface RuleOptions {
|
|
|
3005
2955
|
* @see https://eslint-react.xyz/docs/rules/no-create-ref
|
|
3006
2956
|
*/
|
|
3007
2957
|
'react/no-create-ref'?: Linter.RuleEntry<[]>;
|
|
3008
|
-
/**
|
|
3009
|
-
* Disallows the 'defaultProps' property in favor of ES6 default parameters.
|
|
3010
|
-
* @see https://eslint-react.xyz/docs/rules/no-default-props
|
|
3011
|
-
*/
|
|
3012
|
-
'react/no-default-props'?: Linter.RuleEntry<[]>;
|
|
3013
2958
|
/**
|
|
3014
2959
|
* Disallows direct mutation of 'this.state'.
|
|
3015
2960
|
* @see https://eslint-react.xyz/docs/rules/no-direct-mutation-state
|
|
@@ -3020,22 +2965,26 @@ interface RuleOptions {
|
|
|
3020
2965
|
* @see https://eslint-react.xyz/docs/rules/no-duplicate-key
|
|
3021
2966
|
*/
|
|
3022
2967
|
'react/no-duplicate-key'?: Linter.RuleEntry<[]>;
|
|
3023
|
-
/**
|
|
3024
|
-
* Disallows certain props on components.
|
|
3025
|
-
* @see https://eslint-react.xyz/docs/rules/no-forbidden-props
|
|
3026
|
-
* @deprecated
|
|
3027
|
-
*/
|
|
3028
|
-
'react/no-forbidden-props'?: Linter.RuleEntry<ReactNoForbiddenProps>;
|
|
3029
2968
|
/**
|
|
3030
2969
|
* Replaces usage of 'forwardRef' with passing 'ref' as a prop.
|
|
3031
2970
|
* @see https://eslint-react.xyz/docs/rules/no-forward-ref
|
|
3032
2971
|
*/
|
|
3033
2972
|
'react/no-forward-ref'?: Linter.RuleEntry<[]>;
|
|
2973
|
+
/**
|
|
2974
|
+
* Prevents implicitly passing the 'children' prop to components.
|
|
2975
|
+
* @see https://eslint-react.xyz/docs/rules/no-implicit-children
|
|
2976
|
+
*/
|
|
2977
|
+
'react/no-implicit-children'?: Linter.RuleEntry<[]>;
|
|
3034
2978
|
/**
|
|
3035
2979
|
* Prevents implicitly passing the 'key' prop to components.
|
|
3036
2980
|
* @see https://eslint-react.xyz/docs/rules/no-implicit-key
|
|
3037
2981
|
*/
|
|
3038
2982
|
'react/no-implicit-key'?: Linter.RuleEntry<[]>;
|
|
2983
|
+
/**
|
|
2984
|
+
* Prevents implicitly passing the 'ref' prop to components.
|
|
2985
|
+
* @see https://eslint-react.xyz/docs/rules/no-implicit-ref
|
|
2986
|
+
*/
|
|
2987
|
+
'react/no-implicit-ref'?: Linter.RuleEntry<[]>;
|
|
3039
2988
|
/**
|
|
3040
2989
|
* Prevents problematic leaked values from being rendered.
|
|
3041
2990
|
* @see https://eslint-react.xyz/docs/rules/no-leaked-conditional-rendering
|
|
@@ -3067,20 +3016,10 @@ interface RuleOptions {
|
|
|
3067
3016
|
*/
|
|
3068
3017
|
'react/no-nested-component-definitions'?: Linter.RuleEntry<[]>;
|
|
3069
3018
|
/**
|
|
3070
|
-
* Disallows nesting lazy component declarations inside other components.
|
|
3019
|
+
* Disallows nesting lazy component declarations inside other components or hooks.
|
|
3071
3020
|
* @see https://eslint-react.xyz/docs/rules/no-nested-lazy-component-declarations
|
|
3072
3021
|
*/
|
|
3073
3022
|
'react/no-nested-lazy-component-declarations'?: Linter.RuleEntry<[]>;
|
|
3074
|
-
/**
|
|
3075
|
-
* Disallows 'propTypes' in favor of TypeScript or another type-checking solution.
|
|
3076
|
-
* @see https://eslint-react.xyz/docs/rules/no-prop-types
|
|
3077
|
-
*/
|
|
3078
|
-
'react/no-prop-types'?: Linter.RuleEntry<[]>;
|
|
3079
|
-
/**
|
|
3080
|
-
* Disallows 'shouldComponentUpdate' when extending 'React.PureComponent'.
|
|
3081
|
-
* @see https://eslint-react.xyz/docs/rules/no-redundant-should-component-update
|
|
3082
|
-
*/
|
|
3083
|
-
'react/no-redundant-should-component-update'?: Linter.RuleEntry<[]>;
|
|
3084
3023
|
/**
|
|
3085
3024
|
* Disallows calling 'this.setState' in 'componentDidMount' outside functions such as callbacks.
|
|
3086
3025
|
* @see https://eslint-react.xyz/docs/rules/no-set-state-in-component-did-mount
|
|
@@ -3096,36 +3035,11 @@ interface RuleOptions {
|
|
|
3096
3035
|
* @see https://eslint-react.xyz/docs/rules/no-set-state-in-component-will-update
|
|
3097
3036
|
*/
|
|
3098
3037
|
'react/no-set-state-in-component-will-update'?: Linter.RuleEntry<[]>;
|
|
3099
|
-
/**
|
|
3100
|
-
* Replaces string refs with callback refs.
|
|
3101
|
-
* @see https://eslint-react.xyz/docs/rules/no-string-refs
|
|
3102
|
-
*/
|
|
3103
|
-
'react/no-string-refs'?: Linter.RuleEntry<[]>;
|
|
3104
|
-
/**
|
|
3105
|
-
* Disallows unnecessary 'key' props on nested child elements when rendering lists.
|
|
3106
|
-
* @see https://eslint-react.xyz/docs/rules/no-unnecessary-key
|
|
3107
|
-
*/
|
|
3108
|
-
'react/no-unnecessary-key'?: Linter.RuleEntry<[]>;
|
|
3109
|
-
/**
|
|
3110
|
-
* Disallows unnecessary usage of 'useCallback'.
|
|
3111
|
-
* @see https://eslint-react.xyz/docs/rules/no-unnecessary-use-callback
|
|
3112
|
-
*/
|
|
3113
|
-
'react/no-unnecessary-use-callback'?: Linter.RuleEntry<[]>;
|
|
3114
|
-
/**
|
|
3115
|
-
* Disallows unnecessary usage of 'useMemo'.
|
|
3116
|
-
* @see https://eslint-react.xyz/docs/rules/no-unnecessary-use-memo
|
|
3117
|
-
*/
|
|
3118
|
-
'react/no-unnecessary-use-memo'?: Linter.RuleEntry<[]>;
|
|
3119
3038
|
/**
|
|
3120
3039
|
* Enforces that a function with the 'use' prefix uses at least one Hook inside it.
|
|
3121
3040
|
* @see https://eslint-react.xyz/docs/rules/no-unnecessary-use-prefix
|
|
3122
3041
|
*/
|
|
3123
3042
|
'react/no-unnecessary-use-prefix'?: Linter.RuleEntry<[]>;
|
|
3124
|
-
/**
|
|
3125
|
-
* Disallows unnecessary usage of 'useRef'.
|
|
3126
|
-
* @see https://eslint-react.xyz/docs/rules/no-unnecessary-use-ref
|
|
3127
|
-
*/
|
|
3128
|
-
'react/no-unnecessary-use-ref'?: Linter.RuleEntry<[]>;
|
|
3129
3043
|
/**
|
|
3130
3044
|
* Warns about the use of 'UNSAFE_componentWillMount' in class components.
|
|
3131
3045
|
* @see https://eslint-react.xyz/docs/rules/no-unsafe-component-will-mount
|
|
@@ -3162,45 +3076,345 @@ interface RuleOptions {
|
|
|
3162
3076
|
*/
|
|
3163
3077
|
'react/no-unused-props'?: Linter.RuleEntry<[]>;
|
|
3164
3078
|
/**
|
|
3165
|
-
*
|
|
3166
|
-
* @see https://eslint-react.xyz/docs/rules/no-
|
|
3079
|
+
* Replaces usage of 'useContext' with 'use'.
|
|
3080
|
+
* @see https://eslint-react.xyz/docs/rules/no-use-context
|
|
3081
|
+
*/
|
|
3082
|
+
'react/no-use-context'?: Linter.RuleEntry<[]>;
|
|
3083
|
+
/**
|
|
3084
|
+
* Validates that components and hooks are pure by checking that they do not call known-impure functions during render.
|
|
3085
|
+
* @see https://eslint-react.xyz/docs/rules/purity
|
|
3086
|
+
*/
|
|
3087
|
+
'react/purity'?: Linter.RuleEntry<[]>;
|
|
3088
|
+
/**
|
|
3089
|
+
* Validates correct usage of refs by checking that 'ref.current' is not read or written during render.
|
|
3090
|
+
* @see https://eslint-react.xyz/docs/rules/refs
|
|
3091
|
+
*/
|
|
3092
|
+
'react/refs'?: Linter.RuleEntry<[]>;
|
|
3093
|
+
/**
|
|
3094
|
+
* Validates and transforms React Client/Server Function definitions.
|
|
3095
|
+
* @see https://eslint-react.xyz/docs/rules/function-definition
|
|
3096
|
+
*/
|
|
3097
|
+
'react/rsc-function-definition'?: Linter.RuleEntry<[]>;
|
|
3098
|
+
/**
|
|
3099
|
+
* Enforces the Rules of Hooks.
|
|
3100
|
+
* @see https://react.dev/reference/rules/rules-of-hooks
|
|
3101
|
+
*/
|
|
3102
|
+
'react/rules-of-hooks'?: Linter.RuleEntry<ReactRulesOfHooks>;
|
|
3103
|
+
/**
|
|
3104
|
+
* Validates against setting state synchronously in an effect, which can lead to re-renders that degrade performance.
|
|
3105
|
+
* @see https://eslint-react.xyz/docs/rules/set-state-in-effect
|
|
3106
|
+
*/
|
|
3107
|
+
'react/set-state-in-effect'?: Linter.RuleEntry<[]>;
|
|
3108
|
+
/**
|
|
3109
|
+
* Validates against unconditionally setting state during render, which can trigger additional renders and potential infinite render loops.
|
|
3110
|
+
* @see https://eslint-react.xyz/docs/rules/set-state-in-render
|
|
3111
|
+
*/
|
|
3112
|
+
'react/set-state-in-render'?: Linter.RuleEntry<[]>;
|
|
3113
|
+
/**
|
|
3114
|
+
* Validates that components are static, not recreated every render.
|
|
3115
|
+
* @see https://eslint-react.xyz/docs/rules/static-components
|
|
3116
|
+
*/
|
|
3117
|
+
'react/static-components'?: Linter.RuleEntry<[]>;
|
|
3118
|
+
/**
|
|
3119
|
+
* Validates against syntax that React Compiler does not support.
|
|
3120
|
+
* @see https://eslint-react.xyz/docs/rules/unsupported-syntax
|
|
3121
|
+
*/
|
|
3122
|
+
'react/unsupported-syntax'?: Linter.RuleEntry<[]>;
|
|
3123
|
+
/**
|
|
3124
|
+
* Validates that 'useMemo' is called with a callback that returns a value.
|
|
3125
|
+
* @see https://eslint-react.xyz/docs/rules/use-memo
|
|
3126
|
+
*/
|
|
3127
|
+
'react/use-memo'?: Linter.RuleEntry<[]>;
|
|
3128
|
+
/**
|
|
3129
|
+
* Enforces correct usage of 'useState', including destructuring, symmetric naming of the value and setter, and wrapping expensive initializers in a lazy initializer function.
|
|
3130
|
+
* @see https://eslint-react.xyz/docs/rules/use-state
|
|
3131
|
+
*/
|
|
3132
|
+
'react/use-state'?: Linter.RuleEntry<ReactUseState>;
|
|
3133
|
+
/**
|
|
3134
|
+
* Enforces that every 'addEventListener' in a component or custom hook has a corresponding 'removeEventListener'.
|
|
3135
|
+
* @see https://eslint-react.xyz/docs/rules/web-api-no-leaked-event-listener
|
|
3136
|
+
*/
|
|
3137
|
+
'react/web-api-no-leaked-event-listener'?: Linter.RuleEntry<[]>;
|
|
3138
|
+
/**
|
|
3139
|
+
* Enforces that every 'fetch' in a component or custom hook has a corresponding 'AbortController' abort in the cleanup function.
|
|
3140
|
+
* @see https://eslint-react.xyz/docs/rules/web-api-no-leaked-fetch
|
|
3141
|
+
*/
|
|
3142
|
+
'react/web-api-no-leaked-fetch'?: Linter.RuleEntry<[]>;
|
|
3143
|
+
/**
|
|
3144
|
+
* Enforces that every 'setInterval' in a component or custom hook has a corresponding 'clearInterval'.
|
|
3145
|
+
* @see https://eslint-react.xyz/docs/rules/web-api-no-leaked-interval
|
|
3146
|
+
*/
|
|
3147
|
+
'react/web-api-no-leaked-interval'?: Linter.RuleEntry<[]>;
|
|
3148
|
+
/**
|
|
3149
|
+
* Enforces that every 'ResizeObserver' created in a component or custom hook has a corresponding 'ResizeObserver.disconnect()'.
|
|
3150
|
+
* @see https://eslint-react.xyz/docs/rules/web-api-no-leaked-resize-observer
|
|
3151
|
+
*/
|
|
3152
|
+
'react/web-api-no-leaked-resize-observer'?: Linter.RuleEntry<[]>;
|
|
3153
|
+
/**
|
|
3154
|
+
* Enforces that every 'setTimeout' in a component or custom hook has a corresponding 'clearTimeout'.
|
|
3155
|
+
* @see https://eslint-react.xyz/docs/rules/web-api-no-leaked-timeout
|
|
3156
|
+
*/
|
|
3157
|
+
'react/web-api-no-leaked-timeout'?: Linter.RuleEntry<[]>;
|
|
3158
|
+
/**
|
|
3159
|
+
* Validates usage of Error Boundaries instead of try/catch for errors in child components.
|
|
3160
|
+
* @see https://eslint-react.xyz/docs/rules/error-boundaries
|
|
3161
|
+
*/
|
|
3162
|
+
'react/x-error-boundaries'?: Linter.RuleEntry<[]>;
|
|
3163
|
+
/**
|
|
3164
|
+
* Verifies the list of dependencies for Hooks like 'useEffect' and similar.
|
|
3165
|
+
* @see https://github.com/facebook/react/issues/14920
|
|
3166
|
+
*/
|
|
3167
|
+
'react/x-exhaustive-deps'?: Linter.RuleEntry<ReactXExhaustiveDeps>;
|
|
3168
|
+
/**
|
|
3169
|
+
* Validates against assignment/mutation of globals during render, part of ensuring that side effects must run outside of render.
|
|
3170
|
+
* @see https://eslint-react.xyz/docs/rules/globals
|
|
3171
|
+
*/
|
|
3172
|
+
'react/x-globals'?: Linter.RuleEntry<[]>;
|
|
3173
|
+
/**
|
|
3174
|
+
* Validates against mutating props, state, and other values that are immutable.
|
|
3175
|
+
* @see https://eslint-react.xyz/docs/rules/immutability
|
|
3176
|
+
*/
|
|
3177
|
+
'react/x-immutability'?: Linter.RuleEntry<[]>;
|
|
3178
|
+
/**
|
|
3179
|
+
* Disallows accessing 'this.state' inside 'setState' calls.
|
|
3180
|
+
* @see https://eslint-react.xyz/docs/rules/no-access-state-in-setstate
|
|
3181
|
+
*/
|
|
3182
|
+
'react/x-no-access-state-in-setstate'?: Linter.RuleEntry<[]>;
|
|
3183
|
+
/**
|
|
3184
|
+
* Disallows using an item's index in the array as its key.
|
|
3185
|
+
* @see https://eslint-react.xyz/docs/rules/no-array-index-key
|
|
3186
|
+
*/
|
|
3187
|
+
'react/x-no-array-index-key'?: Linter.RuleEntry<[]>;
|
|
3188
|
+
/**
|
|
3189
|
+
* Disallows the use of 'Children.count' from the 'react' package.
|
|
3190
|
+
* @see https://eslint-react.xyz/docs/rules/no-children-count
|
|
3191
|
+
*/
|
|
3192
|
+
'react/x-no-children-count'?: Linter.RuleEntry<[]>;
|
|
3193
|
+
/**
|
|
3194
|
+
* Disallows the use of 'Children.forEach' from the 'react' package.
|
|
3195
|
+
* @see https://eslint-react.xyz/docs/rules/no-children-for-each
|
|
3196
|
+
*/
|
|
3197
|
+
'react/x-no-children-for-each'?: Linter.RuleEntry<[]>;
|
|
3198
|
+
/**
|
|
3199
|
+
* Disallows the use of 'Children.map' from the 'react' package.
|
|
3200
|
+
* @see https://eslint-react.xyz/docs/rules/no-children-map
|
|
3201
|
+
*/
|
|
3202
|
+
'react/x-no-children-map'?: Linter.RuleEntry<[]>;
|
|
3203
|
+
/**
|
|
3204
|
+
* Disallows the use of 'Children.only' from the 'react' package.
|
|
3205
|
+
* @see https://eslint-react.xyz/docs/rules/no-children-only
|
|
3206
|
+
*/
|
|
3207
|
+
'react/x-no-children-only'?: Linter.RuleEntry<[]>;
|
|
3208
|
+
/**
|
|
3209
|
+
* Disallows the use of 'Children.toArray' from the 'react' package.
|
|
3210
|
+
* @see https://eslint-react.xyz/docs/rules/no-children-to-array
|
|
3211
|
+
*/
|
|
3212
|
+
'react/x-no-children-to-array'?: Linter.RuleEntry<[]>;
|
|
3213
|
+
/**
|
|
3214
|
+
* Disallows class components except for error boundaries.
|
|
3215
|
+
* @see https://eslint-react.xyz/docs/rules/no-class-component
|
|
3216
|
+
*/
|
|
3217
|
+
'react/x-no-class-component'?: Linter.RuleEntry<[]>;
|
|
3218
|
+
/**
|
|
3219
|
+
* Disallows 'cloneElement'.
|
|
3220
|
+
* @see https://eslint-react.xyz/docs/rules/no-clone-element
|
|
3221
|
+
*/
|
|
3222
|
+
'react/x-no-clone-element'?: Linter.RuleEntry<[]>;
|
|
3223
|
+
/**
|
|
3224
|
+
* Replaces usage of 'componentWillMount' with 'UNSAFE_componentWillMount'.
|
|
3225
|
+
* @see https://eslint-react.xyz/docs/rules/no-component-will-mount
|
|
3226
|
+
*/
|
|
3227
|
+
'react/x-no-component-will-mount'?: Linter.RuleEntry<[]>;
|
|
3228
|
+
/**
|
|
3229
|
+
* Replaces usage of 'componentWillReceiveProps' with 'UNSAFE_componentWillReceiveProps'.
|
|
3230
|
+
* @see https://eslint-react.xyz/docs/rules/no-component-will-receive-props
|
|
3231
|
+
*/
|
|
3232
|
+
'react/x-no-component-will-receive-props'?: Linter.RuleEntry<[]>;
|
|
3233
|
+
/**
|
|
3234
|
+
* Replaces usage of 'componentWillUpdate' with 'UNSAFE_componentWillUpdate'.
|
|
3235
|
+
* @see https://eslint-react.xyz/docs/rules/no-component-will-update
|
|
3236
|
+
*/
|
|
3237
|
+
'react/x-no-component-will-update'?: Linter.RuleEntry<[]>;
|
|
3238
|
+
/**
|
|
3239
|
+
* Replaces usage of '<Context.Provider>' with '<Context>'.
|
|
3240
|
+
* @see https://eslint-react.xyz/docs/rules/no-context-provider
|
|
3241
|
+
*/
|
|
3242
|
+
'react/x-no-context-provider'?: Linter.RuleEntry<[]>;
|
|
3243
|
+
/**
|
|
3244
|
+
* Disallows 'createRef' in function components.
|
|
3245
|
+
* @see https://eslint-react.xyz/docs/rules/no-create-ref
|
|
3246
|
+
*/
|
|
3247
|
+
'react/x-no-create-ref'?: Linter.RuleEntry<[]>;
|
|
3248
|
+
/**
|
|
3249
|
+
* Disallows direct mutation of 'this.state'.
|
|
3250
|
+
* @see https://eslint-react.xyz/docs/rules/no-direct-mutation-state
|
|
3251
|
+
*/
|
|
3252
|
+
'react/x-no-direct-mutation-state'?: Linter.RuleEntry<[]>;
|
|
3253
|
+
/**
|
|
3254
|
+
* Prevents duplicate 'key' props on sibling elements when rendering lists.
|
|
3255
|
+
* @see https://eslint-react.xyz/docs/rules/no-duplicate-key
|
|
3256
|
+
*/
|
|
3257
|
+
'react/x-no-duplicate-key'?: Linter.RuleEntry<[]>;
|
|
3258
|
+
/**
|
|
3259
|
+
* Replaces usage of 'forwardRef' with passing 'ref' as a prop.
|
|
3260
|
+
* @see https://eslint-react.xyz/docs/rules/no-forward-ref
|
|
3261
|
+
*/
|
|
3262
|
+
'react/x-no-forward-ref'?: Linter.RuleEntry<[]>;
|
|
3263
|
+
/**
|
|
3264
|
+
* Prevents implicitly passing the 'children' prop to components.
|
|
3265
|
+
* @see https://eslint-react.xyz/docs/rules/no-implicit-children
|
|
3266
|
+
*/
|
|
3267
|
+
'react/x-no-implicit-children'?: Linter.RuleEntry<[]>;
|
|
3268
|
+
/**
|
|
3269
|
+
* Prevents implicitly passing the 'key' prop to components.
|
|
3270
|
+
* @see https://eslint-react.xyz/docs/rules/no-implicit-key
|
|
3271
|
+
*/
|
|
3272
|
+
'react/x-no-implicit-key'?: Linter.RuleEntry<[]>;
|
|
3273
|
+
/**
|
|
3274
|
+
* Prevents implicitly passing the 'ref' prop to components.
|
|
3275
|
+
* @see https://eslint-react.xyz/docs/rules/no-implicit-ref
|
|
3276
|
+
*/
|
|
3277
|
+
'react/x-no-implicit-ref'?: Linter.RuleEntry<[]>;
|
|
3278
|
+
/**
|
|
3279
|
+
* Prevents problematic leaked values from being rendered.
|
|
3280
|
+
* @see https://eslint-react.xyz/docs/rules/no-leaked-conditional-rendering
|
|
3281
|
+
*/
|
|
3282
|
+
'react/x-no-leaked-conditional-rendering'?: Linter.RuleEntry<[]>;
|
|
3283
|
+
/**
|
|
3284
|
+
* Enforces that all components have a 'displayName' that can be used in DevTools.
|
|
3285
|
+
* @see https://eslint-react.xyz/docs/rules/no-missing-component-display-name
|
|
3286
|
+
*/
|
|
3287
|
+
'react/x-no-missing-component-display-name'?: Linter.RuleEntry<[]>;
|
|
3288
|
+
/**
|
|
3289
|
+
* Enforces that all contexts have a 'displayName' that can be used in DevTools.
|
|
3290
|
+
* @see https://eslint-react.xyz/docs/rules/no-missing-context-display-name
|
|
3291
|
+
*/
|
|
3292
|
+
'react/x-no-missing-context-display-name'?: Linter.RuleEntry<[]>;
|
|
3293
|
+
/**
|
|
3294
|
+
* Disallows missing 'key' on items in list rendering.
|
|
3295
|
+
* @see https://eslint-react.xyz/docs/rules/no-missing-key
|
|
3296
|
+
*/
|
|
3297
|
+
'react/x-no-missing-key'?: Linter.RuleEntry<[]>;
|
|
3298
|
+
/**
|
|
3299
|
+
* Prevents incorrect usage of 'captureOwnerStack'.
|
|
3300
|
+
* @see https://eslint-react.xyz/docs/rules/no-misused-capture-owner-stack
|
|
3301
|
+
*/
|
|
3302
|
+
'react/x-no-misused-capture-owner-stack'?: Linter.RuleEntry<[]>;
|
|
3303
|
+
/**
|
|
3304
|
+
* Disallows nesting component definitions inside other components.
|
|
3305
|
+
* @see https://eslint-react.xyz/docs/rules/no-nested-component-definitions
|
|
3306
|
+
*/
|
|
3307
|
+
'react/x-no-nested-component-definitions'?: Linter.RuleEntry<[]>;
|
|
3308
|
+
/**
|
|
3309
|
+
* Disallows nesting lazy component declarations inside other components or hooks.
|
|
3310
|
+
* @see https://eslint-react.xyz/docs/rules/no-nested-lazy-component-declarations
|
|
3311
|
+
*/
|
|
3312
|
+
'react/x-no-nested-lazy-component-declarations'?: Linter.RuleEntry<[]>;
|
|
3313
|
+
/**
|
|
3314
|
+
* Disallows calling 'this.setState' in 'componentDidMount' outside functions such as callbacks.
|
|
3315
|
+
* @see https://eslint-react.xyz/docs/rules/no-set-state-in-component-did-mount
|
|
3316
|
+
*/
|
|
3317
|
+
'react/x-no-set-state-in-component-did-mount'?: Linter.RuleEntry<[]>;
|
|
3318
|
+
/**
|
|
3319
|
+
* Disallows calling 'this.setState' in 'componentDidUpdate' outside functions such as callbacks.
|
|
3320
|
+
* @see https://eslint-react.xyz/docs/rules/no-set-state-in-component-did-update
|
|
3321
|
+
*/
|
|
3322
|
+
'react/x-no-set-state-in-component-did-update'?: Linter.RuleEntry<[]>;
|
|
3323
|
+
/**
|
|
3324
|
+
* Disallows calling 'this.setState' in 'componentWillUpdate' outside functions such as callbacks.
|
|
3325
|
+
* @see https://eslint-react.xyz/docs/rules/no-set-state-in-component-will-update
|
|
3326
|
+
*/
|
|
3327
|
+
'react/x-no-set-state-in-component-will-update'?: Linter.RuleEntry<[]>;
|
|
3328
|
+
/**
|
|
3329
|
+
* Enforces that a function with the 'use' prefix uses at least one Hook inside it.
|
|
3330
|
+
* @see https://eslint-react.xyz/docs/rules/no-unnecessary-use-prefix
|
|
3331
|
+
*/
|
|
3332
|
+
'react/x-no-unnecessary-use-prefix'?: Linter.RuleEntry<[]>;
|
|
3333
|
+
/**
|
|
3334
|
+
* Warns about the use of 'UNSAFE_componentWillMount' in class components.
|
|
3335
|
+
* @see https://eslint-react.xyz/docs/rules/no-unsafe-component-will-mount
|
|
3336
|
+
*/
|
|
3337
|
+
'react/x-no-unsafe-component-will-mount'?: Linter.RuleEntry<[]>;
|
|
3338
|
+
/**
|
|
3339
|
+
* Warns about the use of 'UNSAFE_componentWillReceiveProps' in class components.
|
|
3340
|
+
* @see https://eslint-react.xyz/docs/rules/no-unsafe-component-will-receive-props
|
|
3341
|
+
*/
|
|
3342
|
+
'react/x-no-unsafe-component-will-receive-props'?: Linter.RuleEntry<[]>;
|
|
3343
|
+
/**
|
|
3344
|
+
* Warns about the use of 'UNSAFE_componentWillUpdate' in class components.
|
|
3345
|
+
* @see https://eslint-react.xyz/docs/rules/no-unsafe-component-will-update
|
|
3346
|
+
*/
|
|
3347
|
+
'react/x-no-unsafe-component-will-update'?: Linter.RuleEntry<[]>;
|
|
3348
|
+
/**
|
|
3349
|
+
* Prevents non-stable values (i.e., object literals) from being used as a value for 'Context.Provider'.
|
|
3350
|
+
* @see https://eslint-react.xyz/docs/rules/no-unstable-context-value
|
|
3351
|
+
*/
|
|
3352
|
+
'react/x-no-unstable-context-value'?: Linter.RuleEntry<[]>;
|
|
3353
|
+
/**
|
|
3354
|
+
* Prevents using referential-type values as default props in object destructuring.
|
|
3355
|
+
* @see https://eslint-react.xyz/docs/rules/no-unstable-default-props
|
|
3167
3356
|
*/
|
|
3168
|
-
'react/no-
|
|
3357
|
+
'react/x-no-unstable-default-props'?: Linter.RuleEntry<ReactXNoUnstableDefaultProps>;
|
|
3358
|
+
/**
|
|
3359
|
+
* Warns about unused class component methods and properties.
|
|
3360
|
+
* @see https://eslint-react.xyz/docs/rules/no-unused-class-component-members
|
|
3361
|
+
*/
|
|
3362
|
+
'react/x-no-unused-class-component-members'?: Linter.RuleEntry<[]>;
|
|
3363
|
+
/**
|
|
3364
|
+
* Warns about component props that are defined but never used.
|
|
3365
|
+
* @see https://eslint-react.xyz/docs/rules/no-unused-props
|
|
3366
|
+
*/
|
|
3367
|
+
'react/x-no-unused-props'?: Linter.RuleEntry<[]>;
|
|
3169
3368
|
/**
|
|
3170
3369
|
* Replaces usage of 'useContext' with 'use'.
|
|
3171
3370
|
* @see https://eslint-react.xyz/docs/rules/no-use-context
|
|
3172
3371
|
*/
|
|
3173
|
-
'react/no-use-context'?: Linter.RuleEntry<[]>;
|
|
3372
|
+
'react/x-no-use-context'?: Linter.RuleEntry<[]>;
|
|
3174
3373
|
/**
|
|
3175
|
-
*
|
|
3176
|
-
* @see https://eslint-react.xyz/docs/rules/
|
|
3374
|
+
* Validates that components and hooks are pure by checking that they do not call known-impure functions during render.
|
|
3375
|
+
* @see https://eslint-react.xyz/docs/rules/purity
|
|
3177
3376
|
*/
|
|
3178
|
-
'react/
|
|
3377
|
+
'react/x-purity'?: Linter.RuleEntry<[]>;
|
|
3179
3378
|
/**
|
|
3180
|
-
*
|
|
3181
|
-
* @see https://eslint-react.xyz/docs/rules/
|
|
3379
|
+
* Validates correct usage of refs by checking that 'ref.current' is not read or written during render.
|
|
3380
|
+
* @see https://eslint-react.xyz/docs/rules/refs
|
|
3182
3381
|
*/
|
|
3183
|
-
'react/
|
|
3382
|
+
'react/x-refs'?: Linter.RuleEntry<[]>;
|
|
3184
3383
|
/**
|
|
3185
|
-
* Enforces
|
|
3186
|
-
* @see https://
|
|
3384
|
+
* Enforces the Rules of Hooks.
|
|
3385
|
+
* @see https://react.dev/reference/rules/rules-of-hooks
|
|
3386
|
+
*/
|
|
3387
|
+
'react/x-rules-of-hooks'?: Linter.RuleEntry<ReactXRulesOfHooks>;
|
|
3388
|
+
/**
|
|
3389
|
+
* Validates against setting state synchronously in an effect, which can lead to re-renders that degrade performance.
|
|
3390
|
+
* @see https://eslint-react.xyz/docs/rules/set-state-in-effect
|
|
3391
|
+
*/
|
|
3392
|
+
'react/x-set-state-in-effect'?: Linter.RuleEntry<[]>;
|
|
3393
|
+
/**
|
|
3394
|
+
* Validates against unconditionally setting state during render, which can trigger additional renders and potential infinite render loops.
|
|
3395
|
+
* @see https://eslint-react.xyz/docs/rules/set-state-in-render
|
|
3396
|
+
*/
|
|
3397
|
+
'react/x-set-state-in-render'?: Linter.RuleEntry<[]>;
|
|
3398
|
+
/**
|
|
3399
|
+
* Validates that components are static, not recreated every render.
|
|
3400
|
+
* @see https://eslint-react.xyz/docs/rules/static-components
|
|
3187
3401
|
*/
|
|
3188
|
-
'react/
|
|
3402
|
+
'react/x-static-components'?: Linter.RuleEntry<[]>;
|
|
3189
3403
|
/**
|
|
3190
|
-
*
|
|
3191
|
-
* @see https://eslint-react.xyz/docs/rules/
|
|
3404
|
+
* Validates against syntax that React Compiler does not support.
|
|
3405
|
+
* @see https://eslint-react.xyz/docs/rules/unsupported-syntax
|
|
3192
3406
|
*/
|
|
3193
|
-
'react/
|
|
3407
|
+
'react/x-unsupported-syntax'?: Linter.RuleEntry<[]>;
|
|
3194
3408
|
/**
|
|
3195
|
-
*
|
|
3196
|
-
* @see https://eslint-react.xyz/docs/rules/
|
|
3409
|
+
* Validates that 'useMemo' is called with a callback that returns a value.
|
|
3410
|
+
* @see https://eslint-react.xyz/docs/rules/use-memo
|
|
3197
3411
|
*/
|
|
3198
|
-
'react/
|
|
3412
|
+
'react/x-use-memo'?: Linter.RuleEntry<[]>;
|
|
3199
3413
|
/**
|
|
3200
|
-
* Enforces
|
|
3201
|
-
* @see https://eslint-react.xyz/docs/rules/
|
|
3414
|
+
* Enforces correct usage of 'useState', including destructuring, symmetric naming of the value and setter, and wrapping expensive initializers in a lazy initializer function.
|
|
3415
|
+
* @see https://eslint-react.xyz/docs/rules/use-state
|
|
3202
3416
|
*/
|
|
3203
|
-
'react/
|
|
3417
|
+
'react/x-use-state'?: Linter.RuleEntry<ReactXUseState>;
|
|
3204
3418
|
/**
|
|
3205
3419
|
* disallow confusing quantifiers
|
|
3206
3420
|
* @see https://ota-meshi.github.io/eslint-plugin-regexp/rules/confusing-quantifier.html
|
|
@@ -4344,7 +4558,7 @@ interface RuleOptions {
|
|
|
4344
4558
|
*/
|
|
4345
4559
|
'test/no-mocks-import'?: Linter.RuleEntry<[]>;
|
|
4346
4560
|
/**
|
|
4347
|
-
* disallow
|
|
4561
|
+
* disallow focused/only tests
|
|
4348
4562
|
* @see https://github.com/levibuzolic/eslint-plugin-no-only-tests
|
|
4349
4563
|
*/
|
|
4350
4564
|
'test/no-only-tests'?: Linter.RuleEntry<TestNoOnlyTests>;
|
|
@@ -12571,11 +12785,7 @@ type Quotes = [] | [("single" | "double" | "backtick")] | [("single" | "double"
|
|
|
12571
12785
|
avoidEscape?: boolean;
|
|
12572
12786
|
allowTemplateLiterals?: boolean;
|
|
12573
12787
|
})]; // ----- radix -----
|
|
12574
|
-
type Radix = [] | [("always" | "as-needed")]; // ----- react-
|
|
12575
|
-
type ReactDomNoUnknownProperty = [] | [{
|
|
12576
|
-
ignore?: string[];
|
|
12577
|
-
requireDataLowercase?: boolean;
|
|
12578
|
-
}]; // ----- react-hooks/capitalized-calls -----
|
|
12788
|
+
type Radix = [] | [("always" | "as-needed")]; // ----- react-hooks/capitalized-calls -----
|
|
12579
12789
|
type ReactHooksCapitalizedCalls = [] | [{
|
|
12580
12790
|
[k: string]: unknown | undefined;
|
|
12581
12791
|
}]; // ----- react-hooks/config -----
|
|
@@ -12662,49 +12872,54 @@ type ReactHooksUseMemo = [] | [{
|
|
|
12662
12872
|
}]; // ----- react-hooks/void-use-memo -----
|
|
12663
12873
|
type ReactHooksVoidUseMemo = [] | [{
|
|
12664
12874
|
[k: string]: unknown | undefined;
|
|
12665
|
-
}]; // ----- react-naming-convention/component-name -----
|
|
12666
|
-
type ReactNamingConventionComponentName = [] | [(("PascalCase" | "CONSTANT_CASE") | {
|
|
12667
|
-
allowAllCaps?: boolean;
|
|
12668
|
-
excepts?: string[];
|
|
12669
|
-
rule?: ("PascalCase" | "CONSTANT_CASE");
|
|
12670
|
-
})]; // ----- react-naming-convention/filename -----
|
|
12671
|
-
type ReactNamingConventionFilename = [] | [(("PascalCase" | "camelCase" | "kebab-case" | "snake_case") | {
|
|
12672
|
-
excepts?: string[];
|
|
12673
|
-
extensions?: string[];
|
|
12674
|
-
rule?: ("PascalCase" | "camelCase" | "kebab-case" | "snake_case");
|
|
12675
|
-
})]; // ----- react-naming-convention/filename-extension -----
|
|
12676
|
-
type ReactNamingConventionFilenameExtension = [] | [(("always" | "as-needed") | {
|
|
12677
|
-
allow?: ("always" | "as-needed");
|
|
12678
|
-
extensions?: string[];
|
|
12679
|
-
ignoreFilesWithoutCode?: boolean;
|
|
12680
|
-
})]; // ----- react-naming-convention/use-state -----
|
|
12681
|
-
type ReactNamingConventionUseState = [] | [{
|
|
12682
|
-
enforceAssignment?: boolean;
|
|
12683
|
-
enforceSetterName?: boolean;
|
|
12684
12875
|
}]; // ----- react-refresh/only-export-components -----
|
|
12685
12876
|
type ReactRefreshOnlyExportComponents = [] | [{
|
|
12686
12877
|
extraHOCs?: string[];
|
|
12687
12878
|
allowExportNames?: string[];
|
|
12688
12879
|
allowConstantExport?: boolean;
|
|
12689
12880
|
checkJS?: boolean;
|
|
12690
|
-
}]; // ----- react/
|
|
12691
|
-
type
|
|
12692
|
-
|
|
12693
|
-
|
|
12694
|
-
|
|
12695
|
-
|
|
12696
|
-
|
|
12697
|
-
|
|
12698
|
-
|
|
12699
|
-
|
|
12700
|
-
|
|
12881
|
+
}]; // ----- react/dom-no-unknown-property -----
|
|
12882
|
+
type ReactDomNoUnknownProperty = [] | [{
|
|
12883
|
+
ignore?: string[];
|
|
12884
|
+
requireDataLowercase?: boolean;
|
|
12885
|
+
}]; // ----- react/exhaustive-deps -----
|
|
12886
|
+
type ReactExhaustiveDeps = [] | [{
|
|
12887
|
+
additionalHooks?: string;
|
|
12888
|
+
enableDangerousAutofixThisMayCauseInfiniteLoops?: boolean;
|
|
12889
|
+
experimental_autoDependenciesHooks?: string[];
|
|
12890
|
+
requireExplicitEffectDeps?: boolean;
|
|
12891
|
+
}]; // ----- react/jsx-no-useless-fragment -----
|
|
12892
|
+
type ReactJsxNoUselessFragment = [] | [{
|
|
12893
|
+
allowEmptyFragment?: boolean;
|
|
12894
|
+
allowExpressions?: boolean;
|
|
12701
12895
|
}]; // ----- react/no-unstable-default-props -----
|
|
12702
12896
|
type ReactNoUnstableDefaultProps = [] | [{
|
|
12703
12897
|
safeDefaultProps?: string[];
|
|
12704
|
-
}]; // ----- react/
|
|
12705
|
-
type
|
|
12706
|
-
|
|
12707
|
-
|
|
12898
|
+
}]; // ----- react/rules-of-hooks -----
|
|
12899
|
+
type ReactRulesOfHooks = [] | [{
|
|
12900
|
+
additionalHooks?: string;
|
|
12901
|
+
}]; // ----- react/use-state -----
|
|
12902
|
+
type ReactUseState = [] | [{
|
|
12903
|
+
enforceAssignment?: boolean;
|
|
12904
|
+
enforceLazyInitialization?: boolean;
|
|
12905
|
+
enforceSetterName?: boolean;
|
|
12906
|
+
}]; // ----- react/x-exhaustive-deps -----
|
|
12907
|
+
type ReactXExhaustiveDeps = [] | [{
|
|
12908
|
+
additionalHooks?: string;
|
|
12909
|
+
enableDangerousAutofixThisMayCauseInfiniteLoops?: boolean;
|
|
12910
|
+
experimental_autoDependenciesHooks?: string[];
|
|
12911
|
+
requireExplicitEffectDeps?: boolean;
|
|
12912
|
+
}]; // ----- react/x-no-unstable-default-props -----
|
|
12913
|
+
type ReactXNoUnstableDefaultProps = [] | [{
|
|
12914
|
+
safeDefaultProps?: string[];
|
|
12915
|
+
}]; // ----- react/x-rules-of-hooks -----
|
|
12916
|
+
type ReactXRulesOfHooks = [] | [{
|
|
12917
|
+
additionalHooks?: string;
|
|
12918
|
+
}]; // ----- react/x-use-state -----
|
|
12919
|
+
type ReactXUseState = [] | [{
|
|
12920
|
+
enforceAssignment?: boolean;
|
|
12921
|
+
enforceLazyInitialization?: boolean;
|
|
12922
|
+
enforceSetterName?: boolean;
|
|
12708
12923
|
}]; // ----- regexp/hexadecimal-escape -----
|
|
12709
12924
|
type RegexpHexadecimalEscape = [] | [("always" | "never")]; // ----- regexp/letter-case -----
|
|
12710
12925
|
type RegexpLetterCase = [] | [{
|
|
@@ -17126,9 +17341,6 @@ interface OptionsConfig extends OptionsComponentExts, OptionsProjectType {
|
|
|
17126
17341
|
//#region src/factory.d.ts
|
|
17127
17342
|
declare const defaultPluginRenaming: {
|
|
17128
17343
|
'@eslint-react': string;
|
|
17129
|
-
'@eslint-react/dom': string;
|
|
17130
|
-
'@eslint-react/hooks-extra': string;
|
|
17131
|
-
'@eslint-react/naming-convention': string;
|
|
17132
17344
|
'@stylistic': string;
|
|
17133
17345
|
'@typescript-eslint': string;
|
|
17134
17346
|
'import-lite': string;
|
package/dist/index.js
CHANGED
|
@@ -995,8 +995,8 @@ async function react(options = {}) {
|
|
|
995
995
|
]);
|
|
996
996
|
const isTypeAware = !!tsconfigPath;
|
|
997
997
|
const typeAwareRules = {
|
|
998
|
-
"react/no-
|
|
999
|
-
"react/no-
|
|
998
|
+
"react/no-implicit-key": "error",
|
|
999
|
+
"react/no-leaked-conditional-rendering": "warn"
|
|
1000
1000
|
};
|
|
1001
1001
|
const [pluginReact, pluginReactHooks, pluginReactRefresh] = await Promise.all([
|
|
1002
1002
|
interopDefault(import("@eslint-react/eslint-plugin")),
|
|
@@ -1007,18 +1007,13 @@ async function react(options = {}) {
|
|
|
1007
1007
|
const isUsingRemix = RemixPackages.some((i) => isPackageExists(i));
|
|
1008
1008
|
const isUsingReactRouter = ReactRouterPackages.some((i) => isPackageExists(i));
|
|
1009
1009
|
const isUsingNext = NextJsPackages.some((i) => isPackageExists(i));
|
|
1010
|
-
const plugins = pluginReact.configs.all.plugins;
|
|
1011
1010
|
return [
|
|
1012
1011
|
{
|
|
1013
1012
|
name: "liwo/react/setup",
|
|
1014
1013
|
plugins: {
|
|
1015
|
-
"react":
|
|
1016
|
-
"react-dom": plugins["@eslint-react/dom"],
|
|
1014
|
+
"react": pluginReact,
|
|
1017
1015
|
"react-hooks": pluginReactHooks,
|
|
1018
|
-
"react-
|
|
1019
|
-
"react-naming-convention": plugins["@eslint-react/naming-convention"],
|
|
1020
|
-
"react-refresh": pluginReactRefresh,
|
|
1021
|
-
"react-web-api": plugins["@eslint-react/web-api"]
|
|
1016
|
+
"react-refresh": pluginReactRefresh
|
|
1022
1017
|
}
|
|
1023
1018
|
},
|
|
1024
1019
|
{
|
|
@@ -1029,9 +1024,6 @@ async function react(options = {}) {
|
|
|
1029
1024
|
},
|
|
1030
1025
|
name: "liwo/react/rules",
|
|
1031
1026
|
rules: {
|
|
1032
|
-
"react/jsx-no-comment-textnodes": "warn",
|
|
1033
|
-
"react/jsx-no-duplicate-props": "warn",
|
|
1034
|
-
"react/jsx-uses-vars": "warn",
|
|
1035
1027
|
"react/no-access-state-in-setstate": "error",
|
|
1036
1028
|
"react/no-array-index-key": "warn",
|
|
1037
1029
|
"react/no-children-count": "warn",
|
|
@@ -1039,24 +1031,23 @@ async function react(options = {}) {
|
|
|
1039
1031
|
"react/no-children-map": "warn",
|
|
1040
1032
|
"react/no-children-only": "warn",
|
|
1041
1033
|
"react/no-children-to-array": "warn",
|
|
1034
|
+
"react/no-class-component": "warn",
|
|
1042
1035
|
"react/no-clone-element": "warn",
|
|
1043
1036
|
"react/no-component-will-mount": "error",
|
|
1044
1037
|
"react/no-component-will-receive-props": "error",
|
|
1045
1038
|
"react/no-component-will-update": "error",
|
|
1046
1039
|
"react/no-context-provider": "warn",
|
|
1047
1040
|
"react/no-create-ref": "error",
|
|
1048
|
-
"react/no-default-props": "error",
|
|
1049
1041
|
"react/no-direct-mutation-state": "error",
|
|
1050
1042
|
"react/no-duplicate-key": "warn",
|
|
1051
1043
|
"react/no-forward-ref": "warn",
|
|
1044
|
+
"react/no-missing-component-display-name": "warn",
|
|
1052
1045
|
"react/no-missing-key": "error",
|
|
1046
|
+
"react/no-misused-capture-owner-stack": "warn",
|
|
1053
1047
|
"react/no-nested-component-definitions": "error",
|
|
1054
|
-
"react/no-prop-types": "error",
|
|
1055
|
-
"react/no-redundant-should-component-update": "error",
|
|
1056
1048
|
"react/no-set-state-in-component-did-mount": "warn",
|
|
1057
1049
|
"react/no-set-state-in-component-did-update": "warn",
|
|
1058
1050
|
"react/no-set-state-in-component-will-update": "warn",
|
|
1059
|
-
"react/no-string-refs": "error",
|
|
1060
1051
|
"react/no-unnecessary-use-prefix": "warn",
|
|
1061
1052
|
"react/no-unsafe-component-will-mount": "warn",
|
|
1062
1053
|
"react/no-unsafe-component-will-receive-props": "warn",
|
|
@@ -1064,31 +1055,37 @@ async function react(options = {}) {
|
|
|
1064
1055
|
"react/no-unstable-context-value": "warn",
|
|
1065
1056
|
"react/no-unstable-default-props": "warn",
|
|
1066
1057
|
"react/no-unused-class-component-members": "warn",
|
|
1067
|
-
"react/no-unused-state": "warn",
|
|
1068
1058
|
"react/no-use-context": "warn",
|
|
1069
|
-
"react/no-
|
|
1070
|
-
"react/
|
|
1071
|
-
"react-
|
|
1072
|
-
"react-
|
|
1073
|
-
"react-
|
|
1074
|
-
"react-
|
|
1075
|
-
"react-
|
|
1076
|
-
"react-
|
|
1077
|
-
"react-
|
|
1078
|
-
"react-
|
|
1079
|
-
"react-
|
|
1080
|
-
"react-
|
|
1081
|
-
"react-
|
|
1082
|
-
"react-
|
|
1083
|
-
"react-
|
|
1084
|
-
"react-
|
|
1085
|
-
"react-
|
|
1059
|
+
"react/jsx-no-comment-textnodes": "warn",
|
|
1060
|
+
"react/jsx-no-children-prop": "warn",
|
|
1061
|
+
"react/jsx-no-useless-fragment": "warn",
|
|
1062
|
+
"react/jsx-no-namespace": "error",
|
|
1063
|
+
"react/dom-no-dangerously-set-innerhtml": "warn",
|
|
1064
|
+
"react/dom-no-dangerously-set-innerhtml-with-children": "error",
|
|
1065
|
+
"react/dom-no-find-dom-node": "error",
|
|
1066
|
+
"react/dom-no-flush-sync": "error",
|
|
1067
|
+
"react/dom-no-hydrate": "error",
|
|
1068
|
+
"react/dom-no-missing-button-type": "warn",
|
|
1069
|
+
"react/dom-no-missing-iframe-sandbox": "warn",
|
|
1070
|
+
"react/dom-no-render": "error",
|
|
1071
|
+
"react/dom-no-render-return-value": "error",
|
|
1072
|
+
"react/dom-no-script-url": "warn",
|
|
1073
|
+
"react/dom-no-string-style-prop": "warn",
|
|
1074
|
+
"react/dom-no-unknown-property": "warn",
|
|
1075
|
+
"react/dom-no-unsafe-iframe-sandbox": "warn",
|
|
1076
|
+
"react/dom-no-unsafe-target-blank": "warn",
|
|
1077
|
+
"react/dom-no-use-form-state": "error",
|
|
1078
|
+
"react/dom-no-void-elements-with-children": "error",
|
|
1086
1079
|
...pluginReactHooks.configs.recommended.rules,
|
|
1087
|
-
"react
|
|
1088
|
-
"react
|
|
1089
|
-
"react
|
|
1090
|
-
"react
|
|
1091
|
-
"react
|
|
1080
|
+
"react/set-state-in-effect": "warn",
|
|
1081
|
+
"react/web-api-no-leaked-event-listener": "warn",
|
|
1082
|
+
"react/web-api-no-leaked-fetch": "warn",
|
|
1083
|
+
"react/web-api-no-leaked-interval": "warn",
|
|
1084
|
+
"react/web-api-no-leaked-resize-observer": "warn",
|
|
1085
|
+
"react/web-api-no-leaked-timeout": "warn",
|
|
1086
|
+
"react/naming-convention-context-name": "warn",
|
|
1087
|
+
"react/naming-convention-id-name": "warn",
|
|
1088
|
+
"react/naming-convention-ref-name": "warn",
|
|
1092
1089
|
"react-refresh/only-export-components": ["warn", {
|
|
1093
1090
|
allowConstantExport: isAllowConstantExport,
|
|
1094
1091
|
allowExportNames: [...isUsingNext ? [
|
|
@@ -1927,9 +1924,6 @@ const VuePackages = [
|
|
|
1927
1924
|
];
|
|
1928
1925
|
const defaultPluginRenaming = {
|
|
1929
1926
|
"@eslint-react": "react",
|
|
1930
|
-
"@eslint-react/dom": "react-dom",
|
|
1931
|
-
"@eslint-react/hooks-extra": "react-hooks-extra",
|
|
1932
|
-
"@eslint-react/naming-convention": "react-naming-convention",
|
|
1933
1927
|
"@stylistic": "style",
|
|
1934
1928
|
"@typescript-eslint": "ts",
|
|
1935
1929
|
"import-lite": "import",
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@liwo/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.3",
|
|
5
5
|
"description": "ESLint config by Liwo",
|
|
6
6
|
"author": "Aoang <aoang@x2oe.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -47,16 +47,16 @@
|
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
49
|
"@antfu/install-pkg": "1.1.0",
|
|
50
|
-
"@clack/prompts": "1.
|
|
50
|
+
"@clack/prompts": "1.3.0",
|
|
51
51
|
"@eslint-community/eslint-plugin-eslint-comments": "4.7.1",
|
|
52
|
-
"@eslint-react/eslint-plugin": "
|
|
52
|
+
"@eslint-react/eslint-plugin": "5.6.2",
|
|
53
53
|
"@eslint/markdown": "8.0.1",
|
|
54
54
|
"@stylistic/eslint-plugin": "5.10.0",
|
|
55
|
-
"@typescript-eslint/eslint-plugin": "8.59.
|
|
56
|
-
"@typescript-eslint/parser": "8.59.
|
|
55
|
+
"@typescript-eslint/eslint-plugin": "8.59.1",
|
|
56
|
+
"@typescript-eslint/parser": "8.59.1",
|
|
57
57
|
"@vitest/eslint-plugin": "1.6.16",
|
|
58
58
|
"eslint-config-flat-gitignore": "2.3.0",
|
|
59
|
-
"eslint-flat-config-utils": "3.
|
|
59
|
+
"eslint-flat-config-utils": "3.2.0",
|
|
60
60
|
"eslint-merge-processors": "2.0.0",
|
|
61
61
|
"eslint-plugin-antfu": "3.2.2",
|
|
62
62
|
"eslint-plugin-command": "3.5.2",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"eslint-plugin-jsdoc": "62.9.0",
|
|
66
66
|
"eslint-plugin-jsonc": "3.1.2",
|
|
67
67
|
"eslint-plugin-n": "17.24.0",
|
|
68
|
-
"eslint-plugin-no-only-tests": "3.
|
|
68
|
+
"eslint-plugin-no-only-tests": "3.4.0",
|
|
69
69
|
"eslint-plugin-perfectionist": "5.9.0",
|
|
70
70
|
"eslint-plugin-pnpm": "1.6.0",
|
|
71
71
|
"eslint-plugin-react-hooks": "7.1.1",
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
"eslint-plugin-unicorn": "64.0.0",
|
|
76
76
|
"eslint-plugin-unused-imports": "4.4.1",
|
|
77
77
|
"eslint-plugin-vue": "10.9.0",
|
|
78
|
-
"eslint-plugin-yml": "3.3.
|
|
78
|
+
"eslint-plugin-yml": "3.3.2",
|
|
79
79
|
"eslint-processor-vue-blocks": "2.0.0",
|
|
80
80
|
"globals": "17.5.0",
|
|
81
81
|
"jsonc-eslint-parser": "3.1.0",
|
|
@@ -103,10 +103,10 @@
|
|
|
103
103
|
"tinyglobby": "0.2.16",
|
|
104
104
|
"tsdown": "0.21.10",
|
|
105
105
|
"tsx": "4.21.0",
|
|
106
|
-
"typescript": "
|
|
106
|
+
"typescript": "6.0.3",
|
|
107
107
|
"vitest": "4.1.5",
|
|
108
108
|
"vue": "3.5.33",
|
|
109
|
-
"@liwo/eslint-config": "0.2.
|
|
109
|
+
"@liwo/eslint-config": "0.2.3"
|
|
110
110
|
},
|
|
111
111
|
"simple-git-hooks": {
|
|
112
112
|
"pre-commit": "npx lint-staged"
|