@putout/plugin-merge-duplicate-imports
v11.0.0
Published
🐊Putout plugin adds ability to merge duplicate-imports
Downloads
60,496
Readme
@putout/plugin-merge-duplicate-imports
The static
import
statement is used toimport
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