import-js/eslint-plugin-import

🐞: [import/newline-after-import] False positively reports wrong empty line numbers between imports with comments

Open

#2,913 opened on 2023年10月31日

GitHub で見る
 (2 comments) (2 reactions) (0 assignees)JavaScript (4,946 stars) (1,540 forks)batch import
help wantedimport/export ordering

説明

Something like that:

import './index.scss';

// other imports
import { ErrorBoundary } from 'react-error-boundary';

And my setting is

'import/newline-after-import': [
  'error',
  {
    count: 2,
    exactCount: true,
    considerComments: true
  }
]

It reports like this: image

But this is not the correct behavior, as in the documentation it clearly says:

Enforces having one or more empty lines after the last top-level import statement or require call.

after the last top-level import statement

Note: the exactCount doesn't matter, as I've tried to remove it but it's still causing issue.

Package version: ALL LATEST

コントリビューターガイド

🐞: [import/newline-after-import] False positively reports wrong empty line numbers between imports with comments · import-js/eslint-plugin-import#2913 | Good First Issue