facebook / facebook/jscodeshift
Is there proper way to remove all comments?
Open
question
- Dominant language
- JavaScript
- Stars
- 10k
- Forks
- 498
- PR merge metrics
- No merged PRs in 30d
Description
Now I have to iterate comment nodes and modify values, but comment's signature is staying untouched.
In:
```
// leading_comment
const definition = 'string'
/* block_comment */
```
Modification:
```
const j = api.jscodeshift
const root = j(file.source)
root.find(j.Comment).forEach(comment => (comment.value.value = ''))
```
Out:
```
//
const definition = 'string'
/**/
```
Expected:
```
const definition = 'string'
```
Contributor guide
Assessment
This issue has not been assessed yet.