@putout/plugin-convert-template-to-string

2.0.0 • Public • Published

@putout/plugin-convert-template-to-string NPM version

  • Template literals are literals delimited with backticks (`), allowing embedded expressions called substitutions.
  • The String object is used to represent and manipulate a sequence of characters.

(c) MDN

🐊Putout plugin adds ability to find and convert Template Literals to calling of String constructor.

Install

npm i @putout/plugin-convert-template-to-string

Rule

{
    "rules": {
        "convert-template-to-string": "on"
    }
}

❌ Example of incorrect code

const s = `${a + b}`;

✅ Example of correct code

const s = String(a + b);

License

MIT

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 2.0.0
    1,304
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 2.0.0
    1,304
  • 1.0.0
    23,001

Package Sidebar

Install

npm i @putout/plugin-convert-template-to-string

Weekly Downloads

11,361

Version

2.0.0

License

MIT

Unpacked Size

3.94 kB

Total Files

4

Last publish

Collaborators

  • coderaiser