jsx-eslint/eslint-plugin-react

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

Open

#1.626 geöffnet am 25. Dez. 2017

Auf GitHub ansehen
 (10 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)JavaScript (2.797 Forks)batch import
enhancementhelp wanted

Repository-Metriken

Stars
 (8.630 Stars)
PR-Merge-Metriken
 (Keine gemergten PRs in 30 T)

Beschreibung

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