import-js / eslint-plugin-import

ESLint plugin with rules that help validate proper imports.
MIT License
5.55k stars 1.57k forks source link

[newline-after-import] Ignore comments between imports #2673

Open regseb opened 1 year ago

regseb commented 1 year ago

Ignore comments between imports when option considerComments is actived in import/newline-after-import.

  1. npm install
  2. npx eslint

    /home/regseb/testcase/index.js
     1:1  error  Expected 1 empty line after import statement not followed by another import  import/newline-after-import
    
    ✖ 1 problem (1 error, 0 warnings)
     1 error and 0 warnings potentially fixable with the `--fix` option.
christopher-buss commented 10 months ago

I'd like to +1 this. I have an issue where I have a eslint-disable directive in the middle of my imports, and newline-after-import is incorrectly determining this to be the end of my import statements and therefore I need to have a space before it, which I do not want.