Skip to content

Incorrect quick fix for "use element access" #41786

Closed

Description

// @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"];

Activity

  1. Kingwl commented on Dec 3, 2020

    @Kingwl
    Contributor

    Wow.....

  2. locked as resolved and limited conversation to collaborators on Oct 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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