Webpack eslint网页包解析程序不';行不通

Webpack eslint网页包解析程序不';行不通,webpack,eslint,Webpack,Eslint,我有一些.coffee文件,我的网页包配置为包含这些文件 // inside `webpack.config.js`... resolve: { // tell webpack which extensions to auto search when it resolves modules. With this, // you'll be able to do `require('./utils')` instead of `require('./utils.js')` exten

我有一些
.coffee
文件,我的网页包配置为包含这些文件

// inside `webpack.config.js`...

resolve: {
  // tell webpack which extensions to auto search when it resolves modules. With this,
  // you'll be able to do `require('./utils')` instead of `require('./utils.js')`
  extensions: ['', '.js', '.coffee', '.jsx'],
  // by default, webpack will search in `web_modules` and `node_modules`. Because we're using
  // Bower, we want it to look in there too
  modulesDirectories: ['node_modules', 'bower_components'],

  alias: {
    'jquery.ui.widget': 'jquery-ui/ui/widget.js',
    'jquery-ui/widget': 'jquery-ui/ui/widget.js',
    'jquery-ui-css': 'jquery-ui/../../themes/base'
  }
},
我已将
eslint导入解析器网页包安装到我的项目中,并在我的
.eslintrc.json
文件中进行了设置:

"settings": {
    "import/parser": "babel-eslint",
    "import/resolver": {
        "webpack": { "config": "webpack.config.js" }
    }
},
但是出于某种原因,对于这样一行,我仍然会得到
import/no未解决的
linting错误:

import foo from './my-coffee-file'
目录中有一个
my coffee file.coffee


有什么问题吗?

我的问题是由于我项目的目录结构

config
|__webpack.config.js
|
frontend
|__package.json
|__all the JS/coffee files
所以我需要明确地指向webpack配置文件:

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

。/
是必需的,因为它从查找
package.json
的位置开始搜索,对我来说,它位于
前端
目录中。

我的问题是由于我项目的目录结构造成的

config
|__webpack.config.js
|
frontend
|__package.json
|__all the JS/coffee files
所以我需要明确地指向webpack配置文件:

"settings": {
    "import/resolver": {
        "webpack": { "config": "../config/webpack.config.js" }
    }
}
。/
是必需的,因为它从查找
package.json
的位置开始搜索,对我来说,它位于
前端
目录中