We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
eslint-plugin-react-x
eslint-plugin-react-dom
eslint-plugin-react-web-api
eslint-plugin-react-hooks
eslint-plugin-react-hooks-extra
eslint-plugin-react-naming-convention
ensure-forward-ref-using-ref
forwardRef
ref
no-access-state-in-setstate
this.state
setState
no-array-index-key
index
key
no-children-count
Children.count
no-children-for-each
Children.forEach
no-children-map
Children.map
no-children-only
Children.only
no-children-prop
children
no-children-to-array
Children.toArray
no-class-component
no-clone-element
cloneElement
no-comment-textnodes
no-complex-conditional-rendering
no-component-will-mount
componentWillMount
no-component-will-receive-props
componentWillReceiveProps
no-component-will-update
componentWillUpdate
no-create-ref
createRef
no-default-props
defaultProps
no-direct-mutation-state
no-duplicate-key
no-forward-ref
no-implicit-key
no-leaked-conditional-rendering
no-missing-component-display-name
displayName
no-missing-key
no-nested-components
no-prop-types
propTypes
no-redundant-should-component-update
shouldComponentUpdate
React.PureComponent
no-set-state-in-component-did-mount
this.setState
componentDidMount
no-set-state-in-component-did-update
componentDidUpdate
no-set-state-in-component-will-update
no-string-refs
refs
no-unsafe-component-will-mount
UNSAFE_componentWillMount
no-unsafe-component-will-receive-props
UNSAFE_componentWillReceiveProps
no-unsafe-component-will-update
UNSAFE_componentWillUpdate
no-unstable-context-value
Context.Provider
no-unstable-default-props
no-unused-class-component-members
no-unused-state
no-useless-fragment
fragment
<>
prefer-destructuring-assignment
prefer-read-only-props
prefer-shorthand-boolean
prefer-shorthand-fragment
no-dangerously-set-innerhtml-with-children
DOM element
dangerouslySetInnerHTML
no-dangerously-set-innerhtml
no-find-dom-node
findDOMNode
no-missing-button-type
type
<button>
no-missing-iframe-sandbox
sandbox
iframe
no-namespace
namespace
no-render-return-value
ReactDOM.render
no-script-url
javascript:
no-unsafe-iframe-sandbox
no-unsafe-target-blank
target="_blank"
rel="noreferrer noopener"
no-void-elements-with-children
no-leaked-timeout
setTimeout
no-leaked-interval
setInterval
no-leaked-idle-callback
requestIdleCallback
no-leaked-animation-frame
requestAnimationFrame
no-leaked-event-source
EventSource
no-leaked-event-listener
addEventListener
no-leaked-resize-observer
ResizeObserver
no-leaked-intersection-observer
IntersectionObserver
no-leaked-mutation-observer
MutationObserver
no-leaked-performance-observer
PerformanceObserver
no-leaked-websocket
WebSocket
no-leaked-broadcast-channel
BroadcastChannel
no-leaked-geolocation
Geolocation.watchPosition()
no-leaked-absolute-orientation-sensor
AbsoluteOrientationSensor
no-leaked-relative-accelerometer
Accelerometer
no-leaked-ambient-light-sensor
AmbientLightSensor
no-leaked-gravity-sensor
GravitySensor
no-leaked-gyroscope
Gyroscope
no-leaked-linear-acceleration-sensor
LinearAccelerationSensor
no-leaked-magnetometer
Magnetometer
no-leaked-orientation-sensor
OrientationSensor
no-direct-set-state-in-use-effect
set
useState
useEffect
no-unnecessary-use-callback
useCallback
no-unnecessary-use-memo
useMemo
no-useless-custom-hooks
prefer-use-state-lazy-initialization
component-name
filename
filename-extension
use-state
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Roadmap
Milestone 1.0
Plugins (with ecological niche explanation)
eslint-plugin-react-x
- Core rules (renderer-agnostic, compatible with x-platform).eslint-plugin-react-dom
- DOM Specific rules for React DOM.eslint-plugin-react-web-api
- Rules for interacting with Web APIs.eslint-plugin-react-hooks
- The official one from React.eslint-plugin-react-hooks-extra
- Extra rules foreslint-plugin-react-hooks
.eslint-plugin-react-naming-convention
- Optional naming convention rules (can be replaced with other plugins depending on the project).Rules in
eslint-plugin-react-x
ensure-forward-ref-using-ref
forwardRef
must have aref
parameter.no-access-state-in-setstate
this.state
insidesetState
calls.no-array-index-key
index
askey
.no-children-count
Children.count
.no-children-for-each
Children.forEach
.no-children-map
Children.map
.no-children-only
Children.only
.no-children-prop
children
as a prop.no-children-to-array
Children.toArray
.no-class-component
no-clone-element
cloneElement
.no-comment-textnodes
no-complex-conditional-rendering
no-component-will-mount
componentWillMount
.no-component-will-receive-props
componentWillReceiveProps
.no-component-will-update
componentWillUpdate
.no-create-ref
createRef
.no-default-props
defaultProps
property in favor of ES6 default parameters.no-direct-mutation-state
this.state
.no-duplicate-key
key
on elements in the same array or a list ofchildren
.no-forward-ref
forwardRef
.no-implicit-key
key
from not being explicitly specified (e.g. spreadingkey
from objects).no-leaked-conditional-rendering
no-missing-component-display-name
displayName
which can be used in devtools.no-missing-key
key
on items in list rendering.no-nested-components
no-prop-types
propTypes
in favor of TypeScript or another type-checking solution.no-redundant-should-component-update
shouldComponentUpdate
when extendingReact.PureComponent
.no-set-state-in-component-did-mount
this.setState
incomponentDidMount
outside of functions, such as callbacks.no-set-state-in-component-did-update
this.setState
incomponentDidUpdate
outside of functions, such as callbacks.no-set-state-in-component-will-update
this.setState
incomponentWillUpdate
outside of functions, such as callbacks.no-string-refs
refs
.no-unsafe-component-will-mount
UNSAFE_componentWillMount
in class components.no-unsafe-component-will-receive-props
UNSAFE_componentWillReceiveProps
in class components.no-unsafe-component-will-update
UNSAFE_componentWillUpdate
in class components.no-unstable-context-value
Context.Provider
.no-unstable-default-props
no-unused-class-component-members
no-unused-state
no-useless-fragment
fragment
components or<>
syntax.prefer-destructuring-assignment
prefer-read-only-props
prefer-shorthand-boolean
prefer-shorthand-fragment
Rules in
eslint-plugin-react-dom
no-dangerously-set-innerhtml-with-children
DOM element
usingdangerouslySetInnerHTML
andchildren
at the same time.no-dangerously-set-innerhtml
DOM element
usingdangerouslySetInnerHTML
.no-find-dom-node
findDOMNode
.no-missing-button-type
type
attribute for<button>
elements.no-missing-iframe-sandbox
sandbox
attribute foriframe
elements.no-namespace
namespace
in React elements.no-render-return-value
ReactDOM.render
.no-script-url
javascript:
URLs as the value of certain attributes.no-unsafe-iframe-sandbox
sandbox
attribute foriframe
elements is not set to unsafe combinations.no-unsafe-target-blank
target="_blank"
withoutrel="noreferrer noopener"
.no-void-elements-with-children
children
to void DOM elements.Rules in
eslint-plugin-react-web-api
no-leaked-timeout
setTimeout
no-leaked-interval
setInterval
no-leaked-idle-callback
requestIdleCallback
no-leaked-animation-frame
requestAnimationFrame
no-leaked-event-source
EventSource
no-leaked-event-listener
addEventListener
no-leaked-resize-observer
ResizeObserver
no-leaked-intersection-observer
IntersectionObserver
no-leaked-mutation-observer
MutationObserver
no-leaked-performance-observer
PerformanceObserver
no-leaked-websocket
WebSocket
no-leaked-broadcast-channel
BroadcastChannel
no-leaked-geolocation
Geolocation.watchPosition()
no-leaked-absolute-orientation-sensor
AbsoluteOrientationSensor
no-leaked-relative-accelerometer
Accelerometer
no-leaked-ambient-light-sensor
AmbientLightSensor
no-leaked-gravity-sensor
GravitySensor
no-leaked-gyroscope
Gyroscope
no-leaked-linear-acceleration-sensor
LinearAccelerationSensor
no-leaked-magnetometer
Magnetometer
no-leaked-orientation-sensor
OrientationSensor
Rules in
eslint-plugin-react-hooks-extra
no-direct-set-state-in-use-effect
set
function ofuseState
inuseEffect
.no-unnecessary-use-callback
useCallback
.no-unnecessary-use-memo
useMemo
.no-useless-custom-hooks
prefer-use-state-lazy-initialization
useState
calls.Rules in
eslint-plugin-react-naming-convention
component-name
filename
filename-extension
use-state
useState
hook value and setter variables.The text was updated successfully, but these errors were encountered: