lydell / eslint-plugin-simple-import-sort

Easy autofixable import sorting.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

So how do you remove blank lines between groups?

Mitsunee opened this issue · comments

The README mentions "Remove blank lines between groups." as a thing you can do with custom grouping, but never mentions how to actually do it. I do not like these empty lines and would like to disable them (i.e. join on only one newline character)

It does mention it, it’s just very subtle:

The inner arrays are joined with one newline; the outer arrays are joined with two (creating a blank line).

A bit further down, there’s also a link to examples, which contains:

{
files: ["groups.no-blank-lines.js"],
rules: {
imports: [
"error",
{
// The default grouping, but with no blank lines.
groups: [["^\\u0000", "^node:", "^@?\\w", "^", "^\\."]],
},
],
},
},
{
files: ["groups.default-reverse.js"],
rules: {
imports: [
"error",
{
// The default grouping, but in reverse.
groups: [["^\\."], ["^"], ["^@?\\w"], ["^node:"], ["^\\u0000"]],
},
],
},
},

I understood "Remove blank lines between groups." to mean that there is a way to configure whether groups are joined on one or two newlines. Is there no way to do that other than having all patterns in the same group? If so the sentence I quoted is a bit missleading since it implies the use of multiple groups.

Is there no way to do that other than having all patterns in the same group?

Correct.

If so the sentence I quoted is a bit missleading since it implies the use of multiple groups.

What could a less misleading sentence look like?

What could a less misleading sentence look like?

How about "Avoid blank lines between imports by using a single group."?