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

Make external package and internal components folder as a separate group

Open
#2,545 8 comments 0 reactions 0 assignees View on GitHub
import/export ordering question
Dominant language
JavaScript
Stars
5.9k
Forks
1.5k
PR merge metrics
No merged PRs in 30d

Description

I have this eslint configuration:
```json
"import/order": [
"error",
{
"pathGroups": [
{
"pattern": "@frontend/components",
"group": "internal",
"position": "after"
},
{
"pattern": "~/components/**",
"group": "internal",
"position": "after"
}
],
"groups": [
"builtin",
"external",
"internal",
"unknown",
"parent",
"sibling",
"index",
"object",
"type"
]
}
]
```
I would like all my imports of `@frontend/components` and ` ~/components/ **` to be treated as a separate group. How can I do this?

Contributor guide

Open the contributing guide

Research direction

Start with the import/order rule and the pathGroups and groups configuration shown in the issue. Determine how @frontend/components and ~/components/** can be treated as a distinct import group; done means the rule supports that grouping and its ordering behavior is covered by tests.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.