@antfu/eslint-config 8.3.0 → 9.0.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/cli.mjs +2 -2
- package/dist/index.d.mts +383 -147
- package/dist/index.mjs +4 -14
- package/package.json +4 -4
package/dist/cli.mjs
CHANGED
|
@@ -8,7 +8,7 @@ import { cac } from "cac";
|
|
|
8
8
|
import parse from "parse-gitignore";
|
|
9
9
|
import { execSync } from "node:child_process";
|
|
10
10
|
//#region package.json
|
|
11
|
-
var version = "
|
|
11
|
+
var version = "9.0.0";
|
|
12
12
|
//#endregion
|
|
13
13
|
//#region src/cli/constants.ts
|
|
14
14
|
const vscodeSettingsString = `
|
|
@@ -165,7 +165,7 @@ async function updateEslintFiles(result) {
|
|
|
165
165
|
//#endregion
|
|
166
166
|
//#region src/cli/constants-generated.ts
|
|
167
167
|
const versionsMap = {
|
|
168
|
-
"@eslint-react/eslint-plugin": "^
|
|
168
|
+
"@eslint-react/eslint-plugin": "^5.6.0",
|
|
169
169
|
"@next/eslint-plugin-next": "^16.2.6",
|
|
170
170
|
"@unocss/eslint-plugin": "^66.6.8",
|
|
171
171
|
"astro-eslint-parser": "^1.4.0",
|
package/dist/index.d.mts
CHANGED
|
@@ -3742,182 +3742,162 @@ interface RuleOptions {
|
|
|
3742
3742
|
* @see https://eslint.org/docs/latest/rules/radix
|
|
3743
3743
|
*/
|
|
3744
3744
|
'radix'?: Linter.RuleEntry<Radix>;
|
|
3745
|
+
'react-refresh/only-export-components'?: Linter.RuleEntry<ReactRefreshOnlyExportComponents>;
|
|
3745
3746
|
/**
|
|
3746
3747
|
* Disallows DOM elements from using 'dangerouslySetInnerHTML'.
|
|
3747
3748
|
* @see https://eslint-react.xyz/docs/rules/dom-no-dangerously-set-innerhtml
|
|
3748
3749
|
*/
|
|
3749
|
-
'react-
|
|
3750
|
+
'react/dom-no-dangerously-set-innerhtml'?: Linter.RuleEntry<[]>;
|
|
3750
3751
|
/**
|
|
3751
3752
|
* Disallows DOM elements from using 'dangerouslySetInnerHTML' and 'children' at the same time.
|
|
3752
3753
|
* @see https://eslint-react.xyz/docs/rules/dom-no-dangerously-set-innerhtml-with-children
|
|
3753
3754
|
*/
|
|
3754
|
-
'react-
|
|
3755
|
+
'react/dom-no-dangerously-set-innerhtml-with-children'?: Linter.RuleEntry<[]>;
|
|
3755
3756
|
/**
|
|
3756
3757
|
* Disallows 'findDOMNode'.
|
|
3757
3758
|
* @see https://eslint-react.xyz/docs/rules/dom-no-find-dom-node
|
|
3758
3759
|
*/
|
|
3759
|
-
'react-
|
|
3760
|
+
'react/dom-no-find-dom-node'?: Linter.RuleEntry<[]>;
|
|
3760
3761
|
/**
|
|
3761
3762
|
* Disallows 'flushSync'.
|
|
3762
3763
|
* @see https://eslint-react.xyz/docs/rules/dom-no-flush-sync
|
|
3763
3764
|
*/
|
|
3764
|
-
'react-
|
|
3765
|
+
'react/dom-no-flush-sync'?: Linter.RuleEntry<[]>;
|
|
3765
3766
|
/**
|
|
3766
3767
|
* Replaces usage of 'ReactDOM.hydrate()' with 'hydrateRoot()'.
|
|
3767
3768
|
* @see https://eslint-react.xyz/docs/rules/dom-no-hydrate
|
|
3768
3769
|
*/
|
|
3769
|
-
'react-
|
|
3770
|
+
'react/dom-no-hydrate'?: Linter.RuleEntry<[]>;
|
|
3770
3771
|
/**
|
|
3771
3772
|
* Enforces an explicit 'type' attribute for 'button' elements.
|
|
3772
3773
|
* @see https://eslint-react.xyz/docs/rules/dom-no-missing-button-type
|
|
3773
3774
|
*/
|
|
3774
|
-
'react-
|
|
3775
|
+
'react/dom-no-missing-button-type'?: Linter.RuleEntry<[]>;
|
|
3775
3776
|
/**
|
|
3776
3777
|
* Enforces an explicit 'sandbox' attribute for 'iframe' elements.
|
|
3777
3778
|
* @see https://eslint-react.xyz/docs/rules/dom-no-missing-iframe-sandbox
|
|
3778
3779
|
*/
|
|
3779
|
-
'react-
|
|
3780
|
-
/**
|
|
3781
|
-
* Enforces the absence of a 'namespace' in React elements.
|
|
3782
|
-
* @see https://eslint-react.xyz/docs/rules/dom-no-namespace
|
|
3783
|
-
*/
|
|
3784
|
-
'react-dom/no-namespace'?: Linter.RuleEntry<[]>;
|
|
3780
|
+
'react/dom-no-missing-iframe-sandbox'?: Linter.RuleEntry<[]>;
|
|
3785
3781
|
/**
|
|
3786
3782
|
* Replaces usage of 'ReactDOM.render()' with 'createRoot(node).render()'.
|
|
3787
3783
|
* @see https://eslint-react.xyz/docs/rules/dom-no-render
|
|
3788
3784
|
*/
|
|
3789
|
-
'react-
|
|
3785
|
+
'react/dom-no-render'?: Linter.RuleEntry<[]>;
|
|
3790
3786
|
/**
|
|
3791
3787
|
* Disallows the return value of 'ReactDOM.render'.
|
|
3792
3788
|
* @see https://eslint-react.xyz/docs/rules/dom-no-render-return-value
|
|
3793
3789
|
*/
|
|
3794
|
-
'react-
|
|
3790
|
+
'react/dom-no-render-return-value'?: Linter.RuleEntry<[]>;
|
|
3795
3791
|
/**
|
|
3796
3792
|
* Disallows 'javascript:' URLs as attribute values.
|
|
3797
3793
|
* @see https://eslint-react.xyz/docs/rules/dom-no-script-url
|
|
3798
3794
|
*/
|
|
3799
|
-
'react-
|
|
3795
|
+
'react/dom-no-script-url'?: Linter.RuleEntry<[]>;
|
|
3800
3796
|
/**
|
|
3801
3797
|
* Disallows the use of string style prop in JSX. Use an object instead.
|
|
3802
3798
|
* @see https://eslint-react.xyz/docs/rules/dom-no-string-style-prop
|
|
3803
3799
|
*/
|
|
3804
|
-
'react-
|
|
3800
|
+
'react/dom-no-string-style-prop'?: Linter.RuleEntry<[]>;
|
|
3805
3801
|
/**
|
|
3806
3802
|
* Disallows unknown 'DOM' properties.
|
|
3807
3803
|
* @see https://eslint-react.xyz/docs/rules/dom-no-unknown-property
|
|
3808
3804
|
*/
|
|
3809
|
-
'react-
|
|
3805
|
+
'react/dom-no-unknown-property'?: Linter.RuleEntry<ReactDomNoUnknownProperty>;
|
|
3810
3806
|
/**
|
|
3811
3807
|
* Enforces that the 'sandbox' attribute for 'iframe' elements is not set to unsafe combinations.
|
|
3812
3808
|
* @see https://eslint-react.xyz/docs/rules/dom-no-unsafe-iframe-sandbox
|
|
3813
3809
|
*/
|
|
3814
|
-
'react-
|
|
3810
|
+
'react/dom-no-unsafe-iframe-sandbox'?: Linter.RuleEntry<[]>;
|
|
3815
3811
|
/**
|
|
3816
3812
|
* Disallows 'target="_blank"' without 'rel="noreferrer noopener"'.
|
|
3817
3813
|
* @see https://eslint-react.xyz/docs/rules/dom-no-unsafe-target-blank
|
|
3818
3814
|
*/
|
|
3819
|
-
'react-
|
|
3815
|
+
'react/dom-no-unsafe-target-blank'?: Linter.RuleEntry<[]>;
|
|
3820
3816
|
/**
|
|
3821
3817
|
* Replaces usage of 'useFormState' with 'useActionState'.
|
|
3822
3818
|
* @see https://eslint-react.xyz/docs/rules/dom-no-use-form-state
|
|
3823
3819
|
*/
|
|
3824
|
-
'react-
|
|
3820
|
+
'react/dom-no-use-form-state'?: Linter.RuleEntry<[]>;
|
|
3825
3821
|
/**
|
|
3826
3822
|
* Disallows 'children' in void DOM elements.
|
|
3827
3823
|
* @see https://eslint-react.xyz/docs/rules/dom-no-void-elements-with-children
|
|
3828
3824
|
*/
|
|
3829
|
-
'react-
|
|
3825
|
+
'react/dom-no-void-elements-with-children'?: Linter.RuleEntry<[]>;
|
|
3830
3826
|
/**
|
|
3831
|
-
*
|
|
3832
|
-
* @see https://eslint-react.xyz/docs/rules/
|
|
3833
|
-
*/
|
|
3834
|
-
'react-dom/prefer-namespace-import'?: Linter.RuleEntry<[]>;
|
|
3835
|
-
/**
|
|
3836
|
-
* Enforces the context name to be a valid component name with the suffix 'Context'.
|
|
3837
|
-
* @see https://eslint-react.xyz/docs/rules/naming-convention-context-name
|
|
3827
|
+
* Validates usage of Error Boundaries instead of try/catch for errors in child components.
|
|
3828
|
+
* @see https://eslint-react.xyz/docs/rules/error-boundaries
|
|
3838
3829
|
*/
|
|
3839
|
-
'react
|
|
3830
|
+
'react/error-boundaries'?: Linter.RuleEntry<[]>;
|
|
3840
3831
|
/**
|
|
3841
|
-
*
|
|
3842
|
-
* @see https://
|
|
3832
|
+
* Verifies the list of dependencies for Hooks like 'useEffect' and similar.
|
|
3833
|
+
* @see https://github.com/facebook/react/issues/14920
|
|
3843
3834
|
*/
|
|
3844
|
-
'react
|
|
3835
|
+
'react/exhaustive-deps'?: Linter.RuleEntry<ReactExhaustiveDeps>;
|
|
3845
3836
|
/**
|
|
3846
|
-
*
|
|
3847
|
-
* @see https://eslint-react.xyz/docs/rules/
|
|
3837
|
+
* Validates against assignment/mutation of globals during render, part of ensuring that side effects must run outside of render.
|
|
3838
|
+
* @see https://eslint-react.xyz/docs/rules/globals
|
|
3848
3839
|
*/
|
|
3849
|
-
'react
|
|
3850
|
-
'react-refresh/only-export-components'?: Linter.RuleEntry<ReactRefreshOnlyExportComponents>;
|
|
3840
|
+
'react/globals'?: Linter.RuleEntry<[]>;
|
|
3851
3841
|
/**
|
|
3852
|
-
* Validates and
|
|
3853
|
-
* @see https://eslint-react.xyz/docs/rules/
|
|
3842
|
+
* Validates against mutating props, state, and other values that are immutable.
|
|
3843
|
+
* @see https://eslint-react.xyz/docs/rules/immutability
|
|
3854
3844
|
*/
|
|
3855
|
-
'react
|
|
3845
|
+
'react/immutability'?: Linter.RuleEntry<[]>;
|
|
3856
3846
|
/**
|
|
3857
|
-
*
|
|
3858
|
-
* @see https://eslint-react.xyz/docs/rules/
|
|
3847
|
+
* Disallows passing 'children' as a prop.
|
|
3848
|
+
* @see https://eslint-react.xyz/docs/rules/no-children-prop
|
|
3859
3849
|
*/
|
|
3860
|
-
'react-
|
|
3850
|
+
'react/jsx-no-children-prop'?: Linter.RuleEntry<[]>;
|
|
3861
3851
|
/**
|
|
3862
|
-
*
|
|
3863
|
-
* @see https://eslint-react.xyz/docs/rules/
|
|
3852
|
+
* Disallows passing 'children' as a prop when children are also passed as nested content.
|
|
3853
|
+
* @see https://eslint-react.xyz/docs/rules/no-children-prop-with-children
|
|
3864
3854
|
*/
|
|
3865
|
-
'react-
|
|
3855
|
+
'react/jsx-no-children-prop-with-children'?: Linter.RuleEntry<[]>;
|
|
3866
3856
|
/**
|
|
3867
|
-
*
|
|
3868
|
-
* @see https://eslint-react.xyz/docs/rules/
|
|
3857
|
+
* Prevents comment strings from being accidentally inserted into a JSX element's text nodes.
|
|
3858
|
+
* @see https://eslint-react.xyz/docs/rules/no-comment-textnodes
|
|
3869
3859
|
*/
|
|
3870
|
-
'react-
|
|
3860
|
+
'react/jsx-no-comment-textnodes'?: Linter.RuleEntry<[]>;
|
|
3871
3861
|
/**
|
|
3872
|
-
*
|
|
3873
|
-
* @see https://eslint-react.xyz/docs/rules/
|
|
3862
|
+
* Prevent patterns that cause deoptimization when using the automatic JSX runtime.
|
|
3863
|
+
* @see https://eslint-react.xyz/docs/rules/no-key-after-spread
|
|
3874
3864
|
*/
|
|
3875
|
-
'react-
|
|
3865
|
+
'react/jsx-no-key-after-spread'?: Linter.RuleEntry<[]>;
|
|
3876
3866
|
/**
|
|
3877
|
-
*
|
|
3878
|
-
* @see https://eslint-react.xyz/docs/rules/
|
|
3867
|
+
* Catches `$` before `{expr}` in JSX — typically from template literal `${expr}` being copy-pasted into JSX without removing the `$`. The `$` "leaks" into the rendered output.
|
|
3868
|
+
* @see https://eslint-react.xyz/docs/rules/no-leaked-dollar
|
|
3879
3869
|
*/
|
|
3880
|
-
'react/
|
|
3870
|
+
'react/jsx-no-leaked-dollar'?: Linter.RuleEntry<[]>;
|
|
3881
3871
|
/**
|
|
3882
|
-
*
|
|
3883
|
-
* @see https://eslint-react.xyz/docs/rules/
|
|
3872
|
+
* Catches `;` at the start of JSX text nodes — typically from accidentally placing a statement-ending `;` inside JSX. The `;` "leaks" into the rendered output.
|
|
3873
|
+
* @see https://eslint-react.xyz/docs/rules/no-leaked-semicolon
|
|
3884
3874
|
*/
|
|
3885
|
-
'react/
|
|
3875
|
+
'react/jsx-no-leaked-semicolon'?: Linter.RuleEntry<[]>;
|
|
3886
3876
|
/**
|
|
3887
|
-
*
|
|
3888
|
-
* @see https://
|
|
3877
|
+
* Disallow JSX namespace syntax, as React does not support them.
|
|
3878
|
+
* @see https://eslint-react.xyz/docs/rules/no-namespace
|
|
3889
3879
|
*/
|
|
3890
|
-
'react/
|
|
3880
|
+
'react/jsx-no-namespace'?: Linter.RuleEntry<[]>;
|
|
3891
3881
|
/**
|
|
3892
|
-
*
|
|
3893
|
-
* @see https://eslint-react.xyz/docs/rules/
|
|
3894
|
-
*/
|
|
3895
|
-
'react/immutability'?: Linter.RuleEntry<[]>;
|
|
3896
|
-
/**
|
|
3897
|
-
* Prevents unintentional '$' sign before expression.
|
|
3898
|
-
* @see https://eslint-react.xyz/docs/rules/jsx-dollar
|
|
3899
|
-
*/
|
|
3900
|
-
'react/jsx-dollar'?: Linter.RuleEntry<[]>;
|
|
3901
|
-
/**
|
|
3902
|
-
* Enforces 'key' prop placement before spread props.
|
|
3903
|
-
* @see https://eslint-react.xyz/docs/rules/jsx-key-before-spread
|
|
3882
|
+
* Disallows useless fragment elements.
|
|
3883
|
+
* @see https://eslint-react.xyz/docs/rules/no-useless-fragment
|
|
3904
3884
|
*/
|
|
3905
|
-
'react/jsx-
|
|
3885
|
+
'react/jsx-no-useless-fragment'?: Linter.RuleEntry<ReactJsxNoUselessFragment>;
|
|
3906
3886
|
/**
|
|
3907
|
-
*
|
|
3908
|
-
* @see https://eslint-react.xyz/docs/rules/
|
|
3887
|
+
* Enforces the context name to be a valid component name with the suffix 'Context'.
|
|
3888
|
+
* @see https://eslint-react.xyz/docs/rules/naming-convention-context-name
|
|
3909
3889
|
*/
|
|
3910
|
-
'react/
|
|
3890
|
+
'react/naming-convention-context-name'?: Linter.RuleEntry<[]>;
|
|
3911
3891
|
/**
|
|
3912
|
-
* Enforces
|
|
3913
|
-
* @see https://eslint-react.xyz/docs/rules/
|
|
3892
|
+
* Enforces identifier names assigned from 'useId' calls to be either 'id' or end with 'Id'.
|
|
3893
|
+
* @see https://eslint-react.xyz/docs/rules/naming-convention-id-name
|
|
3914
3894
|
*/
|
|
3915
|
-
'react/
|
|
3895
|
+
'react/naming-convention-id-name'?: Linter.RuleEntry<[]>;
|
|
3916
3896
|
/**
|
|
3917
|
-
* Enforces
|
|
3918
|
-
* @see https://eslint-react.xyz/docs/rules/
|
|
3897
|
+
* Enforces identifier names assigned from 'useRef' calls to be either 'ref' or end with 'Ref'.
|
|
3898
|
+
* @see https://eslint-react.xyz/docs/rules/naming-convention-ref-name
|
|
3919
3899
|
*/
|
|
3920
|
-
'react/
|
|
3900
|
+
'react/naming-convention-ref-name'?: Linter.RuleEntry<[]>;
|
|
3921
3901
|
/**
|
|
3922
3902
|
* Disallows accessing 'this.state' inside 'setState' calls.
|
|
3923
3903
|
* @see https://eslint-react.xyz/docs/rules/no-access-state-in-setstate
|
|
@@ -3948,11 +3928,6 @@ interface RuleOptions {
|
|
|
3948
3928
|
* @see https://eslint-react.xyz/docs/rules/no-children-only
|
|
3949
3929
|
*/
|
|
3950
3930
|
'react/no-children-only'?: Linter.RuleEntry<[]>;
|
|
3951
|
-
/**
|
|
3952
|
-
* Disallows passing 'children' as a prop.
|
|
3953
|
-
* @see https://eslint-react.xyz/docs/rules/no-children-prop
|
|
3954
|
-
*/
|
|
3955
|
-
'react/no-children-prop'?: Linter.RuleEntry<[]>;
|
|
3956
3931
|
/**
|
|
3957
3932
|
* Disallows the use of 'Children.toArray' from the 'react' package.
|
|
3958
3933
|
* @see https://eslint-react.xyz/docs/rules/no-children-to-array
|
|
@@ -4054,15 +4029,10 @@ interface RuleOptions {
|
|
|
4054
4029
|
*/
|
|
4055
4030
|
'react/no-nested-component-definitions'?: Linter.RuleEntry<[]>;
|
|
4056
4031
|
/**
|
|
4057
|
-
* Disallows nesting lazy component declarations inside other components.
|
|
4032
|
+
* Disallows nesting lazy component declarations inside other components or hooks.
|
|
4058
4033
|
* @see https://eslint-react.xyz/docs/rules/no-nested-lazy-component-declarations
|
|
4059
4034
|
*/
|
|
4060
4035
|
'react/no-nested-lazy-component-declarations'?: Linter.RuleEntry<[]>;
|
|
4061
|
-
/**
|
|
4062
|
-
* Disallows 'shouldComponentUpdate' when extending 'React.PureComponent'.
|
|
4063
|
-
* @see https://eslint-react.xyz/docs/rules/no-redundant-should-component-update
|
|
4064
|
-
*/
|
|
4065
|
-
'react/no-redundant-should-component-update'?: Linter.RuleEntry<[]>;
|
|
4066
4036
|
/**
|
|
4067
4037
|
* Disallows calling 'this.setState' in 'componentDidMount' outside functions such as callbacks.
|
|
4068
4038
|
* @see https://eslint-react.xyz/docs/rules/no-set-state-in-component-did-mount
|
|
@@ -4078,16 +4048,6 @@ interface RuleOptions {
|
|
|
4078
4048
|
* @see https://eslint-react.xyz/docs/rules/no-set-state-in-component-will-update
|
|
4079
4049
|
*/
|
|
4080
4050
|
'react/no-set-state-in-component-will-update'?: Linter.RuleEntry<[]>;
|
|
4081
|
-
/**
|
|
4082
|
-
* Disallows unnecessary usage of 'useCallback'.
|
|
4083
|
-
* @see https://eslint-react.xyz/docs/rules/no-unnecessary-use-callback
|
|
4084
|
-
*/
|
|
4085
|
-
'react/no-unnecessary-use-callback'?: Linter.RuleEntry<[]>;
|
|
4086
|
-
/**
|
|
4087
|
-
* Disallows unnecessary usage of 'useMemo'.
|
|
4088
|
-
* @see https://eslint-react.xyz/docs/rules/no-unnecessary-use-memo
|
|
4089
|
-
*/
|
|
4090
|
-
'react/no-unnecessary-use-memo'?: Linter.RuleEntry<[]>;
|
|
4091
4051
|
/**
|
|
4092
4052
|
* Enforces that a function with the 'use' prefix uses at least one Hook inside it.
|
|
4093
4053
|
* @see https://eslint-react.xyz/docs/rules/no-unnecessary-use-prefix
|
|
@@ -4128,31 +4088,11 @@ interface RuleOptions {
|
|
|
4128
4088
|
* @see https://eslint-react.xyz/docs/rules/no-unused-props
|
|
4129
4089
|
*/
|
|
4130
4090
|
'react/no-unused-props'?: Linter.RuleEntry<[]>;
|
|
4131
|
-
/**
|
|
4132
|
-
* Warns about unused class component state.
|
|
4133
|
-
* @see https://eslint-react.xyz/docs/rules/no-unused-state
|
|
4134
|
-
*/
|
|
4135
|
-
'react/no-unused-state'?: Linter.RuleEntry<[]>;
|
|
4136
4091
|
/**
|
|
4137
4092
|
* Replaces usage of 'useContext' with 'use'.
|
|
4138
4093
|
* @see https://eslint-react.xyz/docs/rules/no-use-context
|
|
4139
4094
|
*/
|
|
4140
4095
|
'react/no-use-context'?: Linter.RuleEntry<[]>;
|
|
4141
|
-
/**
|
|
4142
|
-
* Disallows useless fragment elements.
|
|
4143
|
-
* @see https://eslint-react.xyz/docs/rules/no-useless-fragment
|
|
4144
|
-
*/
|
|
4145
|
-
'react/no-useless-fragment'?: Linter.RuleEntry<ReactNoUselessFragment>;
|
|
4146
|
-
/**
|
|
4147
|
-
* Enforces destructuring assignment for component props and context.
|
|
4148
|
-
* @see https://eslint-react.xyz/docs/rules/prefer-destructuring-assignment
|
|
4149
|
-
*/
|
|
4150
|
-
'react/prefer-destructuring-assignment'?: Linter.RuleEntry<[]>;
|
|
4151
|
-
/**
|
|
4152
|
-
* Enforces importing React via a namespace import.
|
|
4153
|
-
* @see https://eslint-react.xyz/docs/rules/prefer-namespace-import
|
|
4154
|
-
*/
|
|
4155
|
-
'react/prefer-namespace-import'?: Linter.RuleEntry<[]>;
|
|
4156
4096
|
/**
|
|
4157
4097
|
* Validates that components and hooks are pure by checking that they do not call known-impure functions during render.
|
|
4158
4098
|
* @see https://eslint-react.xyz/docs/rules/purity
|
|
@@ -4163,6 +4103,11 @@ interface RuleOptions {
|
|
|
4163
4103
|
* @see https://eslint-react.xyz/docs/rules/refs
|
|
4164
4104
|
*/
|
|
4165
4105
|
'react/refs'?: Linter.RuleEntry<[]>;
|
|
4106
|
+
/**
|
|
4107
|
+
* Validates and transforms React Client/Server Function definitions.
|
|
4108
|
+
* @see https://eslint-react.xyz/docs/rules/function-definition
|
|
4109
|
+
*/
|
|
4110
|
+
'react/rsc-function-definition'?: Linter.RuleEntry<[]>;
|
|
4166
4111
|
/**
|
|
4167
4112
|
* Enforces the Rules of Hooks.
|
|
4168
4113
|
* @see https://react.dev/reference/rules/rules-of-hooks
|
|
@@ -4179,15 +4124,10 @@ interface RuleOptions {
|
|
|
4179
4124
|
*/
|
|
4180
4125
|
'react/set-state-in-render'?: Linter.RuleEntry<[]>;
|
|
4181
4126
|
/**
|
|
4182
|
-
*
|
|
4183
|
-
* @see https://eslint-react.xyz/docs/rules/
|
|
4127
|
+
* Validates that components are static, not recreated every render.
|
|
4128
|
+
* @see https://eslint-react.xyz/docs/rules/static-components
|
|
4184
4129
|
*/
|
|
4185
|
-
'react/
|
|
4186
|
-
/**
|
|
4187
|
-
* Enforces the Rules of State.
|
|
4188
|
-
* @see https://eslint-react.xyz/docs/rules/unstable-rules-of-state
|
|
4189
|
-
*/
|
|
4190
|
-
'react/unstable-rules-of-state'?: Linter.RuleEntry<[]>;
|
|
4130
|
+
'react/static-components'?: Linter.RuleEntry<[]>;
|
|
4191
4131
|
/**
|
|
4192
4132
|
* Validates against syntax that React Compiler does not support.
|
|
4193
4133
|
* @see https://eslint-react.xyz/docs/rules/unsupported-syntax
|
|
@@ -4203,6 +4143,291 @@ interface RuleOptions {
|
|
|
4203
4143
|
* @see https://eslint-react.xyz/docs/rules/use-state
|
|
4204
4144
|
*/
|
|
4205
4145
|
'react/use-state'?: Linter.RuleEntry<ReactUseState>;
|
|
4146
|
+
/**
|
|
4147
|
+
* Enforces that every 'addEventListener' in a component or custom hook has a corresponding 'removeEventListener'.
|
|
4148
|
+
* @see https://eslint-react.xyz/docs/rules/web-api-no-leaked-event-listener
|
|
4149
|
+
*/
|
|
4150
|
+
'react/web-api-no-leaked-event-listener'?: Linter.RuleEntry<[]>;
|
|
4151
|
+
/**
|
|
4152
|
+
* Enforces that every 'fetch' in a component or custom hook has a corresponding 'AbortController' abort in the cleanup function.
|
|
4153
|
+
* @see https://eslint-react.xyz/docs/rules/web-api-no-leaked-fetch
|
|
4154
|
+
*/
|
|
4155
|
+
'react/web-api-no-leaked-fetch'?: Linter.RuleEntry<[]>;
|
|
4156
|
+
/**
|
|
4157
|
+
* Enforces that every 'setInterval' in a component or custom hook has a corresponding 'clearInterval'.
|
|
4158
|
+
* @see https://eslint-react.xyz/docs/rules/web-api-no-leaked-interval
|
|
4159
|
+
*/
|
|
4160
|
+
'react/web-api-no-leaked-interval'?: Linter.RuleEntry<[]>;
|
|
4161
|
+
/**
|
|
4162
|
+
* Enforces that every 'ResizeObserver' created in a component or custom hook has a corresponding 'ResizeObserver.disconnect()'.
|
|
4163
|
+
* @see https://eslint-react.xyz/docs/rules/web-api-no-leaked-resize-observer
|
|
4164
|
+
*/
|
|
4165
|
+
'react/web-api-no-leaked-resize-observer'?: Linter.RuleEntry<[]>;
|
|
4166
|
+
/**
|
|
4167
|
+
* Enforces that every 'setTimeout' in a component or custom hook has a corresponding 'clearTimeout'.
|
|
4168
|
+
* @see https://eslint-react.xyz/docs/rules/web-api-no-leaked-timeout
|
|
4169
|
+
*/
|
|
4170
|
+
'react/web-api-no-leaked-timeout'?: Linter.RuleEntry<[]>;
|
|
4171
|
+
/**
|
|
4172
|
+
* Validates usage of Error Boundaries instead of try/catch for errors in child components.
|
|
4173
|
+
* @see https://eslint-react.xyz/docs/rules/error-boundaries
|
|
4174
|
+
*/
|
|
4175
|
+
'react/x-error-boundaries'?: Linter.RuleEntry<[]>;
|
|
4176
|
+
/**
|
|
4177
|
+
* Verifies the list of dependencies for Hooks like 'useEffect' and similar.
|
|
4178
|
+
* @see https://github.com/facebook/react/issues/14920
|
|
4179
|
+
*/
|
|
4180
|
+
'react/x-exhaustive-deps'?: Linter.RuleEntry<ReactXExhaustiveDeps>;
|
|
4181
|
+
/**
|
|
4182
|
+
* Validates against assignment/mutation of globals during render, part of ensuring that side effects must run outside of render.
|
|
4183
|
+
* @see https://eslint-react.xyz/docs/rules/globals
|
|
4184
|
+
*/
|
|
4185
|
+
'react/x-globals'?: Linter.RuleEntry<[]>;
|
|
4186
|
+
/**
|
|
4187
|
+
* Validates against mutating props, state, and other values that are immutable.
|
|
4188
|
+
* @see https://eslint-react.xyz/docs/rules/immutability
|
|
4189
|
+
*/
|
|
4190
|
+
'react/x-immutability'?: Linter.RuleEntry<[]>;
|
|
4191
|
+
/**
|
|
4192
|
+
* Disallows accessing 'this.state' inside 'setState' calls.
|
|
4193
|
+
* @see https://eslint-react.xyz/docs/rules/no-access-state-in-setstate
|
|
4194
|
+
*/
|
|
4195
|
+
'react/x-no-access-state-in-setstate'?: Linter.RuleEntry<[]>;
|
|
4196
|
+
/**
|
|
4197
|
+
* Disallows using an item's index in the array as its key.
|
|
4198
|
+
* @see https://eslint-react.xyz/docs/rules/no-array-index-key
|
|
4199
|
+
*/
|
|
4200
|
+
'react/x-no-array-index-key'?: Linter.RuleEntry<[]>;
|
|
4201
|
+
/**
|
|
4202
|
+
* Disallows the use of 'Children.count' from the 'react' package.
|
|
4203
|
+
* @see https://eslint-react.xyz/docs/rules/no-children-count
|
|
4204
|
+
*/
|
|
4205
|
+
'react/x-no-children-count'?: Linter.RuleEntry<[]>;
|
|
4206
|
+
/**
|
|
4207
|
+
* Disallows the use of 'Children.forEach' from the 'react' package.
|
|
4208
|
+
* @see https://eslint-react.xyz/docs/rules/no-children-for-each
|
|
4209
|
+
*/
|
|
4210
|
+
'react/x-no-children-for-each'?: Linter.RuleEntry<[]>;
|
|
4211
|
+
/**
|
|
4212
|
+
* Disallows the use of 'Children.map' from the 'react' package.
|
|
4213
|
+
* @see https://eslint-react.xyz/docs/rules/no-children-map
|
|
4214
|
+
*/
|
|
4215
|
+
'react/x-no-children-map'?: Linter.RuleEntry<[]>;
|
|
4216
|
+
/**
|
|
4217
|
+
* Disallows the use of 'Children.only' from the 'react' package.
|
|
4218
|
+
* @see https://eslint-react.xyz/docs/rules/no-children-only
|
|
4219
|
+
*/
|
|
4220
|
+
'react/x-no-children-only'?: Linter.RuleEntry<[]>;
|
|
4221
|
+
/**
|
|
4222
|
+
* Disallows the use of 'Children.toArray' from the 'react' package.
|
|
4223
|
+
* @see https://eslint-react.xyz/docs/rules/no-children-to-array
|
|
4224
|
+
*/
|
|
4225
|
+
'react/x-no-children-to-array'?: Linter.RuleEntry<[]>;
|
|
4226
|
+
/**
|
|
4227
|
+
* Disallows class components except for error boundaries.
|
|
4228
|
+
* @see https://eslint-react.xyz/docs/rules/no-class-component
|
|
4229
|
+
*/
|
|
4230
|
+
'react/x-no-class-component'?: Linter.RuleEntry<[]>;
|
|
4231
|
+
/**
|
|
4232
|
+
* Disallows 'cloneElement'.
|
|
4233
|
+
* @see https://eslint-react.xyz/docs/rules/no-clone-element
|
|
4234
|
+
*/
|
|
4235
|
+
'react/x-no-clone-element'?: Linter.RuleEntry<[]>;
|
|
4236
|
+
/**
|
|
4237
|
+
* Replaces usage of 'componentWillMount' with 'UNSAFE_componentWillMount'.
|
|
4238
|
+
* @see https://eslint-react.xyz/docs/rules/no-component-will-mount
|
|
4239
|
+
*/
|
|
4240
|
+
'react/x-no-component-will-mount'?: Linter.RuleEntry<[]>;
|
|
4241
|
+
/**
|
|
4242
|
+
* Replaces usage of 'componentWillReceiveProps' with 'UNSAFE_componentWillReceiveProps'.
|
|
4243
|
+
* @see https://eslint-react.xyz/docs/rules/no-component-will-receive-props
|
|
4244
|
+
*/
|
|
4245
|
+
'react/x-no-component-will-receive-props'?: Linter.RuleEntry<[]>;
|
|
4246
|
+
/**
|
|
4247
|
+
* Replaces usage of 'componentWillUpdate' with 'UNSAFE_componentWillUpdate'.
|
|
4248
|
+
* @see https://eslint-react.xyz/docs/rules/no-component-will-update
|
|
4249
|
+
*/
|
|
4250
|
+
'react/x-no-component-will-update'?: Linter.RuleEntry<[]>;
|
|
4251
|
+
/**
|
|
4252
|
+
* Replaces usage of '<Context.Provider>' with '<Context>'.
|
|
4253
|
+
* @see https://eslint-react.xyz/docs/rules/no-context-provider
|
|
4254
|
+
*/
|
|
4255
|
+
'react/x-no-context-provider'?: Linter.RuleEntry<[]>;
|
|
4256
|
+
/**
|
|
4257
|
+
* Disallows 'createRef' in function components.
|
|
4258
|
+
* @see https://eslint-react.xyz/docs/rules/no-create-ref
|
|
4259
|
+
*/
|
|
4260
|
+
'react/x-no-create-ref'?: Linter.RuleEntry<[]>;
|
|
4261
|
+
/**
|
|
4262
|
+
* Disallows direct mutation of 'this.state'.
|
|
4263
|
+
* @see https://eslint-react.xyz/docs/rules/no-direct-mutation-state
|
|
4264
|
+
*/
|
|
4265
|
+
'react/x-no-direct-mutation-state'?: Linter.RuleEntry<[]>;
|
|
4266
|
+
/**
|
|
4267
|
+
* Prevents duplicate 'key' props on sibling elements when rendering lists.
|
|
4268
|
+
* @see https://eslint-react.xyz/docs/rules/no-duplicate-key
|
|
4269
|
+
*/
|
|
4270
|
+
'react/x-no-duplicate-key'?: Linter.RuleEntry<[]>;
|
|
4271
|
+
/**
|
|
4272
|
+
* Replaces usage of 'forwardRef' with passing 'ref' as a prop.
|
|
4273
|
+
* @see https://eslint-react.xyz/docs/rules/no-forward-ref
|
|
4274
|
+
*/
|
|
4275
|
+
'react/x-no-forward-ref'?: Linter.RuleEntry<[]>;
|
|
4276
|
+
/**
|
|
4277
|
+
* Prevents implicitly passing the 'children' prop to components.
|
|
4278
|
+
* @see https://eslint-react.xyz/docs/rules/no-implicit-children
|
|
4279
|
+
*/
|
|
4280
|
+
'react/x-no-implicit-children'?: Linter.RuleEntry<[]>;
|
|
4281
|
+
/**
|
|
4282
|
+
* Prevents implicitly passing the 'key' prop to components.
|
|
4283
|
+
* @see https://eslint-react.xyz/docs/rules/no-implicit-key
|
|
4284
|
+
*/
|
|
4285
|
+
'react/x-no-implicit-key'?: Linter.RuleEntry<[]>;
|
|
4286
|
+
/**
|
|
4287
|
+
* Prevents implicitly passing the 'ref' prop to components.
|
|
4288
|
+
* @see https://eslint-react.xyz/docs/rules/no-implicit-ref
|
|
4289
|
+
*/
|
|
4290
|
+
'react/x-no-implicit-ref'?: Linter.RuleEntry<[]>;
|
|
4291
|
+
/**
|
|
4292
|
+
* Prevents problematic leaked values from being rendered.
|
|
4293
|
+
* @see https://eslint-react.xyz/docs/rules/no-leaked-conditional-rendering
|
|
4294
|
+
*/
|
|
4295
|
+
'react/x-no-leaked-conditional-rendering'?: Linter.RuleEntry<[]>;
|
|
4296
|
+
/**
|
|
4297
|
+
* Enforces that all components have a 'displayName' that can be used in DevTools.
|
|
4298
|
+
* @see https://eslint-react.xyz/docs/rules/no-missing-component-display-name
|
|
4299
|
+
*/
|
|
4300
|
+
'react/x-no-missing-component-display-name'?: Linter.RuleEntry<[]>;
|
|
4301
|
+
/**
|
|
4302
|
+
* Enforces that all contexts have a 'displayName' that can be used in DevTools.
|
|
4303
|
+
* @see https://eslint-react.xyz/docs/rules/no-missing-context-display-name
|
|
4304
|
+
*/
|
|
4305
|
+
'react/x-no-missing-context-display-name'?: Linter.RuleEntry<[]>;
|
|
4306
|
+
/**
|
|
4307
|
+
* Disallows missing 'key' on items in list rendering.
|
|
4308
|
+
* @see https://eslint-react.xyz/docs/rules/no-missing-key
|
|
4309
|
+
*/
|
|
4310
|
+
'react/x-no-missing-key'?: Linter.RuleEntry<[]>;
|
|
4311
|
+
/**
|
|
4312
|
+
* Prevents incorrect usage of 'captureOwnerStack'.
|
|
4313
|
+
* @see https://eslint-react.xyz/docs/rules/no-misused-capture-owner-stack
|
|
4314
|
+
*/
|
|
4315
|
+
'react/x-no-misused-capture-owner-stack'?: Linter.RuleEntry<[]>;
|
|
4316
|
+
/**
|
|
4317
|
+
* Disallows nesting component definitions inside other components.
|
|
4318
|
+
* @see https://eslint-react.xyz/docs/rules/no-nested-component-definitions
|
|
4319
|
+
*/
|
|
4320
|
+
'react/x-no-nested-component-definitions'?: Linter.RuleEntry<[]>;
|
|
4321
|
+
/**
|
|
4322
|
+
* Disallows nesting lazy component declarations inside other components or hooks.
|
|
4323
|
+
* @see https://eslint-react.xyz/docs/rules/no-nested-lazy-component-declarations
|
|
4324
|
+
*/
|
|
4325
|
+
'react/x-no-nested-lazy-component-declarations'?: Linter.RuleEntry<[]>;
|
|
4326
|
+
/**
|
|
4327
|
+
* Disallows calling 'this.setState' in 'componentDidMount' outside functions such as callbacks.
|
|
4328
|
+
* @see https://eslint-react.xyz/docs/rules/no-set-state-in-component-did-mount
|
|
4329
|
+
*/
|
|
4330
|
+
'react/x-no-set-state-in-component-did-mount'?: Linter.RuleEntry<[]>;
|
|
4331
|
+
/**
|
|
4332
|
+
* Disallows calling 'this.setState' in 'componentDidUpdate' outside functions such as callbacks.
|
|
4333
|
+
* @see https://eslint-react.xyz/docs/rules/no-set-state-in-component-did-update
|
|
4334
|
+
*/
|
|
4335
|
+
'react/x-no-set-state-in-component-did-update'?: Linter.RuleEntry<[]>;
|
|
4336
|
+
/**
|
|
4337
|
+
* Disallows calling 'this.setState' in 'componentWillUpdate' outside functions such as callbacks.
|
|
4338
|
+
* @see https://eslint-react.xyz/docs/rules/no-set-state-in-component-will-update
|
|
4339
|
+
*/
|
|
4340
|
+
'react/x-no-set-state-in-component-will-update'?: Linter.RuleEntry<[]>;
|
|
4341
|
+
/**
|
|
4342
|
+
* Enforces that a function with the 'use' prefix uses at least one Hook inside it.
|
|
4343
|
+
* @see https://eslint-react.xyz/docs/rules/no-unnecessary-use-prefix
|
|
4344
|
+
*/
|
|
4345
|
+
'react/x-no-unnecessary-use-prefix'?: Linter.RuleEntry<[]>;
|
|
4346
|
+
/**
|
|
4347
|
+
* Warns about the use of 'UNSAFE_componentWillMount' in class components.
|
|
4348
|
+
* @see https://eslint-react.xyz/docs/rules/no-unsafe-component-will-mount
|
|
4349
|
+
*/
|
|
4350
|
+
'react/x-no-unsafe-component-will-mount'?: Linter.RuleEntry<[]>;
|
|
4351
|
+
/**
|
|
4352
|
+
* Warns about the use of 'UNSAFE_componentWillReceiveProps' in class components.
|
|
4353
|
+
* @see https://eslint-react.xyz/docs/rules/no-unsafe-component-will-receive-props
|
|
4354
|
+
*/
|
|
4355
|
+
'react/x-no-unsafe-component-will-receive-props'?: Linter.RuleEntry<[]>;
|
|
4356
|
+
/**
|
|
4357
|
+
* Warns about the use of 'UNSAFE_componentWillUpdate' in class components.
|
|
4358
|
+
* @see https://eslint-react.xyz/docs/rules/no-unsafe-component-will-update
|
|
4359
|
+
*/
|
|
4360
|
+
'react/x-no-unsafe-component-will-update'?: Linter.RuleEntry<[]>;
|
|
4361
|
+
/**
|
|
4362
|
+
* Prevents non-stable values (i.e., object literals) from being used as a value for 'Context.Provider'.
|
|
4363
|
+
* @see https://eslint-react.xyz/docs/rules/no-unstable-context-value
|
|
4364
|
+
*/
|
|
4365
|
+
'react/x-no-unstable-context-value'?: Linter.RuleEntry<[]>;
|
|
4366
|
+
/**
|
|
4367
|
+
* Prevents using referential-type values as default props in object destructuring.
|
|
4368
|
+
* @see https://eslint-react.xyz/docs/rules/no-unstable-default-props
|
|
4369
|
+
*/
|
|
4370
|
+
'react/x-no-unstable-default-props'?: Linter.RuleEntry<ReactXNoUnstableDefaultProps>;
|
|
4371
|
+
/**
|
|
4372
|
+
* Warns about unused class component methods and properties.
|
|
4373
|
+
* @see https://eslint-react.xyz/docs/rules/no-unused-class-component-members
|
|
4374
|
+
*/
|
|
4375
|
+
'react/x-no-unused-class-component-members'?: Linter.RuleEntry<[]>;
|
|
4376
|
+
/**
|
|
4377
|
+
* Warns about component props that are defined but never used.
|
|
4378
|
+
* @see https://eslint-react.xyz/docs/rules/no-unused-props
|
|
4379
|
+
*/
|
|
4380
|
+
'react/x-no-unused-props'?: Linter.RuleEntry<[]>;
|
|
4381
|
+
/**
|
|
4382
|
+
* Replaces usage of 'useContext' with 'use'.
|
|
4383
|
+
* @see https://eslint-react.xyz/docs/rules/no-use-context
|
|
4384
|
+
*/
|
|
4385
|
+
'react/x-no-use-context'?: Linter.RuleEntry<[]>;
|
|
4386
|
+
/**
|
|
4387
|
+
* Validates that components and hooks are pure by checking that they do not call known-impure functions during render.
|
|
4388
|
+
* @see https://eslint-react.xyz/docs/rules/purity
|
|
4389
|
+
*/
|
|
4390
|
+
'react/x-purity'?: Linter.RuleEntry<[]>;
|
|
4391
|
+
/**
|
|
4392
|
+
* Validates correct usage of refs by checking that 'ref.current' is not read or written during render.
|
|
4393
|
+
* @see https://eslint-react.xyz/docs/rules/refs
|
|
4394
|
+
*/
|
|
4395
|
+
'react/x-refs'?: Linter.RuleEntry<[]>;
|
|
4396
|
+
/**
|
|
4397
|
+
* Enforces the Rules of Hooks.
|
|
4398
|
+
* @see https://react.dev/reference/rules/rules-of-hooks
|
|
4399
|
+
*/
|
|
4400
|
+
'react/x-rules-of-hooks'?: Linter.RuleEntry<ReactXRulesOfHooks>;
|
|
4401
|
+
/**
|
|
4402
|
+
* Validates against setting state synchronously in an effect, which can lead to re-renders that degrade performance.
|
|
4403
|
+
* @see https://eslint-react.xyz/docs/rules/set-state-in-effect
|
|
4404
|
+
*/
|
|
4405
|
+
'react/x-set-state-in-effect'?: Linter.RuleEntry<[]>;
|
|
4406
|
+
/**
|
|
4407
|
+
* Validates against unconditionally setting state during render, which can trigger additional renders and potential infinite render loops.
|
|
4408
|
+
* @see https://eslint-react.xyz/docs/rules/set-state-in-render
|
|
4409
|
+
*/
|
|
4410
|
+
'react/x-set-state-in-render'?: Linter.RuleEntry<[]>;
|
|
4411
|
+
/**
|
|
4412
|
+
* Validates that components are static, not recreated every render.
|
|
4413
|
+
* @see https://eslint-react.xyz/docs/rules/static-components
|
|
4414
|
+
*/
|
|
4415
|
+
'react/x-static-components'?: Linter.RuleEntry<[]>;
|
|
4416
|
+
/**
|
|
4417
|
+
* Validates against syntax that React Compiler does not support.
|
|
4418
|
+
* @see https://eslint-react.xyz/docs/rules/unsupported-syntax
|
|
4419
|
+
*/
|
|
4420
|
+
'react/x-unsupported-syntax'?: Linter.RuleEntry<[]>;
|
|
4421
|
+
/**
|
|
4422
|
+
* Validates that 'useMemo' is called with a callback that returns a value.
|
|
4423
|
+
* @see https://eslint-react.xyz/docs/rules/use-memo
|
|
4424
|
+
*/
|
|
4425
|
+
'react/x-use-memo'?: Linter.RuleEntry<[]>;
|
|
4426
|
+
/**
|
|
4427
|
+
* Enforces correct usage of 'useState', including destructuring, symmetric naming of the value and setter, and wrapping expensive initializers in a lazy initializer function.
|
|
4428
|
+
* @see https://eslint-react.xyz/docs/rules/use-state
|
|
4429
|
+
*/
|
|
4430
|
+
'react/x-use-state'?: Linter.RuleEntry<ReactXUseState>;
|
|
4206
4431
|
/**
|
|
4207
4432
|
* disallow confusing quantifiers
|
|
4208
4433
|
* @see https://ota-meshi.github.io/eslint-plugin-regexp/rules/confusing-quantifier.html
|
|
@@ -14695,31 +14920,29 @@ type Quotes = [] | [("single" | "double" | "backtick")] | [("single" | "double"
|
|
|
14695
14920
|
avoidEscape?: boolean;
|
|
14696
14921
|
allowTemplateLiterals?: boolean;
|
|
14697
14922
|
})]; // ----- radix -----
|
|
14698
|
-
type Radix = [] | [("always" | "as-needed")]; // ----- react-
|
|
14699
|
-
type ReactDomNoUnknownProperty = [] | [{
|
|
14700
|
-
ignore?: string[];
|
|
14701
|
-
requireDataLowercase?: boolean;
|
|
14702
|
-
}]; // ----- react-refresh/only-export-components -----
|
|
14923
|
+
type Radix = [] | [("always" | "as-needed")]; // ----- react-refresh/only-export-components -----
|
|
14703
14924
|
type ReactRefreshOnlyExportComponents = [] | [{
|
|
14704
14925
|
extraHOCs?: string[];
|
|
14705
14926
|
allowExportNames?: string[];
|
|
14706
14927
|
allowConstantExport?: boolean;
|
|
14707
14928
|
checkJS?: boolean;
|
|
14929
|
+
}]; // ----- react/dom-no-unknown-property -----
|
|
14930
|
+
type ReactDomNoUnknownProperty = [] | [{
|
|
14931
|
+
ignore?: string[];
|
|
14932
|
+
requireDataLowercase?: boolean;
|
|
14708
14933
|
}]; // ----- react/exhaustive-deps -----
|
|
14709
14934
|
type ReactExhaustiveDeps = [] | [{
|
|
14710
14935
|
additionalHooks?: string;
|
|
14711
14936
|
enableDangerousAutofixThisMayCauseInfiniteLoops?: boolean;
|
|
14712
14937
|
experimental_autoDependenciesHooks?: string[];
|
|
14713
14938
|
requireExplicitEffectDeps?: boolean;
|
|
14714
|
-
}]; // ----- react/jsx-
|
|
14715
|
-
type
|
|
14716
|
-
type ReactJsxShorthandFragment = [] | [(-1 | 1)]; // ----- react/no-unstable-default-props -----
|
|
14717
|
-
type ReactNoUnstableDefaultProps = [] | [{
|
|
14718
|
-
safeDefaultProps?: string[];
|
|
14719
|
-
}]; // ----- react/no-useless-fragment -----
|
|
14720
|
-
type ReactNoUselessFragment = [] | [{
|
|
14939
|
+
}]; // ----- react/jsx-no-useless-fragment -----
|
|
14940
|
+
type ReactJsxNoUselessFragment = [] | [{
|
|
14721
14941
|
allowEmptyFragment?: boolean;
|
|
14722
14942
|
allowExpressions?: boolean;
|
|
14943
|
+
}]; // ----- react/no-unstable-default-props -----
|
|
14944
|
+
type ReactNoUnstableDefaultProps = [] | [{
|
|
14945
|
+
safeDefaultProps?: string[];
|
|
14723
14946
|
}]; // ----- react/rules-of-hooks -----
|
|
14724
14947
|
type ReactRulesOfHooks = [] | [{
|
|
14725
14948
|
additionalHooks?: string;
|
|
@@ -14728,6 +14951,23 @@ type ReactUseState = [] | [{
|
|
|
14728
14951
|
enforceAssignment?: boolean;
|
|
14729
14952
|
enforceLazyInitialization?: boolean;
|
|
14730
14953
|
enforceSetterName?: boolean;
|
|
14954
|
+
}]; // ----- react/x-exhaustive-deps -----
|
|
14955
|
+
type ReactXExhaustiveDeps = [] | [{
|
|
14956
|
+
additionalHooks?: string;
|
|
14957
|
+
enableDangerousAutofixThisMayCauseInfiniteLoops?: boolean;
|
|
14958
|
+
experimental_autoDependenciesHooks?: string[];
|
|
14959
|
+
requireExplicitEffectDeps?: boolean;
|
|
14960
|
+
}]; // ----- react/x-no-unstable-default-props -----
|
|
14961
|
+
type ReactXNoUnstableDefaultProps = [] | [{
|
|
14962
|
+
safeDefaultProps?: string[];
|
|
14963
|
+
}]; // ----- react/x-rules-of-hooks -----
|
|
14964
|
+
type ReactXRulesOfHooks = [] | [{
|
|
14965
|
+
additionalHooks?: string;
|
|
14966
|
+
}]; // ----- react/x-use-state -----
|
|
14967
|
+
type ReactXUseState = [] | [{
|
|
14968
|
+
enforceAssignment?: boolean;
|
|
14969
|
+
enforceLazyInitialization?: boolean;
|
|
14970
|
+
enforceSetterName?: boolean;
|
|
14731
14971
|
}]; // ----- regexp/hexadecimal-escape -----
|
|
14732
14972
|
type RegexpHexadecimalEscape = [] | [("always" | "never")]; // ----- regexp/letter-case -----
|
|
14733
14973
|
type RegexpLetterCase = [] | [{
|
|
@@ -19614,10 +19854,6 @@ interface OptionsConfig extends OptionsComponentExts, OptionsProjectType {
|
|
|
19614
19854
|
//#region src/factory.d.ts
|
|
19615
19855
|
declare const defaultPluginRenaming: {
|
|
19616
19856
|
'@eslint-react': string;
|
|
19617
|
-
'@eslint-react/dom': string;
|
|
19618
|
-
'@eslint-react/naming-convention': string;
|
|
19619
|
-
'@eslint-react/rsc': string;
|
|
19620
|
-
'@eslint-react/web-api': string;
|
|
19621
19857
|
'@next/next': string;
|
|
19622
19858
|
'@stylistic': string;
|
|
19623
19859
|
'@typescript-eslint': string;
|
package/dist/index.mjs
CHANGED
|
@@ -1366,17 +1366,12 @@ async function react(options = {}) {
|
|
|
1366
1366
|
const isUsingRemix = RemixPackages.some((i) => isPackageExists(i));
|
|
1367
1367
|
const isUsingReactRouter = ReactRouterPackages.some((i) => isPackageExists(i));
|
|
1368
1368
|
const isUsingNext = NextJsPackages.some((i) => isPackageExists(i));
|
|
1369
|
-
const plugins = pluginReact.configs.all.plugins;
|
|
1370
1369
|
return [
|
|
1371
1370
|
{
|
|
1372
1371
|
name: "antfu/react/setup",
|
|
1373
1372
|
plugins: {
|
|
1374
|
-
"react": plugins["@eslint-react"],
|
|
1375
|
-
"react-
|
|
1376
|
-
"react-naming-convention": plugins["@eslint-react/naming-convention"],
|
|
1377
|
-
"react-refresh": pluginReactRefresh,
|
|
1378
|
-
"react-rsc": plugins["@eslint-react/rsc"],
|
|
1379
|
-
"react-web-api": plugins["@eslint-react/web-api"]
|
|
1373
|
+
"react": pluginReact.configs.all.plugins["@eslint-react"],
|
|
1374
|
+
"react-refresh": pluginReactRefresh
|
|
1380
1375
|
}
|
|
1381
1376
|
},
|
|
1382
1377
|
{
|
|
@@ -1388,7 +1383,6 @@ async function react(options = {}) {
|
|
|
1388
1383
|
name: "antfu/react/rules",
|
|
1389
1384
|
rules: {
|
|
1390
1385
|
...pluginReact.configs.recommended.rules,
|
|
1391
|
-
"react/prefer-namespace-import": "error",
|
|
1392
1386
|
"react-refresh/only-export-components": ["error", {
|
|
1393
1387
|
allowConstantExport: isAllowConstantExport,
|
|
1394
1388
|
allowExportNames: [...isUsingNext ? [
|
|
@@ -1425,8 +1419,8 @@ async function react(options = {}) {
|
|
|
1425
1419
|
files: filesTypeAware,
|
|
1426
1420
|
name: "antfu/react/typescript",
|
|
1427
1421
|
rules: {
|
|
1428
|
-
"react-
|
|
1429
|
-
"react-
|
|
1422
|
+
"react/dom-no-string-style-prop": "off",
|
|
1423
|
+
"react/dom-no-unknown-property": "off"
|
|
1430
1424
|
}
|
|
1431
1425
|
},
|
|
1432
1426
|
...isTypeAware ? [{
|
|
@@ -2351,10 +2345,6 @@ const VuePackages = [
|
|
|
2351
2345
|
];
|
|
2352
2346
|
const defaultPluginRenaming = {
|
|
2353
2347
|
"@eslint-react": "react",
|
|
2354
|
-
"@eslint-react/dom": "react-dom",
|
|
2355
|
-
"@eslint-react/naming-convention": "react-naming-convention",
|
|
2356
|
-
"@eslint-react/rsc": "react-rsc",
|
|
2357
|
-
"@eslint-react/web-api": "react-web-api",
|
|
2358
2348
|
"@next/next": "next",
|
|
2359
2349
|
"@stylistic": "style",
|
|
2360
2350
|
"@typescript-eslint": "ts",
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antfu/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "9.0.0",
|
|
5
5
|
"description": "Anthony's ESLint config",
|
|
6
6
|
"author": "Anthony Fu <anthonyfu117@hotmail.com> (https://github.com/antfu/)",
|
|
7
7
|
"license": "MIT",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"@angular-eslint/eslint-plugin": "^21.1.0",
|
|
33
33
|
"@angular-eslint/eslint-plugin-template": "^21.1.0",
|
|
34
34
|
"@angular-eslint/template-parser": "^21.1.0",
|
|
35
|
-
"@eslint-react/eslint-plugin": "^
|
|
35
|
+
"@eslint-react/eslint-plugin": "^5.6.0",
|
|
36
36
|
"@next/eslint-plugin-next": ">=15.0.0",
|
|
37
37
|
"@prettier/plugin-xml": "^3.4.1",
|
|
38
38
|
"@unocss/eslint-plugin": ">=0.50.0",
|
|
@@ -149,7 +149,7 @@
|
|
|
149
149
|
"@angular-eslint/template-parser": "^21.3.1",
|
|
150
150
|
"@angular/core": "^21.2.12",
|
|
151
151
|
"@antfu/ni": "^30.1.0",
|
|
152
|
-
"@eslint-react/eslint-plugin": "^
|
|
152
|
+
"@eslint-react/eslint-plugin": "^5.6.0",
|
|
153
153
|
"@eslint/config-inspector": "^2.0.1",
|
|
154
154
|
"@next/eslint-plugin-next": "^16.2.6",
|
|
155
155
|
"@prettier/plugin-xml": "^3.4.2",
|
|
@@ -188,7 +188,7 @@
|
|
|
188
188
|
"typescript": "^6.0.3",
|
|
189
189
|
"vitest": "^4.1.5",
|
|
190
190
|
"vue": "^3.5.34",
|
|
191
|
-
"@antfu/eslint-config": "
|
|
191
|
+
"@antfu/eslint-config": "9.0.0"
|
|
192
192
|
},
|
|
193
193
|
"resolutions": {
|
|
194
194
|
"@eslint-community/eslint-utils": "catalog:peer",
|