当前位置:网站首页>Vscode automatically formats code according to eslint specification
Vscode automatically formats code according to eslint specification
2022-07-01 07:14:00 【Kexiaonan】
Create a new project named... In the project root .vscode Folder , Create a new... In this folder settings.json The configuration file , The specific configuration is as follows :
{
"eslint.validate": [
"javascript",
{
"language": "html",
"autoFix": true
},
{
"language": "vue",
"autoFix": true
}
],
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true,
"source.organizeImports": true
},
"eslint.format.enable": true,
"editor.defaultFormatter": "dbaeumer.vscode-eslint",
"eslint.validate": [
"javascript",
"javascriptreact",
"typescript",
"typescriptreact"
],
"editor.codeActionsOnSave": {
"source.fixAll": true,
"source.fixAll.eslint": true
}
}
When the configuration is complete , You can format the code by saving the code directly in the editor , Or a button shift + alt + F Format code shortcuts .
If vscode The local configuration does not need to be uploaded to the code base , It also needs to be in the root directory of the project
.gitignoreAdd... To the file.vscode
边栏推荐
- Code practice - build your own diffusion models / score based generic models from scratch
- (I) apple has open source, but so what?
- 【电气介数】电气介数及考虑HVDC和FACTS元件的电气介数计算
- buildroot override 机制
- AI视频智能平台EasyCVR设备录像出现无法播放现象的问题修复
- Why are so many people turning to product managers? What is the development prospect of product manager?
- rclone常用子命令中文解释
- LeetCode+ 71 - 75
- Summary of the concept and advantages of 5g massive MIMO
- go-etcd
猜你喜欢

为什么这么多人转行产品经理?产品经理发展前景如何?

(I) apple has open source, but so what?

【深圳IO】精确食品称(汇编语言的一些理解)

Open source! Wenxin large model Ernie tiny lightweight technology, accurate and fast, full effect

ctfshow-web354(SSRF)

Ctfhub port scan (SSRF)

C语言实现【扫雷游戏】完整版(实现源码)

C # read and write customized config file

Spark入门(一篇就够了)

C# Newtonsoft.Json中JObject的使用
随机推荐
The game is real! China software cup releases a new industrial innovation competition, and schools and enterprises can participate in it jointly
Is it reliable to open an account on the compass with your mobile phone? Is there any potential safety hazard
(I) apple has open source, but so what?
Code practice - build your own diffusion models / score based generic models from scratch
JSP - paging
C# Newtonsoft. Use of job in JSON
Cadence OrCAD Capture “网络名”相同,但是未连接或连接错误的解放方案之nodename的用法
Challenges faced by operation and maintenance? Intelligent operation and maintenance management system to help you
ctfshow-web351(SSRF)
8 figures | analyze Eureka's first synchronization registry
手机开户选哪个证券公司比较好,哪个更安全
How to choose a product manager course when changing to a product manager?
如何画产品架构图?
[lingo] find the shortest path problem of undirected graph
ctfshow-web352,353(SSRF)
广发证券开户是安全可靠的么?怎么开广发证券账户
Docker installation and deployment redis
关于“2022年度网络安全教育线上培训”相关问题的复盘和说明
C# Newtonsoft.Json中JObject的使用
[the path of system analysts] Chapter 5: software engineering of double disk (reverse clean room and Model Driven Development)