Skip to content

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

Closed

Description

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions