S
S
Shakir Darion2021-01-13 01:00:47
React
Shakir Darion, 2021-01-13 01:00:47

Unexpected template string expression (no-template-curly-in-string)?

this is my code

const y = "`${x()}${y()}`"

I am getting Unexpected template string expression(no-template-curly-in-string) warning. how to get rid of the warning?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
abberati, 2021-01-13
@shakiriker

If you really want to store a template string in a string (

"это строка `а это шаблонная строка внутри строки ${а тут переменная, которая не будет работать, потому что шаблонная строка находится в строке}` и это строка"
), then there are two options - either turn off the rule in .eslinrc, or turn off the rule for this particular line of code (google eslint disable comment).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question