@putout/plugin-remove-useless-replace

1.0.4 • Public • Published

@putout/plugin-remove-useless-replace NPM version

The replace() method returns a new string with some or all matches of a pattern replaced by a replacement. The original string is left unchanged.

(c) MDN

🐊Putout plugin adds ability to remove useless replace. Check it out in 🐊Putout Editor.

Install

npm i @putout/plugin-remove-useless-replace

Rule

{
    "rules": {
        "remove-useless-replace": "on"
    }
}

Example of incorrect code

const a = 'hello'.replace(b, b);

Example of correct code

const a = 'hello';

License

MIT

Package Sidebar

Install

npm i @putout/plugin-remove-useless-replace

Weekly Downloads

4,278

Version

1.0.4

License

MIT

Unpacked Size

3.7 kB

Total Files

4

Last publish

Collaborators

  • coderaiser