jsx-eslint/eslint-plugin-react

Rule idea: no-mutation-props

開放

#1,113 建立於 2017年3月14日

 (6 則留言) (8 個反應) (0 位負責人)JavaScript (2,732 個分叉)batch import
help wantednew rulequestion

倉庫指標

星標
 (9,293 顆星)
PR 合併指標
 (30 天內沒有已合併 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.

貢獻者指南