@kmdavis/eslint-plugin-sort-imports

0.3.0 • Public • Published

eslint-plugin-sort-imports-es6-autofix

A sort-imports rule that properly distinguishes between ES6 import types.

It accepts the same options as the original rule, but the multiple type corresponds to all named imports (regardless of how many are imported), while the single type corresponds only to default imports, and adds a combined type that mixes all, multiple, and single imports and alphabetizes them together.

This rule respects whitespace and comments between imports by only looking at the order of (and sorting) consecutive import statements (those without newlines/comments in between them).

Usage

npm i --save-dev eslint-plugin-sort-imports-es6-autofix

{
  "plugins": [
    "@kmdavis/sort-imports"
  ],
  "rules": {
    "@kmdavis/sort-imports/sort-imports": [2, {
      "ignoreCase": false,
      "ignoreMemberSort": false,
      "memberSyntaxSortOrder": ["combined", "none"]
    }]
  }
}

Package Sidebar

Install

npm i @kmdavis/eslint-plugin-sort-imports

Weekly Downloads

0

Version

0.3.0

License

MIT

Unpacked Size

18.4 kB

Total Files

5

Last publish

Collaborators

  • kmdavis