0
我有一些.coffee
文件,我已將webpack配置爲包含這些文件。eslint webpack解析器不起作用
// 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-import-resolver-webpack
到我的項目,在我.eslintrc.json
文件中設置它:
"settings": {
"import/parser": "babel-eslint",
"import/resolver": {
"webpack": { "config": "webpack.config.js" }
}
},
出於某種原因,不過,我還是會得到這樣一行import/no-unresolved
掉毛錯誤:
import foo from './my-coffee-file'
其中在目錄內有my-coffee-file.coffee
。
關於發生什麼問題的任何想法?