jsx-eslint/eslint-plugin-react

Rule idea: no-mutation-props

开放

#1,113 创建于 2017年3月14日

 (6 条评论) (8 个反应) (0 位负责人)JavaScript (2,731 个派生)batch import
help wantednew rulequestion

仓库指标

星标
 (9,293 个星标)
PR 合并指标
 (PR 指标待抓取)

描述

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.

贡献者指南