@putout/plugin-remove-useless-map
v3.0.0
Published
šPutout plugin adds ability to remove useless `.map`
Maintainers
Readme
@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}`);
const x = array.map((a) => a);
Object
.entries(a)
.map(([a, b]) => [a, b]);ā Example of correct code
const [line] = lines;
const str = `hello ${line}`;
const x = array;License
MIT
