tagged-template-literal-comments
About
Adds comments to tagged template literals.
Features
- Removes commented out strings and values
- Supports single line and multiline comments
- Trims excess whitespace and new lines
Installation
npm install tagged-template-literal-comments
Usage
; // defaults to javascript parserconst jsCommentParser = ; const jsWithComments = jsCommentParser` a | b | expected // test a subset of issues | | // test another subset of issues | | | | // fix for: https://github.com/facebook/jest/pull/8717 | | // some random note // enable later // | | // | | `; const jsWithoutComments = ` a | b | expected | | | | | | | | `; // jsWithComments === jsWithoutComments const htmlCommentParser = ; const htmlWithComments = htmlCommentParser` <!-- remove comment --> <!--<p></p>--> <p></p>`; const htmlWithoutComments = ` <p></p>`; // htmlWithComments === htmlWithoutComments
Options
const parser = ;