3.0.0 β€’ Published 3 months ago

@putout/plugin-apply-template-literals v3.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 months ago

@putout/plugin-apply-template-literals NPM version

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.

Install

npm i @putout/plugin-apply-template-literals

Rule

{
    "rules": {
        "apply-template-literals": "on"
    }
}

❌ Example of incorrect code

const line = '("' + name + '")';

βœ… Example of correct code

const line = `("${name}")`;

Comparison

LinterRuleFix
🐊 Putoutapply-template-literalsβœ…
⏣ ESLintprefer-templateβœ…

License

MIT

3.0.0

3 months ago

2.2.0

12 months ago

2.1.0

12 months ago

2.0.0

1 year ago

1.0.0

1 year ago