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

Support RegExp in `ignore` option of `no-unresolved`

Open
#3,087 5 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
JavaScript
Stars
5.9k
Forks
1.5k
PR merge metrics
No merged PRs in 30d

Description

_An array of `RegExp` pattern strings_ must be set to the [`ignore`](https://github.com/import-js/eslint-plugin-import/blob/v2.31.0/docs/rules/no-unresolved.md#ignore) option of the `import/no-unresolved` rule. With a string, linters (and text editors) don't know that it contains a regex and can't check it.

It would be simpler and safer if we could set the `RegExp` directly:

```javascript
export default [{
rules: {
"import/no-unresolved": ["error", { ignore: [/\.img$/v] }],
}
]};

Contributor guide

Open the contributing guide

Research direction

Start with the no-unresolved rule and the linked documentation for its ignore option. Locate how ignore values are currently handled and where this rule is tested; done means direct RegExp values are accepted for ignore and the existing ignore behavior remains covered.

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.