Home  >  Article  >  Web Front-end  >  Common settings of vscode

Common settings of vscode

php中世界最好的语言
php中世界最好的语言Original
2018-02-27 09:24:363265browse

About vscode

CPU100%

Sometimes, vscode will have a CPU utilization of 100%, and two rg.exe occupy all the CPU. The solution is as follows

File>Preferences>Settings, SearchSet "search.followSymlinks": false;

emmet

If you want to Use emmet to automatically complete the code in jsx. The solution is as follows

File>Preferences>Settings, make the following two settings

1. "emmet.triggerExpansionOnTab": true

 2. "emmet.includeLanguages": {"javascript":"html"},

Automatic semicolon

Ifinstalled the prettier plug-in, when you paste the code or format the file, a semicolon will be added automatically and the double quotation marks will be changed into single quotation marks. This is determined by the default settings of the prettier plug-in. . The solution is as follows

File>Preferences>Settings, make the following two settings

1. "prettier.singleQuote": true

2. "prettier.semi ": false

beauty

When using vscode, beauty plug-ins are generally used to beautify the code. If you want to beautify the .vue code and automatically beautify the code when saving, you need to make the following settings

File>Preferences>Settings, make the following two settings

"editor.formatOnSave": true,
    "beautify.language": {
        "js": {
            "type": [
                "javascript",
                "json"
            ],
            "filename": [
                ".jshintrc",
                ".jsbeautify"
            ]
        },
        "css": [
            "css",
            "scss"
        ],
        "html": [
            "htm",
            "html",
            "vue"
        ]
    }

Use beauty After beautifying the code, generally the code will meet the verification requirements of eslint. However, the two rules of prohibiting function from having a space before the parentheses (space-before-function-paren) and leaving a blank line at the end of the file (eol-last) are in beauty There is no corresponding matching rule in . If these two requirements are not mandatory, you can set them to 0

'eol-last': 0, 'space-before-function-paren': 0## in the .eslintrc file.

# In this way, when writing code, there is no need to consider the code format. When saving, it will be automatically beautified and comply with the verification requirements of eslint

I believe you have mastered the method after reading these cases. For more exciting information, please pay attention to other related articles on the PHP Chinese website!

Related reading:

How to implement a custom mouse right-click menu in JS

JavaScript BOM

js || &&Detailed explanation

Solution to the gap between the image and view tags

The above is the detailed content of Common settings of vscode. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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