@putout/plugin-merge-duplicate-imports

11.0.0 • 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.

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

15,369

Version

11.0.0

License

MIT

Unpacked Size

10.3 kB

Total Files

29

Last publish

Collaborators

  • coderaiser