当前位置:网站首页>After vs code is formatted, the function name will be automatically followed by a space
After vs code is formatted, the function name will be automatically followed by a space
2022-07-26 17:43:00 【Knowledgeable Porter Wang Zai】
VS Code After the formatting Automatically make a space after the function name
1. brief introduction
hi , Hello everyone ! Today I'd like to share with you , How the vscode Add a space after the function name in , Give Way Function names and () There's a space between , Everyone here should Be careful Yes. :Prettier - Code formatter This function cannot be realized , We need to With the help of Vetur To achieve , Xiaobian used to be very fascinated , Why are all configurations configured . We are still There is no effect , It's actually Wrong plug-in , We Should use the Vetur.
2. setting.json Configuration code
Be careful : Here are just some code snippets , here You need to install Vetur This plugin , Then configure .
// Here is the effect of realizing that there is a space after the function name
"vetur.format.defaultFormatter.js": "vscode-typescript",
"javascript.format.insertSpaceBeforeFunctionParenthesis": true,
3. setting.json All configuration
Here are just some simple places , There is one Path Autocomplete This plugin , This It's also very easy to use , If there is You can configure what you like , The corresponding configuration is in the second comment
{
// Basic configuration
"editor.fontSize": 18,
"editor.detectIndentation": false,
"editor.tabSize": 2,
"window.zoomLevel": 2,
/* Path auto prompt configuration + PathA... */
"path-autocomplete.extensionOnImport": true,
"path-autocomplete.pathMappings": {
"@": "${folder}/src"
},
// Use vscode-icons The theme
"workbench.iconTheme": "vscode-icons",
// Every time you save, fix the code according to the format
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll": true
},
"eslint.validate": ["javascript", "javascriptreact", "vue"],
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
// "editor.defaultFormatter": "vscode.typescript-language-features"
},
"[vue]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
// "editor.defaultFormatter": "rvest.vs-code-prettier-eslint"
},
"[jsonc]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[html]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[css]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
//vetur formatting code
// "vetur.format.defaultFormatter.js": "prettier",
// Here is the effect of realizing that there is a space after the function name
"vetur.format.defaultFormatter.js": "vscode-typescript",
"javascript.format.insertSpaceBeforeFunctionParenthesis": true,
"vetur.format.defaultFormatter.html": "prettyhtml",
"vetur.completion.autoImport": true,
"vetur.format.defaultFormatterOptions": {
"prettier": {
// No semicolon at the end
"semi": false,
// exceed 140 Character line feed
"printWidth": 300,
// Use single quotes
"singleQuote": true,
// No trailing comma
"trailingComma": "none",
// Arrow function without semicolon for single parameter
"arrowParens": "avoid"
},
"prettyhtml": {
"printWidth": 300
}
},
// ditto prettier formatting code
"prettier.semi": false,
"prettier.printWidth": 300,
"prettier.tabWidth": 2,
"prettier.trailingComma": "none",
"prettier.singleQuote": true,
"prettier.arrowParens": "avoid",
"prettier.eslintIntegration": true,
"files.associations": {
"*.cjson": "jsonc",
"*.wxss": "css",
"*.wxs": "javascript"
},
// Appoint wxml Formatting
"minapp-vscode.wxmlFormatter": "prettyHtml",
"minapp-vscode.disableAutoConfig": true,
"workbench.sideBar.location": "right",
"editor.formatOnType": true
}
4. summary
Actually , It's suggested that you should be in To configure setting.json When , Configure what you need and Aware of , otherwise , Lots of configurations , You are also I don't know how to control , What's wrong , Also very depressed , There's no way to start .
边栏推荐
- SCCM tips - improve the download speed of drivers and shorten the deployment time of the system when deploying the system
- Spark统一内存划分
- 6-19漏洞利用-nsf获取目标密码文件
- Hardware development and market industry
- 一文详解吞吐量、QPS、TPS、并发数等高并发指标
- How to write plug-ins quickly with elisp
- ACL实验演示(Huawei路由器设备配置)
- Common super easy to use regular expressions!
- URL跳转漏洞
- On the growth of data technicians
猜你喜欢
![Leetcode:1206. design jump table [jump table board]](/img/4f/2b6df8e2151b8bce70c8227c69d8bc.png)
Leetcode:1206. design jump table [jump table board]

CCS TM4C123新建工程

带你熟悉云网络的“电话簿”:DNS
![Cloud rendering volume cloud [theoretical basis and implementation scheme]](/img/38/0e97d6f015f3cb51e872a8d3ce584a.png)
Cloud rendering volume cloud [theoretical basis and implementation scheme]

Summer Challenge openharmony greedy snake based on JS
![[300 opencv routines] 240. Shi Tomas corner detection in opencv](/img/3a/0b81fb06e91e681ccc928e67297188.png)
[300 opencv routines] 240. Shi Tomas corner detection in opencv

ACL实验演示(Huawei路由器设备配置)

机器学习-什么是机器学习、监督学习和无监督学习

SQL中去去重的三种方式

Week 16 OJ practice 1 calculates the day of the year
随机推荐
JS recursive Fibonacci sequence deep cloning
使用 replace-regexp 在行首添加序号
In the first half of the year, sales increased by 10% against the trend. You can always trust Volvo, which is persistent and safe
2.1.2 synchronization always fails
Use dired to move files quickly
Is the rolling update of pod similar to Canary deployment or blue-green deployment?
ACL实验演示(Huawei路由器设备配置)
Is it safe for Huishang futures to open an account online? What is the account opening process?
Tensor operation in pytoch
COSCon'22城市/学校/机构出品人征集令
天翼云Web应用防火墙(边缘云版)支持检测和拦截Apache Spark shell命令注入漏洞
Avalanche subnets vs. polygon supernets of application chain
第17周自由入侵 指针练习--输出最大值
解决哈希冲突的几种方式
03|实现 useReducer 和 useState
Shrimp Shope get commodity details according to ID API return value description
简述CUDA镜像构建
重磅!《2022中国开源发展蓝皮书》正式发布
What is a test case? How to design?
Detailed explanation of openwrt's feeds.conf.default