You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
.eslintrc.cjs can be moved to eslint.config.js - a lot of the Typescript setup can be deleted, it's now handled automatically by typescript-eslint; see their migration instructions.
Install @eslint/js, @types/eslint, and typescript-eslint as dev dependencies.
Remove @typescript-eslint/parser and @typescript-eslint/eslint-plugin from package.json.
All of the plugins (react/recommended, react-hooks/recommended, react/jsx-runtime, prettier/recommended, and react-refresh) need to be upgraded to work with ESLint 9 before I can update. As of 4/27/2024, eslint-plugin-react definitely isn't - see jsx-eslint/eslint-plugin-react#3699. I haven't checked the other plugins.
The new file will probably look something like:
importeslintfrom"@eslint/js";importtseslintfrom"typescript-eslint";importeslintReactfrom"eslint-plugin-react";exportdefaulttseslint.config(// replaces the ignorePatterns key{ignores: ["dist"],},eslint.configs.recommended,// sets up ESLint's recommended config,
...tseslint.configs.recommendedTypeChecked,// sets up typescript-eslint's requirements and it's "recommended-type-checked" config// config object with customizations{// new way of importing pluginsplugins: {"react": eslintReact,// other plugins...},// rule customizations stay the samerules: {"react-refresh/only-export-components": ["warn",{allowConstantExport: true}],"prettier/prettier": "warn",},});
I'm not sure if the env config, env: { browser: true, es2020: true }, is still needed; the ESLint migration guide suggests something with languageOptions.globals. This might be handled automatically by typescript-eslint - their guides don't mention setting this.
I'm also not sure what to do with the settings config:
Upgrade to ESLint 9, with its new flat config system. ESLint has a migration guide.
.eslintrc.cjs
can be moved toeslint.config.js
- a lot of the Typescript setup can be deleted, it's now handled automatically by typescript-eslint; see their migration instructions.@eslint/js
,@types/eslint
, andtypescript-eslint
as dev dependencies.@typescript-eslint/parser
and@typescript-eslint/eslint-plugin
frompackage.json
.All of the plugins (react/recommended, react-hooks/recommended, react/jsx-runtime, prettier/recommended, and react-refresh) need to be upgraded to work with ESLint 9 before I can update. As of 4/27/2024,
eslint-plugin-react
definitely isn't - see jsx-eslint/eslint-plugin-react#3699. I haven't checked the other plugins.The new file will probably look something like:
I'm not sure if the
env
config,env: { browser: true, es2020: true },
is still needed; the ESLint migration guide suggests something withlanguageOptions.globals
. This might be handled automatically bytypescript-eslint
- their guides don't mention setting this.I'm also not sure what to do with the
settings
config:This ESLint blog post on the new config system suggests that putting it first in the array of config objects should work.
The text was updated successfully, but these errors were encountered: