@so1ve/eslint-plugin-sort-imports 3.1.0 → 3.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/shared.js +6 -6
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@so1ve/eslint-plugin-sort-imports",
3
- "version": "3.1.0",
3
+ "version": "3.2.0",
4
4
  "author": "Simon Lydell",
5
5
  "contributors": [
6
6
  "Ray <i@mk1.io> (https://github.com/so1ve)"
package/src/shared.js CHANGED
@@ -811,16 +811,16 @@ function getSpecifierItems(tokens) {
811
811
  const sliceIndex =
812
812
  // If both a newline and a multiline block comment exists, choose the
813
813
  // earlier one.
814
- newlineIndex >= 0 && multilineBlockCommentIndex >= 0
814
+ newlineIndex >= 0 && multilineBlockCommentIndex !== -1
815
815
  ? Math.min(newlineIndex, multilineBlockCommentIndex)
816
816
  : newlineIndex >= 0
817
817
  ? newlineIndex
818
- : multilineBlockCommentIndex >= 0
819
- ? multilineBlockCommentIndex
820
- : // If there are no newlines, move the last whitespace into `result.after`.
821
- endsWithSpaces(after)
818
+ : multilineBlockCommentIndex === -1
819
+ ? endsWithSpaces(after)
822
820
  ? after.length - 1
823
- : -1;
821
+ : -1
822
+ : // If there are no newlines, move the last whitespace into `result.after`.
823
+ multilineBlockCommentIndex;
824
824
 
825
825
  current.specifier = specifier;
826
826
  current.after = sliceIndex === -1 ? after : after.slice(0, sliceIndex);