Skip to content

Option to disable aliased JS/TS destructured property renaming #29238

Closed
@jasongerbes

Description

@jasongerbes

As per the version 1.30 release notes:

Renames handle JS/TS destructuring properly
Renames now handle JavaScript and TypeScript destructuring and will introduce an alias if needed

This means that renaming a property will result in the property being aliased by it's old name wherever destructuring assignment has been used. For example:

// before rename
const x = {
    y: 'value'
}
const { y } = x;
console.log(y);

// after rename
const x = {
    z: 'value'
}
const { z: y } = x;
console.log(y);

Previously, the destructed parameter's name would be updated, as well as all of its usages:

// before rename
const x = {
    y: 'value'
}
const { y } = x;
console.log(y);

// after rename
const x = {
    z: 'value'
}
const { z } = x;
console.log(z);

Can you please make this new behaviour optional?

Metadata

Metadata

Assignees

No one assigned

    Labels

    CommittedThe team has roadmapped this issueSuggestionAn idea for TypeScript

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions