vue

Learn How to “fix unexpected template string expression” in Vue


In this article, you will learn about How to “fix unexpected template string expression” in vue.

In VueJs, you often find yourself in an unwanted situation while working with template string. If you are working on a Vue project and ESLint is installed in your project then you will see an error message like this – “eslint.org/docs/rules/no-template-curly-in-string Unexpected template string expression”. The reason behind this error is you may declare a template string like below:

'Delete the User Name ${user.name}'

It is out of the rule and considered as an error in ESLint. This rule was introduced in ESLint 3.3.0. Because from ES6 you can use backticks for using template string. ES6 stands for version 6 of the ECMA Script programming language. See the solution below :

`Delete the User Name ${user.name}`

Instead of using a single quote, you need to use backticks and this is how you can be able to fix unexpected template string expression” in Vue.


Share on social media

//