Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to disable default resolver #3095

Open
bertho-zero opened this issue Nov 6, 2024 · 1 comment · May be fixed by #3096
Open

Allow to disable default resolver #3095

bertho-zero opened this issue Nov 6, 2024 · 1 comment · May be fixed by #3096

Comments

@bertho-zero
Copy link

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

settings: {
  'import/resolver': {
    [path.resolve(__dirname, './resolver')]: { /* some options */ },
  },
},

Then the following resolvers are used:

{
  '/home/.../eslint-config/resolver': {},
  node: { extensions: [ '.js', '.jsx', '.json' ] }
}

Try 2:

settings: {
  'import/resolver': {
    [path.resolve(__dirname, './resolver')]: { /* some options */ },
    node: false,
  },
},

Then the following resolvers are used:

{
  '/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:

settings: {
  'import/resolver': path.resolve(__dirname, './resolver'),
},

I propose as a solution not to use a resolver if its configuration is equal to false.

@bertho-zero bertho-zero linked a pull request Nov 6, 2024 that will close this issue
@ljharb
Copy link
Member

ljharb commented Dec 23, 2024

I would definitely expect false to work here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

2 participants