Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.8k
Description
Overview
A handful of folks have mentioned that after upgrading to v6, trying toimport
from@typescript-eslint/*
packages such as@typescript-eslint/utils
causes a new TypeScript type error:
import{ESLintUtils}from'@typescript-eslint/utils';
Cannot find module '@typescript-eslint/utils' or its corresponding type declarations.
This is not a bug. We intentionally dropped support in v6 for Node <16 asthose versions of node are EOL.v6 uses package.json exports - which requires Node 16+ and isn't supported by that older module resolution strategy.
To fix the issue, switch your TSConfig's module resolution to a newer version, most likely"bundler"
,"node16"
, or"nodenext"
. See theaka.ms/tsconfig"moduleResolution"
docs for more information.
{"compilerOptions": {"moduleResolution":"bundler" }}
SeeTypeScript's new modules reference docs for more information.
Issues that are duplicates of this one:
- Bug: @typescript-eslint/parser - missing types #7279
- Bug: eslint-plugin@6.0.0/index.d.ts contains TS errors #7213 (comment)
- @typescript-eslint/utils imports no longer detect types in moduleResolution: node(10) in 6.0.0 #7185
https://arethetypeswrong.github.io/?p=%40typescript-eslint%2Futils%406.0.0 also shows a nice table of whichmoduleResolution
values we support. It's all of them exceptnode10
.
Keeping this issue open so it shows up more in searches.