当前位置:网站首页>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 .
边栏推荐
- 树形dp问题
- What are the popular technologies in 2022?
- Brief introduction to CUDA image construction
- 简述CUDA镜像构建
- What kind of product is the Jetson nano? (how about the performance of Jetson nano)
- Comparison between dimensional modeling and paradigm modeling
- Oracle is slow to perform a large number of DML operations. Is it the problem of CPU or hard disk?
- Tree DP problem
- 性能调优bug层出不穷?这3份文档轻松搞定JVM调优
- 图解用户登录验证流程,写得太好了!
猜你喜欢

来吧开发者!不只为了 20 万奖金,试试用最好的“积木”来一场头脑风暴吧!

URL跳转漏洞

跨站脚本攻击(XSS)

Kudu design tablet

JS 递归 斐波那契数列 深克隆

(24) the top menu of blender source code analysis shows code analysis

Machine learning - what are machine learning, supervised learning, and unsupervised learning

Comparison between dimensional modeling and paradigm modeling

In depth exploration of ribbon load balancing

Crazy God redis notes 02
随机推荐
来吧开发者!不只为了 20 万奖金,试试用最好的“积木”来一场头脑风暴吧!...
二层管理型交换机如何设置IP
我们被一个 kong 的性能 bug 折腾了一个通宵
Kudu design tablet
SQL injection (mind map)
In depth exploration of ribbon load balancing
Establishment of Eureka registration center Eureka server
# MySQL 七种连接方式图解
hosts该文件已设置为只读的解决方法
JS 函数作用域 变量声明提升 作用域链 不加var的变量,是全局变量
如何快速使用 ELisp 进行插件编写
Common super easy to use regular expressions!
Tree DP problem
uni-app
机器视觉在服务机器人中的应用
第17周自由入侵 指针练习--输出最大值
Add 5g and AI, oppo announced to invest 10billion R & D funds next year!
Is the rolling update of pod similar to Canary deployment or blue-green deployment?
Week 4 Recurrent Neural Networks
pip安装模块,报错