dsherret / dsherret/ts-morph

Better API for dealing with IfStatements

Open
#719 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
TypeScript
Stars
6.2k
Forks
238
Avg merge
2m
Merged PRs (30d)
1

Description

Questions:

1. How would someone insert comments?
2. How would someone remove only a single `else if` block or just the first `if` block?

Note how the ast looks like:

![image](https://user-images.githubusercontent.com/1609021/65925674-c8490c80-e3bf-11e9-81da-b24a65eb817a.png)

I'm thinking this will most likely be an api on top of the existing one.

For removing, the problem is that people approaching this would not expect removing an if statement to remove all the following else blocks. It might be better to do a breaking change here and have it only remove the if statement for the current one or have a new `removeIfBlock()` method.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.