@dhzh/eslint-config 0.2.3 → 0.3.1

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.cts CHANGED
@@ -2824,523 +2824,311 @@ interface RuleOptions {
2824
2824
  */
2825
2825
  'radix'?: Linter.RuleEntry<Radix>
2826
2826
  /**
2827
- * verifies the list of dependencies for Hooks like useEffect and similar
2828
- * @see https://github.com/facebook/react/issues/14920
2829
- */
2830
- 'react-hooks/exhaustive-deps'?: Linter.RuleEntry<ReactHooksExhaustiveDeps>
2831
- /**
2832
- * enforces the Rules of Hooks
2833
- * @see https://reactjs.org/docs/hooks-rules.html
2834
- */
2835
- 'react-hooks/rules-of-hooks'?: Linter.RuleEntry<[]>
2836
- 'react-refresh/only-export-components'?: Linter.RuleEntry<ReactRefreshOnlyExportComponents>
2837
- /**
2838
- * Enforces consistent naming for boolean props
2839
- * @see https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/boolean-prop-naming.md
2840
- */
2841
- 'react/boolean-prop-naming'?: Linter.RuleEntry<ReactBooleanPropNaming>
2842
- /**
2843
- * Disallow usage of `button` elements without an explicit `type` attribute
2844
- * @see https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/button-has-type.md
2845
- */
2846
- 'react/button-has-type'?: Linter.RuleEntry<ReactButtonHasType>
2847
- /**
2848
- * Enforce using `onChange` or `readonly` attribute when `checked` is used
2849
- * @see https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/checked-requires-onchange-or-readonly.md
2850
- */
2851
- 'react/checked-requires-onchange-or-readonly'?: Linter.RuleEntry<ReactCheckedRequiresOnchangeOrReadonly>
2852
- /**
2853
- * Enforce all defaultProps have a corresponding non-required PropType
2854
- * @see https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/default-props-match-prop-types.md
2855
- */
2856
- 'react/default-props-match-prop-types'?: Linter.RuleEntry<ReactDefaultPropsMatchPropTypes>
2857
- /**
2858
- * Enforce consistent usage of destructuring assignment of props, state, and context
2859
- * @see https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/destructuring-assignment.md
2860
- */
2861
- 'react/destructuring-assignment'?: Linter.RuleEntry<ReactDestructuringAssignment>
2862
- /**
2863
- * Disallow missing displayName in a React component definition
2864
- * @see https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/display-name.md
2865
- */
2866
- 'react/display-name'?: Linter.RuleEntry<ReactDisplayName>
2867
- /**
2868
- * Disallow certain props on components
2869
- * @see https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/forbid-component-props.md
2870
- */
2871
- 'react/forbid-component-props'?: Linter.RuleEntry<ReactForbidComponentProps>
2872
- /**
2873
- * Disallow certain props on DOM Nodes
2874
- * @see https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/forbid-dom-props.md
2875
- */
2876
- 'react/forbid-dom-props'?: Linter.RuleEntry<ReactForbidDomProps>
2877
- /**
2878
- * Disallow certain elements
2879
- * @see https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/forbid-elements.md
2827
+ * disallow passing 'children' to void DOM elements
2828
+ * @see https://eslint-react.xyz/rules/dom-no-children-in-void-dom-elements
2880
2829
  */
2881
- 'react/forbid-elements'?: Linter.RuleEntry<ReactForbidElements>
2830
+ 'react-dom/no-children-in-void-dom-elements'?: Linter.RuleEntry<[]>
2882
2831
  /**
2883
- * Disallow using another component's propTypes
2884
- * @see https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/forbid-foreign-prop-types.md
2832
+ * disallow when a DOM component is using 'dangerouslySetInnerHTML'
2833
+ * @see https://eslint-react.xyz/rules/dom-no-dangerously-set-innerhtml
2885
2834
  */
2886
- 'react/forbid-foreign-prop-types'?: Linter.RuleEntry<ReactForbidForeignPropTypes>
2835
+ 'react-dom/no-dangerously-set-innerhtml'?: Linter.RuleEntry<[]>
2887
2836
  /**
2888
- * Disallow certain propTypes
2889
- * @see https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/forbid-prop-types.md
2890
- */
2891
- 'react/forbid-prop-types'?: Linter.RuleEntry<ReactForbidPropTypes>
2892
- /**
2893
- * Enforce a specific function type for function components
2894
- * @see https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/function-component-definition.md
2895
- */
2896
- 'react/function-component-definition'?: Linter.RuleEntry<ReactFunctionComponentDefinition>
2897
- /**
2898
- * Ensure destructuring and symmetric naming of useState hook value and setter variables
2899
- * @see https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/hook-use-state.md
2900
- */
2901
- 'react/hook-use-state'?: Linter.RuleEntry<ReactHookUseState>
2902
- /**
2903
- * Enforce sandbox attribute on iframe elements
2904
- * @see https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/iframe-missing-sandbox.md
2905
- */
2906
- 'react/iframe-missing-sandbox'?: Linter.RuleEntry<[]>
2907
- /**
2908
- * Enforce boolean attributes notation in JSX
2909
- * @see https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/jsx-boolean-value.md
2910
- */
2911
- 'react/jsx-boolean-value'?: Linter.RuleEntry<ReactJsxBooleanValue>
2912
- /**
2913
- * Enforce or disallow spaces inside of curly braces in JSX attributes and expressions
2914
- * @see https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/jsx-child-element-spacing.md
2915
- */
2916
- 'react/jsx-child-element-spacing'?: Linter.RuleEntry<[]>
2917
- /**
2918
- * Enforce closing bracket location in JSX
2919
- * @see https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/jsx-closing-bracket-location.md
2920
- */
2921
- 'react/jsx-closing-bracket-location'?: Linter.RuleEntry<ReactJsxClosingBracketLocation>
2922
- /**
2923
- * Enforce closing tag location for multiline JSX
2924
- * @see https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/jsx-closing-tag-location.md
2925
- */
2926
- 'react/jsx-closing-tag-location'?: Linter.RuleEntry<[]>
2927
- /**
2928
- * Disallow unnecessary JSX expressions when literals alone are sufficient or enforce JSX expressions on literals in JSX children or attributes
2929
- * @see https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/jsx-curly-brace-presence.md
2930
- */
2931
- 'react/jsx-curly-brace-presence'?: Linter.RuleEntry<ReactJsxCurlyBracePresence>
2932
- /**
2933
- * Enforce consistent linebreaks in curly braces in JSX attributes and expressions
2934
- * @see https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/jsx-curly-newline.md
2935
- */
2936
- 'react/jsx-curly-newline'?: Linter.RuleEntry<ReactJsxCurlyNewline>
2937
- /**
2938
- * Enforce or disallow spaces inside of curly braces in JSX attributes and expressions
2939
- * @see https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/jsx-curly-spacing.md
2940
- */
2941
- 'react/jsx-curly-spacing'?: Linter.RuleEntry<ReactJsxCurlySpacing>
2942
- /**
2943
- * Enforce or disallow spaces around equal signs in JSX attributes
2944
- * @see https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/jsx-equals-spacing.md
2945
- */
2946
- 'react/jsx-equals-spacing'?: Linter.RuleEntry<ReactJsxEqualsSpacing>
2947
- /**
2948
- * Disallow file extensions that may contain JSX
2949
- * @see https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/jsx-filename-extension.md
2950
- */
2951
- 'react/jsx-filename-extension'?: Linter.RuleEntry<ReactJsxFilenameExtension>
2952
- /**
2953
- * Enforce proper position of the first property in JSX
2954
- * @see https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/jsx-first-prop-new-line.md
2955
- */
2956
- 'react/jsx-first-prop-new-line'?: Linter.RuleEntry<ReactJsxFirstPropNewLine>
2957
- /**
2958
- * Enforce shorthand or standard form for React fragments
2959
- * @see https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/jsx-fragments.md
2960
- */
2961
- 'react/jsx-fragments'?: Linter.RuleEntry<ReactJsxFragments>
2962
- /**
2963
- * Enforce event handler naming conventions in JSX
2964
- * @see https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/jsx-handler-names.md
2965
- */
2966
- 'react/jsx-handler-names'?: Linter.RuleEntry<ReactJsxHandlerNames>
2967
- /**
2968
- * Enforce JSX indentation
2969
- * @see https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/jsx-indent.md
2970
- */
2971
- 'react/jsx-indent'?: Linter.RuleEntry<ReactJsxIndent>
2972
- /**
2973
- * Enforce props indentation in JSX
2974
- * @see https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/jsx-indent-props.md
2837
+ * disallow when a DOM component is using both 'children' and 'dangerouslySetInnerHTML'
2838
+ * @see https://eslint-react.xyz/rules/dom-no-dangerously-set-innerhtml-with-children
2975
2839
  */
2976
- 'react/jsx-indent-props'?: Linter.RuleEntry<ReactJsxIndentProps>
2840
+ 'react-dom/no-dangerously-set-innerhtml-with-children'?: Linter.RuleEntry<[]>
2977
2841
  /**
2978
- * Disallow missing `key` props in iterators/collection literals
2979
- * @see https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/jsx-key.md
2842
+ * disallow 'findDOMNode'
2843
+ * @see https://eslint-react.xyz/rules/dom-no-find-dom-node
2980
2844
  */
2981
- 'react/jsx-key'?: Linter.RuleEntry<ReactJsxKey>
2845
+ 'react-dom/no-find-dom-node'?: Linter.RuleEntry<[]>
2982
2846
  /**
2983
- * Enforce JSX maximum depth
2984
- * @see https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/jsx-max-depth.md
2847
+ * enforce that button component have an explicit 'type' attribute
2848
+ * @see https://eslint-react.xyz/rules/dom-no-missing-button-type
2985
2849
  */
2986
- 'react/jsx-max-depth'?: Linter.RuleEntry<ReactJsxMaxDepth>
2850
+ 'react-dom/no-missing-button-type'?: Linter.RuleEntry<[]>
2987
2851
  /**
2988
- * Enforce maximum of props on a single line in JSX
2989
- * @see https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/jsx-max-props-per-line.md
2852
+ * enforce that 'iframe' component have an explicit 'sandbox' attribute
2853
+ * @see https://eslint-react.xyz/rules/dom-no-missing-iframe-sandbox
2990
2854
  */
2991
- 'react/jsx-max-props-per-line'?: Linter.RuleEntry<ReactJsxMaxPropsPerLine>
2855
+ 'react-dom/no-missing-iframe-sandbox'?: Linter.RuleEntry<[]>
2992
2856
  /**
2993
- * Require or prevent a new line after jsx elements and expressions.
2994
- * @see https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/jsx-newline.md
2857
+ * enforce that namespaces are not used in React elements
2858
+ * @see https://eslint-react.xyz/rules/dom-no-namespace
2995
2859
  */
2996
- 'react/jsx-newline'?: Linter.RuleEntry<ReactJsxNewline>
2860
+ 'react-dom/no-namespace'?: Linter.RuleEntry<[]>
2997
2861
  /**
2998
- * Disallow `.bind()` or arrow functions in JSX props
2999
- * @see https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/jsx-no-bind.md
2862
+ * disallow usage of the return value of 'ReactDOM.render'
2863
+ * @see https://eslint-react.xyz/rules/dom-no-render-return-value
3000
2864
  */
3001
- 'react/jsx-no-bind'?: Linter.RuleEntry<ReactJsxNoBind>
2865
+ 'react-dom/no-render-return-value'?: Linter.RuleEntry<[]>
3002
2866
  /**
3003
- * Disallow comments from being inserted as text nodes
3004
- * @see https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/jsx-no-comment-textnodes.md
2867
+ * disallow 'javascript:' URLs as JSX event handler prop's value
2868
+ * @see https://eslint-react.xyz/rules/dom-no-script-url
3005
2869
  */
3006
- 'react/jsx-no-comment-textnodes'?: Linter.RuleEntry<[]>
2870
+ 'react-dom/no-script-url'?: Linter.RuleEntry<[]>
3007
2871
  /**
3008
- * Disallows JSX context provider values from taking values that will cause needless rerenders
3009
- * @see https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/jsx-no-constructed-context-values.md
2872
+ * disallow unsafe iframe 'sandbox' attribute combinations
2873
+ * @see https://eslint-react.xyz/rules/dom-no-unsafe-iframe-sandbox
3010
2874
  */
3011
- 'react/jsx-no-constructed-context-values'?: Linter.RuleEntry<ReactJsxNoConstructedContextValues>
2875
+ 'react-dom/no-unsafe-iframe-sandbox'?: Linter.RuleEntry<[]>
3012
2876
  /**
3013
- * Disallow duplicate properties in JSX
3014
- * @see https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/jsx-no-duplicate-props.md
2877
+ * disallow 'target="_blank"' on an external link without 'rel="noreferrer noopener"'.
2878
+ * @see https://eslint-react.xyz/rules/dom-no-unsafe-target-blank
3015
2879
  */
3016
- 'react/jsx-no-duplicate-props'?: Linter.RuleEntry<ReactJsxNoDuplicateProps>
2880
+ 'react-dom/no-unsafe-target-blank'?: Linter.RuleEntry<[]>
3017
2881
  /**
3018
- * Disallow problematic leaked values from being rendered
3019
- * @see https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/jsx-no-leaked-render.md
2882
+ * enforce custom hooks using other hooks
2883
+ * @see https://eslint-react.xyz/rules/hooks-extra-ensure-custom-hooks-using-other-hooks
3020
2884
  */
3021
- 'react/jsx-no-leaked-render'?: Linter.RuleEntry<ReactJsxNoLeakedRender>
2885
+ 'react-hooks-extra/ensure-custom-hooks-using-other-hooks'?: Linter.RuleEntry<[]>
3022
2886
  /**
3023
- * Disallow usage of string literals in JSX
3024
- * @see https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/jsx-no-literals.md
2887
+ * enforce 'useCallback' has non-empty dependencies array
2888
+ * @see https://eslint-react.xyz/rules/hooks-extra-ensure-use-callback-has-non-empty-deps
3025
2889
  */
3026
- 'react/jsx-no-literals'?: Linter.RuleEntry<ReactJsxNoLiterals>
2890
+ 'react-hooks-extra/ensure-use-callback-has-non-empty-deps'?: Linter.RuleEntry<[]>
3027
2891
  /**
3028
- * Disallow usage of `javascript:` URLs
3029
- * @see https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/jsx-no-script-url.md
2892
+ * enforce 'useMemo' has non-empty dependencies array
2893
+ * @see https://eslint-react.xyz/rules/hooks-extra-ensure-use-memo-has-non-empty-deps
3030
2894
  */
3031
- 'react/jsx-no-script-url'?: Linter.RuleEntry<ReactJsxNoScriptUrl>
2895
+ 'react-hooks-extra/ensure-use-memo-has-non-empty-deps'?: Linter.RuleEntry<[]>
3032
2896
  /**
3033
- * Disallow `target="_blank"` attribute without `rel="noreferrer"`
3034
- * @see https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/jsx-no-target-blank.md
2897
+ * disallow function calls in 'useState' that aren't wrapped in an initializer function
2898
+ * @see https://eslint-react.xyz/rules/hooks-extra-prefer-use-state-lazy-initialization
3035
2899
  */
3036
- 'react/jsx-no-target-blank'?: Linter.RuleEntry<ReactJsxNoTargetBlank>
2900
+ 'react-hooks-extra/prefer-use-state-lazy-initialization'?: Linter.RuleEntry<[]>
3037
2901
  /**
3038
- * Disallow undeclared variables in JSX
3039
- * @see https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/jsx-no-undef.md
2902
+ * verifies the list of dependencies for Hooks like useEffect and similar
2903
+ * @see https://github.com/facebook/react/issues/14920
3040
2904
  */
3041
- 'react/jsx-no-undef'?: Linter.RuleEntry<ReactJsxNoUndef>
2905
+ 'react-hooks/exhaustive-deps'?: Linter.RuleEntry<ReactHooksExhaustiveDeps>
3042
2906
  /**
3043
- * Disallow unnecessary fragments
3044
- * @see https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/jsx-no-useless-fragment.md
2907
+ * enforces the Rules of Hooks
2908
+ * @see https://reactjs.org/docs/hooks-rules.html
3045
2909
  */
3046
- 'react/jsx-no-useless-fragment'?: Linter.RuleEntry<ReactJsxNoUselessFragment>
2910
+ 'react-hooks/rules-of-hooks'?: Linter.RuleEntry<[]>
3047
2911
  /**
3048
- * Require one JSX element per line
3049
- * @see https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/jsx-one-expression-per-line.md
2912
+ * enforce component naming convention to 'PascalCase' or 'CONSTANT_CASE'
2913
+ * @see https://eslint-react.xyz/rules/naming-convention-component-name
3050
2914
  */
3051
- 'react/jsx-one-expression-per-line'?: Linter.RuleEntry<ReactJsxOneExpressionPerLine>
2915
+ 'react-naming-convention/component-name'?: Linter.RuleEntry<ReactNamingConventionComponentName>
3052
2916
  /**
3053
- * Enforce PascalCase for user-defined JSX components
3054
- * @see https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/jsx-pascal-case.md
2917
+ * enforce naming convention for JSX filenames
2918
+ * @see https://eslint-react.xyz/rules/naming-convention-filename
3055
2919
  */
3056
- 'react/jsx-pascal-case'?: Linter.RuleEntry<ReactJsxPascalCase>
2920
+ 'react-naming-convention/filename'?: Linter.RuleEntry<ReactNamingConventionFilename>
3057
2921
  /**
3058
- * Disallow multiple spaces between inline JSX props
3059
- * @see https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/jsx-props-no-multi-spaces.md
2922
+ * enforce naming convention for JSX file extensions
2923
+ * @see https://eslint-react.xyz/rules/naming-convention-filename-extension
3060
2924
  */
3061
- 'react/jsx-props-no-multi-spaces'?: Linter.RuleEntry<[]>
2925
+ 'react-naming-convention/filename-extension'?: Linter.RuleEntry<ReactNamingConventionFilenameExtension>
3062
2926
  /**
3063
- * Disallow JSX prop spreading
3064
- * @see https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/jsx-props-no-spreading.md
2927
+ * enforce destructuring and symmetric naming of 'useState' hook value and setter variables
2928
+ * @see https://eslint-react.xyz/rules/naming-convention-use-state
3065
2929
  */
3066
- 'react/jsx-props-no-spreading'?: Linter.RuleEntry<ReactJsxPropsNoSpreading>
2930
+ 'react-naming-convention/use-state'?: Linter.RuleEntry<[]>
2931
+ 'react-refresh/only-export-components'?: Linter.RuleEntry<ReactRefreshOnlyExportComponents>
3067
2932
  /**
3068
- * Enforce defaultProps declarations alphabetical sorting
3069
- * @see https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/jsx-sort-default-props.md
3070
- * @deprecated
2933
+ * require all 'forwardRef' components include a 'ref' parameter
2934
+ * @see https://eslint-react.xyz/rules/ensure-forward-ref-using-ref
3071
2935
  */
3072
- 'react/jsx-sort-default-props'?: Linter.RuleEntry<ReactJsxSortDefaultProps>
2936
+ 'react/ensure-forward-ref-using-ref'?: Linter.RuleEntry<[]>
3073
2937
  /**
3074
- * Enforce props alphabetical sorting
3075
- * @see https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/jsx-sort-props.md
2938
+ * disallow accessing 'this.state' within 'setState'
2939
+ * @see https://eslint-react.xyz/rules/no-access-state-in-setstate
3076
2940
  */
3077
- 'react/jsx-sort-props'?: Linter.RuleEntry<ReactJsxSortProps>
2941
+ 'react/no-access-state-in-setstate'?: Linter.RuleEntry<[]>
3078
2942
  /**
3079
- * Enforce spacing before closing bracket in JSX
3080
- * @see https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/jsx-space-before-closing.md
3081
- * @deprecated
2943
+ * disallow using Array index as key
2944
+ * @see https://eslint-react.xyz/rules/no-array-index-key
3082
2945
  */
3083
- 'react/jsx-space-before-closing'?: Linter.RuleEntry<ReactJsxSpaceBeforeClosing>
2946
+ 'react/no-array-index-key'?: Linter.RuleEntry<[]>
3084
2947
  /**
3085
- * Enforce whitespace in and around the JSX opening and closing brackets
3086
- * @see https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/jsx-tag-spacing.md
2948
+ * disallow 'Children.count'
2949
+ * @see https://eslint-react.xyz/rules/no-children-count
3087
2950
  */
3088
- 'react/jsx-tag-spacing'?: Linter.RuleEntry<ReactJsxTagSpacing>
2951
+ 'react/no-children-count'?: Linter.RuleEntry<[]>
3089
2952
  /**
3090
- * Disallow React to be incorrectly marked as unused
3091
- * @see https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/jsx-uses-react.md
2953
+ * disallow 'Children.forEach'
2954
+ * @see https://eslint-react.xyz/rules/no-children-for-each
3092
2955
  */
3093
- 'react/jsx-uses-react'?: Linter.RuleEntry<[]>
2956
+ 'react/no-children-for-each'?: Linter.RuleEntry<[]>
3094
2957
  /**
3095
- * Disallow variables used in JSX to be incorrectly marked as unused
3096
- * @see https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/jsx-uses-vars.md
2958
+ * disallow 'Children.map'
2959
+ * @see https://eslint-react.xyz/rules/no-children-map
3097
2960
  */
3098
- 'react/jsx-uses-vars'?: Linter.RuleEntry<[]>
2961
+ 'react/no-children-map'?: Linter.RuleEntry<[]>
3099
2962
  /**
3100
- * Disallow missing parentheses around multiline JSX
3101
- * @see https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/jsx-wrap-multilines.md
2963
+ * disallow 'Children.only'
2964
+ * @see https://eslint-react.xyz/rules/no-children-only
3102
2965
  */
3103
- 'react/jsx-wrap-multilines'?: Linter.RuleEntry<ReactJsxWrapMultilines>
2966
+ 'react/no-children-only'?: Linter.RuleEntry<[]>
3104
2967
  /**
3105
- * Disallow when this.state is accessed within setState
3106
- * @see https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/no-access-state-in-setstate.md
2968
+ * disallow passing of 'children' as props
2969
+ * @see https://eslint-react.xyz/rules/no-children-prop
3107
2970
  */
3108
- 'react/no-access-state-in-setstate'?: Linter.RuleEntry<[]>
2971
+ 'react/no-children-prop'?: Linter.RuleEntry<[]>
3109
2972
  /**
3110
- * Disallow adjacent inline elements not separated by whitespace.
3111
- * @see https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/no-adjacent-inline-elements.md
2973
+ * disallow 'Children.toArray'
2974
+ * @see https://eslint-react.xyz/rules/no-children-to-array
3112
2975
  */
3113
- 'react/no-adjacent-inline-elements'?: Linter.RuleEntry<[]>
2976
+ 'react/no-children-to-array'?: Linter.RuleEntry<[]>
3114
2977
  /**
3115
- * Disallow usage of Array index in keys
3116
- * @see https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/no-array-index-key.md
2978
+ * disallow class component
2979
+ * @see https://eslint-react.xyz/rules/no-class-component
3117
2980
  */
3118
- 'react/no-array-index-key'?: Linter.RuleEntry<[]>
2981
+ 'react/no-class-component'?: Linter.RuleEntry<[]>
3119
2982
  /**
3120
- * Lifecycle methods should be methods on the prototype, not class fields
3121
- * @see https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/no-arrow-function-lifecycle.md
2983
+ * disallow 'cloneElement'
2984
+ * @see https://eslint-react.xyz/rules/no-clone-element
3122
2985
  */
3123
- 'react/no-arrow-function-lifecycle'?: Linter.RuleEntry<[]>
2986
+ 'react/no-clone-element'?: Linter.RuleEntry<[]>
3124
2987
  /**
3125
- * Disallow passing of children as props
3126
- * @see https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/no-children-prop.md
2988
+ * disallow comments from being inserted as text nodes
2989
+ * @see https://eslint-react.xyz/rules/no-comment-textnodes
3127
2990
  */
3128
- 'react/no-children-prop'?: Linter.RuleEntry<ReactNoChildrenProp>
2991
+ 'react/no-comment-textnodes'?: Linter.RuleEntry<[]>
3129
2992
  /**
3130
- * Disallow usage of dangerous JSX properties
3131
- * @see https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/no-danger.md
2993
+ * disallow complicated conditional rendering
2994
+ * @see https://eslint-react.xyz/rules/no-complicated-conditional-rendering
3132
2995
  */
3133
- 'react/no-danger'?: Linter.RuleEntry<[]>
2996
+ 'react/no-complicated-conditional-rendering'?: Linter.RuleEntry<[]>
3134
2997
  /**
3135
- * Disallow when a DOM element is using both children and dangerouslySetInnerHTML
3136
- * @see https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/no-danger-with-children.md
2998
+ * disallow usage of 'componentWillMount'
2999
+ * @see https://eslint-react.xyz/rules/no-component-will-mount
3137
3000
  */
3138
- 'react/no-danger-with-children'?: Linter.RuleEntry<[]>
3001
+ 'react/no-component-will-mount'?: Linter.RuleEntry<[]>
3139
3002
  /**
3140
- * Disallow usage of deprecated methods
3141
- * @see https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/no-deprecated.md
3003
+ * disallow usage of 'componentWillReceiveProps'
3004
+ * @see https://eslint-react.xyz/rules/no-component-will-receive-props
3142
3005
  */
3143
- 'react/no-deprecated'?: Linter.RuleEntry<[]>
3006
+ 'react/no-component-will-receive-props'?: Linter.RuleEntry<[]>
3144
3007
  /**
3145
- * Disallow usage of setState in componentDidMount
3146
- * @see https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/no-did-mount-set-state.md
3008
+ * disallow usage of 'componentWillUpdate'
3009
+ * @see https://eslint-react.xyz/rules/no-component-will-update
3147
3010
  */
3148
- 'react/no-did-mount-set-state'?: Linter.RuleEntry<ReactNoDidMountSetState>
3011
+ 'react/no-component-will-update'?: Linter.RuleEntry<[]>
3149
3012
  /**
3150
- * Disallow usage of setState in componentDidUpdate
3151
- * @see https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/no-did-update-set-state.md
3013
+ * disallow 'createRef' in function components
3014
+ * @see https://eslint-react.xyz/rules/no-create-ref
3152
3015
  */
3153
- 'react/no-did-update-set-state'?: Linter.RuleEntry<ReactNoDidUpdateSetState>
3016
+ 'react/no-create-ref'?: Linter.RuleEntry<[]>
3154
3017
  /**
3155
- * Disallow direct mutation of this.state
3156
- * @see https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/no-direct-mutation-state.md
3018
+ * disallow direct mutation of state
3019
+ * @see https://eslint-react.xyz/rules/no-direct-mutation-state
3157
3020
  */
3158
3021
  'react/no-direct-mutation-state'?: Linter.RuleEntry<[]>
3159
3022
  /**
3160
- * Disallow usage of findDOMNode
3161
- * @see https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/no-find-dom-node.md
3023
+ * disallow duplicate keys in 'key' prop when rendering list
3024
+ * @see https://eslint-react.xyz/rules/no-duplicate-key
3162
3025
  */
3163
- 'react/no-find-dom-node'?: Linter.RuleEntry<[]>
3026
+ 'react/no-duplicate-key'?: Linter.RuleEntry<[]>
3164
3027
  /**
3165
- * Disallow usage of invalid attributes
3166
- * @see https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/no-invalid-html-attribute.md
3028
+ * disallow spreading 'key' from objects.
3029
+ * @see https://eslint-react.xyz/rules/no-implicit-key
3167
3030
  */
3168
- 'react/no-invalid-html-attribute'?: Linter.RuleEntry<ReactNoInvalidHtmlAttribute>
3031
+ 'react/no-implicit-key'?: Linter.RuleEntry<[]>
3169
3032
  /**
3170
- * Disallow usage of isMounted
3171
- * @see https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/no-is-mounted.md
3033
+ * disallow problematic leaked values from being rendered
3034
+ * @see https://eslint-react.xyz/rules/no-leaked-conditional-rendering
3172
3035
  */
3173
- 'react/no-is-mounted'?: Linter.RuleEntry<[]>
3036
+ 'react/no-leaked-conditional-rendering'?: Linter.RuleEntry<[]>
3174
3037
  /**
3175
- * Disallow multiple component definition per file
3176
- * @see https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/no-multi-comp.md
3038
+ * require 'displayName' for memo and forwardRef components
3039
+ * @see https://eslint-react.xyz/rules/no-missing-component-display-name
3177
3040
  */
3178
- 'react/no-multi-comp'?: Linter.RuleEntry<ReactNoMultiComp>
3041
+ 'react/no-missing-component-display-name'?: Linter.RuleEntry<[]>
3179
3042
  /**
3180
- * Enforce that namespaces are not used in React elements
3181
- * @see https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/no-namespace.md
3043
+ * require 'key' prop when rendering list
3044
+ * @see https://eslint-react.xyz/rules/no-missing-key
3182
3045
  */
3183
- 'react/no-namespace'?: Linter.RuleEntry<[]>
3046
+ 'react/no-missing-key'?: Linter.RuleEntry<[]>
3184
3047
  /**
3185
- * Disallow usage of referential-type variables as default param in functional component
3186
- * @see https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/no-object-type-as-default-prop.md
3048
+ * disallow usage of unstable nested components
3049
+ * @see https://eslint-react.xyz/rules/no-nested-components
3187
3050
  */
3188
- 'react/no-object-type-as-default-prop'?: Linter.RuleEntry<[]>
3051
+ 'react/no-nested-components'?: Linter.RuleEntry<[]>
3189
3052
  /**
3190
- * Disallow usage of shouldComponentUpdate when extending React.PureComponent
3191
- * @see https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/no-redundant-should-component-update.md
3053
+ * disallow usage of 'shouldComponentUpdate' in class component extends 'React.PureComponent'
3054
+ * @see https://eslint-react.xyz/rules/no-redundant-should-component-update
3192
3055
  */
3193
3056
  'react/no-redundant-should-component-update'?: Linter.RuleEntry<[]>
3194
3057
  /**
3195
- * Disallow usage of the return value of ReactDOM.render
3196
- * @see https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/no-render-return-value.md
3197
- */
3198
- 'react/no-render-return-value'?: Linter.RuleEntry<[]>
3199
- /**
3200
- * Disallow usage of setState
3201
- * @see https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/no-set-state.md
3058
+ * disallow 'setState' in 'componentDidMount'
3059
+ * @see https://eslint-react.xyz/rules/no-set-state-in-component-did-mount
3202
3060
  */
3203
- 'react/no-set-state'?: Linter.RuleEntry<[]>
3061
+ 'react/no-set-state-in-component-did-mount'?: Linter.RuleEntry<[]>
3204
3062
  /**
3205
- * Disallow using string references
3206
- * @see https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/no-string-refs.md
3063
+ * disallow 'setState' in 'componentDidUpdate'
3064
+ * @see https://eslint-react.xyz/rules/no-set-state-in-component-did-update
3207
3065
  */
3208
- 'react/no-string-refs'?: Linter.RuleEntry<ReactNoStringRefs>
3066
+ 'react/no-set-state-in-component-did-update'?: Linter.RuleEntry<[]>
3209
3067
  /**
3210
- * Disallow `this` from being used in stateless functional components
3211
- * @see https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/no-this-in-sfc.md
3068
+ * disallow 'setState' in 'componentWillUpdate'
3069
+ * @see https://eslint-react.xyz/rules/no-set-state-in-component-will-update
3212
3070
  */
3213
- 'react/no-this-in-sfc'?: Linter.RuleEntry<[]>
3071
+ 'react/no-set-state-in-component-will-update'?: Linter.RuleEntry<[]>
3214
3072
  /**
3215
- * Disallow common typos
3216
- * @see https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/no-typos.md
3073
+ * disallow using deprecated string refs
3074
+ * @see https://eslint-react.xyz/rules/no-string-refs
3217
3075
  */
3218
- 'react/no-typos'?: Linter.RuleEntry<[]>
3076
+ 'react/no-string-refs'?: Linter.RuleEntry<[]>
3219
3077
  /**
3220
- * Disallow unescaped HTML entities from appearing in markup
3221
- * @see https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/no-unescaped-entities.md
3078
+ * disallow usage of 'UNSAFE_componentWillMount'
3079
+ * @see https://eslint-react.xyz/rules/no-unsafe-component-will-mount
3222
3080
  */
3223
- 'react/no-unescaped-entities'?: Linter.RuleEntry<ReactNoUnescapedEntities>
3081
+ 'react/no-unsafe-component-will-mount'?: Linter.RuleEntry<[]>
3224
3082
  /**
3225
- * Disallow usage of unknown DOM property
3226
- * @see https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/no-unknown-property.md
3083
+ * disallow usage of 'UNSAFE_componentWillReceiveProps'
3084
+ * @see https://eslint-react.xyz/rules/no-unsafe-component-will-receive-props
3227
3085
  */
3228
- 'react/no-unknown-property'?: Linter.RuleEntry<ReactNoUnknownProperty>
3086
+ 'react/no-unsafe-component-will-receive-props'?: Linter.RuleEntry<[]>
3229
3087
  /**
3230
- * Disallow usage of unsafe lifecycle methods
3231
- * @see https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/no-unsafe.md
3088
+ * disallow usage of 'UNSAFE_componentWillUpdate'
3089
+ * @see https://eslint-react.xyz/rules/no-unsafe-component-will-update
3232
3090
  */
3233
- 'react/no-unsafe'?: Linter.RuleEntry<ReactNoUnsafe>
3091
+ 'react/no-unsafe-component-will-update'?: Linter.RuleEntry<[]>
3234
3092
  /**
3235
- * Disallow creating unstable components inside components
3236
- * @see https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/no-unstable-nested-components.md
3093
+ * disallow passing constructed values to context providers
3094
+ * @see https://eslint-react.xyz/rules/no-unstable-context-value
3237
3095
  */
3238
- 'react/no-unstable-nested-components'?: Linter.RuleEntry<ReactNoUnstableNestedComponents>
3096
+ 'react/no-unstable-context-value'?: Linter.RuleEntry<[]>
3239
3097
  /**
3240
- * Disallow declaring unused methods of component class
3241
- * @see https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/no-unused-class-component-methods.md
3098
+ * disallow usage of unstable value as default param in function component
3099
+ * @see https://eslint-react.xyz/rules/no-unstable-default-props
3242
3100
  */
3243
- 'react/no-unused-class-component-methods'?: Linter.RuleEntry<[]>
3101
+ 'react/no-unstable-default-props'?: Linter.RuleEntry<[]>
3244
3102
  /**
3245
- * Disallow definitions of unused propTypes
3246
- * @see https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/no-unused-prop-types.md
3103
+ * disallow unused class component members
3104
+ * @see https://eslint-react.xyz/rules/no-unused-class-component-members
3247
3105
  */
3248
- 'react/no-unused-prop-types'?: Linter.RuleEntry<ReactNoUnusedPropTypes>
3106
+ 'react/no-unused-class-component-members'?: Linter.RuleEntry<[]>
3249
3107
  /**
3250
- * Disallow definitions of unused state
3251
- * @see https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/no-unused-state.md
3108
+ * Prevents unused state of class component.
3109
+ * @see https://eslint-react.xyz/rules/no-unused-state
3252
3110
  */
3253
3111
  'react/no-unused-state'?: Linter.RuleEntry<[]>
3254
3112
  /**
3255
- * Disallow usage of setState in componentWillUpdate
3256
- * @see https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/no-will-update-set-state.md
3257
- */
3258
- 'react/no-will-update-set-state'?: Linter.RuleEntry<ReactNoWillUpdateSetState>
3259
- /**
3260
- * Enforce ES5 or ES6 class for React Components
3261
- * @see https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/prefer-es6-class.md
3262
- */
3263
- 'react/prefer-es6-class'?: Linter.RuleEntry<ReactPreferEs6Class>
3264
- /**
3265
- * Prefer exact proptype definitions
3266
- * @see https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/prefer-exact-props.md
3113
+ * disallow unnecessary fragments
3114
+ * @see https://eslint-react.xyz/rules/no-useless-fragment
3267
3115
  */
3268
- 'react/prefer-exact-props'?: Linter.RuleEntry<[]>
3116
+ 'react/no-useless-fragment'?: Linter.RuleEntry<[]>
3269
3117
  /**
3270
- * Enforce that props are read-only
3271
- * @see https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/prefer-read-only-props.md
3118
+ * enforce using destructuring assignment in component props and context
3119
+ * @see https://eslint-react.xyz/rules/prefer-destructuring-assignment
3272
3120
  */
3273
- 'react/prefer-read-only-props'?: Linter.RuleEntry<[]>
3121
+ 'react/prefer-destructuring-assignment'?: Linter.RuleEntry<[]>
3274
3122
  /**
3275
- * Enforce stateless components to be written as a pure function
3276
- * @see https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/prefer-stateless-function.md
3123
+ * enforce boolean attributes notation in JSX
3124
+ * @see https://eslint-react.xyz/rules/prefer-shorthand-boolean
3277
3125
  */
3278
- 'react/prefer-stateless-function'?: Linter.RuleEntry<ReactPreferStatelessFunction>
3126
+ 'react/prefer-shorthand-boolean'?: Linter.RuleEntry<[]>
3279
3127
  /**
3280
- * Disallow missing props validation in a React component definition
3281
- * @see https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/prop-types.md
3128
+ * enforce using fragment syntax instead of Fragment component
3129
+ * @see https://eslint-react.xyz/rules/prefer-shorthand-fragment
3282
3130
  */
3283
- 'react/prop-types'?: Linter.RuleEntry<ReactPropTypes>
3284
- /**
3285
- * Disallow missing React when using JSX
3286
- * @see https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/react-in-jsx-scope.md
3287
- */
3288
- 'react/react-in-jsx-scope'?: Linter.RuleEntry<[]>
3289
- /**
3290
- * Enforce a defaultProps definition for every prop that is not a required prop
3291
- * @see https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/require-default-props.md
3292
- */
3293
- 'react/require-default-props'?: Linter.RuleEntry<ReactRequireDefaultProps>
3294
- /**
3295
- * Enforce React components to have a shouldComponentUpdate method
3296
- * @see https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/require-optimization.md
3297
- */
3298
- 'react/require-optimization'?: Linter.RuleEntry<ReactRequireOptimization>
3299
- /**
3300
- * Enforce ES5 or ES6 class for returning value in render function
3301
- * @see https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/require-render-return.md
3302
- */
3303
- 'react/require-render-return'?: Linter.RuleEntry<[]>
3304
- /**
3305
- * Disallow extra closing tags for components without children
3306
- * @see https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/self-closing-comp.md
3307
- */
3308
- 'react/self-closing-comp'?: Linter.RuleEntry<ReactSelfClosingComp>
3309
- /**
3310
- * Enforce component methods order
3311
- * @see https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/sort-comp.md
3312
- */
3313
- 'react/sort-comp'?: Linter.RuleEntry<ReactSortComp>
3314
- /**
3315
- * Enforce defaultProps declarations alphabetical sorting
3316
- * @see https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/sort-default-props.md
3317
- */
3318
- 'react/sort-default-props'?: Linter.RuleEntry<ReactSortDefaultProps>
3319
- /**
3320
- * Enforce propTypes declarations alphabetical sorting
3321
- * @see https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/sort-prop-types.md
3322
- */
3323
- 'react/sort-prop-types'?: Linter.RuleEntry<ReactSortPropTypes>
3324
- /**
3325
- * Enforce class component state initialization style
3326
- * @see https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/state-in-constructor.md
3327
- */
3328
- 'react/state-in-constructor'?: Linter.RuleEntry<ReactStateInConstructor>
3329
- /**
3330
- * Enforces where React component static properties should be positioned.
3331
- * @see https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/static-property-placement.md
3332
- */
3333
- 'react/static-property-placement'?: Linter.RuleEntry<ReactStaticPropertyPlacement>
3334
- /**
3335
- * Enforce style prop value is an object
3336
- * @see https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/style-prop-object.md
3337
- */
3338
- 'react/style-prop-object'?: Linter.RuleEntry<ReactStylePropObject>
3339
- /**
3340
- * Disallow void DOM elements (e.g. `<img />`, `<br />`) from receiving children
3341
- * @see https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/void-dom-elements-no-children.md
3342
- */
3343
- 'react/void-dom-elements-no-children'?: Linter.RuleEntry<[]>
3131
+ 'react/prefer-shorthand-fragment'?: Linter.RuleEntry<[]>
3344
3132
  /**
3345
3133
  * Disallow assignments that can lead to race conditions due to usage of `await` or `yield`
3346
3134
  * @see https://eslint.org/docs/latest/rules/require-atomic-updates
@@ -10243,442 +10031,27 @@ type ReactHooksExhaustiveDeps = []|[{
10243
10031
  additionalHooks?: string
10244
10032
  enableDangerousAutofixThisMayCauseInfiniteLoops?: boolean
10245
10033
  }]
10246
- // ----- react-refresh/only-export-components -----
10247
- type ReactRefreshOnlyExportComponents = []|[{
10248
- allowConstantExport?: boolean
10249
- checkJS?: boolean
10250
- allowExportNames?: string[]
10251
- }]
10252
- // ----- react/boolean-prop-naming -----
10253
- type ReactBooleanPropNaming = []|[{
10254
-
10255
- propTypeNames?: [string, ...(string)[]]
10256
- rule?: string
10257
- message?: string
10258
- validateNested?: boolean
10259
- }]
10260
- // ----- react/button-has-type -----
10261
- type ReactButtonHasType = []|[{
10262
- button?: boolean
10263
- submit?: boolean
10264
- reset?: boolean
10265
- }]
10266
- // ----- react/checked-requires-onchange-or-readonly -----
10267
- type ReactCheckedRequiresOnchangeOrReadonly = []|[{
10268
- ignoreMissingProperties?: boolean
10269
- ignoreExclusiveCheckedAttribute?: boolean
10270
- }]
10271
- // ----- react/default-props-match-prop-types -----
10272
- type ReactDefaultPropsMatchPropTypes = []|[{
10273
- allowRequiredDefaults?: boolean
10274
- }]
10275
- // ----- react/destructuring-assignment -----
10276
- type ReactDestructuringAssignment = []|[("always" | "never")]|[("always" | "never"), {
10277
- ignoreClassFields?: boolean
10278
- destructureInSignature?: ("always" | "ignore")
10279
- }]
10280
- // ----- react/display-name -----
10281
- type ReactDisplayName = []|[{
10282
- ignoreTranspilerName?: boolean
10283
- checkContextObjects?: boolean
10284
- }]
10285
- // ----- react/forbid-component-props -----
10286
- type ReactForbidComponentProps = []|[{
10287
- forbid?: (string | {
10288
- propName?: string
10289
- allowedFor?: string[]
10290
- message?: string
10291
- } | {
10292
- propName?: string
10293
-
10294
- disallowedFor: [string, ...(string)[]]
10295
- message?: string
10296
- })[]
10297
- [k: string]: unknown | undefined
10298
- }]
10299
- // ----- react/forbid-dom-props -----
10300
- type ReactForbidDomProps = []|[{
10301
- forbid?: (string | {
10302
- propName?: string
10303
- disallowedFor?: string[]
10304
- message?: string
10305
- [k: string]: unknown | undefined
10306
- })[]
10307
- }]
10308
- // ----- react/forbid-elements -----
10309
- type ReactForbidElements = []|[{
10310
- forbid?: (string | {
10311
- element: string
10312
- message?: string
10313
- })[]
10314
- }]
10315
- // ----- react/forbid-foreign-prop-types -----
10316
- type ReactForbidForeignPropTypes = []|[{
10317
- allowInPropTypes?: boolean
10318
- }]
10319
- // ----- react/forbid-prop-types -----
10320
- type ReactForbidPropTypes = []|[{
10321
- forbid?: string[]
10322
- checkContextTypes?: boolean
10323
- checkChildContextTypes?: boolean
10324
- [k: string]: unknown | undefined
10325
- }]
10326
- // ----- react/function-component-definition -----
10327
- type ReactFunctionComponentDefinition = []|[{
10328
- namedComponents?: (("function-declaration" | "arrow-function" | "function-expression") | ("function-declaration" | "arrow-function" | "function-expression")[])
10329
- unnamedComponents?: (("arrow-function" | "function-expression") | ("arrow-function" | "function-expression")[])
10330
- [k: string]: unknown | undefined
10331
- }]
10332
- // ----- react/hook-use-state -----
10333
- type ReactHookUseState = []|[{
10334
- allowDestructuredState?: boolean
10335
- }]
10336
- // ----- react/jsx-boolean-value -----
10337
- type ReactJsxBooleanValue = ([]|[("always" | "never")] | []|["always"]|["always", {
10338
- never?: string[]
10339
- assumeUndefinedIsFalse?: boolean
10340
- }] | []|["never"]|["never", {
10341
- always?: string[]
10342
- assumeUndefinedIsFalse?: boolean
10343
- }])
10344
- // ----- react/jsx-closing-bracket-location -----
10345
- type ReactJsxClosingBracketLocation = []|[(("after-props" | "props-aligned" | "tag-aligned" | "line-aligned") | {
10346
- location?: ("after-props" | "props-aligned" | "tag-aligned" | "line-aligned")
10347
- } | {
10348
- nonEmpty?: ("after-props" | "props-aligned" | "tag-aligned" | "line-aligned" | false)
10349
- selfClosing?: ("after-props" | "props-aligned" | "tag-aligned" | "line-aligned" | false)
10034
+ // ----- react-naming-convention/component-name -----
10035
+ type ReactNamingConventionComponentName = []|[(("PascalCase" | "CONSTANT_CASE") | {
10036
+ excepts?: string[]
10037
+ rule?: ("PascalCase" | "CONSTANT_CASE")
10350
10038
  })]
10351
- // ----- react/jsx-curly-brace-presence -----
10352
- type ReactJsxCurlyBracePresence = []|[({
10353
- props?: ("always" | "never" | "ignore")
10354
- children?: ("always" | "never" | "ignore")
10355
- propElementValues?: ("always" | "never" | "ignore")
10356
- } | ("always" | "never" | "ignore"))]
10357
- // ----- react/jsx-curly-newline -----
10358
- type ReactJsxCurlyNewline = []|[(("consistent" | "never") | {
10359
- singleline?: ("consistent" | "require" | "forbid")
10360
- multiline?: ("consistent" | "require" | "forbid")
10039
+ // ----- react-naming-convention/filename -----
10040
+ type ReactNamingConventionFilename = []|[(("PascalCase" | "camelCase" | "kebab-case" | "snake_case") | {
10041
+ excepts?: string[]
10042
+ extensions?: string[]
10043
+ rule?: ("PascalCase" | "camelCase" | "kebab-case" | "snake_case")
10361
10044
  })]
10362
- // ----- react/jsx-curly-spacing -----
10363
- type ReactJsxCurlySpacing = []|[((_ReactJsxCurlySpacing_BasicConfig & {
10364
- attributes?: _ReactJsxCurlySpacingBasicConfigOrBoolean
10365
- children?: _ReactJsxCurlySpacingBasicConfigOrBoolean
10366
- [k: string]: unknown | undefined
10367
- }) | ("always" | "never"))]|[((_ReactJsxCurlySpacing_BasicConfig & {
10368
- attributes?: _ReactJsxCurlySpacingBasicConfigOrBoolean
10369
- children?: _ReactJsxCurlySpacingBasicConfigOrBoolean
10370
- [k: string]: unknown | undefined
10371
- }) | ("always" | "never")), {
10372
- allowMultiline?: boolean
10373
- spacing?: {
10374
- objectLiterals?: ("always" | "never")
10375
- [k: string]: unknown | undefined
10376
- }
10377
- }]
10378
- type _ReactJsxCurlySpacingBasicConfigOrBoolean = (_ReactJsxCurlySpacing_BasicConfig | boolean)
10379
- interface _ReactJsxCurlySpacing_BasicConfig {
10380
- when?: ("always" | "never")
10381
- allowMultiline?: boolean
10382
- spacing?: {
10383
- objectLiterals?: ("always" | "never")
10384
- [k: string]: unknown | undefined
10385
- }
10386
- [k: string]: unknown | undefined
10387
- }
10388
- // ----- react/jsx-equals-spacing -----
10389
- type ReactJsxEqualsSpacing = []|[("always" | "never")]
10390
- // ----- react/jsx-filename-extension -----
10391
- type ReactJsxFilenameExtension = []|[{
10045
+ // ----- react-naming-convention/filename-extension -----
10046
+ type ReactNamingConventionFilenameExtension = []|[(("always" | "as-needed") | {
10392
10047
  allow?: ("always" | "as-needed")
10393
10048
  extensions?: string[]
10394
- ignoreFilesWithoutCode?: boolean
10395
- }]
10396
- // ----- react/jsx-first-prop-new-line -----
10397
- type ReactJsxFirstPropNewLine = []|[("always" | "never" | "multiline" | "multiline-multiprop" | "multiprop")]
10398
- // ----- react/jsx-fragments -----
10399
- type ReactJsxFragments = []|[("syntax" | "element")]
10400
- // ----- react/jsx-handler-names -----
10401
- type ReactJsxHandlerNames = []|[({
10402
- eventHandlerPrefix?: string
10403
- eventHandlerPropPrefix?: string
10404
- checkLocalVariables?: boolean
10405
- checkInlineFunction?: boolean
10406
- } | {
10407
- eventHandlerPrefix?: string
10408
- eventHandlerPropPrefix?: false
10409
- checkLocalVariables?: boolean
10410
- checkInlineFunction?: boolean
10411
- } | {
10412
- eventHandlerPrefix?: false
10413
- eventHandlerPropPrefix?: string
10414
- checkLocalVariables?: boolean
10415
- checkInlineFunction?: boolean
10416
- } | {
10417
- checkLocalVariables?: boolean
10418
- } | {
10419
- checkInlineFunction?: boolean
10420
10049
  })]
10421
- // ----- react/jsx-indent -----
10422
- type ReactJsxIndent = []|[("tab" | number)]|[("tab" | number), {
10423
- checkAttributes?: boolean
10424
- indentLogicalExpressions?: boolean
10425
- }]
10426
- // ----- react/jsx-indent-props -----
10427
- type ReactJsxIndentProps = []|[(("tab" | "first") | number | {
10428
- indentMode?: (("tab" | "first") | number)
10429
- ignoreTernaryOperator?: boolean
10430
- [k: string]: unknown | undefined
10431
- })]
10432
- // ----- react/jsx-key -----
10433
- type ReactJsxKey = []|[{
10434
- checkFragmentShorthand?: boolean
10435
- checkKeyMustBeforeSpread?: boolean
10436
- warnOnDuplicates?: boolean
10437
- }]
10438
- // ----- react/jsx-max-depth -----
10439
- type ReactJsxMaxDepth = []|[{
10440
- max?: number
10441
- }]
10442
- // ----- react/jsx-max-props-per-line -----
10443
- type ReactJsxMaxPropsPerLine = []|[({
10444
- maximum?: {
10445
- single?: number
10446
- multi?: number
10447
- [k: string]: unknown | undefined
10448
- }
10449
- } | {
10450
- maximum?: number
10451
- when?: ("always" | "multiline")
10452
- })]
10453
- // ----- react/jsx-newline -----
10454
- type ReactJsxNewline = []|[{
10455
- prevent?: boolean
10456
- allowMultilines?: boolean
10457
- }]
10458
- // ----- react/jsx-no-bind -----
10459
- type ReactJsxNoBind = []|[{
10460
- allowArrowFunctions?: boolean
10461
- allowBind?: boolean
10462
- allowFunctions?: boolean
10463
- ignoreRefs?: boolean
10464
- ignoreDOMComponents?: boolean
10465
- }]
10466
- // ----- react/jsx-no-constructed-context-values -----
10467
- interface ReactJsxNoConstructedContextValues {
10468
- [k: string]: unknown | undefined
10469
- }
10470
- // ----- react/jsx-no-duplicate-props -----
10471
- type ReactJsxNoDuplicateProps = []|[{
10472
- ignoreCase?: boolean
10473
- }]
10474
- // ----- react/jsx-no-leaked-render -----
10475
- type ReactJsxNoLeakedRender = []|[{
10476
- validStrategies?: ("ternary" | "coerce")[]
10477
- }]
10478
- // ----- react/jsx-no-literals -----
10479
- type ReactJsxNoLiterals = []|[{
10480
- noStrings?: boolean
10481
- allowedStrings?: string[]
10482
- ignoreProps?: boolean
10483
- noAttributeStrings?: boolean
10484
- }]
10485
- // ----- react/jsx-no-script-url -----
10486
- type ReactJsxNoScriptUrl = ([]|[{
10487
- name: string
10488
- props: string[]
10489
- }[]]|[{
10490
- name: string
10491
- props: string[]
10492
- }[], {
10493
- includeFromSettings?: boolean
10494
- [k: string]: unknown | undefined
10495
- }] | []|[{
10496
- includeFromSettings?: boolean
10497
- [k: string]: unknown | undefined
10498
- }])
10499
- // ----- react/jsx-no-target-blank -----
10500
- type ReactJsxNoTargetBlank = []|[{
10501
- allowReferrer?: boolean
10502
- enforceDynamicLinks?: ("always" | "never")
10503
- warnOnSpreadAttributes?: boolean
10504
- links?: boolean
10505
- forms?: boolean
10506
- }]
10507
- // ----- react/jsx-no-undef -----
10508
- type ReactJsxNoUndef = []|[{
10509
- allowGlobals?: boolean
10510
- }]
10511
- // ----- react/jsx-no-useless-fragment -----
10512
- type ReactJsxNoUselessFragment = []|[{
10513
- allowExpressions?: boolean
10514
- [k: string]: unknown | undefined
10515
- }]
10516
- // ----- react/jsx-one-expression-per-line -----
10517
- type ReactJsxOneExpressionPerLine = []|[{
10518
- allow?: ("none" | "literal" | "single-child" | "non-jsx")
10519
- }]
10520
- // ----- react/jsx-pascal-case -----
10521
- type ReactJsxPascalCase = []|[{
10522
- allowAllCaps?: boolean
10523
- allowLeadingUnderscore?: boolean
10524
- allowNamespace?: boolean
10525
-
10526
- ignore?: []|[string]
10527
- }]
10528
- // ----- react/jsx-props-no-spreading -----
10529
- type ReactJsxPropsNoSpreading = []|[({
10530
- html?: ("enforce" | "ignore")
10531
- custom?: ("enforce" | "ignore")
10532
- exceptions?: string[]
10533
- [k: string]: unknown | undefined
10534
- } & {
10535
- [k: string]: unknown | undefined
10536
- })]
10537
- // ----- react/jsx-sort-default-props -----
10538
- type ReactJsxSortDefaultProps = []|[{
10539
- ignoreCase?: boolean
10540
- }]
10541
- // ----- react/jsx-sort-props -----
10542
- type ReactJsxSortProps = []|[{
10543
- callbacksLast?: boolean
10544
- shorthandFirst?: boolean
10545
- shorthandLast?: boolean
10546
- multiline?: ("ignore" | "first" | "last")
10547
- ignoreCase?: boolean
10548
- noSortAlphabetically?: boolean
10549
- reservedFirst?: (unknown[] | boolean)
10550
- locale?: string
10551
- }]
10552
- // ----- react/jsx-space-before-closing -----
10553
- type ReactJsxSpaceBeforeClosing = []|[("always" | "never")]
10554
- // ----- react/jsx-tag-spacing -----
10555
- type ReactJsxTagSpacing = []|[{
10556
- closingSlash?: ("always" | "never" | "allow")
10557
- beforeSelfClosing?: ("always" | "proportional-always" | "never" | "allow")
10558
- afterOpening?: ("always" | "allow-multiline" | "never" | "allow")
10559
- beforeClosing?: ("always" | "proportional-always" | "never" | "allow")
10560
- }]
10561
- // ----- react/jsx-wrap-multilines -----
10562
- type ReactJsxWrapMultilines = []|[{
10563
- declaration?: (true | false | "ignore" | "parens" | "parens-new-line" | "never")
10564
- assignment?: (true | false | "ignore" | "parens" | "parens-new-line" | "never")
10565
- return?: (true | false | "ignore" | "parens" | "parens-new-line" | "never")
10566
- arrow?: (true | false | "ignore" | "parens" | "parens-new-line" | "never")
10567
- condition?: (true | false | "ignore" | "parens" | "parens-new-line" | "never")
10568
- logical?: (true | false | "ignore" | "parens" | "parens-new-line" | "never")
10569
- prop?: (true | false | "ignore" | "parens" | "parens-new-line" | "never")
10570
- }]
10571
- // ----- react/no-children-prop -----
10572
- type ReactNoChildrenProp = []|[{
10573
- allowFunctions?: boolean
10574
- }]
10575
- // ----- react/no-did-mount-set-state -----
10576
- type ReactNoDidMountSetState = []|["disallow-in-func"]
10577
- // ----- react/no-did-update-set-state -----
10578
- type ReactNoDidUpdateSetState = []|["disallow-in-func"]
10579
- // ----- react/no-invalid-html-attribute -----
10580
- type ReactNoInvalidHtmlAttribute = []|[("rel")[]]
10581
- // ----- react/no-multi-comp -----
10582
- type ReactNoMultiComp = []|[{
10583
- ignoreStateless?: boolean
10584
- }]
10585
- // ----- react/no-string-refs -----
10586
- type ReactNoStringRefs = []|[{
10587
- noTemplateLiterals?: boolean
10588
- }]
10589
- // ----- react/no-unescaped-entities -----
10590
- type ReactNoUnescapedEntities = []|[{
10591
- forbid?: (string | {
10592
- char?: string
10593
- alternatives?: string[]
10594
- [k: string]: unknown | undefined
10595
- })[]
10596
- }]
10597
- // ----- react/no-unknown-property -----
10598
- type ReactNoUnknownProperty = []|[{
10599
- ignore?: string[]
10600
- requireDataLowercase?: boolean
10601
- }]
10602
- // ----- react/no-unsafe -----
10603
- type ReactNoUnsafe = []|[{
10604
- checkAliases?: boolean
10605
- }]
10606
- // ----- react/no-unstable-nested-components -----
10607
- type ReactNoUnstableNestedComponents = []|[{
10608
- customValidators?: string[]
10609
- allowAsProps?: boolean
10610
- }]
10611
- // ----- react/no-unused-prop-types -----
10612
- type ReactNoUnusedPropTypes = []|[{
10613
- ignore?: string[]
10614
- customValidators?: string[]
10615
- skipShapeProps?: boolean
10616
- }]
10617
- // ----- react/no-will-update-set-state -----
10618
- type ReactNoWillUpdateSetState = []|["disallow-in-func"]
10619
- // ----- react/prefer-es6-class -----
10620
- type ReactPreferEs6Class = []|[("always" | "never")]
10621
- // ----- react/prefer-stateless-function -----
10622
- type ReactPreferStatelessFunction = []|[{
10623
- ignorePureComponents?: boolean
10624
- }]
10625
- // ----- react/prop-types -----
10626
- type ReactPropTypes = []|[{
10627
- ignore?: string[]
10628
- customValidators?: string[]
10629
- skipUndeclared?: boolean
10630
- }]
10631
- // ----- react/require-default-props -----
10632
- type ReactRequireDefaultProps = []|[{
10633
- forbidDefaultForRequired?: boolean
10634
- classes?: ("defaultProps" | "ignore")
10635
- functions?: ("defaultArguments" | "defaultProps" | "ignore")
10636
- ignoreFunctionalComponents?: boolean
10637
- }]
10638
- // ----- react/require-optimization -----
10639
- type ReactRequireOptimization = []|[{
10640
- allowDecorators?: string[]
10641
- }]
10642
- // ----- react/self-closing-comp -----
10643
- type ReactSelfClosingComp = []|[{
10644
- component?: boolean
10645
- html?: boolean
10646
- }]
10647
- // ----- react/sort-comp -----
10648
- type ReactSortComp = []|[{
10649
- order?: string[]
10650
- groups?: {
10651
- [k: string]: string[]
10652
- }
10653
- }]
10654
- // ----- react/sort-default-props -----
10655
- type ReactSortDefaultProps = []|[{
10656
- ignoreCase?: boolean
10657
- }]
10658
- // ----- react/sort-prop-types -----
10659
- type ReactSortPropTypes = []|[{
10660
- requiredFirst?: boolean
10661
- callbacksLast?: boolean
10662
- ignoreCase?: boolean
10663
- noSortAlphabetically?: boolean
10664
- sortShapeProp?: boolean
10665
- checkTypes?: boolean
10666
- }]
10667
- // ----- react/state-in-constructor -----
10668
- type ReactStateInConstructor = []|[("always" | "never")]
10669
- // ----- react/static-property-placement -----
10670
- type ReactStaticPropertyPlacement = []|[("static public field" | "static getter" | "property assignment")]|[("static public field" | "static getter" | "property assignment"), {
10671
- propTypes?: ("static public field" | "static getter" | "property assignment")
10672
- defaultProps?: ("static public field" | "static getter" | "property assignment")
10673
- childContextTypes?: ("static public field" | "static getter" | "property assignment")
10674
- contextTypes?: ("static public field" | "static getter" | "property assignment")
10675
- contextType?: ("static public field" | "static getter" | "property assignment")
10676
- displayName?: ("static public field" | "static getter" | "property assignment")
10677
- }]
10678
- // ----- react/style-prop-object -----
10679
- type ReactStylePropObject = []|[{
10680
- allow?: string[]
10681
- [k: string]: unknown | undefined
10050
+ // ----- react-refresh/only-export-components -----
10051
+ type ReactRefreshOnlyExportComponents = []|[{
10052
+ allowConstantExport?: boolean
10053
+ checkJS?: boolean
10054
+ allowExportNames?: string[]
10682
10055
  }]
10683
10056
  // ----- require-atomic-updates -----
10684
10057
  type RequireAtomicUpdates = []|[{
@@ -15515,7 +14888,7 @@ interface OptionsConfig extends OptionsComponentExts {
15515
14888
  * Enable react rules.
15516
14889
  *
15517
14890
  * Requires installing:
15518
- * - `eslint-plugin-react`
14891
+ * - `@eslint-react/eslint-plugin`
15519
14892
  * - `eslint-plugin-react-hooks`
15520
14893
  * - `eslint-plugin-react-refresh`
15521
14894
  *
@@ -15592,6 +14965,10 @@ interface OptionsConfig extends OptionsComponentExts {
15592
14965
  }
15593
14966
 
15594
14967
  declare const defaultPluginRenaming: {
14968
+ '@eslint-react': string;
14969
+ '@eslint-react/dom': string;
14970
+ '@eslint-react/hooks-extra': string;
14971
+ '@eslint-react/naming-convention': string;
15595
14972
  '@stylistic': string;
15596
14973
  '@typescript-eslint': string;
15597
14974
  'import-x': string;
@@ -15639,7 +15016,7 @@ declare function perfectionist(): Promise<TypedFlatConfigItem[]>;
15639
15016
 
15640
15017
  declare function formatters(options?: OptionsFormatters | true, stylistic?: StylisticConfig): Promise<TypedFlatConfigItem[]>;
15641
15018
 
15642
- declare function react(options?: OptionsHasTypeScript & OptionsOverrides & OptionsFiles): Promise<TypedFlatConfigItem[]>;
15019
+ declare function react(options?: OptionsTypeScriptWithTypes & OptionsOverrides & OptionsFiles): Promise<TypedFlatConfigItem[]>;
15643
15020
 
15644
15021
  /**
15645
15022
  * Sort package.json