jsx-eslint/eslint-plugin-react

Rule idea: no-mutation-props

Open

#1113 aperta il 14 mar 2017

Vedi su GitHub
 (6 commenti) (8 reazioni) (0 assegnatari)JavaScript (2797 fork)batch import
help wantednew rulequestion

Metriche repository

Star
 (8630 star)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

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.

Guida contributor