TypeScript icon indicating copy to clipboard operation
TypeScript copied to clipboard

Isolated declarations quick fix results in redundant type arguments when the RHS is a new expression with explicit type arguments

Open blickly opened this issue 1 year ago • 0 comments

Acknowledgement

  • [X] I acknowledge that issues using this template may be closed without further explanation at the maintainer's discretion.

Comment

// @declaration: true
// @isolatedDeclarations: true
export const s = new Set<string>();

After generating and applying a quick-fix, the current resulting code is:

export const s: Set<string> = new Set<string>();

An ideal fix would remove the redundant type arguments in the RHS expression when adding the same type arguments to the suggested type annotation, resulting in something like:

export const s: Set<string> = new Set();

blickly avatar Aug 26 '24 23:08 blickly