@vinicunca/eslint-config 3.11.0 → 3.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -2836,117 +2836,142 @@ interface RuleOptions {
2836
2836
  */
2837
2837
  'radix'?: Linter.RuleEntry<Radix>
2838
2838
  /**
2839
- * disallow void elements (AKA self-closing elements) from having children
2839
+ * Disallow `children` in void DOM elements.
2840
2840
  * @see https://eslint-react.xyz/docs/rules/dom-no-void-elements-with-children
2841
2841
  */
2842
2842
  'react-dom/no-children-in-void-dom-elements'?: Linter.RuleEntry<[]>
2843
2843
  /**
2844
- * disallow when a DOM component is using 'dangerouslySetInnerHTML'
2844
+ * Disallow `dangerouslySetInnerHTML`.
2845
2845
  * @see https://eslint-react.xyz/docs/rules/dom-no-dangerously-set-innerhtml
2846
2846
  */
2847
2847
  'react-dom/no-dangerously-set-innerhtml'?: Linter.RuleEntry<[]>
2848
2848
  /**
2849
- * disallow when a DOM component is using both 'children' and 'dangerouslySetInnerHTML'
2849
+ * Disallow `dangerouslySetInnerHTML` and `children` at the same time.
2850
2850
  * @see https://eslint-react.xyz/docs/rules/dom-no-dangerously-set-innerhtml-with-children
2851
2851
  */
2852
2852
  'react-dom/no-dangerously-set-innerhtml-with-children'?: Linter.RuleEntry<[]>
2853
2853
  /**
2854
- * disallow 'findDOMNode'
2854
+ * Disallow `findDOMNode`.
2855
2855
  * @see https://eslint-react.xyz/docs/rules/dom-no-find-dom-node
2856
2856
  */
2857
2857
  'react-dom/no-find-dom-node'?: Linter.RuleEntry<[]>
2858
2858
  /**
2859
- * enforce that button component have an explicit 'type' attribute
2859
+ * Disallow `flushSync`.
2860
+ * @see https://eslint-react.xyz/docs/rules/dom-no-flush-sync
2861
+ */
2862
+ 'react-dom/no-flush-sync'?: Linter.RuleEntry<[]>
2863
+ /**
2864
+ * Replaces usages of `ReactDom.hydrate()` with `hydrateRoot()`.
2865
+ * @see https://eslint-react.xyz/docs/rules/dom-no-hydrate
2866
+ */
2867
+ 'react-dom/no-hydrate'?: Linter.RuleEntry<[]>
2868
+ /**
2869
+ * Enforces explicit `type` attribute for `button` elements.
2860
2870
  * @see https://eslint-react.xyz/docs/rules/dom-no-missing-button-type
2861
2871
  */
2862
2872
  'react-dom/no-missing-button-type'?: Linter.RuleEntry<[]>
2863
2873
  /**
2864
- * enforce that 'iframe' component have an explicit 'sandbox' attribute
2874
+ * Enforces explicit `sandbox` attribute for `iframe` elements.
2865
2875
  * @see https://eslint-react.xyz/docs/rules/dom-no-missing-iframe-sandbox
2866
2876
  */
2867
2877
  'react-dom/no-missing-iframe-sandbox'?: Linter.RuleEntry<[]>
2868
2878
  /**
2869
- * enforce that namespaces are not used in React elements
2879
+ * Enforces the absence of a `namespace` in React elements.
2870
2880
  * @see https://eslint-react.xyz/docs/rules/dom-no-namespace
2871
2881
  */
2872
2882
  'react-dom/no-namespace'?: Linter.RuleEntry<[]>
2873
2883
  /**
2874
- * disallow usage of the return value of 'ReactDOM.render'
2884
+ * Replaces usages of `ReactDom.render()` with `createRoot(node).render()`.
2885
+ * @see https://eslint-react.xyz/docs/rules/dom-no-render
2886
+ */
2887
+ 'react-dom/no-render'?: Linter.RuleEntry<[]>
2888
+ /**
2889
+ * Disallow the return value of `ReactDOM.render`.
2875
2890
  * @see https://eslint-react.xyz/docs/rules/dom-no-render-return-value
2876
2891
  */
2877
2892
  'react-dom/no-render-return-value'?: Linter.RuleEntry<[]>
2878
2893
  /**
2879
- * disallow 'javascript:' URLs as JSX event handler prop's value
2894
+ * Disallow `javascript:` URLs as attribute values.
2880
2895
  * @see https://eslint-react.xyz/docs/rules/dom-no-script-url
2881
2896
  */
2882
2897
  'react-dom/no-script-url'?: Linter.RuleEntry<[]>
2883
2898
  /**
2884
- * disallow usage of unknown DOM property
2899
+ * Disallow unknown `DOM` property.
2885
2900
  * @see https://eslint-react.xyz/docs/rules/dom-no-unknown-property
2886
2901
  */
2887
2902
  'react-dom/no-unknown-property'?: Linter.RuleEntry<ReactDomNoUnknownProperty>
2888
2903
  /**
2889
- * disallow unsafe iframe 'sandbox' attribute combinations
2904
+ * Enforces `sandbox` attribute for `iframe` elements is not set to unsafe combinations.
2890
2905
  * @see https://eslint-react.xyz/docs/rules/dom-no-unsafe-iframe-sandbox
2891
2906
  */
2892
2907
  'react-dom/no-unsafe-iframe-sandbox'?: Linter.RuleEntry<[]>
2893
2908
  /**
2894
- * disallow 'target="_blank"' on an external link without 'rel="noreferrer noopener"'
2909
+ * Disallow `target="_blank"` without `rel="noreferrer noopener"`.
2895
2910
  * @see https://eslint-react.xyz/docs/rules/dom-no-unsafe-target-blank
2896
2911
  */
2897
2912
  'react-dom/no-unsafe-target-blank'?: Linter.RuleEntry<[]>
2898
2913
  /**
2899
- * disallow void elements (AKA self-closing elements) from having children
2914
+ * Replaces usages of `useFormState` with `useActionState`.
2915
+ * @see https://eslint-react.xyz/docs/rules/dom-no-use-form-state
2916
+ */
2917
+ 'react-dom/no-use-form-state'?: Linter.RuleEntry<[]>
2918
+ /**
2919
+ * Disallow `children` in void DOM elements.
2900
2920
  * @see https://eslint-react.xyz/docs/rules/dom-no-void-elements-with-children
2901
2921
  */
2902
2922
  'react-dom/no-void-elements-with-children'?: Linter.RuleEntry<[]>
2903
2923
  /**
2904
- * enforce custom Hooks to use at least one other hook inside
2905
- * @see https://eslint-react.xyz/docs/rules/hooks-extra-no-useless-custom-hooks
2924
+ * Enforces that a function with the `use` prefix should use at least one Hook inside of it.
2925
+ * @see https://eslint-react.xyz/docs/rules/hooks-extra-no-unnecessary-use-prefix
2906
2926
  */
2907
2927
  'react-hooks-extra/ensure-custom-hooks-using-other-hooks'?: Linter.RuleEntry<[]>
2908
2928
  /**
2909
- * disallow unnecessary usage of 'useCallback'
2929
+ * Disallow unnecessary usage of `useCallback`.
2910
2930
  * @see https://eslint-react.xyz/docs/rules/hooks-extra-no-unnecessary-use-callback
2911
2931
  */
2912
2932
  'react-hooks-extra/ensure-use-callback-has-non-empty-deps'?: Linter.RuleEntry<[]>
2913
2933
  /**
2914
- * disallow unnecessary usage of 'useMemo'
2934
+ * Disallow unnecessary usage of `useMemo`.
2915
2935
  * @see https://eslint-react.xyz/docs/rules/hooks-extra-no-unnecessary-use-memo
2916
2936
  */
2917
2937
  'react-hooks-extra/ensure-use-memo-has-non-empty-deps'?: Linter.RuleEntry<[]>
2918
2938
  /**
2919
- * disallow direct calls to the 'set' function of 'useState' in 'useEffect'
2939
+ * Disallow direct calls to the `set` function of `useState` in `useEffect`.
2920
2940
  * @see https://eslint-react.xyz/docs/rules/hooks-extra-no-direct-set-state-in-use-effect
2921
2941
  */
2922
2942
  'react-hooks-extra/no-direct-set-state-in-use-effect'?: Linter.RuleEntry<[]>
2923
2943
  /**
2924
- * disallow direct calls to the 'set' function of 'useState' in 'useLayoutEffect'
2944
+ * Disallow direct calls to the `set` function of `useState` in `useLayoutEffect`.
2925
2945
  * @see https://eslint-react.xyz/docs/rules/hooks-extra-no-direct-set-state-in-use-layout-effect
2926
2946
  */
2927
2947
  'react-hooks-extra/no-direct-set-state-in-use-layout-effect'?: Linter.RuleEntry<[]>
2928
2948
  /**
2929
- * enforce custom Hooks to use at least one other hook inside
2930
- * @see https://eslint-react.xyz/docs/rules/hooks-extra-no-useless-custom-hooks
2949
+ * Enforces that a function with the `use` prefix should use at least one Hook inside of it.
2950
+ * @see https://eslint-react.xyz/docs/rules/hooks-extra-no-unnecessary-use-prefix
2931
2951
  */
2932
2952
  'react-hooks-extra/no-redundant-custom-hook'?: Linter.RuleEntry<[]>
2933
2953
  /**
2934
- * disallow unnecessary usage of 'useCallback'
2954
+ * Disallow unnecessary usage of `useCallback`.
2935
2955
  * @see https://eslint-react.xyz/docs/rules/hooks-extra-no-unnecessary-use-callback
2936
2956
  */
2937
2957
  'react-hooks-extra/no-unnecessary-use-callback'?: Linter.RuleEntry<[]>
2938
2958
  /**
2939
- * disallow unnecessary usage of 'useMemo'
2959
+ * Disallow unnecessary usage of `useMemo`.
2940
2960
  * @see https://eslint-react.xyz/docs/rules/hooks-extra-no-unnecessary-use-memo
2941
2961
  */
2942
2962
  'react-hooks-extra/no-unnecessary-use-memo'?: Linter.RuleEntry<[]>
2943
2963
  /**
2944
- * enforce custom Hooks to use at least one other hook inside
2945
- * @see https://eslint-react.xyz/docs/rules/hooks-extra-no-useless-custom-hooks
2964
+ * Enforces that a function with the `use` prefix should use at least one Hook inside of it.
2965
+ * @see https://eslint-react.xyz/docs/rules/hooks-extra-no-unnecessary-use-prefix
2966
+ */
2967
+ 'react-hooks-extra/no-unnecessary-use-prefix'?: Linter.RuleEntry<[]>
2968
+ /**
2969
+ * Enforces that a function with the `use` prefix should use at least one Hook inside of it.
2970
+ * @see https://eslint-react.xyz/docs/rules/hooks-extra-no-unnecessary-use-prefix
2946
2971
  */
2947
2972
  'react-hooks-extra/no-useless-custom-hooks'?: Linter.RuleEntry<[]>
2948
2973
  /**
2949
- * disallow function calls in 'useState' that aren't wrapped in an initializer function
2974
+ * Enforces function calls made inside `useState` to be wrapped in an `initializer function`.
2950
2975
  * @see https://eslint-react.xyz/docs/rules/hooks-extra-prefer-use-state-lazy-initialization
2951
2976
  */
2952
2977
  'react-hooks-extra/prefer-use-state-lazy-initialization'?: Linter.RuleEntry<[]>
@@ -2961,314 +2986,344 @@ interface RuleOptions {
2961
2986
  */
2962
2987
  'react-hooks/rules-of-hooks'?: Linter.RuleEntry<[]>
2963
2988
  /**
2964
- * enforce component naming convention to 'PascalCase' or 'CONSTANT_CASE'
2989
+ * Enforces naming conventions for components.
2965
2990
  * @see https://eslint-react.xyz/docs/rules/naming-convention-component-name
2966
2991
  */
2967
2992
  'react-naming-convention/component-name'?: Linter.RuleEntry<ReactNamingConventionComponentName>
2968
2993
  /**
2969
- * enforce naming convention for JSX filenames
2994
+ * Enforces context name to be a valid component name with the suffix `Context`.
2995
+ * @see https://eslint-react.xyz/docs/rules/naming-convention-context-name
2996
+ */
2997
+ 'react-naming-convention/context-name'?: Linter.RuleEntry<[]>
2998
+ /**
2999
+ * Enforces consistent file naming conventions.
2970
3000
  * @see https://eslint-react.xyz/docs/rules/naming-convention-filename
2971
3001
  */
2972
3002
  'react-naming-convention/filename'?: Linter.RuleEntry<ReactNamingConventionFilename>
2973
3003
  /**
2974
- * enforce naming convention for JSX file extensions
3004
+ * Enforces consistent file naming conventions.
2975
3005
  * @see https://eslint-react.xyz/docs/rules/naming-convention-filename-extension
2976
3006
  */
2977
3007
  'react-naming-convention/filename-extension'?: Linter.RuleEntry<ReactNamingConventionFilenameExtension>
2978
3008
  /**
2979
- * enforce destructuring and symmetric naming of 'useState' hook value and setter variables
3009
+ * Enforces destructuring and symmetric naming of `useState` hook value and setter.
2980
3010
  * @see https://eslint-react.xyz/docs/rules/naming-convention-use-state
2981
3011
  */
2982
3012
  'react-naming-convention/use-state'?: Linter.RuleEntry<[]>
2983
3013
  'react-refresh/only-export-components'?: Linter.RuleEntry<ReactRefreshOnlyExportComponents>
2984
3014
  /**
2985
- * enforce that every 'addEventListener' in a component or custom Hook has a corresponding 'removeEventListener'.
3015
+ * Prevents leaked `addEventListener` in a component or custom Hook.
2986
3016
  * @see https://eslint-react.xyz/docs/rules/web-api-no-leaked-event-listener
2987
3017
  */
2988
3018
  'react-web-api/no-leaked-event-listener'?: Linter.RuleEntry<[]>
2989
3019
  /**
2990
- * enforce that every 'setInterval' in a component or custom Hook has a corresponding 'clearInterval'.
3020
+ * Prevents leaked `setInterval` in a component or custom Hook.
2991
3021
  * @see https://eslint-react.xyz/docs/rules/web-api-no-leaked-interval
2992
3022
  */
2993
3023
  'react-web-api/no-leaked-interval'?: Linter.RuleEntry<[]>
2994
3024
  /**
2995
- * enforce cleanup of 'ResizeObserver' instances in components and custom Hooks.
3025
+ * Prevents leaked `ResizeObserver` in a component or custom Hook.
2996
3026
  * @see https://eslint-react.xyz/docs/rules/web-api-no-leaked-resize-observer
2997
3027
  */
2998
3028
  'react-web-api/no-leaked-resize-observer'?: Linter.RuleEntry<[]>
2999
3029
  /**
3000
- * enforce that every 'setTimeout' in a component or custom Hook has a corresponding 'clearTimeout'.
3030
+ * Prevents leaked `setTimeout` in a component or custom Hook.
3001
3031
  * @see https://eslint-react.xyz/docs/rules/web-api-no-leaked-timeout
3002
3032
  */
3003
3033
  'react-web-api/no-leaked-timeout'?: Linter.RuleEntry<[]>
3004
3034
  /**
3005
- * disallow using shorthand boolean attributes
3035
+ * Enforces explicit boolean values for boolean attributes.
3006
3036
  * @see https://eslint-react.xyz/docs/rules/avoid-shorthand-boolean
3007
3037
  */
3008
3038
  'react/avoid-shorthand-boolean'?: Linter.RuleEntry<[]>
3009
3039
  /**
3010
- * disallow using shorthand fragment syntax
3040
+ * Enforces explicit `<Fragment>` components instead of the shorthand `<>` or `</>` syntax.
3011
3041
  * @see https://eslint-react.xyz/docs/rules/avoid-shorthand-fragment
3012
3042
  */
3013
3043
  'react/avoid-shorthand-fragment'?: Linter.RuleEntry<[]>
3014
3044
  /**
3015
- * require a 'ref' parameter to be set when using 'forwardRef'
3016
- * @see https://eslint-react.xyz/docs/rules/ensure-forward-ref-using-ref
3045
+ * Disallow useless `forwardRef` calls on components that don't use `ref`s.
3046
+ * @see https://eslint-react.xyz/docs/rules/no-useless-forward-ref
3017
3047
  */
3018
3048
  'react/ensure-forward-ref-using-ref'?: Linter.RuleEntry<[]>
3019
3049
  /**
3020
- * disallow duplicate props
3021
- * @see https://eslint-react.xyz/docs/rules/no-duplicate-jsx-props
3050
+ * Disallow duplicate props in JSX elements.
3051
+ * @see https://eslint-react.xyz/docs/rules/jsx-no-duplicate-props
3022
3052
  */
3023
3053
  'react/jsx-no-duplicate-props'?: Linter.RuleEntry<[]>
3024
3054
  /**
3025
- * helpes `eslint/no-unused-vars` to correctly mark JSX variables as used.
3026
- * @see https://eslint-react.xyz/docs/rules/use-jsx-vars
3055
+ * Disallow undefined variables in JSX.
3056
+ * @see https://eslint-react.xyz/docs/rules/jsx-no-undef
3057
+ */
3058
+ 'react/jsx-no-undef'?: Linter.RuleEntry<[]>
3059
+ /**
3060
+ * Marks React variables as used when JSX is used.
3061
+ * @see https://eslint-react.xyz/docs/rules/jsx-uses-react
3062
+ */
3063
+ 'react/jsx-uses-react'?: Linter.RuleEntry<[]>
3064
+ /**
3065
+ * Marks variables used in JSX elements as used.
3066
+ * @see https://eslint-react.xyz/docs/rules/jsx-uses-vars
3027
3067
  */
3028
3068
  'react/jsx-uses-vars'?: Linter.RuleEntry<[]>
3029
3069
  /**
3030
- * disallow accessing 'this.state' within 'setState'
3070
+ * Disallow accessing `this.state` inside `setState` calls.
3031
3071
  * @see https://eslint-react.xyz/docs/rules/no-access-state-in-setstate
3032
3072
  */
3033
3073
  'react/no-access-state-in-setstate'?: Linter.RuleEntry<[]>
3034
3074
  /**
3035
- * disallow using Array index as 'key'
3075
+ * Disallow an item's index in the array as its key.
3036
3076
  * @see https://eslint-react.xyz/docs/rules/no-array-index-key
3037
3077
  */
3038
3078
  'react/no-array-index-key'?: Linter.RuleEntry<[]>
3039
3079
  /**
3040
- * disallow using 'Children.count'
3080
+ * Disallow `Children.count`.
3041
3081
  * @see https://eslint-react.xyz/docs/rules/no-children-count
3042
3082
  */
3043
3083
  'react/no-children-count'?: Linter.RuleEntry<[]>
3044
3084
  /**
3045
- * disallow using 'Children.forEach'
3085
+ * Disallow 'Children.forEach'.
3046
3086
  * @see https://eslint-react.xyz/docs/rules/no-children-for-each
3047
3087
  */
3048
3088
  'react/no-children-for-each'?: Linter.RuleEntry<[]>
3049
3089
  /**
3050
- * disallow using 'Children.map'
3090
+ * Disallow `Children.map`.
3051
3091
  * @see https://eslint-react.xyz/docs/rules/no-children-map
3052
3092
  */
3053
3093
  'react/no-children-map'?: Linter.RuleEntry<[]>
3054
3094
  /**
3055
- * disallow using 'Children.only'
3095
+ * Disallow `Children.only`.
3056
3096
  * @see https://eslint-react.xyz/docs/rules/no-children-only
3057
3097
  */
3058
3098
  'react/no-children-only'?: Linter.RuleEntry<[]>
3059
3099
  /**
3060
- * disallow passing 'children' as props
3100
+ * Disallow passing `children` as a prop.
3061
3101
  * @see https://eslint-react.xyz/docs/rules/no-children-prop
3062
3102
  */
3063
3103
  'react/no-children-prop'?: Linter.RuleEntry<[]>
3064
3104
  /**
3065
- * disallow using 'Children.toArray'
3105
+ * Disallow `Children.toArray`.
3066
3106
  * @see https://eslint-react.xyz/docs/rules/no-children-to-array
3067
3107
  */
3068
3108
  'react/no-children-to-array'?: Linter.RuleEntry<[]>
3069
3109
  /**
3070
- * disallow using class components
3110
+ * Disallow class components.
3071
3111
  * @see https://eslint-react.xyz/docs/rules/no-class-component
3072
3112
  */
3073
3113
  'react/no-class-component'?: Linter.RuleEntry<[]>
3074
3114
  /**
3075
- * disallow using 'cloneElement'
3115
+ * Disallow `cloneElement`.
3076
3116
  * @see https://eslint-react.xyz/docs/rules/no-clone-element
3077
3117
  */
3078
3118
  'react/no-clone-element'?: Linter.RuleEntry<[]>
3079
3119
  /**
3080
- * disallow comments from being inserted as text nodes
3120
+ * Prevents comments from being inserted as text nodes.
3081
3121
  * @see https://eslint-react.xyz/docs/rules/no-comment-textnodes
3082
3122
  */
3083
3123
  'react/no-comment-textnodes'?: Linter.RuleEntry<[]>
3084
3124
  /**
3085
- * disallow complex conditional rendering
3125
+ * Disallow complex conditional rendering in JSX expressions.
3086
3126
  * @see https://eslint-react.xyz/docs/rules/no-complex-conditional-rendering
3087
3127
  */
3088
3128
  'react/no-complex-conditional-rendering'?: Linter.RuleEntry<[]>
3089
3129
  /**
3090
- * disallow complex conditional rendering
3130
+ * Disallow complex conditional rendering in JSX expressions.
3091
3131
  * @see https://eslint-react.xyz/docs/rules/no-complex-conditional-rendering
3092
3132
  */
3093
3133
  'react/no-complicated-conditional-rendering'?: Linter.RuleEntry<[]>
3094
3134
  /**
3095
- * disallow using 'componentWillMount'
3135
+ * Replace usages of `componentWillMount` with `UNSAFE_componentWillMount`.
3096
3136
  * @see https://eslint-react.xyz/docs/rules/no-component-will-mount
3097
3137
  */
3098
3138
  'react/no-component-will-mount'?: Linter.RuleEntry<[]>
3099
3139
  /**
3100
- * disallow using 'componentWillReceiveProps'
3140
+ * Replace usages of `componentWillReceiveProps` with `UNSAFE_componentWillReceiveProps`.
3101
3141
  * @see https://eslint-react.xyz/docs/rules/no-component-will-receive-props
3102
3142
  */
3103
3143
  'react/no-component-will-receive-props'?: Linter.RuleEntry<[]>
3104
3144
  /**
3105
- * disallow using 'componentWillReceiveProps'
3145
+ * Replace usages of `componentWillUpdate` with `UNSAFE_componentWillUpdate`.
3106
3146
  * @see https://eslint-react.xyz/docs/rules/no-component-will-update
3107
3147
  */
3108
3148
  'react/no-component-will-update'?: Linter.RuleEntry<[]>
3109
3149
  /**
3110
- * disallow the use of '<Context.Provider>'
3150
+ * Replace usages of `<Context.Provider>` with `<Context>`.
3111
3151
  * @see https://eslint-react.xyz/docs/rules/no-context-provider
3112
3152
  */
3113
3153
  'react/no-context-provider'?: Linter.RuleEntry<[]>
3114
3154
  /**
3115
- * disallow using 'createRef' in function components
3155
+ * Disallow `createRef` in function components.
3116
3156
  * @see https://eslint-react.xyz/docs/rules/no-create-ref
3117
3157
  */
3118
3158
  'react/no-create-ref'?: Linter.RuleEntry<[]>
3119
3159
  /**
3120
- * disallow using 'defaultProps' property in components
3160
+ * Disallow `defaultProps` property in favor of ES6 default parameters.
3121
3161
  * @see https://eslint-react.xyz/docs/rules/no-default-props
3122
3162
  */
3123
3163
  'react/no-default-props'?: Linter.RuleEntry<[]>
3124
3164
  /**
3125
- * disallow direct mutation of state
3165
+ * Disallow direct mutation of `this.state`.
3126
3166
  * @see https://eslint-react.xyz/docs/rules/no-direct-mutation-state
3127
3167
  */
3128
3168
  'react/no-direct-mutation-state'?: Linter.RuleEntry<[]>
3129
3169
  /**
3130
- * disallow duplicate props
3131
- * @see https://eslint-react.xyz/docs/rules/no-duplicate-jsx-props
3170
+ * Disallow duplicate props in JSX elements.
3171
+ * @see https://eslint-react.xyz/docs/rules/jsx-no-duplicate-props
3132
3172
  */
3133
3173
  'react/no-duplicate-jsx-props'?: Linter.RuleEntry<[]>
3134
3174
  /**
3135
- * disallow duplicate keys when rendering list
3175
+ * Disallow duplicate `key` on elements in the same array or a list of `children`.
3136
3176
  * @see https://eslint-react.xyz/docs/rules/no-duplicate-key
3137
3177
  */
3138
3178
  'react/no-duplicate-key'?: Linter.RuleEntry<[]>
3139
3179
  /**
3140
- * disallow the use of 'forwardRef'
3180
+ * Replaces usages of `forwardRef` with passing `ref` as a prop.
3141
3181
  * @see https://eslint-react.xyz/docs/rules/no-forward-ref
3142
3182
  */
3143
3183
  'react/no-forward-ref'?: Linter.RuleEntry<[]>
3144
3184
  /**
3145
- * disallow implicit 'key' props
3185
+ * Prevents `key` from not being explicitly specified (e.g. spreading `key` from objects).
3146
3186
  * @see https://eslint-react.xyz/docs/rules/no-implicit-key
3147
3187
  */
3148
3188
  'react/no-implicit-key'?: Linter.RuleEntry<[]>
3149
3189
  /**
3150
- * disallow problematic leaked values from being rendered
3190
+ * Prevents problematic leaked values from being rendered.
3151
3191
  * @see https://eslint-react.xyz/docs/rules/no-leaked-conditional-rendering
3152
3192
  */
3153
3193
  'react/no-leaked-conditional-rendering'?: Linter.RuleEntry<[]>
3154
3194
  /**
3155
- * require 'displayName' for 'memo' and 'forwardRef' components
3195
+ * Enforces that all components have a `displayName` which can be used in devtools.
3156
3196
  * @see https://eslint-react.xyz/docs/rules/no-missing-component-display-name
3157
3197
  */
3158
3198
  'react/no-missing-component-display-name'?: Linter.RuleEntry<[]>
3159
3199
  /**
3160
- * require 'key' when rendering list
3200
+ * Enforces that all contexts have a `displayName` which can be used in devtools.
3201
+ * @see https://eslint-react.xyz/docs/rules/no-missing-context-display-name
3202
+ */
3203
+ 'react/no-missing-context-display-name'?: Linter.RuleEntry<[]>
3204
+ /**
3205
+ * Disallow missing `key` on items in list rendering.
3161
3206
  * @see https://eslint-react.xyz/docs/rules/no-missing-key
3162
3207
  */
3163
3208
  'react/no-missing-key'?: Linter.RuleEntry<[]>
3164
3209
  /**
3165
- * disallow using unstable nested components
3166
- * @see https://eslint-react.xyz/docs/rules/no-nested-components
3210
+ * Disallow nesting component definitions inside other components.
3211
+ * @see https://eslint-react.xyz/docs/rules/no-nested-component-definitions
3212
+ */
3213
+ 'react/no-nested-component-definitions'?: Linter.RuleEntry<[]>
3214
+ /**
3215
+ * Disallow nesting component definitions inside other components.
3216
+ * @see https://eslint-react.xyz/docs/rules/no-nested-component-definitions
3167
3217
  */
3168
3218
  'react/no-nested-components'?: Linter.RuleEntry<[]>
3169
3219
  /**
3170
- * disallow using 'propTypes' property in components
3220
+ * Disallow `propTypes` in favor of TypeScript or another type-checking solution.
3171
3221
  * @see https://eslint-react.xyz/docs/rules/no-prop-types
3172
3222
  */
3173
3223
  'react/no-prop-types'?: Linter.RuleEntry<[]>
3174
3224
  /**
3175
- * disallow using 'shouldComponentUpdate' in class component extends 'React.PureComponent'
3225
+ * Disallow `shouldComponentUpdate` when extending `React.PureComponent`.
3176
3226
  * @see https://eslint-react.xyz/docs/rules/no-redundant-should-component-update
3177
3227
  */
3178
3228
  'react/no-redundant-should-component-update'?: Linter.RuleEntry<[]>
3179
3229
  /**
3180
- * disallow using 'setState' in 'componentDidMount'
3230
+ * Disallow calling `this.setState` in `componentDidMount` outside of functions, such as callbacks.
3181
3231
  * @see https://eslint-react.xyz/docs/rules/no-set-state-in-component-did-mount
3182
3232
  */
3183
3233
  'react/no-set-state-in-component-did-mount'?: Linter.RuleEntry<[]>
3184
3234
  /**
3185
- * disallow using 'setState' in 'componentDidUpdate'
3235
+ * Disallows calling `this.setState` in `componentDidUpdate` outside of functions, such as callbacks.
3186
3236
  * @see https://eslint-react.xyz/docs/rules/no-set-state-in-component-did-update
3187
3237
  */
3188
3238
  'react/no-set-state-in-component-did-update'?: Linter.RuleEntry<[]>
3189
3239
  /**
3190
- * disallow using 'setState' in 'componentWillUpdate'
3240
+ * Disallows calling `this.setState` in `componentWillUpdate` outside of functions, such as callbacks.
3191
3241
  * @see https://eslint-react.xyz/docs/rules/no-set-state-in-component-will-update
3192
3242
  */
3193
3243
  'react/no-set-state-in-component-will-update'?: Linter.RuleEntry<[]>
3194
3244
  /**
3195
- * disallow using deprecated string refs
3245
+ * Disallow deprecated string `refs`.
3196
3246
  * @see https://eslint-react.xyz/docs/rules/no-string-refs
3197
3247
  */
3198
3248
  'react/no-string-refs'?: Linter.RuleEntry<[]>
3199
3249
  /**
3200
- * disallow using 'UNSAFE_componentWillMount'
3250
+ * Warns the usage of `UNSAFE_componentWillMount` in class components.
3201
3251
  * @see https://eslint-react.xyz/docs/rules/no-unsafe-component-will-mount
3202
3252
  */
3203
3253
  'react/no-unsafe-component-will-mount'?: Linter.RuleEntry<[]>
3204
3254
  /**
3205
- * disallow using 'UNSAFE_componentWillReceiveProps'
3255
+ * Warns the usage of `UNSAFE_componentWillReceiveProps` in class components.
3206
3256
  * @see https://eslint-react.xyz/docs/rules/no-unsafe-component-will-receive-props
3207
3257
  */
3208
3258
  'react/no-unsafe-component-will-receive-props'?: Linter.RuleEntry<[]>
3209
3259
  /**
3210
- * disallow using 'UNSAFE_componentWillUpdate'
3260
+ * Warns the usage of `UNSAFE_componentWillUpdate` in class components.
3211
3261
  * @see https://eslint-react.xyz/docs/rules/no-unsafe-component-will-update
3212
3262
  */
3213
3263
  'react/no-unsafe-component-will-update'?: Linter.RuleEntry<[]>
3214
3264
  /**
3215
- * disallow passing constructed values to context providers
3265
+ * Prevents non-stable values (i.e. object literals) from being used as a value for `Context.Provider`.
3216
3266
  * @see https://eslint-react.xyz/docs/rules/no-unstable-context-value
3217
3267
  */
3218
3268
  'react/no-unstable-context-value'?: Linter.RuleEntry<[]>
3219
3269
  /**
3220
- * disallow using unstable value as default param in function component
3270
+ * Prevents using referential-type values as default props in object destructuring.
3221
3271
  * @see https://eslint-react.xyz/docs/rules/no-unstable-default-props
3222
3272
  */
3223
3273
  'react/no-unstable-default-props'?: Linter.RuleEntry<[]>
3224
3274
  /**
3225
- * disallow unused class component members
3275
+ * Warns unused class component methods and properties.
3226
3276
  * @see https://eslint-react.xyz/docs/rules/no-unused-class-component-members
3227
3277
  */
3228
3278
  'react/no-unused-class-component-members'?: Linter.RuleEntry<[]>
3229
3279
  /**
3230
- * disallow unused state of class component
3280
+ * Warns unused class component state.
3231
3281
  * @see https://eslint-react.xyz/docs/rules/no-unused-state
3232
3282
  */
3233
3283
  'react/no-unused-state'?: Linter.RuleEntry<[]>
3234
3284
  /**
3235
- * disallow the use of 'useContext'
3285
+ * Replaces usages of `useContext` with `use`.
3236
3286
  * @see https://eslint-react.xyz/docs/rules/no-use-context
3237
3287
  */
3238
3288
  'react/no-use-context'?: Linter.RuleEntry<[]>
3239
3289
  /**
3240
- * disallow unnecessary fragments
3290
+ * Disallow useless `forwardRef` calls on components that don't use `ref`s.
3291
+ * @see https://eslint-react.xyz/docs/rules/no-useless-forward-ref
3292
+ */
3293
+ 'react/no-useless-forward-ref'?: Linter.RuleEntry<[]>
3294
+ /**
3295
+ * Disallow useless fragment elements.
3241
3296
  * @see https://eslint-react.xyz/docs/rules/no-useless-fragment
3242
3297
  */
3243
3298
  'react/no-useless-fragment'?: Linter.RuleEntry<ReactNoUselessFragment>
3244
3299
  /**
3245
- * enforce using destructuring assignment in component props and context
3300
+ * Enforces destructuring assignment for component props and context.
3246
3301
  * @see https://eslint-react.xyz/docs/rules/prefer-destructuring-assignment
3247
3302
  */
3248
3303
  'react/prefer-destructuring-assignment'?: Linter.RuleEntry<[]>
3249
3304
  /**
3250
- * enforce React is imported via a namespace import
3305
+ * Enforces React is imported via a namespace import.
3251
3306
  * @see https://eslint-react.xyz/docs/rules/prefer-react-namespace-import
3252
3307
  */
3253
3308
  'react/prefer-react-namespace-import'?: Linter.RuleEntry<[]>
3254
3309
  /**
3255
- * enforce read-only props in components
3310
+ * Enforces read-only props in components.
3256
3311
  * @see https://eslint-react.xyz/docs/rules/prefer-read-only-props
3257
3312
  */
3258
3313
  'react/prefer-read-only-props'?: Linter.RuleEntry<[]>
3259
3314
  /**
3260
- * enforce using shorthand boolean attributes
3315
+ * Enforces shorthand syntax for boolean attributes.
3261
3316
  * @see https://eslint-react.xyz/docs/rules/prefer-shorthand-boolean
3262
3317
  */
3263
3318
  'react/prefer-shorthand-boolean'?: Linter.RuleEntry<[]>
3264
3319
  /**
3265
- * enforce using fragment syntax instead of 'Fragment' component
3320
+ * Enforces shorthand syntax for fragments.
3266
3321
  * @see https://eslint-react.xyz/docs/rules/prefer-shorthand-fragment
3267
3322
  */
3268
3323
  'react/prefer-shorthand-fragment'?: Linter.RuleEntry<[]>
3269
3324
  /**
3270
- * helpes `eslint/no-unused-vars` to correctly mark JSX variables as used.
3271
- * @see https://eslint-react.xyz/docs/rules/use-jsx-vars
3325
+ * Marks variables used in JSX elements as used.
3326
+ * @see https://eslint-react.xyz/docs/rules/jsx-uses-vars
3272
3327
  */
3273
3328
  'react/use-jsx-vars'?: Linter.RuleEntry<[]>
3274
3329
  /**
@@ -6250,6 +6305,11 @@ interface RuleOptions {
6250
6305
  * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-comparison-matcher.md
6251
6306
  */
6252
6307
  'test/prefer-comparison-matcher'?: Linter.RuleEntry<[]>
6308
+ /**
6309
+ * enforce using a function as a describe title over an equivalent string
6310
+ * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-describe-function-title.md
6311
+ */
6312
+ 'test/prefer-describe-function-title'?: Linter.RuleEntry<[]>
6253
6313
  /**
6254
6314
  * enforce using `each` rather than manual loops
6255
6315
  * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-each.md
package/dist/index.js CHANGED
@@ -1420,29 +1420,29 @@ async function react(options = {}) {
1420
1420
  "react-dom/no-dangerously-set-innerhtml": WARN,
1421
1421
  "react-dom/no-dangerously-set-innerhtml-with-children": ERROR,
1422
1422
  "react-dom/no-find-dom-node": ERROR,
1423
- "react-dom/no-flush-sync": "error",
1424
- "react-dom/no-hydrate": "error",
1423
+ "react-dom/no-flush-sync": ERROR,
1424
+ "react-dom/no-hydrate": ERROR,
1425
1425
  "react-dom/no-missing-button-type": WARN,
1426
1426
  "react-dom/no-missing-iframe-sandbox": WARN,
1427
1427
  "react-dom/no-namespace": ERROR,
1428
- "react-dom/no-render": "error",
1428
+ "react-dom/no-render": ERROR,
1429
1429
  "react-dom/no-render-return-value": ERROR,
1430
1430
  "react-dom/no-script-url": WARN,
1431
1431
  "react-dom/no-unsafe-iframe-sandbox": WARN,
1432
1432
  "react-dom/no-unsafe-target-blank": WARN,
1433
- "react-dom/no-use-form-state": "error",
1434
- "react-dom/no-void-elements-with-children": "error",
1433
+ "react-dom/no-use-form-state": ERROR,
1434
+ "react-dom/no-void-elements-with-children": ERROR,
1435
1435
  // recommended rules eslint-plugin-react-hooks https://github.com/facebook/react/tree/main/packages/eslint-plugin-react-hooks/src/rules
1436
1436
  "react-hooks/exhaustive-deps": WARN,
1437
1437
  "react-hooks/rules-of-hooks": ERROR,
1438
1438
  // recommended rules from eslint-plugin-react-hooks-extra https://eslint-react.xyz/docs/rules/overview#hooks-extra-rules
1439
- "react-hooks-extra/no-direct-set-state-in-use-effect": "warn",
1440
- "react-hooks-extra/no-unnecessary-use-prefix": "warn",
1439
+ "react-hooks-extra/no-direct-set-state-in-use-effect": WARN,
1440
+ "react-hooks-extra/no-unnecessary-use-prefix": WARN,
1441
1441
  // recommended rules from eslint-plugin-react-web-api https://eslint-react.xyz/docs/rules/overview#web-api-rules
1442
- "react-web-api/no-leaked-event-listener": "warn",
1443
- "react-web-api/no-leaked-interval": "warn",
1444
- "react-web-api/no-leaked-resize-observer": "warn",
1445
- "react-web-api/no-leaked-timeout": "warn",
1442
+ "react-web-api/no-leaked-event-listener": WARN,
1443
+ "react-web-api/no-leaked-interval": WARN,
1444
+ "react-web-api/no-leaked-resize-observer": WARN,
1445
+ "react-web-api/no-leaked-timeout": WARN,
1446
1446
  // preconfigured rules from eslint-plugin-react-refresh https://github.com/ArnaudBarre/eslint-plugin-react-refresh/tree/main/src
1447
1447
  "react-refresh/only-export-components": [
1448
1448
  WARN,
@@ -1891,7 +1891,7 @@ async function svelte(options = {}) {
1891
1891
  varsIgnorePattern: "^(\\$\\$Props$|\\$\\$Events$|\\$\\$Slots$)"
1892
1892
  }],
1893
1893
  "svelte/comment-directive": ERROR,
1894
- "svelte/no-at-debug-tags": "warn",
1894
+ "svelte/no-at-debug-tags": WARN,
1895
1895
  "svelte/no-at-html-tags": ERROR,
1896
1896
  "svelte/no-dupe-else-if-blocks": ERROR,
1897
1897
  "svelte/no-dupe-style-properties": ERROR,
@@ -2390,8 +2390,9 @@ async function vue(options = {}) {
2390
2390
  ERROR,
2391
2391
  "camelCase",
2392
2392
  {
2393
- // This will allow using lower case separated with a colon (e.g. click:row)
2394
- ignores: [/^[a-z]+(?:-[a-z]+)*:[a-z]+(?:-[a-z]+)*$/u]
2393
+ ignores: [
2394
+ "/^[a-z]+(?:-[a-z]+)*:[a-z]+(?:-[a-z]+)*$/u"
2395
+ ]
2395
2396
  }
2396
2397
  ],
2397
2398
  "vue/define-macros-order": [ERROR, {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vinicunca/eslint-config",
3
3
  "type": "module",
4
- "version": "3.11.0",
4
+ "version": "3.12.0",
5
5
  "description": "Vinicunca ESLint config",
6
6
  "author": {
7
7
  "name": "praburangki",
@@ -52,7 +52,7 @@
52
52
  "node": ">=22.0.0"
53
53
  },
54
54
  "peerDependencies": {
55
- "@eslint-react/eslint-plugin": "^1.19.0",
55
+ "@eslint-react/eslint-plugin": "^1.38.4",
56
56
  "@prettier/plugin-xml": "^3.4.1",
57
57
  "astro-eslint-parser": "^1.0.2",
58
58
  "eslint": "^9.10.0",
@@ -110,14 +110,14 @@
110
110
  },
111
111
  "dependencies": {
112
112
  "@antfu/install-pkg": "^1.0.0",
113
- "@clack/prompts": "^0.10.0",
113
+ "@clack/prompts": "^0.10.1",
114
114
  "@eslint-community/eslint-plugin-eslint-comments": "^4.4.1",
115
115
  "@eslint/markdown": "^6.3.0",
116
116
  "@stylistic/eslint-plugin": "^4.2.0",
117
117
  "@typescript-eslint/eslint-plugin": "^8.29.1",
118
118
  "@typescript-eslint/parser": "^8.29.1",
119
119
  "@unocss/eslint-plugin": "^66.0.0",
120
- "@vitest/eslint-plugin": "^1.1.39",
120
+ "@vitest/eslint-plugin": "^1.1.40",
121
121
  "eslint-config-flat-gitignore": "^2.1.0",
122
122
  "eslint-flat-config-utils": "^2.0.1",
123
123
  "eslint-merge-processors": "^2.0.0",