首页 > 解决方案 > 通过 CRA 在服务器文件上使用 ESLint

问题描述

backend在 VS Code 中 - 当运行 CRA 并使用和目录设置简单的文件结构时frontend,ESLint 会自动检查前端(React)文件,但backend服务器文件中没有语法突出显示。

我们已经在项目的不同位置(根等)尝试了多个 .eslintrc.js 文件,但文件的语法突出显示(错误、警告)backend没有发生。

在非反应项目中,这在 VS Code 中工作正常,.eslintrc.js根目录中有一个文件。

CRA 配置是否覆盖任何其他配置?

我们已经尝试过,例如:

Adding the following snippet to settings.json in VS code

"eslint.validate": [
  "javascript",
  "javascriptreact",
  "typescript",
  "typescriptreact"
],

但这没有任何区别。

标签: create-react-appeslintrcprettier-eslint

解决方案


推荐阅读