openedx / wg-frontend

Open edX Frontend Working Group
4 stars 1 forks source link

eslint-plugin-react-hooks in @edx/frontend-build doesn't seem to be working #99

Closed adamstankiewicz closed 2 years ago

adamstankiewicz commented 2 years ago

@edx/frontend-build attempts to utilize eslint-plugin-react-hooks (code), insofar as installing the package in its package.json file. The default ESLint config file in @edx/frontend-build extends the @edx/eslint-config package (code).

The @edx/eslint-config package in turns extends from the airbnb ESlint config (code):

// The airbnb config includes configuraton for import, react, and jsx-a11y.
// That means it's the only thing we need here.  We still need to
// have those eslint-config plugins installed, though - it defines them
// as peer dependencies.

~The eslint-plugin-react-hooks plugin also falls into this, where the airbnb config is configuring ESLint for React hooks.~ As it turns out, the airbnb ESLint config does not enable the hooks linting by default. To enable this, we must extend "airbnb/hooks" as well: https://github.com/airbnb/javascript/blob/fdc812a0a5773449274f7c4d473e0841eca89614/packages/eslint-config-airbnb/README.md#eslint-config-airbnbhooks

adamstankiewicz commented 2 years ago

This was resolved in @edx/eslint-config@3.0.0 and @edx/frontend-build@10.0.0.