@liwo/eslint-config 0.1.2 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.d.ts +130 -91
  2. package/package.json +23 -23
package/dist/index.d.ts CHANGED
@@ -387,6 +387,11 @@ interface RuleOptions {
387
387
  * @see https://github.com/9romise/eslint-plugin-import-lite/blob/main/src/rules/consistent-type-specifier-style/README.md
388
388
  */
389
389
  'import/consistent-type-specifier-style'?: Linter.RuleEntry<ImportConsistentTypeSpecifierStyle>;
390
+ /**
391
+ * Ensure all exports appear after other statements.
392
+ * @see https://github.com/9romise/eslint-plugin-import-lite/blob/main/src/rules/exports-last/README.md
393
+ */
394
+ 'import/exports-last'?: Linter.RuleEntry<[]>;
390
395
  /**
391
396
  * Ensure all imports appear before other statements.
392
397
  * @see https://github.com/9romise/eslint-plugin-import-lite/blob/main/src/rules/first/README.md
@@ -2540,97 +2545,97 @@ interface RuleOptions {
2540
2545
  */
2541
2546
  'radix'?: Linter.RuleEntry<Radix>;
2542
2547
  /**
2543
- * Disallow `dangerouslySetInnerHTML`.
2548
+ * Disallows DOM elements from using 'dangerouslySetInnerHTML'.
2544
2549
  * @see https://eslint-react.xyz/docs/rules/dom-no-dangerously-set-innerhtml
2545
2550
  */
2546
2551
  'react-dom/no-dangerously-set-innerhtml'?: Linter.RuleEntry<[]>;
2547
2552
  /**
2548
- * Disallow `dangerouslySetInnerHTML` and `children` at the same time.
2553
+ * Disallows DOM elements from using 'dangerouslySetInnerHTML' and 'children' at the same time.
2549
2554
  * @see https://eslint-react.xyz/docs/rules/dom-no-dangerously-set-innerhtml-with-children
2550
2555
  */
2551
2556
  'react-dom/no-dangerously-set-innerhtml-with-children'?: Linter.RuleEntry<[]>;
2552
2557
  /**
2553
- * Disallow `findDOMNode`.
2558
+ * Disallows 'findDOMNode'.
2554
2559
  * @see https://eslint-react.xyz/docs/rules/dom-no-find-dom-node
2555
2560
  */
2556
2561
  'react-dom/no-find-dom-node'?: Linter.RuleEntry<[]>;
2557
2562
  /**
2558
- * Disallow `flushSync`.
2563
+ * Disallows 'flushSync'.
2559
2564
  * @see https://eslint-react.xyz/docs/rules/dom-no-flush-sync
2560
2565
  */
2561
2566
  'react-dom/no-flush-sync'?: Linter.RuleEntry<[]>;
2562
2567
  /**
2563
- * Replaces usages of `ReactDom.hydrate()` with `hydrateRoot()`.
2568
+ * Replaces usage of 'ReactDOM.hydrate()' with 'hydrateRoot()'.
2564
2569
  * @see https://eslint-react.xyz/docs/rules/dom-no-hydrate
2565
2570
  */
2566
2571
  'react-dom/no-hydrate'?: Linter.RuleEntry<[]>;
2567
2572
  /**
2568
- * Enforces explicit `type` attribute for `button` elements.
2573
+ * Enforces an explicit 'type' attribute for 'button' elements.
2569
2574
  * @see https://eslint-react.xyz/docs/rules/dom-no-missing-button-type
2570
2575
  */
2571
2576
  'react-dom/no-missing-button-type'?: Linter.RuleEntry<[]>;
2572
2577
  /**
2573
- * Enforces explicit `sandbox` prop for `iframe` elements.
2578
+ * Enforces an explicit 'sandbox' attribute for 'iframe' elements.
2574
2579
  * @see https://eslint-react.xyz/docs/rules/dom-no-missing-iframe-sandbox
2575
2580
  */
2576
2581
  'react-dom/no-missing-iframe-sandbox'?: Linter.RuleEntry<[]>;
2577
2582
  /**
2578
- * Enforces the absence of a `namespace` in React elements.
2583
+ * Enforces the absence of a 'namespace' in React elements.
2579
2584
  * @see https://eslint-react.xyz/docs/rules/dom-no-namespace
2580
2585
  */
2581
2586
  'react-dom/no-namespace'?: Linter.RuleEntry<[]>;
2582
2587
  /**
2583
- * Replaces usages of `ReactDom.render()` with `createRoot(node).render()`.
2588
+ * Replaces usage of 'ReactDOM.render()' with 'createRoot(node).render()'.
2584
2589
  * @see https://eslint-react.xyz/docs/rules/dom-no-render
2585
2590
  */
2586
2591
  'react-dom/no-render'?: Linter.RuleEntry<[]>;
2587
2592
  /**
2588
- * Disallow the return value of `ReactDOM.render`.
2593
+ * Disallows the return value of 'ReactDOM.render'.
2589
2594
  * @see https://eslint-react.xyz/docs/rules/dom-no-render-return-value
2590
2595
  */
2591
2596
  'react-dom/no-render-return-value'?: Linter.RuleEntry<[]>;
2592
2597
  /**
2593
- * Disallow `javascript:` URLs as attribute values.
2598
+ * Disallows 'javascript:' URLs as attribute values.
2594
2599
  * @see https://eslint-react.xyz/docs/rules/dom-no-script-url
2595
2600
  */
2596
2601
  'react-dom/no-script-url'?: Linter.RuleEntry<[]>;
2597
2602
  /**
2598
- * Disallows the use of string style prop.
2603
+ * Disallows the use of string style prop in JSX. Use an object instead.
2599
2604
  * @see https://eslint-react.xyz/docs/rules/dom-no-string-style-prop
2600
2605
  */
2601
2606
  'react-dom/no-string-style-prop'?: Linter.RuleEntry<[]>;
2602
2607
  /**
2603
- * Disallow unknown `DOM` property.
2608
+ * Disallows unknown 'DOM' properties.
2604
2609
  * @see https://eslint-react.xyz/docs/rules/dom-no-unknown-property
2605
2610
  */
2606
2611
  'react-dom/no-unknown-property'?: Linter.RuleEntry<ReactDomNoUnknownProperty>;
2607
2612
  /**
2608
- * Enforces `sandbox` attribute for `iframe` elements is not set to unsafe combinations.
2613
+ * Enforces 'sandbox' attribute for 'iframe' elements is not set to unsafe combinations.
2609
2614
  * @see https://eslint-react.xyz/docs/rules/dom-no-unsafe-iframe-sandbox
2610
2615
  */
2611
2616
  'react-dom/no-unsafe-iframe-sandbox'?: Linter.RuleEntry<[]>;
2612
2617
  /**
2613
- * Disallow `target="_blank"` without `rel="noreferrer noopener"`.
2618
+ * Disallows 'target="_blank"' without 'rel="noreferrer noopener"'.
2614
2619
  * @see https://eslint-react.xyz/docs/rules/dom-no-unsafe-target-blank
2615
2620
  */
2616
2621
  'react-dom/no-unsafe-target-blank'?: Linter.RuleEntry<[]>;
2617
2622
  /**
2618
- * Replaces usages of `useFormState` with `useActionState`.
2623
+ * Replaces usage of 'useFormState' with 'useActionState'.
2619
2624
  * @see https://eslint-react.xyz/docs/rules/dom-no-use-form-state
2620
2625
  */
2621
2626
  'react-dom/no-use-form-state'?: Linter.RuleEntry<[]>;
2622
2627
  /**
2623
- * Disallow `children` in void DOM elements.
2628
+ * Disallows 'children' in void DOM elements.
2624
2629
  * @see https://eslint-react.xyz/docs/rules/dom-no-void-elements-with-children
2625
2630
  */
2626
2631
  'react-dom/no-void-elements-with-children'?: Linter.RuleEntry<[]>;
2627
2632
  /**
2628
- * Enforces React Dom is imported via a namespace import.
2633
+ * Enforces importing React DOM via a namespace import.
2629
2634
  * @see https://eslint-react.xyz/docs/rules/dom-prefer-namespace-import
2630
2635
  */
2631
2636
  'react-dom/prefer-namespace-import'?: Linter.RuleEntry<[]>;
2632
2637
  /**
2633
- * Disallow direct calls to the `set` function of `useState` in `useEffect`.
2638
+ * Disallows direct calls to the ['set' function](https://react.dev/reference/react/useState#setstate) of 'useState' in 'useEffect'.
2634
2639
  * @see https://eslint-react.xyz/docs/rules/hooks-extra-no-direct-set-state-in-use-effect
2635
2640
  */
2636
2641
  'react-hooks-extra/no-direct-set-state-in-use-effect'?: Linter.RuleEntry<[]>;
@@ -2758,88 +2763,93 @@ interface RuleOptions {
2758
2763
  */
2759
2764
  'react-naming-convention/component-name'?: Linter.RuleEntry<ReactNamingConventionComponentName>;
2760
2765
  /**
2761
- * Enforces context name to be a valid component name with the suffix `Context`.
2766
+ * Enforces the context name to be a valid component name with the suffix 'Context'.
2762
2767
  * @see https://eslint-react.xyz/docs/rules/naming-convention-context-name
2763
2768
  */
2764
2769
  'react-naming-convention/context-name'?: Linter.RuleEntry<[]>;
2765
2770
  /**
2766
- * Enforces consistent file naming conventions.
2771
+ * Enforces consistent file-naming conventions.
2767
2772
  * @see https://eslint-react.xyz/docs/rules/naming-convention-filename
2768
2773
  */
2769
2774
  'react-naming-convention/filename'?: Linter.RuleEntry<ReactNamingConventionFilename>;
2770
2775
  /**
2771
- * Enforces consistent file naming conventions.
2776
+ * Enforces consistent use of the JSX file extension.
2772
2777
  * @see https://eslint-react.xyz/docs/rules/naming-convention-filename-extension
2773
2778
  */
2774
2779
  'react-naming-convention/filename-extension'?: Linter.RuleEntry<ReactNamingConventionFilenameExtension>;
2775
2780
  /**
2776
- * Enforces destructuring and symmetric naming of `useState` hook value and setter.
2781
+ * Enforces identifier names assigned from 'useRef' calls to be either 'ref' or end with 'Ref'.
2782
+ * @see https://eslint-react.xyz/docs/rules/naming-convention-ref-name
2783
+ */
2784
+ 'react-naming-convention/ref-name'?: Linter.RuleEntry<[]>;
2785
+ /**
2786
+ * Enforces destructuring and symmetric naming of the 'useState' hook value and setter.
2777
2787
  * @see https://eslint-react.xyz/docs/rules/naming-convention-use-state
2778
2788
  */
2779
- 'react-naming-convention/use-state'?: Linter.RuleEntry<[]>;
2789
+ 'react-naming-convention/use-state'?: Linter.RuleEntry<ReactNamingConventionUseState>;
2780
2790
  'react-refresh/only-export-components'?: Linter.RuleEntry<ReactRefreshOnlyExportComponents>;
2781
2791
  /**
2782
- * Prevents leaked `addEventListener` in a component or custom Hook.
2792
+ * Enforces that every 'addEventListener' in a component or custom hook has a corresponding 'removeEventListener'.
2783
2793
  * @see https://eslint-react.xyz/docs/rules/web-api-no-leaked-event-listener
2784
2794
  */
2785
2795
  'react-web-api/no-leaked-event-listener'?: Linter.RuleEntry<[]>;
2786
2796
  /**
2787
- * Prevents leaked `setInterval` in a component or custom Hook.
2797
+ * Enforces that every 'setInterval' in a component or custom hook has a corresponding 'clearInterval'.
2788
2798
  * @see https://eslint-react.xyz/docs/rules/web-api-no-leaked-interval
2789
2799
  */
2790
2800
  'react-web-api/no-leaked-interval'?: Linter.RuleEntry<[]>;
2791
2801
  /**
2792
- * Prevents leaked `ResizeObserver` in a component or custom Hook.
2802
+ * Enforces that every 'ResizeObserver' created in a component or custom hook has a corresponding 'ResizeObserver.disconnect()'.
2793
2803
  * @see https://eslint-react.xyz/docs/rules/web-api-no-leaked-resize-observer
2794
2804
  */
2795
2805
  'react-web-api/no-leaked-resize-observer'?: Linter.RuleEntry<[]>;
2796
2806
  /**
2797
- * Prevents leaked `setTimeout` in a component or custom Hook.
2807
+ * Enforces that every 'setTimeout' in a component or custom hook has a corresponding 'clearTimeout'.
2798
2808
  * @see https://eslint-react.xyz/docs/rules/web-api-no-leaked-timeout
2799
2809
  */
2800
2810
  'react-web-api/no-leaked-timeout'?: Linter.RuleEntry<[]>;
2801
2811
  /**
2802
- * Prevents dollar signs from being inserted as text nodes before expressions.
2812
+ * Prevents unnecessary dollar signs ('$') from being inserted before an expression in JSX.
2803
2813
  * @see https://eslint-react.xyz/docs/rules/jsx-dollar
2804
2814
  */
2805
2815
  'react/jsx-dollar'?: Linter.RuleEntry<[]>;
2806
2816
  /**
2807
- * Enforces that the 'key' prop is placed before the spread prop in JSX elements.
2817
+ * Enforces that the 'key' prop is placed before the spread prop in JSX elements when using the new JSX transform.
2808
2818
  * @see https://eslint-react.xyz/docs/rules/jsx-key-before-spread
2809
2819
  */
2810
2820
  'react/jsx-key-before-spread'?: Linter.RuleEntry<[]>;
2811
2821
  /**
2812
- * Prevents comments from being inserted as text nodes.
2822
+ * Prevents comment strings (e.g., beginning with '//' or '/*') from being accidentally inserted into a JSX element's text nodes.
2813
2823
  * @see https://eslint-react.xyz/docs/rules/jsx-no-comment-textnodes
2814
2824
  */
2815
2825
  'react/jsx-no-comment-textnodes'?: Linter.RuleEntry<[]>;
2816
2826
  /**
2817
- * Disallow duplicate props in JSX elements.
2827
+ * Disallows duplicate props in JSX elements.
2818
2828
  * @see https://eslint-react.xyz/docs/rules/jsx-no-duplicate-props
2819
2829
  */
2820
2830
  'react/jsx-no-duplicate-props'?: Linter.RuleEntry<[]>;
2821
2831
  /**
2822
- * Disallows 'IIFE' in JSX elements.
2832
+ * Disallows 'IIFE' in JSX.
2823
2833
  * @see https://eslint-react.xyz/docs/rules/jsx-no-iife
2824
2834
  */
2825
2835
  'react/jsx-no-iife'?: Linter.RuleEntry<[]>;
2826
2836
  /**
2827
- * Disallow undefined variables in JSX.
2837
+ * Prevents using variables in JSX that are not defined in the scope.
2828
2838
  * @see https://eslint-react.xyz/docs/rules/jsx-no-undef
2829
2839
  */
2830
2840
  'react/jsx-no-undef'?: Linter.RuleEntry<[]>;
2831
2841
  /**
2832
- * Enforces shorthand syntax for boolean attributes.
2842
+ * Enforces the use of shorthand syntax for boolean attributes.
2833
2843
  * @see https://eslint-react.xyz/docs/rules/jsx-shorthand-boolean
2834
2844
  */
2835
2845
  'react/jsx-shorthand-boolean'?: Linter.RuleEntry<ReactJsxShorthandBoolean>;
2836
2846
  /**
2837
- * Enforces shorthand syntax for fragments.
2847
+ * Enforces the use of shorthand syntax for fragments.
2838
2848
  * @see https://eslint-react.xyz/docs/rules/jsx-shorthand-fragment
2839
2849
  */
2840
2850
  'react/jsx-shorthand-fragment'?: Linter.RuleEntry<ReactJsxShorthandFragment>;
2841
2851
  /**
2842
- * Marks React variables as used when JSX is used.
2852
+ * Marks React variables as used when JSX is present.
2843
2853
  * @see https://eslint-react.xyz/docs/rules/jsx-uses-react
2844
2854
  */
2845
2855
  'react/jsx-uses-react'?: Linter.RuleEntry<[]>;
@@ -2849,108 +2859,108 @@ interface RuleOptions {
2849
2859
  */
2850
2860
  'react/jsx-uses-vars'?: Linter.RuleEntry<[]>;
2851
2861
  /**
2852
- * Disallow accessing `this.state` inside `setState` calls.
2862
+ * Disallows accessing 'this.state' inside 'setState' calls.
2853
2863
  * @see https://eslint-react.xyz/docs/rules/no-access-state-in-setstate
2854
2864
  */
2855
2865
  'react/no-access-state-in-setstate'?: Linter.RuleEntry<[]>;
2856
2866
  /**
2857
- * Disallow an item's index in the array as its key.
2867
+ * Disallows using an item's index in the array as its key.
2858
2868
  * @see https://eslint-react.xyz/docs/rules/no-array-index-key
2859
2869
  */
2860
2870
  'react/no-array-index-key'?: Linter.RuleEntry<[]>;
2861
2871
  /**
2862
- * Disallow `Children.count`.
2872
+ * Disallows the use of 'Children.count' from the 'react' package.
2863
2873
  * @see https://eslint-react.xyz/docs/rules/no-children-count
2864
2874
  */
2865
2875
  'react/no-children-count'?: Linter.RuleEntry<[]>;
2866
2876
  /**
2867
- * Disallow 'Children.forEach'.
2877
+ * Disallows the use of 'Children.forEach' from the 'react' package.
2868
2878
  * @see https://eslint-react.xyz/docs/rules/no-children-for-each
2869
2879
  */
2870
2880
  'react/no-children-for-each'?: Linter.RuleEntry<[]>;
2871
2881
  /**
2872
- * Disallow `Children.map`.
2882
+ * Disallows the use of 'Children.map' from the 'react' package.
2873
2883
  * @see https://eslint-react.xyz/docs/rules/no-children-map
2874
2884
  */
2875
2885
  'react/no-children-map'?: Linter.RuleEntry<[]>;
2876
2886
  /**
2877
- * Disallow `Children.only`.
2887
+ * Disallows the use of 'Children.only' from the 'react' package.
2878
2888
  * @see https://eslint-react.xyz/docs/rules/no-children-only
2879
2889
  */
2880
2890
  'react/no-children-only'?: Linter.RuleEntry<[]>;
2881
2891
  /**
2882
- * Disallow passing `children` as a prop.
2892
+ * Disallows passing 'children' as a prop.
2883
2893
  * @see https://eslint-react.xyz/docs/rules/no-children-prop
2884
2894
  */
2885
2895
  'react/no-children-prop'?: Linter.RuleEntry<[]>;
2886
2896
  /**
2887
- * Disallow `Children.toArray`.
2897
+ * Disallows the use of 'Children.toArray' from the 'react' package.
2888
2898
  * @see https://eslint-react.xyz/docs/rules/no-children-to-array
2889
2899
  */
2890
2900
  'react/no-children-to-array'?: Linter.RuleEntry<[]>;
2891
2901
  /**
2892
- * Disallow class components except for error boundaries.
2902
+ * Disallows class components except for error boundaries.
2893
2903
  * @see https://eslint-react.xyz/docs/rules/no-class-component
2894
2904
  */
2895
2905
  'react/no-class-component'?: Linter.RuleEntry<[]>;
2896
2906
  /**
2897
- * Disallow `cloneElement`.
2907
+ * Disallows 'cloneElement'.
2898
2908
  * @see https://eslint-react.xyz/docs/rules/no-clone-element
2899
2909
  */
2900
2910
  'react/no-clone-element'?: Linter.RuleEntry<[]>;
2901
2911
  /**
2902
- * Replace usages of `componentWillMount` with `UNSAFE_componentWillMount`.
2912
+ * Replaces usage of 'componentWillMount' with 'UNSAFE_componentWillMount'.
2903
2913
  * @see https://eslint-react.xyz/docs/rules/no-component-will-mount
2904
2914
  */
2905
2915
  'react/no-component-will-mount'?: Linter.RuleEntry<[]>;
2906
2916
  /**
2907
- * Replace usages of `componentWillReceiveProps` with `UNSAFE_componentWillReceiveProps`.
2917
+ * Replaces usage of 'componentWillReceiveProps' with 'UNSAFE_componentWillReceiveProps'.
2908
2918
  * @see https://eslint-react.xyz/docs/rules/no-component-will-receive-props
2909
2919
  */
2910
2920
  'react/no-component-will-receive-props'?: Linter.RuleEntry<[]>;
2911
2921
  /**
2912
- * Replace usages of `componentWillUpdate` with `UNSAFE_componentWillUpdate`.
2922
+ * Replaces usage of 'componentWillUpdate' with 'UNSAFE_componentWillUpdate'.
2913
2923
  * @see https://eslint-react.xyz/docs/rules/no-component-will-update
2914
2924
  */
2915
2925
  'react/no-component-will-update'?: Linter.RuleEntry<[]>;
2916
2926
  /**
2917
- * Replace usages of `<Context.Provider>` with `<Context>`.
2927
+ * Replaces usage of '<Context.Provider>' with '<Context>'.
2918
2928
  * @see https://eslint-react.xyz/docs/rules/no-context-provider
2919
2929
  */
2920
2930
  'react/no-context-provider'?: Linter.RuleEntry<[]>;
2921
2931
  /**
2922
- * Disallow `createRef` in function components.
2932
+ * Disallows 'createRef' in function components.
2923
2933
  * @see https://eslint-react.xyz/docs/rules/no-create-ref
2924
2934
  */
2925
2935
  'react/no-create-ref'?: Linter.RuleEntry<[]>;
2926
2936
  /**
2927
- * Disallow `defaultProps` property in favor of ES6 default parameters.
2937
+ * Disallows the 'defaultProps' property in favor of ES6 default parameters.
2928
2938
  * @see https://eslint-react.xyz/docs/rules/no-default-props
2929
2939
  */
2930
2940
  'react/no-default-props'?: Linter.RuleEntry<[]>;
2931
2941
  /**
2932
- * Disallow direct mutation of `this.state`.
2942
+ * Disallows direct mutation of 'this.state'.
2933
2943
  * @see https://eslint-react.xyz/docs/rules/no-direct-mutation-state
2934
2944
  */
2935
2945
  'react/no-direct-mutation-state'?: Linter.RuleEntry<[]>;
2936
2946
  /**
2937
- * Disallow duplicate `key` on elements in the same array or a list of `children`.
2947
+ * Prevents duplicate 'key' props on sibling elements when rendering lists.
2938
2948
  * @see https://eslint-react.xyz/docs/rules/no-duplicate-key
2939
2949
  */
2940
2950
  'react/no-duplicate-key'?: Linter.RuleEntry<[]>;
2941
2951
  /**
2942
- * Disallow certain props on components.
2952
+ * Disallows certain props on components.
2943
2953
  * @see https://eslint-react.xyz/docs/rules/no-forbidden-props
2944
2954
  * @deprecated
2945
2955
  */
2946
2956
  'react/no-forbidden-props'?: Linter.RuleEntry<ReactNoForbiddenProps>;
2947
2957
  /**
2948
- * Replaces usages of `forwardRef` with passing `ref` as a prop.
2958
+ * Replaces usage of 'forwardRef' with passing 'ref' as a prop.
2949
2959
  * @see https://eslint-react.xyz/docs/rules/no-forward-ref
2950
2960
  */
2951
2961
  'react/no-forward-ref'?: Linter.RuleEntry<[]>;
2952
2962
  /**
2953
- * Prevents `key` from not being explicitly specified (e.g. spreading `key` from objects).
2963
+ * Prevents 'key' from not being explicitly specified (e.g., spreading 'key' from objects).
2954
2964
  * @see https://eslint-react.xyz/docs/rules/no-implicit-key
2955
2965
  */
2956
2966
  'react/no-implicit-key'?: Linter.RuleEntry<[]>;
@@ -2960,57 +2970,57 @@ interface RuleOptions {
2960
2970
  */
2961
2971
  'react/no-leaked-conditional-rendering'?: Linter.RuleEntry<[]>;
2962
2972
  /**
2963
- * Enforces that all components have a `displayName` which can be used in devtools.
2973
+ * Enforces that all components have a 'displayName' that can be used in devtools.
2964
2974
  * @see https://eslint-react.xyz/docs/rules/no-missing-component-display-name
2965
2975
  */
2966
2976
  'react/no-missing-component-display-name'?: Linter.RuleEntry<[]>;
2967
2977
  /**
2968
- * Enforces that all contexts have a `displayName` which can be used in devtools.
2978
+ * Enforces that all contexts have a 'displayName' that can be used in devtools.
2969
2979
  * @see https://eslint-react.xyz/docs/rules/no-missing-context-display-name
2970
2980
  */
2971
2981
  'react/no-missing-context-display-name'?: Linter.RuleEntry<[]>;
2972
2982
  /**
2973
- * Disallow missing `key` on items in list rendering.
2983
+ * Disallows missing 'key' on items in list rendering.
2974
2984
  * @see https://eslint-react.xyz/docs/rules/no-missing-key
2975
2985
  */
2976
2986
  'react/no-missing-key'?: Linter.RuleEntry<[]>;
2977
2987
  /**
2978
- * Prevents incorrect usage of `captureOwnerStack`.
2988
+ * Prevents incorrect usage of 'captureOwnerStack'.
2979
2989
  * @see https://eslint-react.xyz/docs/rules/no-misused-capture-owner-stack
2980
2990
  */
2981
2991
  'react/no-misused-capture-owner-stack'?: Linter.RuleEntry<[]>;
2982
2992
  /**
2983
- * Disallow nesting component definitions inside other components.
2993
+ * Disallows nesting component definitions inside other components.
2984
2994
  * @see https://eslint-react.xyz/docs/rules/no-nested-component-definitions
2985
2995
  */
2986
2996
  'react/no-nested-component-definitions'?: Linter.RuleEntry<[]>;
2987
2997
  /**
2988
- * Disallow nesting lazy component declarations inside other components.
2998
+ * Disallows nesting lazy component declarations inside other components.
2989
2999
  * @see https://eslint-react.xyz/docs/rules/no-nested-lazy-component-declarations
2990
3000
  */
2991
3001
  'react/no-nested-lazy-component-declarations'?: Linter.RuleEntry<[]>;
2992
3002
  /**
2993
- * Disallow `propTypes` in favor of TypeScript or another type-checking solution.
3003
+ * Disallows 'propTypes' in favor of TypeScript or another type-checking solution.
2994
3004
  * @see https://eslint-react.xyz/docs/rules/no-prop-types
2995
3005
  */
2996
3006
  'react/no-prop-types'?: Linter.RuleEntry<[]>;
2997
3007
  /**
2998
- * Disallow `shouldComponentUpdate` when extending `React.PureComponent`.
3008
+ * Disallows 'shouldComponentUpdate' when extending 'React.PureComponent'.
2999
3009
  * @see https://eslint-react.xyz/docs/rules/no-redundant-should-component-update
3000
3010
  */
3001
3011
  'react/no-redundant-should-component-update'?: Linter.RuleEntry<[]>;
3002
3012
  /**
3003
- * Disallow calling `this.setState` in `componentDidMount` outside of functions, such as callbacks.
3013
+ * Disallows calling 'this.setState' in 'componentDidMount' outside functions such as callbacks.
3004
3014
  * @see https://eslint-react.xyz/docs/rules/no-set-state-in-component-did-mount
3005
3015
  */
3006
3016
  'react/no-set-state-in-component-did-mount'?: Linter.RuleEntry<[]>;
3007
3017
  /**
3008
- * Disallow calling `this.setState` in `componentDidUpdate` outside of functions, such as callbacks.
3018
+ * Disallows calling 'this.setState' in 'componentDidUpdate' outside functions such as callbacks.
3009
3019
  * @see https://eslint-react.xyz/docs/rules/no-set-state-in-component-did-update
3010
3020
  */
3011
3021
  'react/no-set-state-in-component-did-update'?: Linter.RuleEntry<[]>;
3012
3022
  /**
3013
- * Disallow calling `this.setState` in `componentWillUpdate` outside of functions, such as callbacks.
3023
+ * Disallows calling 'this.setState' in 'componentWillUpdate' outside functions such as callbacks.
3014
3024
  * @see https://eslint-react.xyz/docs/rules/no-set-state-in-component-will-update
3015
3025
  */
3016
3026
  'react/no-set-state-in-component-will-update'?: Linter.RuleEntry<[]>;
@@ -3020,42 +3030,47 @@ interface RuleOptions {
3020
3030
  */
3021
3031
  'react/no-string-refs'?: Linter.RuleEntry<[]>;
3022
3032
  /**
3023
- * Prevents the use of unnecessary `key` props on JSX elements when rendering lists.
3033
+ * Disallows unnecessary 'key' props on elements.
3024
3034
  * @see https://eslint-react.xyz/docs/rules/no-unnecessary-key
3025
3035
  */
3026
3036
  'react/no-unnecessary-key'?: Linter.RuleEntry<[]>;
3027
3037
  /**
3028
- * Disallow unnecessary usage of `useCallback`.
3038
+ * Disallows unnecessary usage of 'useCallback'.
3029
3039
  * @see https://eslint-react.xyz/docs/rules/no-unnecessary-use-callback
3030
3040
  */
3031
3041
  'react/no-unnecessary-use-callback'?: Linter.RuleEntry<[]>;
3032
3042
  /**
3033
- * Disallow unnecessary usage of `useMemo`.
3043
+ * Disallows unnecessary usage of 'useMemo'.
3034
3044
  * @see https://eslint-react.xyz/docs/rules/no-unnecessary-use-memo
3035
3045
  */
3036
3046
  'react/no-unnecessary-use-memo'?: Linter.RuleEntry<[]>;
3037
3047
  /**
3038
- * Enforces that a function with the `use` prefix should use at least one Hook inside of it.
3048
+ * Enforces that a function with the 'use' prefix uses at least one Hook inside it.
3039
3049
  * @see https://eslint-react.xyz/docs/rules/no-unnecessary-use-prefix
3040
3050
  */
3041
3051
  'react/no-unnecessary-use-prefix'?: Linter.RuleEntry<[]>;
3042
3052
  /**
3043
- * Warns the usage of `UNSAFE_componentWillMount` in class components.
3053
+ * Disallows unnecessary usage of 'useRef'.
3054
+ * @see https://eslint-react.xyz/docs/rules/no-unnecessary-use-ref
3055
+ */
3056
+ 'react/no-unnecessary-use-ref'?: Linter.RuleEntry<[]>;
3057
+ /**
3058
+ * Warns about the use of 'UNSAFE_componentWillMount' in class components.
3044
3059
  * @see https://eslint-react.xyz/docs/rules/no-unsafe-component-will-mount
3045
3060
  */
3046
3061
  'react/no-unsafe-component-will-mount'?: Linter.RuleEntry<[]>;
3047
3062
  /**
3048
- * Warns the usage of `UNSAFE_componentWillReceiveProps` in class components.
3063
+ * Warns about the use of 'UNSAFE_componentWillReceiveProps' in class components.
3049
3064
  * @see https://eslint-react.xyz/docs/rules/no-unsafe-component-will-receive-props
3050
3065
  */
3051
3066
  'react/no-unsafe-component-will-receive-props'?: Linter.RuleEntry<[]>;
3052
3067
  /**
3053
- * Warns the usage of `UNSAFE_componentWillUpdate` in class components.
3068
+ * Warns about the use of 'UNSAFE_componentWillUpdate' in class components.
3054
3069
  * @see https://eslint-react.xyz/docs/rules/no-unsafe-component-will-update
3055
3070
  */
3056
3071
  'react/no-unsafe-component-will-update'?: Linter.RuleEntry<[]>;
3057
3072
  /**
3058
- * Prevents non-stable values (i.e. object literals) from being used as a value for `Context.Provider`.
3073
+ * Prevents non-stable values (i.e., object literals) from being used as a value for 'Context.Provider'.
3059
3074
  * @see https://eslint-react.xyz/docs/rules/no-unstable-context-value
3060
3075
  */
3061
3076
  'react/no-unstable-context-value'?: Linter.RuleEntry<[]>;
@@ -3065,32 +3080,32 @@ interface RuleOptions {
3065
3080
  */
3066
3081
  'react/no-unstable-default-props'?: Linter.RuleEntry<ReactNoUnstableDefaultProps>;
3067
3082
  /**
3068
- * Warns unused class component methods and properties.
3083
+ * Warns about unused class component methods and properties.
3069
3084
  * @see https://eslint-react.xyz/docs/rules/no-unused-class-component-members
3070
3085
  */
3071
3086
  'react/no-unused-class-component-members'?: Linter.RuleEntry<[]>;
3072
3087
  /**
3073
- * Warns component props that are defined but never used.
3088
+ * Warns about component props that are defined but never used.
3074
3089
  * @see https://eslint-react.xyz/docs/rules/no-unused-props
3075
3090
  */
3076
3091
  'react/no-unused-props'?: Linter.RuleEntry<[]>;
3077
3092
  /**
3078
- * Warns unused class component state.
3093
+ * Warns about unused class component state.
3079
3094
  * @see https://eslint-react.xyz/docs/rules/no-unused-state
3080
3095
  */
3081
3096
  'react/no-unused-state'?: Linter.RuleEntry<[]>;
3082
3097
  /**
3083
- * Replaces usages of `useContext` with `use`.
3098
+ * Replaces usage of 'useContext' with 'use'.
3084
3099
  * @see https://eslint-react.xyz/docs/rules/no-use-context
3085
3100
  */
3086
3101
  'react/no-use-context'?: Linter.RuleEntry<[]>;
3087
3102
  /**
3088
- * Disallow useless `forwardRef` calls on components that don't use `ref`s.
3103
+ * Disallows useless 'forwardRef' calls on components that don't use 'ref's.
3089
3104
  * @see https://eslint-react.xyz/docs/rules/no-useless-forward-ref
3090
3105
  */
3091
3106
  'react/no-useless-forward-ref'?: Linter.RuleEntry<[]>;
3092
3107
  /**
3093
- * Disallow useless fragment elements.
3108
+ * Disallows useless fragment elements.
3094
3109
  * @see https://eslint-react.xyz/docs/rules/no-useless-fragment
3095
3110
  */
3096
3111
  'react/no-useless-fragment'?: Linter.RuleEntry<ReactNoUselessFragment>;
@@ -3100,7 +3115,7 @@ interface RuleOptions {
3100
3115
  */
3101
3116
  'react/prefer-destructuring-assignment'?: Linter.RuleEntry<[]>;
3102
3117
  /**
3103
- * Enforces React is imported via a namespace import.
3118
+ * Enforces importing React via a namespace import.
3104
3119
  * @see https://eslint-react.xyz/docs/rules/prefer-namespace-import
3105
3120
  */
3106
3121
  'react/prefer-namespace-import'?: Linter.RuleEntry<[]>;
@@ -3110,7 +3125,7 @@ interface RuleOptions {
3110
3125
  */
3111
3126
  'react/prefer-read-only-props'?: Linter.RuleEntry<[]>;
3112
3127
  /**
3113
- * Enforces function calls made inside `useState` to be wrapped in an `initializer function`.
3128
+ * Enforces wrapping function calls made inside 'useState' in an 'initializer function'.
3114
3129
  * @see https://eslint-react.xyz/docs/rules/prefer-use-state-lazy-initialization
3115
3130
  */
3116
3131
  'react/prefer-use-state-lazy-initialization'?: Linter.RuleEntry<[]>;
@@ -4280,6 +4295,11 @@ interface RuleOptions {
4280
4295
  * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-test-return-statement.md
4281
4296
  */
4282
4297
  'test/no-test-return-statement'?: Linter.RuleEntry<[]>;
4298
+ /**
4299
+ * Disallow unnecessary async function wrapper for expected promises
4300
+ * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-unneeded-async-expect-function.md
4301
+ */
4302
+ 'test/no-unneeded-async-expect-function'?: Linter.RuleEntry<[]>;
4283
4303
  /**
4284
4304
  * Enforce padding around `afterAll` blocks
4285
4305
  * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/padding-around-after-all-blocks.md
@@ -4389,7 +4409,7 @@ interface RuleOptions {
4389
4409
  * prefer dynamic import in mock
4390
4410
  * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-import-in-mock.md
4391
4411
  */
4392
- 'test/prefer-import-in-mock'?: Linter.RuleEntry<[]>;
4412
+ 'test/prefer-import-in-mock'?: Linter.RuleEntry<TestPreferImportInMock>;
4393
4413
  /**
4394
4414
  * enforce importing Vitest globals
4395
4415
  * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-importing-vitest-globals.md
@@ -4405,6 +4425,11 @@ interface RuleOptions {
4405
4425
  * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-mock-promise-shorthand.md
4406
4426
  */
4407
4427
  'test/prefer-mock-promise-shorthand'?: Linter.RuleEntry<[]>;
4428
+ /**
4429
+ * Prefer mock return shorthands
4430
+ * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-mock-return-shorthand.md
4431
+ */
4432
+ 'test/prefer-mock-return-shorthand'?: Linter.RuleEntry<[]>;
4408
4433
  /**
4409
4434
  * enforce including a hint with external snapshots
4410
4435
  * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-snapshot-hint.md
@@ -4450,6 +4475,11 @@ interface RuleOptions {
4450
4475
  * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-to-contain.md
4451
4476
  */
4452
4477
  'test/prefer-to-contain'?: Linter.RuleEntry<[]>;
4478
+ /**
4479
+ * Suggest using `toHaveBeenCalledTimes()`
4480
+ * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-to-have-been-called-times.md
4481
+ */
4482
+ 'test/prefer-to-have-been-called-times'?: Linter.RuleEntry<[]>;
4453
4483
  /**
4454
4484
  * enforce using toHaveLength()
4455
4485
  * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-to-have-length.md
@@ -4475,11 +4505,6 @@ interface RuleOptions {
4475
4505
  * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/require-hook.md
4476
4506
  */
4477
4507
  'test/require-hook'?: Linter.RuleEntry<TestRequireHook>;
4478
- /**
4479
- * require usage of import in vi.mock()
4480
- * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/require-import-vi-mock.md
4481
- */
4482
- 'test/require-import-vi-mock'?: Linter.RuleEntry<[]>;
4483
4508
  /**
4484
4509
  * require local Test Context for concurrent snapshot tests
4485
4510
  * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/require-local-test-context-for-concurrent-snapshots.md
@@ -5099,6 +5124,11 @@ interface RuleOptions {
5099
5124
  * @see https://typescript-eslint.io/rules/no-useless-constructor
5100
5125
  */
5101
5126
  'ts/no-useless-constructor'?: Linter.RuleEntry<[]>;
5127
+ /**
5128
+ * Disallow default values that will never be used
5129
+ * @see https://typescript-eslint.io/rules/no-useless-default-assignment
5130
+ */
5131
+ 'ts/no-useless-default-assignment'?: Linter.RuleEntry<[]>;
5102
5132
  /**
5103
5133
  * Disallow empty exports that don't change anything in a module file
5104
5134
  * @see https://typescript-eslint.io/rules/no-useless-empty-export
@@ -11909,6 +11939,11 @@ type ReactNamingConventionFilenameExtension = [] | [(("always" | "as-needed") |
11909
11939
  extensions?: string[];
11910
11940
  ignoreFilesWithoutCode?: boolean;
11911
11941
  })];
11942
+ // ----- react-naming-convention/use-state -----
11943
+ type ReactNamingConventionUseState = [] | [{
11944
+ enforceAssignment?: boolean;
11945
+ enforceSetterName?: boolean;
11946
+ }];
11912
11947
  // ----- react-refresh/only-export-components -----
11913
11948
  type ReactRefreshOnlyExportComponents = [] | [{
11914
11949
  allowExportNames?: string[];
@@ -13474,6 +13509,10 @@ type TestPreferExpectAssertions = [] | [{
13474
13509
  onlyFunctionsWithExpectInLoop?: boolean;
13475
13510
  onlyFunctionsWithExpectInCallback?: boolean;
13476
13511
  }];
13512
+ // ----- test/prefer-import-in-mock -----
13513
+ type TestPreferImportInMock = [] | [{
13514
+ fixable?: boolean;
13515
+ }];
13477
13516
  // ----- test/prefer-lowercase-title -----
13478
13517
  type TestPreferLowercaseTitle = [] | [{
13479
13518
  ignore?: ("describe" | "test" | "it")[];
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@liwo/eslint-config",
3
3
  "type": "module",
4
- "version": "0.1.2",
4
+ "version": "0.2.0",
5
5
  "description": "ESLint config by Liwo",
6
6
  "author": "Aoang <aoang@x2oe.com>",
7
7
  "license": "MIT",
@@ -48,36 +48,36 @@
48
48
  "dependencies": {
49
49
  "@antfu/install-pkg": "1.1.0",
50
50
  "@clack/prompts": "0.11.0",
51
- "@eslint-community/eslint-plugin-eslint-comments": "4.5.0",
52
- "@eslint-react/eslint-plugin": "2.3.13",
51
+ "@eslint-community/eslint-plugin-eslint-comments": "4.6.0",
52
+ "@eslint-react/eslint-plugin": "2.7.2",
53
53
  "@eslint/markdown": "7.5.1",
54
54
  "@stylistic/eslint-plugin": "5.6.1",
55
- "@typescript-eslint/eslint-plugin": "8.49.0",
56
- "@typescript-eslint/parser": "8.49.0",
57
- "@vitest/eslint-plugin": "1.5.2",
55
+ "@typescript-eslint/eslint-plugin": "8.51.0",
56
+ "@typescript-eslint/parser": "8.51.0",
57
+ "@vitest/eslint-plugin": "1.6.4",
58
58
  "eslint-config-flat-gitignore": "2.1.0",
59
59
  "eslint-flat-config-utils": "2.1.4",
60
60
  "eslint-merge-processors": "2.0.0",
61
61
  "eslint-plugin-antfu": "3.1.1",
62
- "eslint-plugin-command": "3.3.1",
62
+ "eslint-plugin-command": "3.4.0",
63
63
  "eslint-plugin-format": "1.1.0",
64
- "eslint-plugin-import-lite": "0.3.0",
64
+ "eslint-plugin-import-lite": "0.4.0",
65
65
  "eslint-plugin-jsdoc": "61.5.0",
66
66
  "eslint-plugin-jsonc": "2.21.0",
67
67
  "eslint-plugin-n": "17.23.1",
68
68
  "eslint-plugin-no-only-tests": "3.3.0",
69
69
  "eslint-plugin-perfectionist": "4.15.1",
70
- "eslint-plugin-pnpm": "1.4.2",
70
+ "eslint-plugin-pnpm": "1.4.3",
71
71
  "eslint-plugin-react-hooks": "7.0.1",
72
- "eslint-plugin-react-refresh": "0.4.24",
72
+ "eslint-plugin-react-refresh": "0.4.26",
73
73
  "eslint-plugin-regexp": "2.10.0",
74
- "eslint-plugin-toml": "0.12.0",
74
+ "eslint-plugin-toml": "1.0.3",
75
75
  "eslint-plugin-unicorn": "62.0.0",
76
76
  "eslint-plugin-unused-imports": "4.3.0",
77
77
  "eslint-plugin-vue": "10.6.2",
78
- "eslint-plugin-yml": "1.19.0",
78
+ "eslint-plugin-yml": "1.19.1",
79
79
  "eslint-processor-vue-blocks": "2.0.0",
80
- "globals": "16.5.0",
80
+ "globals": "17.0.0",
81
81
  "jsonc-eslint-parser": "2.4.2",
82
82
  "local-pkg": "1.1.2",
83
83
  "parse-gitignore": "2.0.0",
@@ -88,25 +88,25 @@
88
88
  "devDependencies": {
89
89
  "@eslint/config-inspector": "1.4.2",
90
90
  "@prettier/plugin-xml": "3.4.2",
91
- "@types/node": "24.10.2",
92
- "@unocss/eslint-plugin": "66.5.10",
91
+ "@types/node": "25.0.3",
92
+ "@unocss/eslint-plugin": "66.6.0",
93
93
  "bumpp": "10.3.2",
94
- "eslint": "9.39.1",
94
+ "eslint": "9.39.2",
95
95
  "eslint-plugin-vuejs-accessibility": "2.4.1",
96
96
  "eslint-typegen": "2.3.0",
97
97
  "execa": "9.6.1",
98
98
  "lint-staged": "16.2.7",
99
- "pnpm-workspace-yaml": "1.4.2",
99
+ "pnpm-workspace-yaml": "1.4.3",
100
100
  "prettier-plugin-slidev": "1.0.5",
101
- "react": "19.2.1",
101
+ "react": "19.2.3",
102
102
  "simple-git-hooks": "2.13.1",
103
103
  "tinyglobby": "0.2.15",
104
- "tsdown": "0.17.2",
104
+ "tsdown": "0.18.4",
105
105
  "tsx": "4.21.0",
106
106
  "typescript": "5.9.3",
107
- "vitest": "4.0.15",
108
- "vue": "3.5.25",
109
- "@liwo/eslint-config": "0.1.2"
107
+ "vitest": "4.0.16",
108
+ "vue": "3.5.26",
109
+ "@liwo/eslint-config": "0.2.0"
110
110
  },
111
111
  "simple-git-hooks": {
112
112
  "pre-commit": "npx lint-staged"
@@ -127,7 +127,7 @@
127
127
  "format": "eslint --fix .",
128
128
  "gen": "tsx scripts/typegen.ts",
129
129
  "test": "vitest",
130
- "release": "bumpp",
130
+ "release": "bumpp --sign",
131
131
  "typecheck": "tsc --noEmit"
132
132
  }
133
133
  }