2.0.0 β’ Published 6 months ago
@putout/plugin-remove-useless-map v2.0.0
@putout/plugin-remove-useless-map 
The
map()method creates a new array populated with the results of calling a provided function on every element in the calling array.(c) MDN
πPutout plugin adds ability to remove useless map().
Install
npm i @putout/plugin-remove-useless-mapRule
{
"rules": {
"remove-useless-map": "on"
}
}β Example of incorrect code
const [str] = lines.map((line) => `hello ${line}`);β Example of correct code
const [line] = lines;
const str = `hello ${line}`;License
MIT