πPutout plugin adds ability to apply template literals
npm install @putout/plugin-apply-template-literals[NPMIMGURL]: https://img.shields.io/npm/v/@putout/plugin-apply-template-literals.svg?style=flat&longCache=true
[NPMURL]: https://npmjs.org/package/@putout/plugin-apply-template-literals "npm"
> Template literals are literals delimited with backtick () characters, allowing for multi-line strings, string interpolation with embedded expressions, and special constructs called tagged templates.
> Template literals are sometimes informally called template strings, because they are used most commonly for string interpolation (to create strings by doing substitution of placeholders
>
> (c) MDN
πPutout plugin adds ability to apply template literals. Check out in πPutout Editor.
``
npm i @putout/plugin-apply-template-literals
`json`
{
"rules": {
"apply-template-literals": "on"
}
}
`js`
const line = '("' + name + '")';
`js("${name}")
const line = ;`
Linter | Rule | Fix
--------|-------|------------|
π Putout | apply-template-literals | β
β£ ESLint | prefer-template` | β
MIT