Rules
Overview

Rules Overview

JSX

Name                               Description
jsx/no-array-index-keydisallow using Array index as key
jsx/no-comment-textnodesdisallow comments from being inserted as text nodes
jsx/no-complicated-conditional-renderingdisallow complicated conditional rendering
jsx/no-duplicate-keydisallow duplicate keys in key prop when rendering list
jsx/no-leaked-conditional-renderingdisallow problematic leaked values from being rendered
jsx/no-missing-keyrequire key prop when rendering list
jsx/no-spreading-keydisallow spreading key from objects.
jsx/no-useless-fragmentdisallow unnecessary fragments
jsx/prefer-shorthand-booleanenforce boolean attributes notation in JSX
jsx/prefer-shorthand-fragmentenforce using fragment syntax instead of Fragment component

React Hooks

NameDescription
react-hooks/ensure-custom-hooks-using-other-hooksenforce custom hooks using other hooks
react-hooks/ensure-use-callback-has-non-empty-depsenforce useCallback has non-empty dependencies array
react-hooks/ensure-use-memo-has-non-empty-depsenforce useMemo has non-empty dependencies array

React

NameDescription
react/no-children-countdisallow Children.count
react/no-children-for-eachdisallow Children.forEach
react/no-children-in-void-dom-elementsdisallow passing children to void DOM elements
react/no-children-mapdisallow Children.map
react/no-children-onlydisallow Children.only()
react/no-children-propdisallow passing of children as props
react/no-children-to-arraydisallow Children.toArray()
react/no-class-componentdisallow class component
react/no-clone-elementdisallow cloneElement
react/no-component-will-mountdisallow componentWillMount
react/no-component-will-receive-propsdisallow componentWillReceiveProps
react/no-component-will-updatedisallow componentWillUpdate
react/no-constructed-context-valuedisallow passing constructed values to context providers
react/no-create-refdisallow createRef in function components
react/no-dangerously-set-innerhtmldisallow when a DOM element is using dangerouslySetInnerHTML
react/no-dangerously-set-innerhtml-with-childrendisallow when a DOM element is using both children and dangerouslySetInnerHTML
react/no-direct-mutation-statedisallow direct mutation of this.state
react/no-find-dom-nodedisallow findDOMNode
react/no-missing-button-typeenforce that button elements have an explicit type attribute
react/no-missing-iframe-sandboxenforce that iframe elements explicitly specify a sandbox attribute
react/no-namespaceenforce that namespaces are not used in React elements
react/no-redundant-should-component-updatedisallow usage of shouldComponentUpdate in class component extends React.PureComponent
react/no-render-return-valuedisallow usage of the return value of ReactDOM.render
react/no-script-urldisallow javascript: URLs as JSX event handler prop's value
react/no-set-state-in-component-did-mountdisallow usage of this.setState in componentDidMount
react/no-set-state-in-component-did-updatedisallow usage of this.setState in componentDidUpdate
react/no-set-state-in-component-will-updatedisallow usage of this.setState in componentWillUpdate
react/no-string-refsdisallow using deprecated string refs
react/no-unsafe-component-will-mountdisallow usage of UNSAFE_componentWillMount in class components
react/no-unsafe-component-will-receive-propsdisallow usage of UNSAFE_componentWillReceiveProps in class components
react/no-unsafe-component-will-updatedisallow usage of UNSAFE_componentWillUpdate in class components
react/no-unsafe-iframe-sandboxdisallow unsafe iframe sandbox attribute combinations
react/no-unsafe-target-blankdisallow target="_blank" without rel="noreferrer noopener"
react/no-unstable-default-propsdisallow usage of unstable value as default param in function component
react/no-unstable-nested-componentsdisallow usage of unstable nested components
react/prefer-destructuring-assignmentenforce using destructuring assignment in component props and context

Naming Convention

Name                                Description
naming-convention/component-nameenforce component naming convention to PascalCase or CONSTANT_CASE
naming-convention/filenameenforce naming convention for JSX file names
naming-convention/filename-extensionenforce naming convention for JSX file extensions

Debug

NameDescription
debug/class-componentreport all class components, including anonymous ones
debug/function-componentreport all function components, including anonymous ones
debug/react-hooksreport all react hooks