2.0.0 β€’ Published 17 days ago

@putout/plugin-convert-template-to-string v2.0.0

Weekly downloads
2,762
License
MIT
Repository
github
Last release
17 days ago

@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