import-js / import-js/eslint-plugin-import

Request: shall there be have a separate rule for `newlines-between` of `order`?

Open
#3,219 1 comment 0 reactions 0 assignees View on GitHub
rule proposal
Dominant language
JavaScript
Stars
5.9k
Forks
1.5k
PR merge metrics
No merged PRs in 30d

Description

I don't know if it is a common situation, but I would very much like a separate rule that enforces [newlines between imports](https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/order.md#newlines-between) (or avoids them).

For example, I need to set up the rule like this:

```ts
"import/order": [
"error",
{
// disable all default grouping behaviour
groups: [],

// disable alphabetising
alphabetize: {
order: "ignore",
caseInsensitive: false,
},

"newlines-between": "never",
},
],
```

just because I prefer to handle the sorting elsewhere or by other rules/plugins/file-specific.

Contributor guide

Open the contributing guide

Research direction

Start by reading the import/order documentation, especially the existing newlines-between option and the configuration shown in the issue. Determine how newline enforcement can be separated from grouping and sorting, then document and test the resulting behavior so both enforcing and avoiding newlines work independently.

Written by the indexing model from the issue text.

Assessment

Tech stack
eslint, javascript
Domain
tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
40/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.