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

Feature request: add posibility to pass regular expressions to the 'import-order' rules

Open
#1,015 12 comments 27 reactions 0 assignees View on GitHub
import/export ordering
Dominant language
JavaScript
Stars
5.9k
Forks
1.5k
PR merge metrics
No merged PRs in 30d

Description

Hi everyone,

Now we have the default groups, such as `["builtin", "external", "parent", "sibling", "index"]`, but would be better to add possibility to pass regular expressions to these groups definitions. For example, like this:

```
["buildin", "external", ".constants.js$", "index"]
```

It will improve code readability by adding customization of import groupings.
I just want to get approve from maintainers of this repository. Its not a problem to implement it and create PR by myself.

Contributor guide

Open the contributing guide

Research direction

Start by locating the import-order rule implementation and its existing tests. Read how the current default groups are parsed and matched, then determine the expected behavior for regular-expression group definitions. Done means custom expressions such as ".constants.js$" consistently control import grouping and the relevant tests pass.

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
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.