@putout/plugin-remove-useless-map
🐊Putout plugin adds ability to remove useless `.map`
Last updated 2 months ago by coderaiser .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @putout/plugin-remove-useless-map 
SYNC missed versions from official npm registry.

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

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-map

Rule

{
    "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

Current Tags

  • 3.0.1                                ...           latest (2 months ago)

5 Versions

  • 3.0.1                                ...           2 months ago
  • 3.0.0                                ...           2 months ago
  • 2.0.0                                ...           a year ago
  • 1.1.0                                ...           5 years ago
  • 1.0.0                                ...           5 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (1)
Dev Dependencies (6)
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |