Skip to content

feat(oxlint): disallow derived state in effects - #9

Open
karsten-bot wants to merge 1 commit into
mainfrom
enable-no-deriving-state-in-effects
Open

karsten-bot wants to merge 1 commit into
mainfrom
enable-no-deriving-state-in-effects

Conversation

@karsten-bot

Copy link
Copy Markdown
Collaborator

Enables react/no-deriving-state-in-effects at error severity in the shared React Oxlint preset.

The rule catches state copied from props or other state inside an effect, which causes an avoidable second render and can leave the derived value stale.

Verification:

  • npx --yes oxlint@1.80.0 --config ./oxlint/react.jsonc <fixture> rejects a derived-state-in-effect fixture with react(no-deriving-state-in-effects)
  • the same config accepts the equivalent render-time derivation fixture
  • git diff --check

References TIM-345

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant