Release Date: 2023-11-13
Better compatibility/detection of Prettier community plugins.
Release Date: 2023-11-04
In Prettier v3, --loglevel
CLI option was changed to --log-level
.
Release Date: 2022-10-06
Auto-format on save support for cjs, cts, mts, jsonc, json5, and yaml file types.
Thanks @alecmev!
Release Date: 2022-03-18
Added setting to support new singleAttributePerLine
option, which can force
each attribute to be placed on a single line in HTML, Vue and JSX.
Release Date: 2021-09-12
This release renames the jsxBracketSameLine
option to bracketSameLine
, which
supports HTML, Vue, and Angular in addition to JSX.
Checkout what's new in Prettier v2.4.
Release Date: 2021-07-14
Config and executable paths are no longer cached by the plugin. Path resolution/discovery caching now differed to Prettier when applicable.
Release Date: 2021-01-27
Added Prettier Ignore snippets for:
- CSS
- GraphQL
- HTML
- Handlebars
- JSX
- JavaScript
- Markdown
- YAML
Tab trigger is pi
.
Release Date: 2020-09-11
-
Added support for configuring new Prettier "Embedded Language Formatting" option (requires Prettier v2.1+).
More info:
Release Date: 2020-04-30
-
Fixed format not running for newlines at end of file. Previously, if your file was properly formatted except for newlines/whitespace at the end of the file, JsPrettier would not actually apply the format despite it not actually being fully formatted by the underlying prettier. This causes formatting inconsistencies and can result in CI checks to fail if you're enforcing prettier formats across your codebase.
Thanks rkoval!
Release Date: 2020-04-05
-
Try to resolve Prettier closest to the current view first; and when a custom path isn't specified.
Thanks nfmc!
Release Date: 2020-03-31
- Update default settings to align with Prettier 2.0.
Release Date: 2019-11-14
-
Added support for new Prettier Vue files script and style tags indentation option; determines whether or not to indent the code inside
<script>
and<style>
tags in Vue files (requires Prettier v1.19+).Default CLI Override API Override false
--vue-indent-script-and-style <bool>
vueIndentScriptAndStyle: <bool>
Valid options:
false
(default) - Do not indent script and style tags in Vue files.true
- Indent script and style tags in Vue files.
Release Date: 2019-04-18
-
Added support for new Prettier Quote Props option; changes quotes around object properties (requires Prettier v1.17+).
- Default:
"as-needed"
- CLI Override:
--quote-props <as-needed|consistent|preserve>
- API Override:
quoteProps:
"<as-needed|consistent|preserve>"
Valid options:
"as-needed"
(default) - Only add quotes around object properties where required."consistent"
- If at least one property in an object requires quotes, quote all properties."preserve"
- Respect the input use of quotes in object properties.
- Default:
Release Date: 2019-04-07
-
Added new setting (
disable_prettier_cursor_offset
) to disable Prettier's (buggy) cursor offset calculation.There's an apparent (and nasty) defect in Prettier that seems to occur during Prettier's cursor offset calculation, and when attempting to format large or minimized files (but not limited to just these cases). The issue effectively results in the CPU spiking to a constant 100%... indefinitely, or until the node executable/process running Prettier is forcefully terminated.
To avoid this problematic behavior, or until the defect is resolved, you can disable the plugin (JsPrettier) from ever passing the cursor offset position to Prettier by setting the
disable_prettier_cursor_offset
value totrue
.- See related issues: #147, #168
- Prettier Cursor Offset Documentation
Release Date: 2019-03-17
-
Added support for formatting PHP files; requires the Prettier PHP Plugin.
cd to/project/directory npm install @prettier/plugin-php
Release Date: 2019-02-27
- Enabling debug mode now also sets Prettier's
--loglevel
option todebug
(when not overridden byadditional_cli_args
), for printing additional debug information to the console.
Release Date: 2019-01-29
-
Added support for auto-expanding environment and Sublime Text (v3+ only) variables in path-like settings. Including
prettier_cli_path
,node_path
and options defined inadditional_cli_args
(e.g.--config
<path>
).Check-out the default settings (comment section) for examples.
Release Date: 2019-01-25
-
Renamed default
babylon
parser tobabel
(requires Prettier v1.16+). Babel's parser, babylon, was renamed to @babel/parser in Babel 7.See the Prettier v1.16 release notes page for additional information on the parser change, including new features and bug fixes.
Release Date: 2019-01-21
- Added setting to
disable_tab_width_auto_detection
(default isfalse
); which disables the default behavior of the plugin automatically setting Prettier's "tabWidth" option (at runtime) with the SublimeText configured value for "tab_size".
Release Date: 2018-09-28
- Added YAML syntax/file formatting support. Requires Prettier v1.14+.
Release Date: 2018-02-13
-
Added new
auto_format_on_save_requires_prettier_config
setting that will enable/disable auto format on save only if a Prettier config file is (or isn't) found.The Prettier config file is resolved by first checking if a
--config </path/to/prettier/config>
is specified in theadditional_cli_args
setting, then by searching the location of the file being formatted, and finally navigating up the file tree until a config file is (or isn't) found.
Release Date: 2018-01-12
- Support for Vue Single File Components. Requires Prettier v1.10+.
Release Date: 2017-12-09
- Added support for
arrowParens
option. Configure formatting to include parentheses around a sole arrow function parameter. Requires Prettier v1.9+.
Release Date: 2017-11-10
- Added support for formatting Markdown files (requires Prettier v1.8+).
Release Date: 2017-09-23
- Added new setting for requirePragma option.
- Allow formatting to take place when Prettier reports non-fatal errors. For example, when Prettier reports warnings (to stderr) about unknown options (#63, #64, #67, #68, #72).
Release Date: 2017-09-05
-
Added support for setting a custom Prettier config path (via
additional_cli_args
setting), or disabling Prettier config discovery all together; using theadditional_cli_args
setting.See the docs for more details and config examples.
Release Date: 2017-09-02
- Prettier configuration files are now automatically resolved via the
prettier --find-config-path <target_file_to_format>
command. Requires prettier v1.6+.
Release Date: 2017-09-01
- Add support for reading configuration options from Prettier configuration
files (e.g.:
.prettierrc
files). Requires prettier v1.6+.
Release Date: 2017-07-02
- Added new
auto_format_on_save_excludes
setting to ignore auto formatting when the target file, or its path resides in a particular location, and whenauto_format_on_save
is turned on.
Release Date: 2017-06-29
- Added support for JSON formatting (requires Prettier v1.5+).
- Added support for GraphQL formatting (requires Prettier v1.5+).
Release Date: 2017-06-07
- Added the new setting
max_file_size_limit
to restrict Prettier formatting based on file size.
Release Date: 2017-06-05
- Added new setting
additional_cli_args
for appending additional arguments to the prettier cli command.
Release Date: 2017-06-04
- Added new setting to allow formatting custom file extensions.
- Support for CSS formatting (requires Prettier v1.4+).
- Built-in support for TypeScript.
Release Date: 2017-04-13
- Added support for new
--semi
and--use-tabs
options.
Release Date: 2017-03-08
- Introduced new
debug
(bool) setting. When enabled (true), additional debugging information about the command and configured settings will be printed to the Sublime Text Console; useful for troubleshooting purposes.
Release Date: 2017-02-24
- Added the ability to specify a custom node path, via the
node_path
setting.
Release Date: 2017-02-20
- Added support for Project-level settings.
Release Date: 2017-02-19
-
Added support for the modified
trailingComma
option. ThetrailingComma
option controls the printing of trailing commas wherever possible.Valid options are:
"none"
-- No trailing commas"es5"
-- Trailing commas where valid in ES5 (objects, arrays, etc)"all"
-- Trailing commas wherever possible (function arguments)
Release Date: 2017-02-18
- Added the new setting
allow_inline_formatting
(defaults to false) which provides the ability to format selections of in-lined JavaScript code, outside of the normal JavaScript syntax. For example, to format a selection of JavaScript code within a PHP or HTML file. Whentrue
, the JsPrettier command is available for use across all Sublime Text syntaxes.
Release Date: 2017-02-16
- Added format on save support for .jsx files.
Release Date: 2017-02-16
- Added support for the new
jsxBracketSameLine
option. WhenjsxBracketSameLine
is true (the default is false), right-angle brackets>
of multi-line jsx elements will be placed at the end of the last line, instead of being alone on the next line. You may be required to update to the latest version of the Prettier to leverage thejsxBracketSameLine
option (available since v0.17.0).
Release Date: 2017-02-10
- Now when the
auto_format_on_save
setting is set totrue
, the entire file will always be formatted. - Removed extra line-breaks injected by the
prettier
cli command at the end of selected regions and entire file. - Added Context Menu shortcut.
Release Date: 2017-01-28
- Added support for merging selective
prettier_options
in the UserJsPrettier.sublime-settings
file.
Release Date: 2017-01-22
- Introduced less aggressive error reporting (#4). Errors generated by the
prettier
cli are written to Sublime Text's console output window, instead of an alert dialog.
Release Date: 2017-01-21
- Removed the
node_path
option from settings. - Added new
prettier_cli_path
setting for those wanting to explicitly set the path to the prettier executable/command. - Removed support for local prettier installations stored in the Sublime Text Package directory.
- Improved detection of environment prettier path.
Release Date: 2017-01-19
- Incorporated new prettier option to specify which parser to use. Valid options
for
parser
areflow
andbabel
. TheuseFlowParser
option has been deprecated, in favor of the newparser
option.
Release Date: 2017-01-19
- Removed the default value for "node_path", and internally try to sniff out the appropriate path.
Release Date: 2017-01-18
-
Fixed package path to use "JsPrettier" instead of "SublimeJsPrettier". Previously caused the "Default" settings file not to open from the Main Menu.
-
Added notice regarding local installations of Prettier. The
node_modules
directory will be deleted after every package update pushed by Package Control.
Release Date: 2017-01-18
- JsPrettier now available on Package Control.