@putout/plugin-group-imports-by-source
v2.0.4
Published
🐊Putout plugin adds ability to find and group imports by source
Maintainers
Readme
@putout/plugin-group-imports-by-source 
The static import declaration is used to import read-only live bindings which are exported by another module. The imported bindings are called live bindings because they are updated by the module that exported the binding, but cannot be re-assigned by the importing module.
(c) MDN
🐊Putout plugin adds ability to find and group import statements by source. Checkout in 🐊Putout Editor. For CommonJS use nodejs/group-require-by-id.
Merged with @putout/plugin-esm.
Group order:
- ✅ builtins;
- ✅ external;
- ✅ internal;
Install
npm i @putout/plugin-group-imports-by-sourceRule
{
"rules": {
"group-imports-by-source": "on"
}
}❌ Example of incorrect code
import fs from 'node:fs';
import {lodash} from 'lodash';
import react from 'react';
import d from '../hello.js';
import ss from '../../bb/ss.js';
import b from './ss.js';
const c = 5;✅ Example of correct code
import fs from 'node:fs';
import react from 'react';
import {lodash} from 'lodash';
import b from './ss.js';
import d from '../hello.js';
import ss from '../../bb/ss.js';
const c = 5;License
MIT
