Eslint-plugin-import: [import/order] Inline comments are not moved by the auto-fixer along with the rest of the line

Created on 7 Apr 2020  路  1Comment  路  Source: benmosher/eslint-plugin-import

Related: https://github.com/benmosher/eslint-plugin-import/issues/1450

Repro

import { Foo } from 'foo';
export { Bar }; // Comment on the export line
import/order:
  - error
  - pathGroupsExcludedImportTypes:
      - builtin
    newlines-between: always
    alphabetize:
      order: asc
      caseInsensitive: true

Expected

import { Foo } from 'foo';

export { Bar }; // Comment on the export line

Actual

import { Foo } from 'foo'; // Comment on the export line

export { Bar };
bug help wanted imporexport ordering

Most helpful comment

Comments on lines before and after are tricky (comment attachment is a hard problem) but absolutely same-line comments should follow the line they're on.

>All comments

Comments on lines before and after are tricky (comment attachment is a hard problem) but absolutely same-line comments should follow the line they're on.

Was this page helpful?
0 / 5 - 0 ratings