New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Typescript support for moduleResolution node16 #96
Comments
Could you provide the use cases or concrete code slices? Is it only a linting warning about potential issues or are there any real failures? Here is the test case only for ts definition: https://github.com/kaelzhang/node-ignore/blob/master/test/ts/simple.ts |
Sure and it's a real typescript typing/intellisense failure, not just linting. I ran into this in my own project here: I think with typescript + node16 resolution, when you share a single types file with cjs and esm, it seems to assume cjs. In this code, I had to @ts-expect-error because If you need a repo environment, that project should work, just removed the @ts-expect-error and you should see the same bug. If that doesn't work for you, creating a narrowed reproduction repo wouldn't be difficult, it will just take a few days since the work week is starting. |
It is really weird that
|
@kaelzhang I think the only way to fix this is to add a real esm output: {
"name": "ignore",
"version": "5.3.0",
"main": "index.js",
"module": "index.mjs",
"types": "index.d.ts"
} |
As a typescript user when setting moduleResolution to Node16 or NodeNext, I currently get typescript failures from the ignore package.
Due to typescript-eslint@6 upgrading to only support Node16+, I'm unable to support both simultaneously.
For more information on possible fixes see:
https://arethetypeswrong.github.io/?p=ignore
The text was updated successfully, but these errors were encountered: