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

Fix/newline after import #2952

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

developer-bandi
Copy link

fix #2905

  • new var in test file use multiple space when require
  • fix or remove invalid test cases
  • add feature considerComments is applied normally when use require

src/rules/newline-after-import.js Show resolved Hide resolved
tests/src/rules/newline-after-import.js Show resolved Hide resolved
tests/src/rules/newline-after-import.js Outdated Show resolved Hide resolved
Comment on lines -855 to -856
code: `const foo = require('foo');\n\n\n// some random comment\nconst bar = function() {};`,
options: [{ count: 2, exactCount: true, considerComments: true }],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we keep this existing test case, to ensure it's not a breaking change?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test case is valid, so if we want to keep it, I think the test case should be included in the valid array. Is it okay to do this?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, that's fine - moving the test shows it's a bug fix.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, I applied it.

@Arkellys
Copy link

Arkellys commented Apr 5, 2024

Any news about this?

@developer-bandi
Copy link
Author

developer-bandi commented Apr 6, 2024

@Arkellys for merge, i wait code review.
@ljharb Could you please take a look?

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

Successfully merging this pull request may close these issues.

[import/newline-after-import] considerComments not working with require statements
3 participants