@clark/eslint-config-node-order-imports

2.0.0 • Public • Published






CLARK




@clark/eslint-config-node-order-imports

Node CI code style: prettier dependencies devDependencies lerna CLARK Open Source

Sorts ES module imports for Node.js projects

Installation

If you use the @clark/eslint-config-node or @clark/eslint-config-node-typescript, you don't need to do anything, as they already include this config.

If you don't like our config and just want to order your imports while using your own eslint config, just install this package and add it to extends.

yarn add -D eslint @clark/eslint-config-node-order-imports
module.exports = {
  extends: ["@clark/node-order-imports"],
  rules: {
    // your rules here
  },
};

What does it do?

This is a distributable standalone config for eslint-plugin-import-helpers that orders the ES module imports. The order is a s follows:

  1. Node standard modules: fs, http, ...
  2. Named modules, e.g. installed from npm: lodash, dotenv/register
  3. Absolute paths (very uncommon): /foo/bar
  4. Parent modules: ../foo
  5. Sibling modules: ./bar
  6. Index: ./

Package Sidebar

Install

npm i @clark/eslint-config-node-order-imports

Weekly Downloads

131

Version

2.0.0

License

ISC

Unpacked Size

5.08 kB

Total Files

4

Last publish

Collaborators

  • buschtoens
  • clark-bot
  • mtrense
  • kennethlarsen