Skip to content

Latest commit

 

History

History
45 lines (31 loc) · 608 Bytes

no-interpolation.md

File metadata and controls

45 lines (31 loc) · 608 Bytes

Disallow JavaScript interpolation (react-pug/no-interpolation)

It asks to use Pug with own well-handled interpolation than just using JavaScript interpolation.

Rule Details

The following patterns are considered warnings:

const test = 'Hello'

pug`
  div ${test}
`
const test = 'Hello'

pug`
  Component(attr=${test})
`

The following patterns are not considered warnings:

const test = 'Hello'

pug`
  div #{test}
`
const test = 'Hello'

pug`
  Component(attr=test)
`

When Not To Use It

If you are not using Pug then you can disable this rule.