Unable to resolve path to module '' import/no-unresolved

Configure the alias, but eslint error "can not resolve this export."

Two solutions.

The first:

yarn add eslint-import-resolver-webpack --dev

  

Edit .eslintrc

{ 
  "Settings": { 
    "WebPACK": { 
      "config": "config / webpack.config.js" // This is where you set alias configuration file path 
    } 
  } 
}

 

Now it

Reference: https://github.com/houndci/hound/issues/1419#

 

Method Two:

Modify the configuration .eslintrc

Add the rules inside

    "Import / NO---unresolved": [ 
      2, 
      { 
          "the ignore": [ "@ ^ /"] // Alias @ path is provided 
      } 
    ],

 

Guess you like

Origin www.cnblogs.com/ly0612/p/12600156.html