-
eslint
—>=9
-
globals
—>=14
-
eslint-plugin-react
—7.34.2
-
eslint-plugin-react-hooks
—4.6.2
-
eslint-plugin-jest
—28.6.0
yarn add -D @glyph-cat/eslint-config
yarn add -D @glyph-cat/eslint-config eslint-plugin-jest
yarn add -D @glyph-cat/eslint-config eslint-plugin-react eslint-plugin-react-hooks
yarn add -D @glyph-cat/eslint-config eslint-plugin-jest eslint-plugin-react eslint-plugin-react-hooks
const { recommended as baseRecommended } = require('@glyph-cat/eslint-config/base')
const { recommended as jestRecommended } = require('@glyph-cat/eslint-config/jest')
const { recommended as reactRecommended } = require('@glyph-cat/eslint-config/react')
module.exports = [
...baseRecommended,
...jestRecommended, // optional, for projects that uses Jest
...reactRecommended, // optional, for React projects
]
const { libraryAuthoring as baseLibraryAuthoring } = require('@glyph-cat/eslint-config/base')
const { libraryAuthoring as jestLibraryAuthoring } = require('@glyph-cat/eslint-config/jest')
const { libraryAuthoring as reactLibraryAuthoring } = require('@glyph-cat/eslint-config/react')
module.exports = [
...baseLibraryAuthoring,
...jestLibraryAuthoring, // optional, but libraries should be adequately tested to begin with
...reactLibraryAuthoring, // optional, for React-based libraries
]
Solution: Run yarn why globals
to check the version. Make sure the version of globals is at least v14.X.X. The package can be updated to the latest version by running yarn upgrade global@latest
.
The eslint-plugin-react
installed might be an old version, run yarn upgrade eslint-plugin-react@latest
and the problem should be resolved. Working version of eslint-plugin-react
is 7.34.2
at the time of writing.
For the time being, install the rc
version by running yarn upgrade eslint-plugin-react@rc
to resolve the problem. (written as of 09 June 2024)