visual-studio-code - 使用 VSCode 配置 ESLint
问题描述
我有以下目录结构:
/
├──.node-modules
├──server # server code
│ ├──...
├──shared # modules used by client and server
├──webapp # client code
│ ├──...
│ ├──eslintrc.js # client eslint config
├──eslintrc.js # project eslint config
└──webpack.config.js
我将 Vue 用于客户端代码和dbaeumer.vscode-eslint
VSCode 扩展。在.vue
文件上,我不断收到import
报表错误。
无法解析模块的路径
module
我一直在搞乱eslint.workingDirectories
设置来设置它,但没有成功。在我的客户端本地 eslint 配置中,我定义了导入/解析器:
module.exports = {
...
settings: {
'import/resolver': 'webpack',
},
}
解决方案
不久前,我在我的 VS Code 上安装 ESlint 时使用了这个视频。
也许这可能是版本的问题,您可以从这里检查最佳版本。
推荐阅读
- django - 如何从 django 中的其他函数获取对象
- raspberry-pi - 有没有办法在 PyPI 上发布具有相同版本号的多平台轮子?
- java - 如何修复 Java 中的“绑定不匹配”
- canvas - 用 isPointInStroke 改变线条的颜色
- java - 如何通过描述符 web.xml 配置 Undertow 服务器?(就像它发生在Tomcat中一样)
- angular - 仅在一个 ngFor 元素上显示图像
- php - 连接到 Cloud Datastore 时出现致命错误代码 401
- sql - 消息 240,锚点和列中的递归部分之间的类型不匹配
- java - 为什么我编码错误,geotools create shapefile chinese setAttribute error
- kotlin - 通过 vert.x 发送文件作为响应的表达式的名称是什么