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

Add support for absolute imports to import/order

Open
#512 10 comments 3 reactions 0 assignees View on GitHub
enhancement import/export ordering
Dominant language
JavaScript
Stars
5.9k
Forks
1.5k
PR merge metrics
No merged PRs in 30d

Description

Currently, when you have the [order](https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/order.md) rule turned on and the option `newlines-between` set to `always`
it will give errors when you have something like this:

``` js
import a from '/imports/config';
import b from '/imports/some/folder'
```

This will report having an empty line between the imports which in my opinion isn't correct.
### Proposal

Add a new string to the order rule called `absolute`.

Contributor guide

Open the contributing guide

Research direction

Start with the linked import/order rule documentation and inspect how `newlines-between` handles the absolute import examples. Define the behavior of the proposed `absolute` order option, then verify that enabling it no longer reports the shown imports as requiring an empty line.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.