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

[import/newline-after-import] considerComments not working with require statements #2905

Open
Arkellys opened this issue Oct 25, 2023 · 0 comments · May be fixed by #2952
Open

[import/newline-after-import] considerComments not working with require statements #2905

Arkellys opened this issue Oct 25, 2023 · 0 comments · May be fixed by #2952

Comments

@Arkellys
Copy link

Arkellys commented Oct 25, 2023

The option considerComments doesn't seem to work with require statements. For example, with the following configuration:

"import/newline-after-import": ["warn", { count: 2, considerComments: true }]

These are considered valid:

const fs = require("fs");

// Test comment
const FOO = true;
const fs = require("fs");
/**
 * Test comment
 */
const FOO = true;

While they should be:

const fs = require("fs");


// Test comment
const FOO = true;
const fs = require("fs");


/**
 * Test comment
 */
const FOO = true;

It works as it should with import statements.

@developer-bandi developer-bandi linked a pull request Jan 12, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

2 participants