import-js / import-js/eslint-plugin-import
Allow to disable default resolver
- Dominant language
- JavaScript
- Stars
- 5.9k
- Forks
- 1.5k
- PR merge metrics
- No merged PRs in 30d
Description
By default eslint merges the config, making it impossible to use a custom resolver with option without the default resolver node being added.
### Try 1
```js
settings: {
'import/resolver': {
[path.resolve(__dirname, './resolver')]: { /* some options */ },
},
},
```
Then the following resolvers are used:
```js
{
'/home/.../eslint-config/resolver': {},
node: { extensions: [ '.js', '.jsx', '.json' ] }
}
```
### Try 2:
```js
settings: {
'import/resolver': {
[path.resolve(__dirname, './resolver')]: { /* some options */ },
node: false,
},
},
```
Then the following resolvers are used:
```js
{
'/home/.../eslint-config/resolver': {},
node: false,
}
```
And the node resolver is still used, same with null, undefined or other
### Try 3:
I can only disable resolver node by doing this, but I can't pass any options:
```js
settings: {
'import/resolver': path.resolve(__dirname, './resolver'),
},
```
---
I propose as a solution not to use a resolver if its configuration is equal to false.
Contributor guide
Research direction
Start by tracing how the `settings['import/resolver']` configuration is interpreted, focusing on the custom resolver options and the default `node` resolver. Done means a resolver configured as `false` is not used while other configured resolvers still receive their options; add regression coverage for this behavior.
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
- 35/100