@putout/plugin-remove-useless-replace
v1.0.4
Published
šPutout plugin adds ability to remove useless 'replace()'
Downloads
17,498
Maintainers
Readme
@putout/plugin-remove-useless-replace
The
replace()
method returns a new string with some or all matches of apattern
replaced by areplacement
. 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