@putout/plugin-merge-duplicate-imports

11.0.3 • Public • Published

@putout/plugin-merge-duplicate-imports NPM version

The static import statement is used to import read only live bindings which are exported by another module.

(c) MDN

🐊Putout plugin adds ability to find and merge duplicate imports. Merged to @putout/plugin-esm.

Install

npm i @putout/plugin-merge-duplicate-imports
{
    "rules": {
        "merge-duplicate-imports/join": "on",
        "merge-duplicate-imports/rename": "on"
    }
}

join

❌ Example of incorrect code

import test from 'supertape';
import {stub} from 'supertape';

✅ Example of correct code

import test, {stub} from 'supertape';

rename

Checkout in 🐊Putout Editor.

❌ Example of incorrect code

import putout from './putout.js';
import all from './putout.js';
import x from './putout.js';

console.log(all);
console.log(x);

✅ Example of correct code

import putout from './putout.js';

console.log(putout);
console.log(putout);

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i @putout/plugin-merge-duplicate-imports

Weekly Downloads

12,099

Version

11.0.3

License

MIT

Unpacked Size

10.4 kB

Total Files

29

Last publish

Collaborators

  • coderaiser