@putout/plugin-group-imports-by-source
🐊Putout plugin adds ability to find and group imports by source
Last updated a year ago by coderaiser .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @putout/plugin-group-imports-by-source 
SYNC missed versions from official npm registry.

@putout/plugin-group-imports-by-source NPM version

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-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

Current Tags

  • 2.0.4                                ...           latest (a year ago)

6 Versions

  • 2.0.4                                ...           a year ago
  • 2.0.3                                ...           a year ago
  • 2.0.2                                ...           a year ago
  • 2.0.1                                ...           a year ago
  • 2.0.0                                ...           a year ago
  • 1.0.0                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (0)
None
Dev Dependencies (9)
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |