microsoft / microsoft/TypeScript

convert a property/element access expression to a getter and setter

Open
#26,767 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Awaiting More Feedback Suggestion
Dominant language
Go
Stars
111k
Forks
14.3k
Avg merge
2d 4h
Merged PRs (30d)
132

Description

Search Terms

refactor, getter, setter

Suggestion

convert a property/element access expression to a getter and setter

Use Cases

this.a.b.c.d = 1

to

get /*RENAME*/ temp1 () {
  return this.a.b.c.d
}
set temp1 (value) {
  this.a.b.c.d = value
}

/// ...

this.temp1 = 1

Examples

Checklist

My suggestion meets these guidelines:

  • This wouldn't be a breaking change in existing TypeScript / JavaScript code
  • This wouldn't change the runtime behavior of existing JavaScript code
  • This could be implemented without emitting different JS based on the types of the expressions
  • This isn't a runtime feature (e.g. new expression-level syntax)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no source files, tests, or entry points; start by locating the TypeScript refactoring or language-service implementation for transformations involving property and element access. Done means the shown access expression can be converted to a getter and setter while preserving the demonstrated read and write behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.