简体   繁体   English

如何调试为什么 eslint 无法与 vscode 正常工作?

[英]How do I debug why eslint is not working correctly with vscode?

I'm using vscode and eslint is running but it's not finding errors in certain files that it finds in others in the same project.我正在使用 vscode 并且 eslint 正在运行,但它没有在同一项目中的其他文件中找到某些文件中的错误。

Is there some way to debug this?有没有办法调试这个? Like an option for more verbose output that will show me where it's getting its configuration for each file while running inside vscode?就像一个更详细的输出选项,它会告诉我在 vscode 中运行时它在哪里获取每个文件的配置?

The easiest way I've found of diagnosing ESLint problems is opening the tray at the bottom of the screen, clicking the Output tab, and selecting the ESLint debug feed from the dropdown at the top right corner of the tray.我发现诊断 ESLint 问题的最简单方法是打开屏幕底部的托盘,单击“输出”选项卡,然后从托盘右上角的下拉列表中选择 ESLint 调试源。 This will report what problems ESLint encounters as it loads and tries to lint your code.这将报告 ESLint 在加载和尝试 lint 代码时遇到的问题。 You might have to open a file of the type you're trying to lint to see all the output problems.您可能需要打开一个您尝试 lint 类型的文件才能查看所有输出问题。

You can also open this from the command palette by pressing Cntl + Shift + P and then typing ESLint: Show Output Panel .您也可以通过按Cntl + Shift + P然后输入ESLint: Show Output Panel从命令面板打开它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM