Skip to content

Incorrect quick fix for "use element access" #41786

@DanielRosenwasser

Description

@DanielRosenwasser
// @noPropertyAccessFromIndexSignature: true

declare let x: { y: { [x: string]: string } };

x.y.yadda/**/;

Request quick fixes here.

Current behavior*:

Quick fix is suggested for y, the code results in

declare let x: { y: { [x: string]: string } };

x["y"].yadda;

Expected:

Quick fix is suggested for yadda, the code results in

declare let x: { y: { [x: string]: string } };

x.y["yadda"];

Metadata

Metadata

Labels

BugA bug in TypeScriptDomain: LS: Quick FixesEditor-provided fixes, often called code actions.Effort: ModerateRequires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual".Fix AvailableA PR has been opened for this issueHelp WantedYou can do this

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions