找不到Visual Studio Code的ESLint配置 [英] No ESLint configuration found for Visual Studio Code
问题描述
我已经为Visual Studio Code编辑器安装了ESLint插件,它显示它也已安装,但是仍然看到错误:在编辑器顶部找不到针对Visual Studio Code的ESLint配置窗口,如下面的屏幕截图所示:
I have installed the ESLint plugin for Visual Studio Code editor and it shows that it is installed also but still I see the error: No ESLint configuration found for Visual Studio Code at the top of the editor window as shown in the screenshot below:
谁能帮我知道我在这里想念什么吗?
Can anyone help me to know is there anything that I am missing here.
推荐答案
您缺少 .eslintrc.* 文件.可以使用不同的格式js,json,yaml ...创建配置文件有两种可用的方法
You are missing .eslintrc.* file. Which can be in different format js, json, yaml... There are two available methods to create configuration file
- 手动创建文件并添加规则
-
使用初始化命令
$ ./node_modules/.bin/eslint --init
或eslint --init
(如果全局安装了ESLint).然后按照说明进行操作,然后根据自己的喜好编辑创建的文件.
- Manually, just create file and add rules
use init command
$ ./node_modules/.bin/eslint --init
oreslint --init
if you have ESLint installed globally. Then follow instructions and after edit created file to your liking.
更多信息:
http://eslint.org/docs/user-guide/configuring
这篇关于找不到Visual Studio Code的ESLint配置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!