Is there any way around having no-multiple-empty-lines and newline-after-import together?
See original GitHub issueI’d like to have 2 spaces between imports, but for the rest of my sources, only allow a max of 1.
"import/newline-after-import": [
"error",
{
count: 2,
},
],
"no-multiple-empty-lines": [
"error",
{
max: 1,
}
],
Unfortunately these get in a bit of a scuffle 😆
Issue Analytics
- State:
- Created 4 years ago
- Reactions:7
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Is there any way around having no-multiple-empty-lines and ...
I'd like to have 2 spaces between imports, but for the rest of my sources, only allow a max of 1. "import/newline-after-import": [...
Read more >Changelog - JavaScript Standard Style
This major release fully focuses on getting in sync with the wider ESLint ... Disallow any imports that come after non-import statements (import/first)...
Read more >@thibaudcolas/eslint-plugin-cookbook - Package Manager
config: now exports only the recommended config, Prettier-compatible. There is no reason to have separate config since it no longer mandates Prettier usage....
Read more >Eslint rule to put a new line inside import - Stack Overflow
I was looking for such a rule for both import and export declaration. As a result I've made a plugin with autofix. So...
Read more >no-multiple-empty-lines - ESLint - Pluggable JavaScript Linter
Rule Details. This rule aims to reduce the scrolling required when reading through your code. It will warn when the maximum amount of...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
this is not an issue with rule itself but rather with your configuration
no-multiple-empty-lines
is configured in this case to allow only 1 line between statements but you are enforcing 2 empty lines after import, rules does not know about other rules (they are isolated) as they should be.both of those conditions can’t be valid at same time
or
Hahaha it’s just empty lines. I don’t think I’ve ever seen a strong opinion about those before now.