Query module UnusedOrUndefinedStateProperty

name
Unused or undefined state property
description
Unused or undefined component state properties may be a symptom of a bug and should be examined carefully.
kind
problem
problem.severity
warning
id
js/react/unused-or-undefined-state-property
tags
correctness reliability frameworks/react
precision
high

Imports

React

Provides classes for working with React and Preact code.

RestrictedLocations

Provides classes for restricting the locations reported for program elements.

Predicates

getAPotentialStateAccess

Gets an access to a state property of c, both future, present or past state objects are considered.

getAnUndefinedStateProperty

Gets a read for a state property of c that has no corresponding write.

getAnUnusedStateProperty

Gets a write for a state property of c that has no corresponding read.

hasAStateEscape

Holds if the state object of c escapes from the scope of this file’s query.

hasUnknownStatePropertyRead

Holds if there exists a read for a state property of c that uses an unknown property name.

hasUnknownStatePropertyWrite

Holds if there exists a write for a state property of c that uses an unknown property name.

potentialStateSource

Gets the source of a future, present or past state object of c.

usesMixins

Holds if c uses the mixins mechanism (an obsolete React feature) .