从redux-saga导入时出现ESLint错误

时间:2018-01-05 10:43:28

标签: webpack eslint redux-saga

按如下方式导入redux-saga:

import { takeLatest } from 'redux-saga/effects'

ESLint引发了以下错误:

 Error while running ESLint: Cannot find module
 '/Users/cjpitt/project/node_modules/redux-saga/config/webpack.config.dev.js'

我的ESLint配置包含导入解析器,如下所示:

"settings": {
    "import/resolver": {
        "webpack": {
            "config": "./config/webpack.config.dev.js"
        }
    }
},

包含示例的存储库:https://github.com/cjpete/redux-saga-import-issue

问题:

  1. 为什么ESLint会尝试使用'node_modules / redux-saga / config / webpack.config.dev.js'来导入模块?

  2. 如何在不更改导入解析器的情况下解决此问题?

0 个答案:

没有答案