Skip to content

Commit 920ced2

Browse files
committed
feat(react-x): add 'no-unnecessary-use-effect'
1 parent d4b3aca commit 920ced2

File tree

11 files changed

+54
-1228
lines changed

11 files changed

+54
-1228
lines changed

packages/plugins/eslint-plugin-react-x/src/configs/recommended.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ export const rules = {
3030
// "react-x/prefer-destructuring-assignment": "warn",
3131
// "react-x/prefer-namespace-import": "warn",
3232
// "react-x/prefer-read-only-props": "error",
33-
"react-x/no-direct-set-state-in-use-effect": "warn",
3433
"react-x/no-duplicate-key": "warn",
3534
"react-x/no-forward-ref": "warn",
3635
"react-x/no-implicit-key": "warn",

packages/plugins/eslint-plugin-react-x/src/plugin.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ import noContextProvider from "./rules/no-context-provider";
2525
import noCreateRef from "./rules/no-create-ref";
2626
import noDefaultProps from "./rules/no-default-props";
2727
import noDirectMutationState from "./rules/no-direct-mutation-state";
28-
import noDirectSetStateInUseEffect from "./rules/no-direct-set-state-in-use-effect";
29-
import noDirectSetStateInUseLayoutEffect from "./rules/no-direct-set-state-in-use-layout-effect";
3028
import noDuplicateKey from "./rules/no-duplicate-key";
3129
import noForwardRef from "./rules/no-forward-ref";
3230
import noImplicitKey from "./rules/no-implicit-key";
@@ -44,6 +42,7 @@ import noSetStateInComponentDidUpdate from "./rules/no-set-state-in-component-di
4442
import noSetStateInComponentWillUpdate from "./rules/no-set-state-in-component-will-update";
4543
import noStringRefs from "./rules/no-string-refs";
4644
import noUnnecessaryUseCallback from "./rules/no-unnecessary-use-callback";
45+
import noUnnecessaryUseEffect from "./rules/no-unnecessary-use-effect";
4746
import noUnnecessaryUseMemo from "./rules/no-unnecessary-use-memo";
4847
import noUnnecessaryUsePrefix from "./rules/no-unnecessary-use-prefix";
4948
import noUnsafeComponentWillMount from "./rules/no-unsafe-component-will-mount";
@@ -69,6 +68,7 @@ export const plugin = {
6968
"jsx-key-before-spread": jsxKeyBeforeSpread,
7069
"jsx-no-comment-textnodes": jsxNoCommentTextnodes,
7170
"jsx-no-duplicate-props": jsxNoDuplicateProps,
71+
"jsx-no-iife": jsxNoIife,
7272
"jsx-no-undef": jsxNoUndef,
7373
"jsx-shorthand-boolean": jsxShorthandBoolean,
7474
"jsx-shorthand-fragment": jsxShorthandFragment,
@@ -91,8 +91,6 @@ export const plugin = {
9191
"no-create-ref": noCreateRef,
9292
"no-default-props": noDefaultProps,
9393
"no-direct-mutation-state": noDirectMutationState,
94-
"no-direct-set-state-in-use-effect": noDirectSetStateInUseEffect,
95-
"no-direct-set-state-in-use-layout-effect": noDirectSetStateInUseLayoutEffect,
9694
"no-duplicate-key": noDuplicateKey,
9795
"no-forward-ref": noForwardRef,
9896
"no-implicit-key": noImplicitKey,
@@ -110,6 +108,7 @@ export const plugin = {
110108
"no-set-state-in-component-will-update": noSetStateInComponentWillUpdate,
111109
"no-string-refs": noStringRefs,
112110
"no-unnecessary-use-callback": noUnnecessaryUseCallback,
111+
"no-unnecessary-use-effect": noUnnecessaryUseEffect,
113112
"no-unnecessary-use-memo": noUnnecessaryUseMemo,
114113
"no-unnecessary-use-prefix": noUnnecessaryUsePrefix,
115114
"no-unsafe-component-will-mount": noUnsafeComponentWillMount,

packages/plugins/eslint-plugin-react-x/src/rules/no-direct-set-state-in-use-layout-effect.md

Lines changed: 0 additions & 314 deletions
This file was deleted.

0 commit comments

Comments
 (0)