eslint-plugin-sort-imports-es6-autofix icon indicating copy to clipboard operation
eslint-plugin-sort-imports-es6-autofix copied to clipboard

multiple before single is not working

Open urielha opened this issue 4 years ago • 2 comments

I'm using version 0.6.0

With the configuration from the readme

{
  'plugins': [
    'sort-imports-es6-autofix',
  ],
  'rules': {
    'sort-imports-es6-autofix/sort-imports-es6': [2, {
      'ignoreCase': false,
      'ignoreMemberSort': false,
      'memberSyntaxSortOrder': ['none', 'all', 'multiple', 'single'],
    }],
  },
}

And let say I have this file with imports:

import { a } from './modules/one';
import { aa, b, c} from './modules/two';
import { c as d, a as k} from './modules/four';
import { x, y} from './modules/three';

It doesn't put the first import after all others (multiple before single) So the eslint can't fix it.

Am I doing something wrong? or is it indeed a bug?

urielha avatar Oct 20 '21 20:10 urielha

same issue. It seems to treat any named export as a multiple.

jackson-dean avatar Nov 11 '21 02:11 jackson-dean

This is the point of this plugin. You can just use the original ESLint rule sort-imports if you want imports such as { a } to be considered single.

Arkellys avatar Feb 10 '22 11:02 Arkellys