microsoft / microsoft/TypeScript
convert a property/element access expression to a getter and setter
Open
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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