jsx-eslint/eslint-plugin-react

Some cases should not be triggered **no-unused-state**

Open

#1,626 创建于 2017年12月25日

在 GitHub 查看
 (10 评论) (0 反应) (0 负责人)JavaScript (2,797 fork)batch import
enhancementhelp wanted

仓库指标

Star
 (8,630 star)
PR 合并指标
 (30 天内没有已合并 PR)

描述

no-unused-state

state = {
  id: null,
  name: '',
  age: 0,
}
const {
  id,
  ...data
} = this.state;

console.log('data', data);

name and age should not be reported as error [eslint] Unused state field: 'departmentId' (react/no-unused-state).

贡献者指南