当前位置:网站首页>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 .
边栏推荐
- JS recursive Fibonacci sequence deep cloning
- About the adjustment of the game background, reading this article is enough
- In depth exploration of ribbon load balancing
- SQL injection (mind map)
- Why are test / development programmers who are better paid than me? Abandoned by the times
- 天翼云Web应用防火墙(边缘云版)支持检测和拦截Apache Spark shell命令注入漏洞
- What is a test case? How to design?
- Summer Challenge openharmony greedy snake based on JS
- 【云原生】 iVX 低代码开发 引入腾讯地图并在线预览
- 跨站点请求伪造(CSRF)
猜你喜欢

大咖访谈 | 开源对安全是双刃剑——《大教堂与集市》中文译本作者卫剑钒

Heavy announcement! Icml2022 Awards: 15 outstanding papers, selected by Fudan University, Xiamen University and Shanghai Jiaotong University

解决哈希冲突的几种方式

JS function scope variables declare that the variables that promote the scope chain without VaR are global variables

6-19漏洞利用-nsf获取目标密码文件

(25)Blender源码分析之顶层菜单Blender菜单

云渲染-体积云【理论基础与实现方案】

我们被一个 kong 的性能 bug 折腾了一个通宵

Establishment of Eureka registration center Eureka server
![Leetcode:1206. design jump table [jump table board]](/img/4f/2b6df8e2151b8bce70c8227c69d8bc.png)
Leetcode:1206. design jump table [jump table board]
随机推荐
Shrimp Shope get commodity details according to ID API return value description
How to set IP for layer 2 management switches
Cloud rendering volume cloud [theoretical basis and implementation scheme]
即刻报名|飞桨黑客马拉松第三期盛夏登场,等你挑战
(25) top level menu of blender source code analysis blender menu
图扑 3D 可视化国风设计 | 科技与文化碰撞炫酷”火花“
JS closure simulates private variable interview questions and immediately executes function Iife
我们被一个 kong 的性能 bug 折腾了一个通宵
Oracle is slow to perform a large number of DML operations. Is it the problem of CPU or hard disk?
Everything is available Cassandra: the fairy database behind Huawei tag
After Australia, New Zealand announced the ban on Huawei 5g! Huawei official response
SQL injection (mind map)
重磅公布!ICML2022奖项:15篇杰出论文,复旦、厦大、上交大研究入选
About the adjustment of the game background, reading this article is enough
Tree DP problem
URL跳转漏洞
SCCM tips - improve the download speed of drivers and shorten the deployment time of the system when deploying the system
(24) the top menu of blender source code analysis shows code analysis
点击劫持攻击
6-19漏洞利用-nsf获取目标密码文件