dinosmajovic
dinosmajovic

Reputation: 39

How to enable absolute imports in eslint when extending airbnb?

I found this but I can't seem to figure out what to do. How can I change my .eslintrc file so it ignores absolute imports of React components. I get the Unable to resolve path to module 'products/whatever/routing'.eslint(import/no-unresolved) error when trying to import something.

Also, I have ./src as a baseUrl in jsconfig.json

Upvotes: 0

Views: 3470

Answers (1)

dinosmajovic
dinosmajovic

Reputation: 39

This solved the issue:

  settings: {
'import/resolver': {
  node: {
    paths: ['src']
  }
 }
}

Upvotes: 2

Related Questions