VSCode 从终端窗格中单击以转到 React 编译警告的来源?

VSCode click from terminal pane to go to source of React compilation warnings?

保存对我的 create-react-app 应用程序的更改后,我收到此编译器警告:

Compiled with warnings.

./src/components/DurationPicker.js
  Line 22:  Expected an assignment or function call and instead saw an expression  no-unused-expressions

Search for the keywords to learn more about each warning.
To ignore, add // eslint-disable-next-line to the line before.

有没有办法让 React 发出警告 "clickable" 以便我可以单击终端窗格中的警告,编辑器将导航到文件中带有警告的行号? (顺便说一句,我知道我说的是 "React's warnings" 但这些实际上是由 ESLint 生成的吗?)

老式 Visual Studio 在其输出窗格中使用编译器错误执行此操作,这非常方便。我希望在 VS Code 中有类似的方法来执行此操作。

或者是否已经有一种方法可以在 VS Code 中执行此操作,但 React(或 ESLint?)没有以 VS Code 期望的格式发出编译警告?

VSCode 有一个内置机制来实现您正在尝试做的事情:Problem matchers

您可能还想知道问题匹配器适用于通过 VSCode 任务系统定义和启动的任务。

但是如果你只想缓存 ESLint 错误,有一个扩展:https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint