-
Notifications
You must be signed in to change notification settings - Fork 65
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
bug: ts issues in d.ts file #25
Comments
The 2nd issue happens due to naming collision in the unified deceleration file and can be easily solved by giving the spread parameter a different name. Spent a couple of hours investigating the 1st issue. I managed to understand that because @types/mocha declares a namespace for NodeJs - declare namespace NodeJS {
// Forward declaration for `NodeJS.EventEmitter` from node.d.ts.
// Required by Mocha.Runnable, Mocha.Runner, and Mocha.Suite.
// NOTE: Mocha *must not* have a direct dependency on @types/node.
// tslint:disable-next-line no-empty-interface
interface EventEmitter { }
// Augments NodeJS's `global` object when node.d.ts is loaded
// tslint:disable-next-line no-empty-interface
interface Global extends Mocha.MochaGlobals { }
} It causes typescript to assume that mocha is a referenced type. The strange thing is that if you run plain The issue first appears in the @arcanis this can be easily solved if we separate the test dependencies, maybe by putting it in a different sub package.When I remove the @types/mocha as a dependency the issue got resolved... p.s |
So it seems that solution was easy - declare explicitly the types in tsconfig and not put mocha there when bundling |
What is |
Seems to be a bug in the rollup ts plugin. I will open 2 issues there later today with reproduction repos |
The roolup ts plugin causes the issue, it thinks it collides with binaryName from Core.ts for some reason. This is not a typescript issue but the plugins way to handle conflicts while merging the deceleration files. |
Released in 2.4.2 |
Thanks @arcanis ! |
Hi @arcanis
My PR in snyk/nodejs-lockfile-parser#57 is using @yarnpkg/core which in turn depends on this library (2.4.1) but the d.ts file of the published npm files causes compilation issues.
I will try to create a quick PR to fix it
The text was updated successfully, but these errors were encountered: