-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Open
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: Refactoringse.g. extract to constant or function, rename symbole.g. extract to constant or function, rename symbolEffort: CasualGood issue if you're already used to contributing to the codebase. Harder than "good first issue".Good issue if you're already used to contributing to the codebase. Harder than "good first issue".Help WantedYou can do thisYou can do thisRescheduledThis issue was previously scheduled to an earlier milestoneThis issue was previously scheduled to an earlier milestone
Milestone
Description
Currently "typedef to type conversion" doesn't care about the place where type is generated, resulting broken code if the type if generated inside the class / interface etc.
It's better to generate class in closest SourceFile root, namespace root or even function body in case the comment containing @typedef is placed at any other place of the code.
🔎 Search Terms
Searched for typedef issues reported after March 1st
🕗 Version & Regression Information
- This changed between versions 5.1.x and latest
⏯ Playground Link
💻 Code
class Example {
/**
* List of items to be rendered in the bar chart
* @typedef {{ count: number }} Counter
* @returns {Counter}
*/
get something() {
return { count: 0 };
}
}
🙁 Actual behavior
class Example {
type Counter={ count: number; }; // <- bug is here
get something() {
return { count: 0 };
}
}
🙂 Expected behavior
type Counter={ count: number; };
class Example {
/**
* List of items to be rendered in the bar chart
* @returns {Counter}
*/
get something() {
return { count: 0 };
}
}
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: Refactoringse.g. extract to constant or function, rename symbole.g. extract to constant or function, rename symbolEffort: CasualGood issue if you're already used to contributing to the codebase. Harder than "good first issue".Good issue if you're already used to contributing to the codebase. Harder than "good first issue".Help WantedYou can do thisYou can do thisRescheduledThis issue was previously scheduled to an earlier milestoneThis issue was previously scheduled to an earlier milestone