Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

​ vscode's method of sorting out the Code

Shulou Source: shulou.com Published: 2022-06-02 17:59:21 10月01日 Update

This article mainly introduces the method of vscode to organize the code, the article is very detailed, has a certain reference value, interested friends must read it!

How vscode organizes the code:

1. Use vscode's own code formatting feature to organize vscode formatting codes 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-ins to format the code:

Example:

Plug-in required: eslint

Add to the settings:

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

Eslint.autoFixOnSave is used to format automatically when saved, but only javascript .js files are supported by default.

The file type used by eslint.validate to configure the role.

Then when you save the code, it is automatically formatted in eslint style (you need to save it multiple times).

These are all the contents of this article entitled "vscode's way to organize Code". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Tags: Code format keyboard shortcuts methods environment content plug-ins files articles values roles interests functions guys buddies time more knowledge examples types Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MySQL Microsoft Huawei Docker Shulou Tech Info