【问题标题】:How to enable absolute imports in eslint when extending airbnb?扩展airbnb时如何在eslint中启用绝对导入?
【发布时间】:2020-05-27 07:43:40
【问题描述】:

我找到了this,但我似乎不知道该怎么做。如何更改我的 .eslintrc 文件,使其忽略 React 组件的绝对导入。尝试导入某些内容时出现Unable to resolve path to module 'products/nomad_insurance/routing'.eslint(import/no-unresolved) 错误。

另外,我在 jsconfig.json 中有 ./src 作为 baseUrl

【问题讨论】:

标签: reactjs webpack eslint


【解决方案1】:

这解决了问题:

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

}

【讨论】:

    猜你喜欢
    • 2018-03-13
    • 2020-08-12
    • 1970-01-01
    • 2020-02-28
    • 2017-07-06
    • 2020-04-03
    • 2019-03-08
    • 2020-07-26
    • 2018-06-01
    相关资源
    最近更新 更多