-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: Declaration EmitThe issue relates to the emission of d.ts filesThe issue relates to the emission of d.ts filesHelp WantedYou can do thisYou can do this
Milestone
Description
Bug Report
TypeScript is producing duplicate methods in the generated declaration file of a JavaScript file.
🔎 Search Terms
emit allowJs duplicate methods
🕗 Version & Regression Information
Tried it in two:
- 4.8.0-dev.20220521
- 4.5.5
💻 Code
main.js (not .ts... works fine in .ts):
export default {
methods: {
handleScroll() {}
}
};tsconfig.json:
{
"compilerOptions": {
"target": "es2016",
"declaration": true,
"emitDeclarationOnly": true,
"allowJs": true,
"module": "commonjs",
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"strict": true,
"skipLibCheck": true
}
}🙁 Actual behavior
main.d.ts:
declare namespace _default {
namespace methods {
function handleScroll(): void;
function handleScroll(): void;
}
}
export default _default;🙂 Expected behavior
declare namespace _default {
namespace methods {
function handleScroll(): void;
}
}
export default _default;Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: Declaration EmitThe issue relates to the emission of d.ts filesThe issue relates to the emission of d.ts filesHelp WantedYou can do thisYou can do this