-
-
Notifications
You must be signed in to change notification settings - Fork 3
Description
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
andreact-hooks/exhaustive-deps
rule toerror
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
.