@luxass/eslint-config 7.3.0 → 7.4.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/README.md +1 -2
- package/dist/index.d.mts +94 -337
- package/dist/index.mjs +16 -95
- package/package.json +2 -7
package/README.md
CHANGED
|
@@ -271,7 +271,6 @@ Since flat config requires us to explicitly provide the plugin names (instead of
|
|
|
271
271
|
| `test/*` | `vitest/*` | [@vitest/eslint-plugin](https://github.com/vitest-dev/eslint-plugin-vitest) |
|
|
272
272
|
| `react/*` | `@eslint-react/*` | [@eslint-react/eslint-plugin ](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin) |
|
|
273
273
|
| `react-dom/*` | `@eslint-react/dom/*` | [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) |
|
|
274
|
-
| `react-hooks-extra/*` | `@eslint-react/hooks-extra/*` | [eslint-plugin-react-hooks-extra](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-hooks-extra) |
|
|
275
274
|
| `react-naming-convention/*` | `@eslint-react/naming-convention/*` | [eslint-plugin-react-naming-convention](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-naming-convention) |
|
|
276
275
|
|
|
277
276
|
When you want to override rules, or disable them inline, you need to update to the new prefix:
|
|
@@ -432,7 +431,7 @@ export default luxass({
|
|
|
432
431
|
Running `npx eslint` should prompt you to install the required dependencies, otherwise, you can install them manually:
|
|
433
432
|
|
|
434
433
|
```bash
|
|
435
|
-
npm i -D @eslint-react/eslint-plugin eslint-plugin-react-
|
|
434
|
+
npm i -D @eslint-react/eslint-plugin eslint-plugin-react-refresh
|
|
436
435
|
```
|
|
437
436
|
|
|
438
437
|
#### Astro
|
package/dist/index.d.mts
CHANGED
|
@@ -450,10 +450,6 @@ interface ReactOptions {
|
|
|
450
450
|
* @default ['**\/*.md\/**', '**\/*.astro/*.ts']
|
|
451
451
|
*/
|
|
452
452
|
ignoresTypeAware?: string[];
|
|
453
|
-
/**
|
|
454
|
-
* Enable rules that require React Compiler.
|
|
455
|
-
*/
|
|
456
|
-
reactCompiler?: boolean;
|
|
457
453
|
}
|
|
458
454
|
declare function react(options?: ReactOptions): Promise<TypedFlatConfigItem[]>;
|
|
459
455
|
//#endregion
|
|
@@ -3763,149 +3759,11 @@ interface RuleOptions {
|
|
|
3763
3759
|
* @see https://eslint-react.xyz/docs/rules/dom-prefer-namespace-import
|
|
3764
3760
|
*/
|
|
3765
3761
|
'react-dom/prefer-namespace-import'?: Linter.RuleEntry<[]>;
|
|
3766
|
-
/**
|
|
3767
|
-
* Disallows direct calls to the ['set' function](https://react.dev/reference/react/useState#setstate) of 'useState' in 'useEffect'.
|
|
3768
|
-
* @see https://eslint-react.xyz/docs/rules/hooks-extra-no-direct-set-state-in-use-effect
|
|
3769
|
-
*/
|
|
3770
|
-
'react-hooks-extra/no-direct-set-state-in-use-effect'?: Linter.RuleEntry<[]>;
|
|
3771
|
-
/**
|
|
3772
|
-
* Verifies that automatic effect dependencies are compiled if opted-in
|
|
3773
|
-
*/
|
|
3774
|
-
'react-hooks/automatic-effect-dependencies'?: Linter.RuleEntry<ReactHooksAutomaticEffectDependencies>;
|
|
3775
|
-
/**
|
|
3776
|
-
* Validates against calling capitalized functions/methods instead of using JSX
|
|
3777
|
-
*/
|
|
3778
|
-
'react-hooks/capitalized-calls'?: Linter.RuleEntry<ReactHooksCapitalizedCalls>;
|
|
3779
|
-
/**
|
|
3780
|
-
* Validates against higher order functions defining nested components or hooks. Components and hooks should be defined at the module level
|
|
3781
|
-
*/
|
|
3782
|
-
'react-hooks/component-hook-factories'?: Linter.RuleEntry<ReactHooksComponentHookFactories>;
|
|
3783
|
-
/**
|
|
3784
|
-
* Validates the compiler configuration options
|
|
3785
|
-
*/
|
|
3786
|
-
'react-hooks/config'?: Linter.RuleEntry<ReactHooksConfig>;
|
|
3787
|
-
/**
|
|
3788
|
-
* Validates usage of error boundaries instead of try/catch for errors in child components
|
|
3789
|
-
*/
|
|
3790
|
-
'react-hooks/error-boundaries'?: Linter.RuleEntry<ReactHooksErrorBoundaries>;
|
|
3791
|
-
/**
|
|
3792
|
-
* verifies the list of dependencies for Hooks like useEffect and similar
|
|
3793
|
-
* @see https://github.com/facebook/react/issues/14920
|
|
3794
|
-
*/
|
|
3795
|
-
'react-hooks/exhaustive-deps'?: Linter.RuleEntry<ReactHooksExhaustiveDeps>;
|
|
3796
|
-
/**
|
|
3797
|
-
* Validates usage of fbt
|
|
3798
|
-
*/
|
|
3799
|
-
'react-hooks/fbt'?: Linter.RuleEntry<ReactHooksFbt>;
|
|
3800
|
-
/**
|
|
3801
|
-
* Validates usage of `fire`
|
|
3802
|
-
*/
|
|
3803
|
-
'react-hooks/fire'?: Linter.RuleEntry<ReactHooksFire>;
|
|
3804
|
-
/**
|
|
3805
|
-
* Validates configuration of [gating mode](https://react.dev/reference/react-compiler/gating)
|
|
3806
|
-
*/
|
|
3807
|
-
'react-hooks/gating'?: Linter.RuleEntry<ReactHooksGating>;
|
|
3808
|
-
/**
|
|
3809
|
-
* Validates against assignment/mutation of globals during render, part of ensuring that [side effects must render outside of render](https://react.dev/reference/rules/components-and-hooks-must-be-pure#side-effects-must-run-outside-of-render)
|
|
3810
|
-
*/
|
|
3811
|
-
'react-hooks/globals'?: Linter.RuleEntry<ReactHooksGlobals>;
|
|
3812
|
-
/**
|
|
3813
|
-
* Validates the rules of hooks
|
|
3814
|
-
*/
|
|
3815
|
-
'react-hooks/hooks'?: Linter.RuleEntry<ReactHooksHooks>;
|
|
3816
|
-
/**
|
|
3817
|
-
* Validates against mutating props, state, and other values that [are immutable](https://react.dev/reference/rules/components-and-hooks-must-be-pure#props-and-state-are-immutable)
|
|
3818
|
-
*/
|
|
3819
|
-
'react-hooks/immutability'?: Linter.RuleEntry<ReactHooksImmutability>;
|
|
3820
|
-
/**
|
|
3821
|
-
* Validates against usage of libraries which are incompatible with memoization (manual or automatic)
|
|
3822
|
-
*/
|
|
3823
|
-
'react-hooks/incompatible-library'?: Linter.RuleEntry<ReactHooksIncompatibleLibrary>;
|
|
3824
|
-
/**
|
|
3825
|
-
* Internal invariants
|
|
3826
|
-
*/
|
|
3827
|
-
'react-hooks/invariant'?: Linter.RuleEntry<ReactHooksInvariant>;
|
|
3828
|
-
/**
|
|
3829
|
-
* Validates that effect dependencies are memoized
|
|
3830
|
-
*/
|
|
3831
|
-
'react-hooks/memoized-effect-dependencies'?: Linter.RuleEntry<ReactHooksMemoizedEffectDependencies>;
|
|
3832
|
-
/**
|
|
3833
|
-
* Validates against deriving values from state in an effect
|
|
3834
|
-
*/
|
|
3835
|
-
'react-hooks/no-deriving-state-in-effects'?: Linter.RuleEntry<ReactHooksNoDerivingStateInEffects>;
|
|
3836
|
-
/**
|
|
3837
|
-
* Validates that existing manual memoized is preserved by the compiler. React Compiler will only compile components and hooks if its inference [matches or exceeds the existing manual memoization](https://react.dev/learn/react-compiler/introduction#what-should-i-do-about-usememo-usecallback-and-reactmemo)
|
|
3838
|
-
*/
|
|
3839
|
-
'react-hooks/preserve-manual-memoization'?: Linter.RuleEntry<ReactHooksPreserveManualMemoization>;
|
|
3840
|
-
/**
|
|
3841
|
-
* Validates that [components/hooks are pure](https://react.dev/reference/rules/components-and-hooks-must-be-pure) by checking that they do not call known-impure functions
|
|
3842
|
-
*/
|
|
3843
|
-
'react-hooks/purity'?: Linter.RuleEntry<ReactHooksPurity>;
|
|
3844
|
-
/**
|
|
3845
|
-
* Validates correct usage of refs, not reading/writing during render. See the "pitfalls" section in [`useRef()` usage](https://react.dev/reference/react/useRef#usage)
|
|
3846
|
-
*/
|
|
3847
|
-
'react-hooks/refs'?: Linter.RuleEntry<ReactHooksRefs>;
|
|
3848
|
-
/**
|
|
3849
|
-
* Validates against suppression of other rules
|
|
3850
|
-
*/
|
|
3851
|
-
'react-hooks/rule-suppression'?: Linter.RuleEntry<ReactHooksRuleSuppression>;
|
|
3852
|
-
/**
|
|
3853
|
-
* enforces the Rules of Hooks
|
|
3854
|
-
* @see https://react.dev/reference/rules/rules-of-hooks
|
|
3855
|
-
*/
|
|
3856
|
-
'react-hooks/rules-of-hooks'?: Linter.RuleEntry<ReactHooksRulesOfHooks>;
|
|
3857
|
-
/**
|
|
3858
|
-
* Validates against calling setState synchronously in an effect, which can lead to re-renders that degrade performance
|
|
3859
|
-
*/
|
|
3860
|
-
'react-hooks/set-state-in-effect'?: Linter.RuleEntry<ReactHooksSetStateInEffect>;
|
|
3861
|
-
/**
|
|
3862
|
-
* Validates against setting state during render, which can trigger additional renders and potential infinite render loops
|
|
3863
|
-
*/
|
|
3864
|
-
'react-hooks/set-state-in-render'?: Linter.RuleEntry<ReactHooksSetStateInRender>;
|
|
3865
|
-
/**
|
|
3866
|
-
* Validates that components are static, not recreated every render. Components that are recreated dynamically can reset state and trigger excessive re-rendering
|
|
3867
|
-
*/
|
|
3868
|
-
'react-hooks/static-components'?: Linter.RuleEntry<ReactHooksStaticComponents>;
|
|
3869
|
-
/**
|
|
3870
|
-
* Validates against invalid syntax
|
|
3871
|
-
*/
|
|
3872
|
-
'react-hooks/syntax'?: Linter.RuleEntry<ReactHooksSyntax>;
|
|
3873
|
-
/**
|
|
3874
|
-
* Unimplemented features
|
|
3875
|
-
*/
|
|
3876
|
-
'react-hooks/todo'?: Linter.RuleEntry<ReactHooksTodo>;
|
|
3877
|
-
/**
|
|
3878
|
-
* Validates against syntax that we do not plan to support in React Compiler
|
|
3879
|
-
*/
|
|
3880
|
-
'react-hooks/unsupported-syntax'?: Linter.RuleEntry<ReactHooksUnsupportedSyntax>;
|
|
3881
|
-
/**
|
|
3882
|
-
* Validates usage of the useMemo() hook against common mistakes. See [`useMemo()` docs](https://react.dev/reference/react/useMemo) for more information.
|
|
3883
|
-
*/
|
|
3884
|
-
'react-hooks/use-memo'?: Linter.RuleEntry<ReactHooksUseMemo>;
|
|
3885
|
-
/**
|
|
3886
|
-
* Validates that useMemos always return a value and that the result of the useMemo is used by the component/hook. See [`useMemo()` docs](https://react.dev/reference/react/useMemo) for more information.
|
|
3887
|
-
*/
|
|
3888
|
-
'react-hooks/void-use-memo'?: Linter.RuleEntry<ReactHooksVoidUseMemo>;
|
|
3889
|
-
/**
|
|
3890
|
-
* Enforces naming conventions for components.
|
|
3891
|
-
* @see https://eslint-react.xyz/docs/rules/naming-convention-component-name
|
|
3892
|
-
*/
|
|
3893
|
-
'react-naming-convention/component-name'?: Linter.RuleEntry<ReactNamingConventionComponentName>;
|
|
3894
3762
|
/**
|
|
3895
3763
|
* Enforces the context name to be a valid component name with the suffix 'Context'.
|
|
3896
3764
|
* @see https://eslint-react.xyz/docs/rules/naming-convention-context-name
|
|
3897
3765
|
*/
|
|
3898
3766
|
'react-naming-convention/context-name'?: Linter.RuleEntry<[]>;
|
|
3899
|
-
/**
|
|
3900
|
-
* Enforces consistent file-naming conventions.
|
|
3901
|
-
* @see https://eslint-react.xyz/docs/rules/naming-convention-filename
|
|
3902
|
-
*/
|
|
3903
|
-
'react-naming-convention/filename'?: Linter.RuleEntry<ReactNamingConventionFilename>;
|
|
3904
|
-
/**
|
|
3905
|
-
* Enforces consistent use of the JSX file extension.
|
|
3906
|
-
* @see https://eslint-react.xyz/docs/rules/naming-convention-filename-extension
|
|
3907
|
-
*/
|
|
3908
|
-
'react-naming-convention/filename-extension'?: Linter.RuleEntry<ReactNamingConventionFilenameExtension>;
|
|
3909
3767
|
/**
|
|
3910
3768
|
* Enforces identifier names assigned from 'useId' calls to be either 'id' or end with 'Id'.
|
|
3911
3769
|
* @see https://eslint-react.xyz/docs/rules/naming-convention-id-name
|
|
@@ -3916,14 +3774,9 @@ interface RuleOptions {
|
|
|
3916
3774
|
* @see https://eslint-react.xyz/docs/rules/naming-convention-ref-name
|
|
3917
3775
|
*/
|
|
3918
3776
|
'react-naming-convention/ref-name'?: Linter.RuleEntry<[]>;
|
|
3919
|
-
/**
|
|
3920
|
-
* Enforces destructuring and symmetric naming of the 'useState' hook value and setter.
|
|
3921
|
-
* @see https://eslint-react.xyz/docs/rules/naming-convention-use-state
|
|
3922
|
-
*/
|
|
3923
|
-
'react-naming-convention/use-state'?: Linter.RuleEntry<ReactNamingConventionUseState>;
|
|
3924
3777
|
'react-refresh/only-export-components'?: Linter.RuleEntry<ReactRefreshOnlyExportComponents>;
|
|
3925
3778
|
/**
|
|
3926
|
-
*
|
|
3779
|
+
* Validates and transforms React Client/Server Function definitions.
|
|
3927
3780
|
* @see https://eslint-react.xyz/docs/rules/function-definition
|
|
3928
3781
|
*/
|
|
3929
3782
|
'react-rsc/function-definition'?: Linter.RuleEntry<[]>;
|
|
@@ -3947,6 +3800,26 @@ interface RuleOptions {
|
|
|
3947
3800
|
* @see https://eslint-react.xyz/docs/rules/web-api-no-leaked-timeout
|
|
3948
3801
|
*/
|
|
3949
3802
|
'react-web-api/no-leaked-timeout'?: Linter.RuleEntry<[]>;
|
|
3803
|
+
/**
|
|
3804
|
+
* Disallows higher order functions that define components or hooks inside them.
|
|
3805
|
+
* @see https://eslint-react.xyz/docs/rules/component-hook-factories
|
|
3806
|
+
*/
|
|
3807
|
+
'react/component-hook-factories'?: Linter.RuleEntry<[]>;
|
|
3808
|
+
/**
|
|
3809
|
+
* Validates usage of Error Boundaries instead of try/catch for errors in child components.
|
|
3810
|
+
* @see https://eslint-react.xyz/docs/rules/error-boundaries
|
|
3811
|
+
*/
|
|
3812
|
+
'react/error-boundaries'?: Linter.RuleEntry<[]>;
|
|
3813
|
+
/**
|
|
3814
|
+
* Verifies the list of dependencies for Hooks like 'useEffect' and similar.
|
|
3815
|
+
* @see https://github.com/facebook/react/issues/14920
|
|
3816
|
+
*/
|
|
3817
|
+
'react/exhaustive-deps'?: Linter.RuleEntry<ReactExhaustiveDeps>;
|
|
3818
|
+
/**
|
|
3819
|
+
* Validates against mutating props, state, and other values that are immutable.
|
|
3820
|
+
* @see https://eslint-react.xyz/docs/rules/immutability
|
|
3821
|
+
*/
|
|
3822
|
+
'react/immutability'?: Linter.RuleEntry<[]>;
|
|
3950
3823
|
/**
|
|
3951
3824
|
* Prevents unintentional '$' sign before expression.
|
|
3952
3825
|
* @see https://eslint-react.xyz/docs/rules/jsx-dollar
|
|
@@ -3958,25 +3831,10 @@ interface RuleOptions {
|
|
|
3958
3831
|
*/
|
|
3959
3832
|
'react/jsx-key-before-spread'?: Linter.RuleEntry<[]>;
|
|
3960
3833
|
/**
|
|
3961
|
-
* Prevents comment strings (
|
|
3834
|
+
* Prevents comment strings (ex: beginning with '//' or '/*') from being accidentally inserted into a JSX element's text nodes.
|
|
3962
3835
|
* @see https://eslint-react.xyz/docs/rules/jsx-no-comment-textnodes
|
|
3963
3836
|
*/
|
|
3964
3837
|
'react/jsx-no-comment-textnodes'?: Linter.RuleEntry<[]>;
|
|
3965
|
-
/**
|
|
3966
|
-
* Disallows duplicate props in JSX elements.
|
|
3967
|
-
* @see https://eslint-react.xyz/docs/rules/jsx-no-duplicate-props
|
|
3968
|
-
*/
|
|
3969
|
-
'react/jsx-no-duplicate-props'?: Linter.RuleEntry<[]>;
|
|
3970
|
-
/**
|
|
3971
|
-
* Disallows immediately-invoked function expressions in JSX.
|
|
3972
|
-
* @see https://eslint-react.xyz/docs/rules/jsx-no-iife
|
|
3973
|
-
*/
|
|
3974
|
-
'react/jsx-no-iife'?: Linter.RuleEntry<[]>;
|
|
3975
|
-
/**
|
|
3976
|
-
* Prevents using variables in JSX that are not defined in the scope.
|
|
3977
|
-
* @see https://eslint-react.xyz/docs/rules/jsx-no-undef
|
|
3978
|
-
*/
|
|
3979
|
-
'react/jsx-no-undef'?: Linter.RuleEntry<[]>;
|
|
3980
3838
|
/**
|
|
3981
3839
|
* Enforces shorthand syntax for boolean props.
|
|
3982
3840
|
* @see https://eslint-react.xyz/docs/rules/jsx-shorthand-boolean
|
|
@@ -3987,16 +3845,6 @@ interface RuleOptions {
|
|
|
3987
3845
|
* @see https://eslint-react.xyz/docs/rules/jsx-shorthand-fragment
|
|
3988
3846
|
*/
|
|
3989
3847
|
'react/jsx-shorthand-fragment'?: Linter.RuleEntry<ReactJsxShorthandFragment>;
|
|
3990
|
-
/**
|
|
3991
|
-
* Marks React variables as used when JSX is present.
|
|
3992
|
-
* @see https://eslint-react.xyz/docs/rules/jsx-uses-react
|
|
3993
|
-
*/
|
|
3994
|
-
'react/jsx-uses-react'?: Linter.RuleEntry<[]>;
|
|
3995
|
-
/**
|
|
3996
|
-
* Marks JSX element variables as used.
|
|
3997
|
-
* @see https://eslint-react.xyz/docs/rules/jsx-uses-vars
|
|
3998
|
-
*/
|
|
3999
|
-
'react/jsx-uses-vars'?: Linter.RuleEntry<[]>;
|
|
4000
3848
|
/**
|
|
4001
3849
|
* Disallows accessing 'this.state' inside 'setState' calls.
|
|
4002
3850
|
* @see https://eslint-react.xyz/docs/rules/no-access-state-in-setstate
|
|
@@ -4072,11 +3920,6 @@ interface RuleOptions {
|
|
|
4072
3920
|
* @see https://eslint-react.xyz/docs/rules/no-create-ref
|
|
4073
3921
|
*/
|
|
4074
3922
|
'react/no-create-ref'?: Linter.RuleEntry<[]>;
|
|
4075
|
-
/**
|
|
4076
|
-
* Disallows the 'defaultProps' property in favor of ES6 default parameters.
|
|
4077
|
-
* @see https://eslint-react.xyz/docs/rules/no-default-props
|
|
4078
|
-
*/
|
|
4079
|
-
'react/no-default-props'?: Linter.RuleEntry<[]>;
|
|
4080
3923
|
/**
|
|
4081
3924
|
* Disallows direct mutation of 'this.state'.
|
|
4082
3925
|
* @see https://eslint-react.xyz/docs/rules/no-direct-mutation-state
|
|
@@ -4087,22 +3930,26 @@ interface RuleOptions {
|
|
|
4087
3930
|
* @see https://eslint-react.xyz/docs/rules/no-duplicate-key
|
|
4088
3931
|
*/
|
|
4089
3932
|
'react/no-duplicate-key'?: Linter.RuleEntry<[]>;
|
|
4090
|
-
/**
|
|
4091
|
-
* Disallows certain props on components.
|
|
4092
|
-
* @see https://eslint-react.xyz/docs/rules/no-forbidden-props
|
|
4093
|
-
* @deprecated
|
|
4094
|
-
*/
|
|
4095
|
-
'react/no-forbidden-props'?: Linter.RuleEntry<ReactNoForbiddenProps>;
|
|
4096
3933
|
/**
|
|
4097
3934
|
* Replaces usage of 'forwardRef' with passing 'ref' as a prop.
|
|
4098
3935
|
* @see https://eslint-react.xyz/docs/rules/no-forward-ref
|
|
4099
3936
|
*/
|
|
4100
3937
|
'react/no-forward-ref'?: Linter.RuleEntry<[]>;
|
|
3938
|
+
/**
|
|
3939
|
+
* Prevents implicitly passing the 'children' prop to components.
|
|
3940
|
+
* @see https://eslint-react.xyz/docs/rules/no-implicit-children
|
|
3941
|
+
*/
|
|
3942
|
+
'react/no-implicit-children'?: Linter.RuleEntry<[]>;
|
|
4101
3943
|
/**
|
|
4102
3944
|
* Prevents implicitly passing the 'key' prop to components.
|
|
4103
3945
|
* @see https://eslint-react.xyz/docs/rules/no-implicit-key
|
|
4104
3946
|
*/
|
|
4105
3947
|
'react/no-implicit-key'?: Linter.RuleEntry<[]>;
|
|
3948
|
+
/**
|
|
3949
|
+
* Prevents implicitly passing the 'ref' prop to components.
|
|
3950
|
+
* @see https://eslint-react.xyz/docs/rules/no-implicit-ref
|
|
3951
|
+
*/
|
|
3952
|
+
'react/no-implicit-ref'?: Linter.RuleEntry<[]>;
|
|
4106
3953
|
/**
|
|
4107
3954
|
* Prevents problematic leaked values from being rendered.
|
|
4108
3955
|
* @see https://eslint-react.xyz/docs/rules/no-leaked-conditional-rendering
|
|
@@ -4138,11 +3985,6 @@ interface RuleOptions {
|
|
|
4138
3985
|
* @see https://eslint-react.xyz/docs/rules/no-nested-lazy-component-declarations
|
|
4139
3986
|
*/
|
|
4140
3987
|
'react/no-nested-lazy-component-declarations'?: Linter.RuleEntry<[]>;
|
|
4141
|
-
/**
|
|
4142
|
-
* Disallows 'propTypes' in favor of TypeScript or another type-checking solution.
|
|
4143
|
-
* @see https://eslint-react.xyz/docs/rules/no-prop-types
|
|
4144
|
-
*/
|
|
4145
|
-
'react/no-prop-types'?: Linter.RuleEntry<[]>;
|
|
4146
3988
|
/**
|
|
4147
3989
|
* Disallows 'shouldComponentUpdate' when extending 'React.PureComponent'.
|
|
4148
3990
|
* @see https://eslint-react.xyz/docs/rules/no-redundant-should-component-update
|
|
@@ -4163,16 +4005,6 @@ interface RuleOptions {
|
|
|
4163
4005
|
* @see https://eslint-react.xyz/docs/rules/no-set-state-in-component-will-update
|
|
4164
4006
|
*/
|
|
4165
4007
|
'react/no-set-state-in-component-will-update'?: Linter.RuleEntry<[]>;
|
|
4166
|
-
/**
|
|
4167
|
-
* Replaces string refs with callback refs.
|
|
4168
|
-
* @see https://eslint-react.xyz/docs/rules/no-string-refs
|
|
4169
|
-
*/
|
|
4170
|
-
'react/no-string-refs'?: Linter.RuleEntry<[]>;
|
|
4171
|
-
/**
|
|
4172
|
-
* Disallows unnecessary 'key' props on nested child elements when rendering lists.
|
|
4173
|
-
* @see https://eslint-react.xyz/docs/rules/no-unnecessary-key
|
|
4174
|
-
*/
|
|
4175
|
-
'react/no-unnecessary-key'?: Linter.RuleEntry<[]>;
|
|
4176
4008
|
/**
|
|
4177
4009
|
* Disallows unnecessary usage of 'useCallback'.
|
|
4178
4010
|
* @see https://eslint-react.xyz/docs/rules/no-unnecessary-use-callback
|
|
@@ -4188,11 +4020,6 @@ interface RuleOptions {
|
|
|
4188
4020
|
* @see https://eslint-react.xyz/docs/rules/no-unnecessary-use-prefix
|
|
4189
4021
|
*/
|
|
4190
4022
|
'react/no-unnecessary-use-prefix'?: Linter.RuleEntry<[]>;
|
|
4191
|
-
/**
|
|
4192
|
-
* Disallows unnecessary usage of 'useRef'.
|
|
4193
|
-
* @see https://eslint-react.xyz/docs/rules/no-unnecessary-use-ref
|
|
4194
|
-
*/
|
|
4195
|
-
'react/no-unnecessary-use-ref'?: Linter.RuleEntry<[]>;
|
|
4196
4023
|
/**
|
|
4197
4024
|
* Warns about the use of 'UNSAFE_componentWillMount' in class components.
|
|
4198
4025
|
* @see https://eslint-react.xyz/docs/rules/no-unsafe-component-will-mount
|
|
@@ -4238,11 +4065,6 @@ interface RuleOptions {
|
|
|
4238
4065
|
* @see https://eslint-react.xyz/docs/rules/no-use-context
|
|
4239
4066
|
*/
|
|
4240
4067
|
'react/no-use-context'?: Linter.RuleEntry<[]>;
|
|
4241
|
-
/**
|
|
4242
|
-
* Disallows useless 'forwardRef' calls on components that don't use 'ref's.
|
|
4243
|
-
* @see https://eslint-react.xyz/docs/rules/no-useless-forward-ref
|
|
4244
|
-
*/
|
|
4245
|
-
'react/no-useless-forward-ref'?: Linter.RuleEntry<[]>;
|
|
4246
4068
|
/**
|
|
4247
4069
|
* Disallows useless fragment elements.
|
|
4248
4070
|
* @see https://eslint-react.xyz/docs/rules/no-useless-fragment
|
|
@@ -4259,15 +4081,55 @@ interface RuleOptions {
|
|
|
4259
4081
|
*/
|
|
4260
4082
|
'react/prefer-namespace-import'?: Linter.RuleEntry<[]>;
|
|
4261
4083
|
/**
|
|
4262
|
-
*
|
|
4263
|
-
* @see https://eslint-react.xyz/docs/rules/
|
|
4084
|
+
* Validates that components and hooks are pure by checking that they do not call known-impure functions during render.
|
|
4085
|
+
* @see https://eslint-react.xyz/docs/rules/purity
|
|
4086
|
+
*/
|
|
4087
|
+
'react/purity'?: Linter.RuleEntry<[]>;
|
|
4088
|
+
/**
|
|
4089
|
+
* Validates correct usage of refs by checking that 'ref.current' is not read or written during render.
|
|
4090
|
+
* @see https://eslint-react.xyz/docs/rules/refs
|
|
4091
|
+
*/
|
|
4092
|
+
'react/refs'?: Linter.RuleEntry<[]>;
|
|
4093
|
+
/**
|
|
4094
|
+
* Enforces the Rules of Hooks.
|
|
4095
|
+
* @see https://react.dev/reference/rules/rules-of-hooks
|
|
4264
4096
|
*/
|
|
4265
|
-
'react/
|
|
4097
|
+
'react/rules-of-hooks'?: Linter.RuleEntry<ReactRulesOfHooks>;
|
|
4266
4098
|
/**
|
|
4267
|
-
*
|
|
4268
|
-
* @see https://eslint-react.xyz/docs/rules/
|
|
4099
|
+
* Validates against setting state synchronously in an effect, which can lead to re-renders that degrade performance.
|
|
4100
|
+
* @see https://eslint-react.xyz/docs/rules/set-state-in-effect
|
|
4269
4101
|
*/
|
|
4270
|
-
'react/
|
|
4102
|
+
'react/set-state-in-effect'?: Linter.RuleEntry<[]>;
|
|
4103
|
+
/**
|
|
4104
|
+
* Validates against unconditionally setting state during render, which can trigger additional renders and potential infinite render loops.
|
|
4105
|
+
* @see https://eslint-react.xyz/docs/rules/set-state-in-render
|
|
4106
|
+
*/
|
|
4107
|
+
'react/set-state-in-render'?: Linter.RuleEntry<[]>;
|
|
4108
|
+
/**
|
|
4109
|
+
* Enforces the Rules of Props.
|
|
4110
|
+
* @see https://eslint-react.xyz/docs/rules/unstable-rules-of-props
|
|
4111
|
+
*/
|
|
4112
|
+
'react/unstable-rules-of-props'?: Linter.RuleEntry<[]>;
|
|
4113
|
+
/**
|
|
4114
|
+
* Enforces the Rules of State.
|
|
4115
|
+
* @see https://eslint-react.xyz/docs/rules/unstable-rules-of-state
|
|
4116
|
+
*/
|
|
4117
|
+
'react/unstable-rules-of-state'?: Linter.RuleEntry<[]>;
|
|
4118
|
+
/**
|
|
4119
|
+
* Validates against syntax that React Compiler does not support.
|
|
4120
|
+
* @see https://eslint-react.xyz/docs/rules/unsupported-syntax
|
|
4121
|
+
*/
|
|
4122
|
+
'react/unsupported-syntax'?: Linter.RuleEntry<[]>;
|
|
4123
|
+
/**
|
|
4124
|
+
* Validates that 'useMemo' is called with a callback that returns a value.
|
|
4125
|
+
* @see https://eslint-react.xyz/docs/rules/use-memo
|
|
4126
|
+
*/
|
|
4127
|
+
'react/use-memo'?: Linter.RuleEntry<[]>;
|
|
4128
|
+
/**
|
|
4129
|
+
* Enforces correct usage of 'useState', including destructuring, symmetric naming of the value and setter, and wrapping expensive initializers in a lazy initializer function.
|
|
4130
|
+
* @see https://eslint-react.xyz/docs/rules/use-state
|
|
4131
|
+
*/
|
|
4132
|
+
'react/use-state'?: Linter.RuleEntry<ReactUseState>;
|
|
4271
4133
|
/**
|
|
4272
4134
|
* disallow confusing quantifiers
|
|
4273
4135
|
* @see https://ota-meshi.github.io/eslint-plugin-regexp/rules/confusing-quantifier.html
|
|
@@ -13439,139 +13301,35 @@ type Radix = [] | [("always" | "as-needed")]; // ----- react-dom/no-unknown-prop
|
|
|
13439
13301
|
type ReactDomNoUnknownProperty = [] | [{
|
|
13440
13302
|
ignore?: string[];
|
|
13441
13303
|
requireDataLowercase?: boolean;
|
|
13442
|
-
}]; // ----- react-hooks/automatic-effect-dependencies -----
|
|
13443
|
-
type ReactHooksAutomaticEffectDependencies = [] | [{
|
|
13444
|
-
[k: string]: unknown | undefined;
|
|
13445
|
-
}]; // ----- react-hooks/capitalized-calls -----
|
|
13446
|
-
type ReactHooksCapitalizedCalls = [] | [{
|
|
13447
|
-
[k: string]: unknown | undefined;
|
|
13448
|
-
}]; // ----- react-hooks/component-hook-factories -----
|
|
13449
|
-
type ReactHooksComponentHookFactories = [] | [{
|
|
13450
|
-
[k: string]: unknown | undefined;
|
|
13451
|
-
}]; // ----- react-hooks/config -----
|
|
13452
|
-
type ReactHooksConfig = [] | [{
|
|
13453
|
-
[k: string]: unknown | undefined;
|
|
13454
|
-
}]; // ----- react-hooks/error-boundaries -----
|
|
13455
|
-
type ReactHooksErrorBoundaries = [] | [{
|
|
13456
|
-
[k: string]: unknown | undefined;
|
|
13457
|
-
}]; // ----- react-hooks/exhaustive-deps -----
|
|
13458
|
-
type ReactHooksExhaustiveDeps = [] | [{
|
|
13459
|
-
additionalHooks?: string;
|
|
13460
|
-
enableDangerousAutofixThisMayCauseInfiniteLoops?: boolean;
|
|
13461
|
-
experimental_autoDependenciesHooks?: string[];
|
|
13462
|
-
requireExplicitEffectDeps?: boolean;
|
|
13463
|
-
}]; // ----- react-hooks/fbt -----
|
|
13464
|
-
type ReactHooksFbt = [] | [{
|
|
13465
|
-
[k: string]: unknown | undefined;
|
|
13466
|
-
}]; // ----- react-hooks/fire -----
|
|
13467
|
-
type ReactHooksFire = [] | [{
|
|
13468
|
-
[k: string]: unknown | undefined;
|
|
13469
|
-
}]; // ----- react-hooks/gating -----
|
|
13470
|
-
type ReactHooksGating = [] | [{
|
|
13471
|
-
[k: string]: unknown | undefined;
|
|
13472
|
-
}]; // ----- react-hooks/globals -----
|
|
13473
|
-
type ReactHooksGlobals = [] | [{
|
|
13474
|
-
[k: string]: unknown | undefined;
|
|
13475
|
-
}]; // ----- react-hooks/hooks -----
|
|
13476
|
-
type ReactHooksHooks = [] | [{
|
|
13477
|
-
[k: string]: unknown | undefined;
|
|
13478
|
-
}]; // ----- react-hooks/immutability -----
|
|
13479
|
-
type ReactHooksImmutability = [] | [{
|
|
13480
|
-
[k: string]: unknown | undefined;
|
|
13481
|
-
}]; // ----- react-hooks/incompatible-library -----
|
|
13482
|
-
type ReactHooksIncompatibleLibrary = [] | [{
|
|
13483
|
-
[k: string]: unknown | undefined;
|
|
13484
|
-
}]; // ----- react-hooks/invariant -----
|
|
13485
|
-
type ReactHooksInvariant = [] | [{
|
|
13486
|
-
[k: string]: unknown | undefined;
|
|
13487
|
-
}]; // ----- react-hooks/memoized-effect-dependencies -----
|
|
13488
|
-
type ReactHooksMemoizedEffectDependencies = [] | [{
|
|
13489
|
-
[k: string]: unknown | undefined;
|
|
13490
|
-
}]; // ----- react-hooks/no-deriving-state-in-effects -----
|
|
13491
|
-
type ReactHooksNoDerivingStateInEffects = [] | [{
|
|
13492
|
-
[k: string]: unknown | undefined;
|
|
13493
|
-
}]; // ----- react-hooks/preserve-manual-memoization -----
|
|
13494
|
-
type ReactHooksPreserveManualMemoization = [] | [{
|
|
13495
|
-
[k: string]: unknown | undefined;
|
|
13496
|
-
}]; // ----- react-hooks/purity -----
|
|
13497
|
-
type ReactHooksPurity = [] | [{
|
|
13498
|
-
[k: string]: unknown | undefined;
|
|
13499
|
-
}]; // ----- react-hooks/refs -----
|
|
13500
|
-
type ReactHooksRefs = [] | [{
|
|
13501
|
-
[k: string]: unknown | undefined;
|
|
13502
|
-
}]; // ----- react-hooks/rule-suppression -----
|
|
13503
|
-
type ReactHooksRuleSuppression = [] | [{
|
|
13504
|
-
[k: string]: unknown | undefined;
|
|
13505
|
-
}]; // ----- react-hooks/rules-of-hooks -----
|
|
13506
|
-
type ReactHooksRulesOfHooks = [] | [{
|
|
13507
|
-
additionalHooks?: string;
|
|
13508
|
-
}]; // ----- react-hooks/set-state-in-effect -----
|
|
13509
|
-
type ReactHooksSetStateInEffect = [] | [{
|
|
13510
|
-
[k: string]: unknown | undefined;
|
|
13511
|
-
}]; // ----- react-hooks/set-state-in-render -----
|
|
13512
|
-
type ReactHooksSetStateInRender = [] | [{
|
|
13513
|
-
[k: string]: unknown | undefined;
|
|
13514
|
-
}]; // ----- react-hooks/static-components -----
|
|
13515
|
-
type ReactHooksStaticComponents = [] | [{
|
|
13516
|
-
[k: string]: unknown | undefined;
|
|
13517
|
-
}]; // ----- react-hooks/syntax -----
|
|
13518
|
-
type ReactHooksSyntax = [] | [{
|
|
13519
|
-
[k: string]: unknown | undefined;
|
|
13520
|
-
}]; // ----- react-hooks/todo -----
|
|
13521
|
-
type ReactHooksTodo = [] | [{
|
|
13522
|
-
[k: string]: unknown | undefined;
|
|
13523
|
-
}]; // ----- react-hooks/unsupported-syntax -----
|
|
13524
|
-
type ReactHooksUnsupportedSyntax = [] | [{
|
|
13525
|
-
[k: string]: unknown | undefined;
|
|
13526
|
-
}]; // ----- react-hooks/use-memo -----
|
|
13527
|
-
type ReactHooksUseMemo = [] | [{
|
|
13528
|
-
[k: string]: unknown | undefined;
|
|
13529
|
-
}]; // ----- react-hooks/void-use-memo -----
|
|
13530
|
-
type ReactHooksVoidUseMemo = [] | [{
|
|
13531
|
-
[k: string]: unknown | undefined;
|
|
13532
|
-
}]; // ----- react-naming-convention/component-name -----
|
|
13533
|
-
type ReactNamingConventionComponentName = [] | [(("PascalCase" | "CONSTANT_CASE") | {
|
|
13534
|
-
allowAllCaps?: boolean;
|
|
13535
|
-
excepts?: string[];
|
|
13536
|
-
rule?: ("PascalCase" | "CONSTANT_CASE");
|
|
13537
|
-
})]; // ----- react-naming-convention/filename -----
|
|
13538
|
-
type ReactNamingConventionFilename = [] | [(("PascalCase" | "camelCase" | "kebab-case" | "snake_case") | {
|
|
13539
|
-
excepts?: string[];
|
|
13540
|
-
extensions?: string[];
|
|
13541
|
-
rule?: ("PascalCase" | "camelCase" | "kebab-case" | "snake_case");
|
|
13542
|
-
})]; // ----- react-naming-convention/filename-extension -----
|
|
13543
|
-
type ReactNamingConventionFilenameExtension = [] | [(("always" | "as-needed") | {
|
|
13544
|
-
allow?: ("always" | "as-needed");
|
|
13545
|
-
extensions?: string[];
|
|
13546
|
-
ignoreFilesWithoutCode?: boolean;
|
|
13547
|
-
})]; // ----- react-naming-convention/use-state -----
|
|
13548
|
-
type ReactNamingConventionUseState = [] | [{
|
|
13549
|
-
enforceAssignment?: boolean;
|
|
13550
|
-
enforceSetterName?: boolean;
|
|
13551
13304
|
}]; // ----- react-refresh/only-export-components -----
|
|
13552
13305
|
type ReactRefreshOnlyExportComponents = [] | [{
|
|
13553
13306
|
extraHOCs?: string[];
|
|
13554
13307
|
allowExportNames?: string[];
|
|
13555
13308
|
allowConstantExport?: boolean;
|
|
13556
13309
|
checkJS?: boolean;
|
|
13310
|
+
}]; // ----- react/exhaustive-deps -----
|
|
13311
|
+
type ReactExhaustiveDeps = [] | [{
|
|
13312
|
+
additionalHooks?: string;
|
|
13313
|
+
enableDangerousAutofixThisMayCauseInfiniteLoops?: boolean;
|
|
13314
|
+
experimental_autoDependenciesHooks?: string[];
|
|
13315
|
+
requireExplicitEffectDeps?: boolean;
|
|
13557
13316
|
}]; // ----- react/jsx-shorthand-boolean -----
|
|
13558
13317
|
type ReactJsxShorthandBoolean = [] | [(-1 | 1)]; // ----- react/jsx-shorthand-fragment -----
|
|
13559
|
-
type ReactJsxShorthandFragment = [] | [(-1 | 1)]; // ----- react/no-
|
|
13560
|
-
type ReactNoForbiddenProps = [] | [{
|
|
13561
|
-
forbid?: (string | {
|
|
13562
|
-
excludedNodes?: string[];
|
|
13563
|
-
prop: string;
|
|
13564
|
-
} | {
|
|
13565
|
-
includedNodes?: string[];
|
|
13566
|
-
prop: string;
|
|
13567
|
-
})[];
|
|
13568
|
-
}]; // ----- react/no-unstable-default-props -----
|
|
13318
|
+
type ReactJsxShorthandFragment = [] | [(-1 | 1)]; // ----- react/no-unstable-default-props -----
|
|
13569
13319
|
type ReactNoUnstableDefaultProps = [] | [{
|
|
13570
13320
|
safeDefaultProps?: string[];
|
|
13571
13321
|
}]; // ----- react/no-useless-fragment -----
|
|
13572
13322
|
type ReactNoUselessFragment = [] | [{
|
|
13573
13323
|
allowEmptyFragment?: boolean;
|
|
13574
13324
|
allowExpressions?: boolean;
|
|
13325
|
+
}]; // ----- react/rules-of-hooks -----
|
|
13326
|
+
type ReactRulesOfHooks = [] | [{
|
|
13327
|
+
additionalHooks?: string;
|
|
13328
|
+
}]; // ----- react/use-state -----
|
|
13329
|
+
type ReactUseState = [] | [{
|
|
13330
|
+
enforceAssignment?: boolean;
|
|
13331
|
+
enforceLazyInitialization?: boolean;
|
|
13332
|
+
enforceSetterName?: boolean;
|
|
13575
13333
|
}]; // ----- regexp/hexadecimal-escape -----
|
|
13576
13334
|
type RegexpHexadecimalEscape = [] | [("always" | "never")]; // ----- regexp/letter-case -----
|
|
13577
13335
|
type RegexpLetterCase = [] | [{
|
|
@@ -17512,7 +17270,7 @@ type Yoda = [] | [("always" | "never")] | [("always" | "never"), {
|
|
|
17512
17270
|
exceptRange?: boolean;
|
|
17513
17271
|
onlyEquality?: boolean;
|
|
17514
17272
|
}]; // Names of all the configs
|
|
17515
|
-
type ConfigNames = 'luxass/gitignore' | 'luxass/ignores' | 'luxass/javascript/setup' | 'luxass/javascript/rules' | 'luxass/disables/cli' | 'luxass/eslint-comments' | 'command' | 'luxass/perfectionist/setup' | 'luxass/node/setup' | 'luxass/node/rules' | 'luxass/jsdoc/setup' | 'luxass/jsdoc/rules' | 'luxass/imports' | 'luxass/e18e/rules' | 'luxass/unicorn/rules' | 'luxass/jsx/setup' | 'luxass/typescript/setup' | 'luxass/typescript/type-aware-parser' | 'luxass/typescript/parser' | 'luxass/typescript/rules' | 'luxass/typescript/rules-type-aware' | 'luxas/typescript/erasable-syntax-only' | 'luxass/stylistic' | 'luxass/regexp/rules' | 'luxass/test/setup' | 'luxass/test/rules' | 'luxass/react/setup' | 'luxass/react/rules' | 'luxass/react/type-aware-rules' | 'luxass/vue/setup' | 'luxass/vue/rules' | 'luxass/astro/setup' | 'luxass/astro/rules' | 'luxass/unocss' | 'luxass/jsonc/setup' | 'luxass/jsonc/rules' | 'luxass/sort/package-json' | 'luxass/sort/tsconfig' | 'luxass/pnpm/package-json' | 'luxass/pnpm/pnpm-workspace-yaml' | 'luxass/pnpm/pnpm-workspace-yaml-sort' | 'luxass/yaml/setup' | 'luxass/yaml/rules' | 'luxass/yaml/pnpm-workspace' | 'luxass/toml/setup' | 'luxass/toml/rules' | 'luxass/markdown/setup' | 'luxass/markdown/processor' | 'luxass/markdown/parser' | 'luxass/markdown/rules' | 'luxass/markdown/disables/markdown' | 'luxass/markdown/disables/code' | 'luxass/formatter/setup' | 'luxass/formatter/css' | 'luxass/formatter/scss' | 'luxass/formatter/less' | 'luxass/formatter/html' | 'luxass/formatter/xml' | 'luxass/formatter/svg' | 'luxass/formatter/markdown' | 'luxass/formatter/astro' | 'luxass/formatter/graphql' | 'luxass/disables/scripts' | 'luxass/disables/cli' | 'luxass/disables/bin' | 'luxass/disables/dts' | 'luxass/disables/cjs' | 'luxass/disables/github-actions' | 'luxass/disables/config-files';
|
|
17273
|
+
type ConfigNames = 'luxass/gitignore' | 'luxass/ignores' | 'luxass/javascript/setup' | 'luxass/javascript/rules' | 'luxass/disables/cli' | 'luxass/eslint-comments' | 'command' | 'luxass/perfectionist/setup' | 'luxass/node/setup' | 'luxass/node/rules' | 'luxass/jsdoc/setup' | 'luxass/jsdoc/rules' | 'luxass/imports' | 'luxass/e18e/rules' | 'luxass/unicorn/rules' | 'luxass/jsx/setup' | 'luxass/typescript/setup' | 'luxass/typescript/type-aware-parser' | 'luxass/typescript/parser' | 'luxass/typescript/rules' | 'luxass/typescript/rules-type-aware' | 'luxas/typescript/erasable-syntax-only' | 'luxass/stylistic' | 'luxass/regexp/rules' | 'luxass/test/setup' | 'luxass/test/rules' | 'luxass/react/setup' | 'luxass/react/rules' | 'luxass/react/typescript' | 'luxass/react/type-aware-rules' | 'luxass/vue/setup' | 'luxass/vue/rules' | 'luxass/astro/setup' | 'luxass/astro/rules' | 'luxass/unocss' | 'luxass/jsonc/setup' | 'luxass/jsonc/rules' | 'luxass/sort/package-json' | 'luxass/sort/tsconfig' | 'luxass/pnpm/package-json' | 'luxass/pnpm/pnpm-workspace-yaml' | 'luxass/pnpm/pnpm-workspace-yaml-sort' | 'luxass/yaml/setup' | 'luxass/yaml/rules' | 'luxass/yaml/pnpm-workspace' | 'luxass/toml/setup' | 'luxass/toml/rules' | 'luxass/markdown/setup' | 'luxass/markdown/processor' | 'luxass/markdown/parser' | 'luxass/markdown/rules' | 'luxass/markdown/disables/markdown' | 'luxass/markdown/disables/code' | 'luxass/formatter/setup' | 'luxass/formatter/css' | 'luxass/formatter/scss' | 'luxass/formatter/less' | 'luxass/formatter/html' | 'luxass/formatter/xml' | 'luxass/formatter/svg' | 'luxass/formatter/markdown' | 'luxass/formatter/astro' | 'luxass/formatter/graphql' | 'luxass/disables/scripts' | 'luxass/disables/cli' | 'luxass/disables/bin' | 'luxass/disables/dts' | 'luxass/disables/cjs' | 'luxass/disables/github-actions' | 'luxass/disables/config-files';
|
|
17516
17274
|
//#endregion
|
|
17517
17275
|
//#region src/types.d.ts
|
|
17518
17276
|
type Awaitable<T> = T | Promise<T>;
|
|
@@ -17620,7 +17378,6 @@ interface ConfigOptions {
|
|
|
17620
17378
|
*
|
|
17621
17379
|
* Requires installing:
|
|
17622
17380
|
* - `@eslint-react/eslint-plugin`
|
|
17623
|
-
* - `eslint-plugin-react-hooks`
|
|
17624
17381
|
* - `eslint-plugin-react-refresh`
|
|
17625
17382
|
*
|
|
17626
17383
|
* @default false
|
package/dist/index.mjs
CHANGED
|
@@ -1354,26 +1354,17 @@ const ReactRouterPackages = [
|
|
|
1354
1354
|
];
|
|
1355
1355
|
const TanstackRouterPackages = ["@tanstack/react-router"];
|
|
1356
1356
|
const NextJsPackages = ["next"];
|
|
1357
|
-
const ReactCompilerPackages = ["babel-plugin-react-compiler"];
|
|
1358
1357
|
async function react(options = {}) {
|
|
1359
1358
|
const { files = [
|
|
1360
1359
|
GLOB_JS,
|
|
1361
1360
|
GLOB_JSX,
|
|
1362
1361
|
GLOB_TS,
|
|
1363
1362
|
GLOB_TSX
|
|
1364
|
-
], filesTypeAware = [GLOB_TS, GLOB_TSX], ignoresTypeAware = [`${GLOB_MARKDOWN}/**`, GLOB_ASTRO_TS], overrides = {},
|
|
1365
|
-
await ensure([
|
|
1366
|
-
"@eslint-react/eslint-plugin",
|
|
1367
|
-
"eslint-plugin-react-hooks",
|
|
1368
|
-
"eslint-plugin-react-refresh"
|
|
1369
|
-
]);
|
|
1363
|
+
], filesTypeAware = [GLOB_TS, GLOB_TSX], ignoresTypeAware = [`${GLOB_MARKDOWN}/**`, GLOB_ASTRO_TS], overrides = {}, tsconfigPath } = options;
|
|
1364
|
+
await ensure(["@eslint-react/eslint-plugin", "eslint-plugin-react-refresh"]);
|
|
1370
1365
|
const isTypeAware = !!tsconfigPath;
|
|
1371
|
-
const typeAwareRules = { "react/no-leaked-conditional-rendering": "
|
|
1372
|
-
const [pluginReact,
|
|
1373
|
-
interop(import("@eslint-react/eslint-plugin")),
|
|
1374
|
-
interop(import("eslint-plugin-react-hooks")),
|
|
1375
|
-
interop(import("eslint-plugin-react-refresh"))
|
|
1376
|
-
]);
|
|
1366
|
+
const typeAwareRules = { "react/no-leaked-conditional-rendering": "error" };
|
|
1367
|
+
const [pluginReact, pluginReactRefresh] = await Promise.all([interop(import("@eslint-react/eslint-plugin")), interop(import("eslint-plugin-react-refresh"))]);
|
|
1377
1368
|
const isAllowConstantExport = ReactRefreshAllowConstantExportPackages.some((i) => isPackageExists(i));
|
|
1378
1369
|
const isUsingRemix = RemixPackages.some((i) => isPackageExists(i));
|
|
1379
1370
|
const isUsingReactRouter = ReactRouterPackages.some((i) => isPackageExists(i));
|
|
@@ -1386,8 +1377,6 @@ async function react(options = {}) {
|
|
|
1386
1377
|
plugins: {
|
|
1387
1378
|
"react": plugins["@eslint-react"],
|
|
1388
1379
|
"react-dom": plugins["@eslint-react/dom"],
|
|
1389
|
-
"react-hooks": pluginReactHooks,
|
|
1390
|
-
"react-hooks-extra": plugins["@eslint-react/hooks-extra"],
|
|
1391
1380
|
"react-naming-convention": plugins["@eslint-react/naming-convention"],
|
|
1392
1381
|
"react-refresh": pluginReactRefresh,
|
|
1393
1382
|
"react-rsc": plugins["@eslint-react/rsc"],
|
|
@@ -1402,85 +1391,7 @@ async function react(options = {}) {
|
|
|
1402
1391
|
},
|
|
1403
1392
|
name: "luxass/react/rules",
|
|
1404
1393
|
rules: {
|
|
1405
|
-
|
|
1406
|
-
"react-dom/no-dangerously-set-innerhtml-with-children": "error",
|
|
1407
|
-
"react-dom/no-find-dom-node": "error",
|
|
1408
|
-
"react-dom/no-flush-sync": "error",
|
|
1409
|
-
"react-dom/no-hydrate": "error",
|
|
1410
|
-
"react-dom/no-namespace": "error",
|
|
1411
|
-
"react-dom/no-render": "error",
|
|
1412
|
-
"react-dom/no-render-return-value": "error",
|
|
1413
|
-
"react-dom/no-script-url": "warn",
|
|
1414
|
-
"react-dom/no-unsafe-iframe-sandbox": "warn",
|
|
1415
|
-
"react-dom/no-use-form-state": "error",
|
|
1416
|
-
"react-dom/no-void-elements-with-children": "error",
|
|
1417
|
-
"react-hooks-extra/no-direct-set-state-in-use-effect": "warn",
|
|
1418
|
-
"react-hooks/exhaustive-deps": "warn",
|
|
1419
|
-
"react-hooks/rules-of-hooks": "error",
|
|
1420
|
-
"react-naming-convention/context-name": "warn",
|
|
1421
|
-
"react-naming-convention/ref-name": "warn",
|
|
1422
|
-
"react-naming-convention/use-state": "warn",
|
|
1423
|
-
"react-rsc/function-definition": "error",
|
|
1424
|
-
"react-web-api/no-leaked-event-listener": "warn",
|
|
1425
|
-
"react-web-api/no-leaked-interval": "warn",
|
|
1426
|
-
"react-web-api/no-leaked-resize-observer": "warn",
|
|
1427
|
-
"react-web-api/no-leaked-timeout": "warn",
|
|
1428
|
-
"react/jsx-key-before-spread": "warn",
|
|
1429
|
-
"react/jsx-no-comment-textnodes": "warn",
|
|
1430
|
-
"react/jsx-no-duplicate-props": "warn",
|
|
1431
|
-
"react/jsx-uses-react": "warn",
|
|
1432
|
-
"react/jsx-uses-vars": "warn",
|
|
1433
|
-
"react/no-access-state-in-setstate": "error",
|
|
1434
|
-
"react/no-array-index-key": "warn",
|
|
1435
|
-
"react/no-children-count": "warn",
|
|
1436
|
-
"react/no-children-for-each": "warn",
|
|
1437
|
-
"react/no-children-map": "warn",
|
|
1438
|
-
"react/no-children-only": "warn",
|
|
1439
|
-
"react/no-children-to-array": "warn",
|
|
1440
|
-
"react/no-clone-element": "warn",
|
|
1441
|
-
"react/no-component-will-mount": "error",
|
|
1442
|
-
"react/no-component-will-receive-props": "error",
|
|
1443
|
-
"react/no-component-will-update": "error",
|
|
1444
|
-
"react/no-context-provider": "warn",
|
|
1445
|
-
"react/no-create-ref": "error",
|
|
1446
|
-
"react/no-default-props": "error",
|
|
1447
|
-
"react/no-direct-mutation-state": "error",
|
|
1448
|
-
"react/no-forward-ref": "warn",
|
|
1449
|
-
"react/no-missing-key": "error",
|
|
1450
|
-
"react/no-nested-component-definitions": "error",
|
|
1451
|
-
"react/no-nested-lazy-component-declarations": "error",
|
|
1452
|
-
"react/no-prop-types": "error",
|
|
1453
|
-
"react/no-redundant-should-component-update": "error",
|
|
1454
|
-
"react/no-set-state-in-component-did-mount": "warn",
|
|
1455
|
-
"react/no-set-state-in-component-did-update": "warn",
|
|
1456
|
-
"react/no-set-state-in-component-will-update": "warn",
|
|
1457
|
-
"react/no-string-refs": "error",
|
|
1458
|
-
"react/no-unnecessary-use-prefix": "warn",
|
|
1459
|
-
"react/no-unsafe-component-will-mount": "warn",
|
|
1460
|
-
"react/no-unsafe-component-will-receive-props": "warn",
|
|
1461
|
-
"react/no-unsafe-component-will-update": "warn",
|
|
1462
|
-
"react/no-unused-class-component-members": "warn",
|
|
1463
|
-
"react/no-use-context": "warn",
|
|
1464
|
-
"react/no-useless-forward-ref": "warn",
|
|
1465
|
-
"react/prefer-namespace-import": "error",
|
|
1466
|
-
"react/prefer-use-state-lazy-initialization": "warn",
|
|
1467
|
-
...reactCompiler ? {
|
|
1468
|
-
"react-hooks/component-hook-factories": "error",
|
|
1469
|
-
"react-hooks/config": "error",
|
|
1470
|
-
"react-hooks/error-boundaries": "error",
|
|
1471
|
-
"react-hooks/gating": "error",
|
|
1472
|
-
"react-hooks/globals": "error",
|
|
1473
|
-
"react-hooks/immutability": "error",
|
|
1474
|
-
"react-hooks/incompatible-library": "warn",
|
|
1475
|
-
"react-hooks/preserve-manual-memoization": "error",
|
|
1476
|
-
"react-hooks/purity": "error",
|
|
1477
|
-
"react-hooks/refs": "error",
|
|
1478
|
-
"react-hooks/set-state-in-effect": "error",
|
|
1479
|
-
"react-hooks/set-state-in-render": "error",
|
|
1480
|
-
"react-hooks/static-components": "error",
|
|
1481
|
-
"react-hooks/unsupported-syntax": "warn",
|
|
1482
|
-
"react-hooks/use-memo": "error"
|
|
1483
|
-
} : {},
|
|
1394
|
+
...pluginReact.configs.recommended.rules,
|
|
1484
1395
|
"react-refresh/only-export-components": ["error", {
|
|
1485
1396
|
allowConstantExport: isAllowConstantExport,
|
|
1486
1397
|
allowExportNames: [...isUsingNext ? [
|
|
@@ -1519,9 +1430,18 @@ async function react(options = {}) {
|
|
|
1519
1430
|
"createLazyRoute"
|
|
1520
1431
|
] : []]
|
|
1521
1432
|
}],
|
|
1433
|
+
"react/prefer-namespace-import": "error",
|
|
1522
1434
|
...overrides
|
|
1523
1435
|
}
|
|
1524
1436
|
},
|
|
1437
|
+
{
|
|
1438
|
+
files: filesTypeAware,
|
|
1439
|
+
name: "luxass/react/typescript",
|
|
1440
|
+
rules: {
|
|
1441
|
+
"react-dom/no-string-style-prop": "off",
|
|
1442
|
+
"react-dom/no-unknown-property": "off"
|
|
1443
|
+
}
|
|
1444
|
+
},
|
|
1525
1445
|
...isTypeAware ? [{
|
|
1526
1446
|
files: filesTypeAware,
|
|
1527
1447
|
ignores: ignoresTypeAware,
|
|
@@ -2338,8 +2258,9 @@ const VuePackages = [
|
|
|
2338
2258
|
const defaultPluginRenaming = {
|
|
2339
2259
|
"@eslint-react": "react",
|
|
2340
2260
|
"@eslint-react/dom": "react-dom",
|
|
2341
|
-
"@eslint-react/hooks-extra": "react-hooks-extra",
|
|
2342
2261
|
"@eslint-react/naming-convention": "react-naming-convention",
|
|
2262
|
+
"@eslint-react/rsc": "react-rsc",
|
|
2263
|
+
"@eslint-react/web-api": "react-web-api",
|
|
2343
2264
|
"@stylistic": "style",
|
|
2344
2265
|
"@typescript-eslint": "ts",
|
|
2345
2266
|
"import-lite": "import",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@luxass/eslint-config",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.4.0",
|
|
4
4
|
"description": "ESLint config for @luxass",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": {
|
|
@@ -42,7 +42,6 @@
|
|
|
42
42
|
"eslint": "^9.10.0 || ^10.0.0",
|
|
43
43
|
"eslint-plugin-astro": "^1.2.0",
|
|
44
44
|
"eslint-plugin-format": ">=0.1.0",
|
|
45
|
-
"eslint-plugin-react-hooks": "^7.0.0",
|
|
46
45
|
"eslint-plugin-react-refresh": "^0.4.19",
|
|
47
46
|
"eslint-plugin-tailwindcss": "^3.17.0",
|
|
48
47
|
"prettier-plugin-astro": "^0.14.0"
|
|
@@ -63,9 +62,6 @@
|
|
|
63
62
|
"@eslint-react/eslint-plugin": {
|
|
64
63
|
"optional": true
|
|
65
64
|
},
|
|
66
|
-
"eslint-plugin-react-hooks": {
|
|
67
|
-
"optional": true
|
|
68
|
-
},
|
|
69
65
|
"eslint-plugin-react-refresh": {
|
|
70
66
|
"optional": true
|
|
71
67
|
},
|
|
@@ -115,7 +111,7 @@
|
|
|
115
111
|
"yaml-eslint-parser": "^2.0.0"
|
|
116
112
|
},
|
|
117
113
|
"devDependencies": {
|
|
118
|
-
"@eslint-react/eslint-plugin": "^
|
|
114
|
+
"@eslint-react/eslint-plugin": "^3.0.0",
|
|
119
115
|
"@eslint/config-inspector": "^1.5.0",
|
|
120
116
|
"@prettier/plugin-xml": "^3.4.2",
|
|
121
117
|
"@types/node": "^25.2.1",
|
|
@@ -126,7 +122,6 @@
|
|
|
126
122
|
"eslint-plugin-astro": "^1.6.0",
|
|
127
123
|
"eslint-plugin-erasable-syntax-only": "^0.4.0",
|
|
128
124
|
"eslint-plugin-format": "^2.0.1",
|
|
129
|
-
"eslint-plugin-react-hooks": "^7.0.1",
|
|
130
125
|
"eslint-plugin-react-refresh": "^0.5.2",
|
|
131
126
|
"eslint-plugin-tailwindcss": "^3.18.2",
|
|
132
127
|
"eslint-typegen": "^2.3.1",
|