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 (8,630 star) (2,797 fork)batch import
enhancementhelp wanted

描述

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).

貢獻者指南