[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>
Showing
| ... | @@ -34,7 +34,7 @@ | ... | @@ -34,7 +34,7 @@ |
| "git-clean": "git clean -d -x -e node_modules -e packages -f", | "git-clean": "git clean -d -x -e node_modules -e packages -f", | ||
| "typescript": "tsc --noEmit", | "typescript": "tsc --noEmit", | ||
| "lint-typescript": "turbo run typescript", | "lint-typescript": "turbo run typescript", | ||
| "lint-eslint": "eslint . --ext js,jsx,ts,tsx --config .eslintrc.cli.json --no-eslintrc", | "lint-eslint": "cross-env ESLINT_USE_FLAT_CONFIG=false eslint . --ext js,jsx,ts,tsx --config .eslintrc.cli.json --no-eslintrc", | ||
| "lint-ast-grep": "ast-grep scan", | "lint-ast-grep": "ast-grep scan", | ||
| "lint-no-typescript": "run-p prettier-check lint-eslint lint-language", | "lint-no-typescript": "run-p prettier-check lint-eslint lint-language", | ||
| "types-and-precompiled": "run-p lint-typescript check-precompiled validate-externals-doc", | "types-and-precompiled": "run-p lint-typescript check-precompiled validate-externals-doc", | ||
| ... | @@ -121,8 +121,8 @@ | ... | @@ -121,8 +121,8 @@ |
| "@types/relay-runtime": "14.1.13", | "@types/relay-runtime": "14.1.13", | ||
| "@types/string-hash": "1.1.1", | "@types/string-hash": "1.1.1", | ||
| "@types/trusted-types": "2.0.3", | "@types/trusted-types": "2.0.3", | ||
| "@typescript-eslint/eslint-plugin": "7.16.0", | "@typescript-eslint/eslint-plugin": "8.0.0", | ||
| "@typescript-eslint/parser": "7.16.0", | "@typescript-eslint/parser": "8.0.0", | ||
| "@vercel/devlow-bench": "workspace:*", | "@vercel/devlow-bench": "workspace:*", | ||
| "@vercel/fetch": "6.1.1", | "@vercel/fetch": "6.1.1", | ||
| "@vercel/og": "0.6.3", | "@vercel/og": "0.6.3", | ||
| ... | @@ -144,15 +144,16 @@ | ... | @@ -144,15 +144,16 @@ |
| "dd-trace": "4.12.0", | "dd-trace": "4.12.0", | ||
| "es5-ext": "0.10.53", | "es5-ext": "0.10.53", | ||
| "escape-string-regexp": "2.0.0", | "escape-string-regexp": "2.0.0", | ||
| "eslint": "8.56.0", | "eslint": "9.12.0", | ||
| "eslint-config-next": "workspace:*", | "eslint-config-next": "workspace:*", | ||
| "eslint-formatter-codeframe": "7.32.1", | "eslint-formatter-codeframe": "7.32.1", | ||
| "eslint-plugin-eslint-plugin": "5.2.1", | "eslint-plugin-eslint-plugin": "5.2.1", | ||
| "eslint-plugin-import": "2.29.1", | "eslint-plugin-import": "2.31.0", | ||
| "eslint-plugin-jest": "27.6.3", | "eslint-plugin-jest": "27.6.3", | ||
| "eslint-plugin-jsdoc": "48.0.4", | "eslint-plugin-jsdoc": "48.0.4", | ||
| "eslint-plugin-react": "7.33.2", | "eslint-plugin-react": "7.35.0", | ||
| "eslint-plugin-react-hooks": "4.6.0", | "eslint-plugin-react-hooks": "5.0.0", | ||
| "eslint-v8": "npm:eslint@^8.57.0", | |||
| "event-stream": "4.0.1", | "event-stream": "4.0.1", | ||
| "execa": "2.0.3", | "execa": "2.0.3", | ||
| "expect-type": "0.14.2", | "expect-type": "0.14.2", | ||
| ... | ... |
This source diff could not be displayed because it is too large.
You can
view the blob
instead.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Please
register
or
sign in
to comment