VSCode - Beautify plug-in configuration

1. Establish .jsbeautifyrc file in the working directory

Official Documents

{
   "brace_style": "none,preserve-inline",
   "indent_size": 2,
   "indent_char": " ", "jslint_happy": true, "unformatted": [""], "css": { "indent_size": 2 } } 

Note

  • brace_style, Style format, see the official explanation (to avoid default and eslint check for conflicts recommend this property is set to none, preserve-inline)
  • indent_size, Indentation length (in order to avoid default and eslint check for conflicts recommend this property to 2)
  • indent_charIndent filled content (full ♂)
  • jslint_happy:trueIf you want to use with jslint, turn this option
  • unformatted:["a","pre"], There does not need to put the tag type of format. Note that the default template is not formatted, .vue label if you need to format the template redefine the .jsbeautifyrc without a template declaration property

2. Enable automatic saving

Add VSCode configuration file editor.formatOnSave:trueis automatically formatted to achieve conservation

3. Shortcuts

Add shortcut file in VS Code keyboard

{
  "key": "cmd+b", // 自己定键位
  "command": "HookyQR.beautify", "when": "editorFocus" } 

Small gifts around and Jane book to my attention



Author: small yin notes
link: https: //www.jianshu.com/p/34ad34528549
Source: Jane book
Jane book copyright reserved by the authors, are reproduced in any form, please contact the author to obtain authorization and indicate the source.

Guess you like

Origin www.cnblogs.com/telwanggs/p/10953916.html