-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: LS: Refactoringse.g. extract to constant or function, rename symbole.g. extract to constant or function, rename symbolEffort: ModerateRequires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual".Requires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual".FixedA PR has been merged for this issueA PR has been merged for this issueHelp WantedYou can do thisYou can do this
Milestone
Description
let yadda = document.getElementById("asd")!;
let badda = document.getElementById("asd") as HTMLElement;
let bing = <HTMLElement>document.getElementById("asd");Try extracting the complete initializers of yadda, badda, and bing.
Each will create a new local variable, but will be unnecessarily parenthesized.
const newLocal = (document.getElementById("asd")!);
let yadda = newLocal;
const newLocal_1 = (document.getElementById("asd") as HTMLElement);
let badda = newLocal_1;
const newLocal_2 = (<HTMLElement>document.getElementById("asd"));
let bing = newLocal_2;The expected behavior is to not add these parentheses
const newLocal = document.getElementById("asd")!;
let yadda = newLocal;
const newLocal_1 = document.getElementById("asd") as HTMLElement;
let badda = newLocal_1;
const newLocal_2 = <HTMLElement>document.getElementById("asd");
let bing = newLocal_2;Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: LS: Refactoringse.g. extract to constant or function, rename symbole.g. extract to constant or function, rename symbolEffort: ModerateRequires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual".Requires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual".FixedA PR has been merged for this issueA PR has been merged for this issueHelp WantedYou can do thisYou can do this