question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Using `import/resolver` in a global config file

See original GitHub issue

I use a global ESLint config file. It contains most import rules, plus:

module.exports = {
  settings: {
    'import/resolver': {
      node: {
        extensions: ['.js', '.jsx', '.ts', '.tsx'],
      },
    },
  },
}

I lint with it using the command eslint . --resolve-plugins-relative-to /Users/gary/.dotfiles/ and a .eslintrc.js file of the following, in my projects:

module.exports = {
  extends: '/Users/gary/.eslintrc.js',
};

Every import rule reports the error: Resolve error: unable to load resolver "node".

This error only started appearing after upgrading from v2.18.2 to v2.20.0.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
garykingcommented, Jan 12, 2020

Yes that fixed it.

0reactions
ljharbcommented, Jan 12, 2020

v2.5.2 of eslint-module-utils is released; hopefully that resolves the issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using import/resolver in a global config file #1603 - GitHub
I use a global ESLint config file. It contains most import rules, plus: module.exports = { settings: { 'import/resolver': { node: ...
Read more >
webpack - How to manually add a path to be resolved in eslintrc
You can add resolving directories by using config. ... I installed eslint-import-resolver-webpack and updated .eslintrc thusly { "settings": ...
Read more >
eslint-import-resolver-jest | Yarn - Package Manager
Jest will attempt to resolve the import using a set of file extensions defined in moduleFileExtensions. Allow <rootDir> to be defined within the...
Read more >
global-config-file - npm
This package exports one function that accepts a filename and an options object. The file provided must be the one with no extension....
Read more >
How to set important Git config global properties
gitconfig file will be used instead of the global git config file of the user running the script. This can lead to unexpected...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found