Home > Development Tools > VSCode > body text

How vscode organizes code

Release: 2020-01-09 14:18:04
Original
25031 people have browsed it

How vscode organizes code

How to organize the code in vscode:

1. Use the code formatting function of vscode to organize it. The shortcut keys for formatting the code in vscode are as follows:

Use shortcut keys in Windows environment: Shift Alt F

Use shortcut keys in Mac environment: Shift Option F

Use shortcut keys in Ubuntu environment: Ctrl Shift I

2. Use plug-in to format code:

Example:

Requires plug-in: eslint

How vscode organizes codeAdd in settings:

"eslint.autoFixOnSave": true,
"eslint.validate": [
  "javascript",
  "javascriptreact",
  {
    "language": "html",
    "autoFix": true
  },
  {
    "language": "vue",
    "autoFix": true
  }
],
Copy after login

eslint.autoFixOnSave is used to automatically format when saving, but only supports javascript .js files by default.

eslint.validate is used to configure the file type used.

Then when you save the code, it will be automatically formatted into eslint style (it needs to be saved multiple times).

Recommended related articles and tutorials: vscode tutorial

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

Related labels:
source:php.cn
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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!