Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

newline-after-imports: new option exactCount bug with following comments #2882

Closed
FFdhorkin opened this issue Sep 23, 2023 · 0 comments
Closed

Comments

@FFdhorkin
Copy link

I checked out the main branch to try out the new exactCount option for newline-after-imports. This does not work properly if there are comments following an import.

Regardless of whether I use
'import/newline-after-import': ['error', { count: 1, considerComments: false, exactCount: true }],
or
'import/newline-after-import': ['error', { count: 1, considerComments: true, exactCount: true }],

The following code snippets produce an error:

import _ from 'lodash';

/**
 * A comment is here
 */
import _ from 'lodash';

// A comment is here

Expected 1 empty line after import statement not followed by another import

kinland added a commit to kinland/eslint-plugin-import that referenced this issue Sep 26, 2023
kinland added a commit to kinland/eslint-plugin-import that referenced this issue Sep 26, 2023
kinland added a commit to kinland/eslint-plugin-import that referenced this issue Sep 26, 2023
kinland added a commit to kinland/eslint-plugin-import that referenced this issue Sep 26, 2023
kinland added a commit to kinland/eslint-plugin-import that referenced this issue Sep 26, 2023
@ljharb ljharb closed this as completed in 66cb10f Sep 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants