jsx-eslint/eslint-plugin-react

Rule idea: no-mutation-props

Open

#1,113 opened on Mar 14, 2017

View on GitHub
 (6 comments) (8 reactions) (0 assignees)JavaScript (2,797 forks)batch import
help wantednew rulequestion

Repository metrics

Stars
 (8,630 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

A component is never meant to modify its own props (https://facebook.github.io/react/docs/components-and-props.html#props-are-read-only).

I suggest we had a no-mutation-props rule to check for mutations of a components own props. It looks like we could likely copy the logic used in no-direct-mutation-state.js.

Contributor guide