Problem with typescript paths

Asked

Viewed 38 times

-2

Hello,

I am using the Airbnb Eslint configuration and it is giving an error in typescript paths.

inserir a descrição da imagem aqui

inserir a descrição da imagem aqui

  • Hello, welcome to Stackoverflow. :) Please, edit your question to remove image code in favor of code (and error messages) in text. As you can read here, posting codes as image is not recommended.

1 answer

0


According to the documentation of plugin eslint-plugin-import, the rule import/no-unresolved:

Ensures an Imported module can be resolved to a module on the local filesystem, as defined by standard Node require.resolve behavior.

In free translation:

Ensures that an imported module can be solved to a module in the local file system as defined by the default behavior of require.resolve node.js.

However, since you are using this Typescript, the use of this Eslint rule is redundant, since Typescript (in addition to performing code typing analysis) by default checks whether the modules you import actually exist and are valid.

Therefore, using Typesript, you can safely disable this rule.

// .eslintrc.json
{
  "rules": {
    "import/no-unresolved": "off"
  }
}
  • I’m very grateful for your help and time!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.