[BREAKING] Support ESLint v9 in plugin, config and `next lint` (#71218)
> [!WARNING]
> **Breaking Change:** Now uses `eslint-plugin-react-hooks@5.0.0` which
has a new violation disallowing Component names starting with anything
but an uppercase letter. See
https://github.com/facebook/react/releases/tag/eslint-plugin-react-hooks%405.0.0
for more details.
Adds support of ESLint v9 to `eslint-plugin-next`, `eslint-config-next`
and `next lint`.
Does not require using the new flat config format. `next lint` will
automatically ensure the old config format can be used.
### Why?
As `eslint-plugin-react-hooks` has been updated for ESLint v9 support
and is a helpful package for Next v15 upgrade, unblock the restrictions
to upgrade to ESLint v9.
Also, ESLint v8 is [End of
Life](https://eslint.org/blog/2024/09/eslint-v8-eol-version-support/#:~:text=ESLint%20v8.-,x%20end%20of%20life%20is%20October%205%2C%202024,x%20on%20October%205%2C%202024.)
support since Oct 5th, so is good to unblock v9 now.
Plugins bumped:
- [x]
[@rushstack/eslint-patch](https://github.com/microsoft/rushstack/pull/4719)
([v1.10.3](https://www.npmjs.com/package/@rushstack/eslint-patch/v/1.10.3?activeTab=versions)
no release post, confirmed on NPM)
- [x]
[@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/pull/9002)
([v8.0.0](https://github.com/typescript-eslint/typescript-eslint/pull/9002#issuecomment-2106424400))
- [x]
[eslint-plugin-import](https://github.com/import-js/eslint-plugin-import/pull/2996)
([v2.31.0](https://github.com/import-js/eslint-plugin-import/releases/tag/v2.31.0))
- [x]
[eslint-plugin-jsx-a11y](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/pull/1009)
([v6.10.0](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/releases/tag/v6.10.0))
- [x]
[eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react/pull/3759)
([v7.35.0](https://github.com/jsx-eslint/eslint-plugin-react/releases/tag/v7.35.0))
- [x]
[eslint-plugin-react-hooks](https://github.com/facebook/react/pull/28773)
([v5.0.0](https://github.com/facebook/react/releases/tag/eslint-plugin-react-hooks%405.0.0))
We have to switch to ESLint v9 in our repo due to a pnpm bug where it
automatically uses ESLint v9 even though we only installed it via
`eslint-v9: npm:eslint@9.0.0`. This is a pnpm bug that wouldn't happen
with Yarn v1, v4 nor NPM.
Closes https://github.com/vercel/next.js/issues/64409
Closes https://github.com/vercel/next.js/issues/64114
Closes https://github.com/vercel/next.js/issues/64453
Closes NEXT-3293
---------
Co-authored-by: Sebastian "Sebbie" Silbermann <sebastian.silbermann@vercel.com>