jsx-eslint/eslint-plugin-react

Rule idea: no-mutation-props

Open

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

在 GitHub 查看
 (6 评论) (8 反应) (0 负责人)JavaScript (8,630 star) (2,797 fork)batch import
help wantednew rulequestion

描述

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.

贡献者指南

Rule idea: no-mutation-props · jsx-eslint/eslint-plugin-react#1113 | Good First Issue