When reading though YDKJS: ES6 & Beyond; Chapter 2: Syntax about Tagged Template Literals, I thought of the case, "what if a multi-line tagged template literal is inside of a function or other containing block with indentation?" That lead me to test and see that by default it doesn't compensate for white space indentation, but YDKJS doesn't cover this case nor similar ones to it. I don't think YDKJS needs to cover all similar cases, but I think it would be a good idea to at least point to common ideas or a library of common ones such as common-tags that I came across which provides a template literal tag function called stripIndent that helps with cases like this.
Thanks for writing the book! It's thorough and very helpful for me learning new ES6 features.
When reading though YDKJS: ES6 & Beyond; Chapter 2: Syntax about Tagged Template Literals, I thought of the case, "what if a multi-line tagged template literal is inside of a function or other containing block with indentation?" That lead me to test and see that by default it doesn't compensate for white space indentation, but YDKJS doesn't cover this case nor similar ones to it. I don't think YDKJS needs to cover all similar cases, but I think it would be a good idea to at least point to common ideas or a library of common ones such as common-tags that I came across which provides a template literal tag function called
stripIndent
that helps with cases like this.Thanks for writing the book! It's thorough and very helpful for me learning new ES6 features.