VS Code uses js-beautify internally, bit it lacks the ability to modify the style you wish to use. This extension enables running js-beautify in VS Code, AND honouring any .jsbeautifyrc file in the open file's path tree to load your code styling. Run with F1Beautify.
This package includes hints when editing your .jsbeautifyrc. Only the first file found will be used. If the format is bad, the default js-beautify settings will be used, but a warning will be issued to let you know. Comments in your settings file are acceptable (they're removed before the file is parsed). The embedded schema for .jsbeautifyrc has also been published at JSON Schema Store which allows users of VSCode 0.10.3 to add it manually to their user or workspace settings:
Also runs http and css beautify from the same package, as determined by the file extension. The schema indicates which beautifier each of the settings pertains to.
The .jsbeautifyrc config parser accepts sub elements of html, js and css so that different settings can be used for each of the beautifiers (like sublime allows). Note that this will cause the config file to be incorrectly structure for running js-beautify from the command line.
Settings are inherited from the base of the file. Thus:
js-beautify for VS Code
VS Code uses js-beautify internally, bit it lacks the ability to modify the style you wish to use. This extension enables running js-beautify in VS Code, AND honouring any
.jsbeautifyrc
file in the open file's path tree to load your code styling. Run with F1Beautify
.This package includes hints when editing your
.jsbeautifyrc
. Only the first file found will be used. If the format is bad, the default js-beautify settings will be used, but a warning will be issued to let you know. Comments in your settings file are acceptable (they're removed before the file is parsed). The embedded schema for.jsbeautifyrc
has also been published at JSON Schema Store which allows users of VSCode 0.10.3 to add it manually to their user or workspace settings:Also runs http and css beautify from the same package, as determined by the file extension. The schema indicates which beautifier each of the settings pertains to.
The
.jsbeautifyrc
config parser accepts sub elements ofhtml
,js
andcss
so that different settings can be used for each of the beautifiers (like sublime allows). Note that this will cause the config file to be incorrectly structure for runningjs-beautify
from the command line.Settings are inherited from the base of the file. Thus:
Will result in the
indent_size
being set to 4 for Javascript and HTML, but set to 2 for css. All will get the sameintent_char
setting.If the file is unsaved, or the type is undetermined, you'll be prompted for which beautifier to use.
Extra (permanent) file extension may be added under user or workspace settings.
Embedded version of js-beautify is v1.5.10.
Changes:
0.0.6: 27 Dec 2015
0.0.5: 24 Dec 2015
0.0.4: 19 Dec 2015
0.0.3: 19 Dec 2015
json.schema
settings as JSON, and thus beautify as JS..jsbeautifyrc
file. (Requires VS Code v0.10.5+ see Issue #1).jsbeautifyrc
is recognised as JSON.0.0.2: 17 Dec 2015