eslint-plugin-sort-imports-es6

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

MIT 3 个版本
安装
npm install eslint-plugin-sort-imports-es6
yarn add eslint-plugin-sort-imports-es6
pnpm add eslint-plugin-sort-imports-es6
bun add eslint-plugin-sort-imports-es6
README

eslint-plugin-sort-imports-es6 Build Status

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

ESLint's built-in sort-imports rule considers the following to be the same type of import:

import foo from 'foo';
import { bar } from 'bar';

This version of the rule fixes that.

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.

Usage

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

{
  "plugins": [
    "sort-imports-es6"
  ],
  "rules": {
    "sort-imports-es6/sort-imports-es6": [2, {
      "ignoreCase": false,
      "ignoreMemberSort": false,
      "memberSyntaxSortOrder": ["none", "all", "multiple", "single"]
    }]
  }
}
版本列表
0.0.3 2016-03-07
0.0.2 2016-03-04
0.0.1 2016-02-21