jsx-eslint/eslint-plugin-react

New rule: identify missing PropType definition

Open

#1,887 建立於 2018年7月18日

在 GitHub 查看
 (9 留言) (0 反應) (0 負責人)JavaScript (2,797 fork)batch import
help wantednew rule

倉庫指標

Star
 (8,630 star)
PR 合併指標
 (30 天內沒有已合併 PR)

描述

I accidentally forgot to add the PropTypes assignment to a prop and this was not picked up by eslint:

const propTypes = {
    actions: {
        something: PropTypes.func.isRequired,
    }.isRequired,
};

should have been

const propTypes = {
    actions: PropTypes.shape({
        something: PropTypes.func.isRequired,
    }).isRequired,
};

貢獻者指南