Rules Overview

Emoji Legend

  • πŸ’Ό - Rule Category
  • πŸ’­ - Requires Type Information
  • β›” - Restriction
  • βœ”οΈ - Correctness
  • ❌ - Deprecated
  • 🎨 - Style
  • 🐞 - Debug
  • 🧐 - Suspicious
  • πŸ“– - Convention
  • πŸ”’ - Security
  • πŸš€ - Performance
  • πŸ€” - Pedantic
  • 🀯 - Complexity

Core Rules

RuleDescriptionπŸ’ΌπŸ’­βŒ
avoid-shorthand-booleanEnforces using shorthand syntax for boolean attributes.🎨
avoid-shorthand-fragmentEnforces using shorthand syntax for fragments.🎨
ensure-forward-ref-using-refRequires that components wrapped with forwardRef must have a ref parameter.βœ”οΈ
no-access-state-in-setstatePrevents accessing this.state inside setState calls.βœ”οΈ
no-array-index-keyPrevents using array index as key.🧐
no-children-countPrevents using Children.count.β›”
no-children-for-eachPrevents using Children.forEach.β›”
no-children-mapPrevents using Children.map.β›”
no-children-onlyPrevents using Children.only.β›”
no-children-propPrevents using children as a prop.β›”
no-children-to-arrayPrevents using Children.toArray.β›”
no-class-componentPrevents using class component.β›”
no-clone-elementPrevents using cloneElement.β›”
no-comment-textnodesPrevents comments from being inserted as text nodes.🧐
no-complex-conditional-renderingPrevents complex conditional rendering in JSX.🀯
no-component-will-mountPrevents using componentWillMount.β›”
no-component-will-receive-propsPrevents using componentWillReceiveProps.β›”
no-component-will-updatePrevents using componentWillUpdate.β›”
no-create-refPrevents using createRef.β›”
no-default-propsPrevents using defaultProps property in favor of ES6 default parameters.βœ”οΈ
no-direct-mutation-statePrevents direct mutation of this.state.βœ”οΈ
no-duplicate-keyPrevents duplicate key props on elements in the same array or a list of children.βœ”οΈ
no-implicit-keyPrevents key prop from not being explicitly specified (e.g. spreading key prop from objects).🧐❌
no-leaked-conditional-renderingPrevents problematic leaked values from being rendered.πŸ§πŸ’­
no-missing-component-display-nameEnforces that all components have a displayName which can be used in devtools.🐞
no-missing-keyPrevents missing key prop on items in list rendering.βœ”οΈ
no-nested-componentsPrevents nesting component definitions inside other components.βœ”οΈ
no-props-typesPrevents using propTypes in favor of TypeScript or another type-checking solution.β›”
no-redundant-should-component-updatePrevents using shouldComponentUpdate when extending React.PureComponent.βœ”οΈ
no-set-state-in-component-did-mountPrevents calling this.setState in componentDidMount outside of functions, such as callbacks.🧐
no-set-state-in-component-did-updatePrevents calling this.setState in componentDidUpdate outside of functions, such as callbacks.🧐
no-set-state-in-component-will-updatePrevents calling this.setState in componentWillUpdate outside of functions, such as callbacks.🧐
no-string-refsPrevents using deprecated string refs.β›”
no-unsafe-component-will-mountWarns the usage of UNSAFE_componentWillMount in class components.🧐
no-unsafe-component-will-receive-propsWarns the usage of UNSAFE_componentWillReceiveProps in class components.🧐
no-unsafe-component-will-updateWarns the usage of UNSAFE_componentWillUpdate in class components.🧐
no-unstable-context-valuePrevents non-stable values (i.e. object literals) from being used as a value for Context.Provider.πŸš€
no-unstable-default-propsPrevents using referential-type values as default props in object destructuring.πŸš€
no-unused-class-component-membersWarns unused class component methods and properties.βœ”οΈ
no-unused-stateWarns unused class component state.βœ”οΈ
no-useless-fragmentPrevents using useless fragment components or <> syntax.βœ”οΈ
prefer-destructuring-assignmentEnforces using destructuring assignment over property assignment.🎨
prefer-read-only-propsEnforce read-only props in components.βœ”οΈπŸ’­
prefer-shorthand-booleanEnforces using shorthand syntax for boolean attributes.🎨
prefer-shorthand-fragmentEnforces using shorthand syntax for fragments.🎨

DOM Rules

RuleDescriptionπŸ’ΌπŸ’­βŒ
dom/no-children-in-void-dom-elementsPrevents using children in void DOM elements.βœ”οΈ
dom/no-dangerously-set-innerhtmlPrevents DOM element using dangerouslySetInnerHTML.πŸ”’
dom/no-dangerously-set-innerhtml-with-childrenPrevents DOM element using dangerouslySetInnerHTML and children at the same time.βœ”οΈ
dom/no-find-dom-nodePrevents using findDOMNode.β›”
dom/no-missing-button-typeEnforces explicit type attribute for <button> elements.βœ”οΈ
dom/no-missing-iframe-sandboxEnforces explicit sandbox attribute for iframe elements.πŸ”’
dom/no-namespaceEnforces the absence of a namespace in React elements.βœ”οΈ
dom/no-render-return-valuePrevents using the return value of ReactDOM.render.β›”
dom/no-script-urlPrevents using javascript: URLs as the value of certain attributes.πŸ”’
dom/no-unsafe-iframe-sandboxEnforces sandbox attribute for iframe elements is not set to unsafe combinations.πŸ”’
dom/no-unsafe-target-blankPrevents using target="_blank" without rel="noreferrer noopener".πŸ”’

Hooks Extra Rules

RuleDescriptionπŸ’ΌπŸ’­βŒ
hooks-extra/ensure-custom-hooks-using-other-hooksWarns when custom Hooks that don’t use other Hooks.βœ”οΈ
hooks-extra/ensure-use-callback-has-non-empty-depsWarns when useCallback is called with empty dependencies array.🧐
hooks-extra/ensure-use-memo-has-non-empty-depsWarns when useMemo is called with empty dependencies array.🧐
hooks-extra/no-direct-set-state-in-use-effectDisallow direct calls to the set function of useState in useEffect.βœ”οΈ
hooks-extra/no-direct-set-state-in-use-layout-effectDisallow direct calls to the set function of useState in useLayoutEffect.βœ”οΈ
hooks-extra/prefer-use-state-lazy-initializationWarns function calls made inside useState calls.πŸš€

Naming Convention Rules

RuleDescriptionπŸ’ΌπŸ’­βŒ
naming-convention/component-nameEnforces naming conventions for components.πŸ“–
naming-convention/filenameEnforces naming convention for JSX files.πŸ“–
naming-convention/filename-extensionEnforces consistent use of the JSX file extension.πŸ“–
naming-convention/use-stateEnforces destructuring and symmetric naming of useState hook value and setter variables.πŸ“–

Debug Rules

RuleDescriptionπŸ’ΌπŸ’­βŒ
debug/class-componentPrint all class components.🐞
debug/function-componentPrint all function components.🐞
debug/react-hooksPrint all react hooks.🐞