Home > Development Tools > VSCode > Solve the problems that occur after saving in vscode format

Solve the problems that occur after saving in vscode format

angryTom
Release: 2019-11-30 16:56:20
forward
5574 people have browsed it

Solve the problems that occur after saving in vscode format

Modify the settings.json file configuration

1. The problem of spaces being deleted after functions after formatting

"vetur.format.defaultFormatter.js": "vscode-typescript", 
"javascript.format.insertSpaceBeforeFunctionParenthesis": true,
Copy after login

2. Code indentation

"vetur.format.options.tabSize": 4,
Copy after login

3.Single quotes become double quotes after saving

"prettier": {
    // Prettier option here
     "semi": false,
     "singleQuote": true //单引号问题
    }
},
Copy after login

There are also crude solutions:

1. Just remove the ESlint configuration code in the file in webpack.config.js. If it is in a vue project, we need Open the build folder in the project root directory and open the webpack.base.conf.js file in the folder, and then remove the ESlint configuration code in the file

2. Modify the following configuration

{
    "editor.formatOnType": false,
    "editor.formatOnSave": false
}
Copy after login

If there is still a problem with the formatting code when saving after saving, you need to disable the JS-CSS-HTML Formatter plug-in and run it perfectly. When formatting, use Alt shift f to format

Related recommendations : "vscode tutorial"

The above is the detailed content of Solve the problems that occur after saving in vscode format. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:csdn.net
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template