英文:
How to ESLint files opened in Editor in Attached Docker container in VS Code?
问题
我昨天切换到Docker容器中的开发,总体上运行良好。
我现在缺少的一件事是ESLint消息的可视突出显示。
-
在我的容器中运行
pnpm run lint
产生以下结果(这是好的)193:6 警告:React Hook useCallback 缺少依赖项:'state.editingRecord' 和 'state.originalRecord'。要么包括它们,要么删除依赖项数组。 react-hooks/exhaustive-deps
-
在编辑器中打开文件不会给出在第193行存在问题的视觉提示
期望行为:[]
应该被下划线标记。悬停在其上应该显示消息 193:6 警告:React Hook useCallback 缺少依赖项:'state.editingRecord' 和 'state.originalRecord'。要么包括它们,要么删除依赖项数组。 react-hooks/exhaustive-deps
。
在容器外工作时,可视突出显示正常工作。
英文:
I switched to Development in a Docker container yesterday and it's working well overall.
One thing I am missing is Visual Highlighting of ESLint messages.
-
Running
pnpm run lint
in my container yields (this is good)193:6 Warning: React Hook useCallback has missing dependencies: 'state.editingRecord' and 'state.originalRecord'. Either include them or remove the dependency array. react-hooks/exhaustive-deps
-
Opening the file in the Editor does not give a visual hint that there is a problem in line 193
Expected behavior: []
should be underlined. Hovering over it should give the message 193:6 Warning: React Hook useCallback has missing dependencies: 'state.editingRecord' and 'state.originalRecord'. Either include them or remove the dependency array. react-hooks/exhaustive-deps
.
Visual Highlighting works when working outside of the container.
答案1
得分: 1
你需要在容器中安装ESLint扩展。在扩展视图中的扩展页面上会有一个按钮,用于“在容器中安装 <容器名称>”。就像这样:
英文:
You have to install the ESLint extension in the container. The extension page in the Extension View will have a button to "Install in Container <container name>". Like this:
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论