Skip to main content

js/noUnusedTemplateLiteral

MISSING DOCUMENTATION

ESLint Equivalent: quotes#allowtemplateliterals

Examples

Invalid

const foo = `bar`

 file.ts:1:12 lint/js/noUnusedTemplateLiteral  FIXABLE  ━━━━━━━━━━━━━━━━━━━

  Do not use template literals if interpolation and special-character
    handling are not needed.

    const foo = `bar`
                ^^^^^

  Safe fix

  - `bar`
  + "bar"


const foo = `bar `

 file.ts:1:12 lint/js/noUnusedTemplateLiteral  FIXABLE  ━━━━━━━━━━━━━━━━━━━

  Do not use template literals if interpolation and special-character
    handling are not needed.

    const foo = `bar `
                ^^^^^^

  Safe fix

  - `bar·`
  + "bar·"

Valid

const foo = `bar
`
const foo = `"bar"`
const foo = `'bar'`