Skip to content

factory.updateModifiers should be part of NodeFactory public apiΒ #42254

@FranklinWhale

Description

@FranklinWhale

Suggestion

πŸ” Search Terms

node, modifiers, update, updateModifiers

βœ… Viability 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. library functionality, non-ECMAScript syntax with JavaScript output, new syntax sugar for JS, etc.)
  • This feature would agree with the rest of TypeScript's Design Goals.

⭐ Suggestion

Currently modifying the modifiers for different types of nodes is a bit complicated because each type of nodes has its own update method provided by the factory. The factory already has a updateModifiers method; it is just not public.

πŸ“ƒ Motivating Example

https://stackoverflow.com/questions/65075866/typescript-compiler-api-how-to-add-remove-modifier-from-statement

πŸ’» Use Cases

Allow API user to update any node with modifiers using the same method

Metadata

Metadata

Assignees

Labels

Fix AvailableA PR has been opened for this issueNeeds InvestigationThis issue needs a team member to investigate its status.RescheduledThis issue was previously scheduled to an earlier milestone

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions