Duplicate method declarations exists in the emitted .d.ts file of this JS file
See original GitHub issueDescribe the bug
Version: 14.0.0
duplicate code exists in the .d.ts declaration file generated by ts-morph from .js file.
To Reproduce
// .js
export default {
methods: {
handleScroll() {}
}
};
// .d.ts
// handleScroll is duplicate
declare namespace _default {
namespace methods {
function handleScroll(): void;
function handleScroll(): void;
}
}
export default _default;
Expected behavior no duplicate code
Issue Analytics
- State:
- Created a year ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
build mode: generated .d.ts files causing 'Duplicate identifier ...
Today, the only way you get a /// <reference types="node" /> directive out of declaration emit is by inputting one (as the mapping...
Read more >Typescript does not copy d.ts files to build - Stack Overflow
You are right - declaration:true implies that only for each given .ts file tsc generates and copies a corresponding .d.ts output file to...
Read more >Documentation - Creating .d.ts Files from .js files - TypeScript
The TSConfig is a jsonc file which configures both your compiler flags, and declare where to find files. In this case, you will...
Read more >Configuring TypeScript compiler - inDepthDev
TypeScript files are compiled into JavaScript using TypeScript compiler. ... To have the compiler emit .d.ts files, use the declaration option: <>Copy.
Read more >typescript-cheatsheet - GitHub Pages
js, most tasks are accomplished by loading one or more modules. We could define each module in its own .d.ts file with top-level...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@likuner well I won’t be able to fix it because I don’t have time and it’s a bug with the TypeScript compiler. If you need this fixed then you can look into fixing this bug I opened in TS’s repo: https://github.com/microsoft/TypeScript/issues/49200
OK, please let me know after the problem is solved, I need it urgently, Thanks!