facebook / facebook/jscodeshift
Is there proper way to remove all comments?
オープン
question
- 主要言語
- JavaScript
- スター
- 10k
- フォーク
- 498
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
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'
```
コントリビューションガイド
評価
この issue はまだ評価されていません。