Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The method of standardizing Code format with one Button in vscode

2025-01-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

Editor to share with you the method of vscode one-click standard code format, I believe that most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!

The specific methods are as follows:

File-> preferences-> Settings-> {}

You can change the current editor by default in the user settings on the right

Copy the following to the user settings and ctrl + s will complete the specification of the code.

{/ / vscode enables the option to automatically set tabsize based on file type "editor.detectIndentation": false, / / reset tabsize "editor.tabSize": 2, / / # automatically format "editor.formatOnSave": true every time you save, / / # fix "eslint.autoFixOnSave": true in eslint format every time you save / / adding vue supports "eslint.validate": ["javascript", "javascriptreact", {"language": "vue", "autoFix": true}], / / # Let prettier use the eslint code format to verify "prettier.eslintIntegration": true, / / # remove the semicolon "prettier.semi" at the end of the code: false / / # use quotation marks instead of double quotation marks "prettier.singleQuote": true, / / # put a space between the function (name) and the following parentheses "javascript.format.insertSpaceBeforeFunctionParenthesis": true, / / # choose "vetur.format.defaultFormatter.html": "js-beautify-html" according to the user's custom / / # Let the js in vue format "vetur.format.defaultFormatter.js": "vscode-typescript", "vetur.format.defaultFormatterOptions": {"js-beautify-html": {"wrap_attributes": "force-aligned" / / # vue component html code format}}, / / format stylus Need to install Manta's Stylus Supremacy plug-in "stylusSupremacy.insertColons": false, / / whether to insert colon "stylusSupremacy.insertSemicolons": false, / / whether to insert "stylusSupremacy.insertBraces": false, / / whether to insert curly braces "stylusSupremacy.insertNewLineAroundImports": false / / whether to wrap the line "stylusSupremacy.insertNewLineAroundBlocks" after import: whether to wrap the line in false / / two selectors} these are all the contents of the article "vscode one-click standard code format". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report