facebook / facebook/jscodeshift
Is there proper way to remove all comments?
Aperta
question
- Lingua principale
- JavaScript
- Stelle
- 10k
- Fork
- 498
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
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'
```
Guida per i contributori
Apri la guida per i contributori
Valutazione
Questa issue non è ancora stata valutata.