Eslint:无法解析模块路径

时间:2020-10-16 10:23:44

标签: javascript reactjs eslint

每次尝试启动项目时都会出现一系列错误:

  15:8   error  Unable to resolve path to module 'config'              import/no-unresolved
  17:33  error  Unable to resolve path to module 'shared/locales'      import/no-unresolved
  17:33  error  Missing file extension for "shared/locales"            import/extensions
  18:31  error  Unable to resolve path to module 'shared/store'        import/no-unresolved
  18:31  error  Missing file extension for "shared/store"              import/extensions
  19:32  error  Unable to resolve path to module 'shared/drawer'       import/no-unresolved
  19:32  error  Missing file extension for "shared/drawer"             import/extensions
  20:37  error  Unable to resolve path to module 'shared/persistence'  import/no-unresolved
  20:37  error  Missing file extension for "shared/persistence"        import/extensions
  22:36  error  Unable to resolve path to module 'shared/apollo'       import/no-unresolved
  22:36  error  Missing file extension for "shared/apollo"             import/extensions

这是我的.eslint.js文件

    module.exports = {
      ...
      "settings": {
        "import/resolver": {
          "babel-module-alias": {}
        }
      }
    };

任何帮助将不胜感激!

0 个答案:

没有答案