Skip to content

React Hooks support and entry point #17

@arcticicestudio

Description

@arcticicestudio

All React based Arctic Ice Studio projects using at least React version 16.8 that introduced the awesome Hooks. Since this comes with a entire new API that follows new design/usage pattern, the React team created an official „Hooks“ ESLint plugin to help to adhere to the „Rules of Hooks“.

Since the @arcticicestudio/eslint-config package already includes support for React and „JSX A11Y“, support for Hooks will also be added through a new shareable configuration entry point that

  • enables the react-hooks plugin.
  • configures both currently available rules react-hooks/rules-of-hooks and react-hooks/exhaustive-deps rule to error level.

Because Hooks make more use of arrow functions the react/jsx-no-bind will be adjusted to prevent compatibility problems by allowing setting the ignoreDOMComponents and allowArrowFunctions options to true.
The react/display-name rule will also be disabled in order to prevent problems due to missing display names for functional components that make use of Hooks instead of being created through a class component.

The new entry point will be available as @arcticicestudio/eslint-config/react-hooks and can be composed with all other available entry points to inherit their rules.

This feature will add the eslint-plugin-react-hooks package as new peer dependency for @arcticicestudio/eslint-config.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions