quick-lint-js

Find bugs in JavaScript programs.

E0711: missing expression in placeholder within template literal

Everytime you use ${} within a template literal, which is a string defined with backticks, such as this one below inside console.log, you should specify an expression inside its curly braces.

console.log(`My name is ${}`);

To fix this error, write an expression between ${ and }:

const yourName = "Ryan";
console.log(`My name is ${yourName}`);

If your goals were to have the placeholder literally in your string, consider escaping it using a backslash before the placeholder:

console.log(`\${}`);

Or just use double-quoted string (""):

console.log("${}");

Documentation for other errors