Closed bbruneau closed 7 years ago
@bbruneau it is not a syntax of pugjs so it's not related to pugjs (and pug-lexer).
It's related to these two issues in eslint-plugin-react-pug:
Will do my best to fix it! Thank you for reporting this.
Ah, thanks a million.
@bbruneau hey, please set version of eslint-plugin-react-pug
to 0.0.5
.
Either one of
return pug`
- div(className=${`${blockClass}__element`})
+ div(className=`${blockClass}__element`)
+ div(className=`${`${blockClass}__element`}`)
| Whatever content
`;
should work.
The attribute value is a JS expression, so no extra ${}
needed; but you'll need backticks either way.
I'm using babel-plugin-transform-react-pug in a React project where I'm passing dynamic class names. I use nested template literals like so:
This works fine. But JSLint throws an error that seems to come from pug-lexer:
Is this just because of the difference in formatting between babel-plugin-transform-react-pug and pugjs?
viz,
Incidentally, I've cross-posted this with pug-lexer: https://github.com/pugjs/pug-lexer/issues/81