jsx-eslint/eslint-plugin-react

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

Open

#1,626 opened on Dec 25, 2017

 (10 comments) (0 reactions) (0 assignees)JavaScript (2,734 forks)batch import
enhancementhelp wanted

Repository metrics

Stars
 (9,294 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

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

Contributor guide