2.0.0 β’ Published 9 months ago
@putout/plugin-group-imports-by-source v2.0.0
@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.
Group order:
- β builtins;
- β external;
- β internal;
Install
npm i @putout/plugin-group-imports-by-source
Rule
{
"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