npm / prettier
prettier
What changed in prettier 2 to 3, from its official release notes, upgrade guides and advisories. Also covers wp-prettier. Sources checked 2026-12-05.
80 breaking1 deprecations24 new APIs and options3 performance66 behavior and defaults17 tooling241 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initprettier 3339 changes
Breaking changes 50
Strips blockquote markers from continuation lines instead of keeping them as literal text.
The legacy import assertion syntax using assert is no longer supported; migrate to the current with syntax.
Prints a semicolon before a type assertion in
no-semimode.Prettier no longer adds a trailing comma to SCSS
if()function calls.Prettier removes the space after a pipe name in Angular pipe expressions.
Support for Angular quote expressions is dropped.
The babel parser no longer recognizes Flow syntax in JS files without an @flow pragma; it still switches for that pragma or .js.flow files.
The CLI executable moved from bin-prettier.js to bin/prettier.cjs.
Prettier no longer inserts spaces between Chinese or Japanese and Western characters, while preserving existing spaces.
GraphQL no longer accepts the comma-separated interfaces syntax.
The css parser now accepts only vanilla CSS; use the appropriate parser or let Prettier detect Less and SCSS by file extension.
The legacy custom parser feature has been removed because its functionality was a subset of the Plugin API.
HTML5 doctype is printed in lowercase.
The printer embed method has a new, incompatible signature to support async parsers for embedded languages.
Plugins are loaded with import(), allowing ESM plugins; directory paths and extensionless file paths may no longer load.
Special Flow comment syntax is no longer preserved; flow and babel-flow parse it as normal code, while unsupported parsers treat it as ordinary comments.
An object type in a declare function signature now breaks before the return type, matching TypeScript formatting.
The resolveConfig option now defaults to true.
Prettier now ignores files listed in .gitignore by default; set --ignore-path=.prettierignore for the old behavior.
Multiple whitespace characters in Markdown inline code are preserved instead of being collapsed.
Prettier no longer breaks lines inside Korean words when proseWrap is always, avoiding unintended word divisions when text is unwrapped.
Node.js 10 and 12 are no longer supported; the minimum required version is 14.
Prettier no longer falls back to the
babelparser when no parser or filepath is provided; formatting now throws anUndefinedParserError.The second parsers argument was removed from parse; parser access can be obtained through imports or the options argument.
Automatic plugin search and its CLI flags and API option have been removed; use --plugin and plugins instead.
Parser files in the npm package moved under plugins, with updated plugin names and paths; standalone users must load the estree plugin when printing JavaScript, TypeScript, Flow, or JSON.
The CLI option is renamed from
--loglevelto--log-level.The API now returns Promise<boolean>.
The API now returns Promise<void>.
The previously deprecated concat builder has been removed.
This undocumented internal API has been removed.
This undocumented internal API has been removed.
This undocumented internal API has been removed.
This undocumented internal API has been removed.
This undocumented internal API has been removed.
The API now returns Promise<string> instead of a string.
The API now returns Promise<string>.
The API now returns a Promise of the formatted result and cursor offset.
The synchronous getFileInfo API has been removed.
The API now returns a Promise.
The synchronous resolveConfig API has been removed.
The synchronous resolveConfigFile API has been removed.
The signature now takes
textandstartIndexinstead of a node and location callback.The signature now takes
textandstartIndexinstead of a node and location callback.The signature now takes
textandstartIndexinstead of a node and location callback.undefined and null are no longer passed to a plugin's print function; plugins should check them in the parent node instead.
Prettier no longer follows symbolic links while expanding command line arguments, avoiding issues such as cycles and links to ignored files.
The default is now all instead of es5; configure es5 to retain the old behavior.
Breaks constructor parameters onto separate lines when formatting TypeScript parameter properties.
Vue template expressions are formatted as TypeScript when any script tag has
lang="ts".
Deprecations 1
This utility is deprecated; use
prettier.util.isNextLineEmptyinstead.
New APIs and options 19
Adds support for Angular @boundary error boundaries.
The typescript parser now supports import defer.
A new official plugin is available.
A new official plugin is available separately and includes the yuku and yuku-ts parsers for JavaScript and TypeScript syntax.
Adds formatting support for Flow match instance patterns and Flow records.
Formats Lightning Web Components syntax in Markdown code blocks tagged lwc.
Updates the Printer interface so print accepts an optional selector and optional args parameter.
A plugin can provide an estree printer without also providing parsers.
Adds support for front matter in Handlebars.
Adds support for opaque types with lower and upper bounds.
Receives ancestors, allowing plugins to prevent comments from attaching to a specific child node.
Plugins can provide printPrettierIgnored() to customize how nodes with prettier-ignore comments are printed, including handling parentheses or leading semicolons.
Adds support for the Import Attributes proposal.
ESM configuration is supported in this filename when package.json sets type to module.
ESM configuration files are supported.
Adds a utility that returns the next non-space, non-comment character.
ESM configuration is supported in this filename when package.json sets type to module.
ESM configuration files are supported.
Adds support for Flow type guards.
Performance 3
Updated the Markdown table parser dependency to fix a table parse performance issue.
Prettier now uses Flow's Rust-based parser, improving parsing performance for Flow-typed code.
Fixes a performance regression in the doc printer.
Behavior and default changes 52
Prettier no longer expands empty Flow module declarations onto multiple lines.
Supports literal initializers and multiple declarations in
DeclareVariable.Adds support for implicit declared functions and components.
Treats a .git file as a project root marker, preventing EditorConfig settings above Git worktrees or submodules from being applied.
Long interface implementation lists can now break across lines.
Aligns JSDoc before union type elements.
Preserves original number and string representations, avoiding rounding large or small numbers and unescaping special characters.
One existing blank line between JSX attributes is preserved; multiple blank lines are still collapsed to one.
Formatting around comments after break and continue is stable in no-semi mode, avoiding the previous awkward line break and leading semicolon.
Comment formatting in objects is improved, including spacing before a property.
Preserves setext headings rather than converting them to ATX headings.
Keeps union types on one line when they fit.
Prettier now accepts and prints Flow’s readonly property variance annotation, equivalent to + (covariant/read-only).
Prettier now formats arrow function expressions in Angular templates.
Prettier now supports Angular’s exhaustive typechecking syntax using @default never;.
Prettier now formats instanceof expressions in Angular templates.
Prettier formats Angular syntax in Markdown code blocks tagged angular-html.
Prettier formats Angular syntax in Markdown code blocks tagged angular-ts.
Prettier formats spread elements in array literals, object literals, and function calls inside Angular templates.
Prettier no longer prints attribute values that are single template or string literals on new lines.
Removes extra indentation in logical expressions inside Boolean() calls to reduce diffs when changing conditions or switching between Boolean() and !!.
Formats the
allowattribute of iframe elements.Import attributes can now break across multiple lines when formatted.
Formats JavaScript in inline event handler attributes.
Removes redundant parentheses around JSX elements.
Keeps property and variable accessors tight without inserting spaces.
Prettier now preserves indentation for test.fixme, test.describe.skip, and test.describe.fixme, as it already does for test.skip.
May now return a Promise, aligning with
plugin.printer.preprocess(); the notes still suggest moving async work toplugin.parser.parse().Prints the trailing comma in TypeScript import type attributes.
Breaks a line after
=when formatting long type parameter defaults.Prettier's fork of Angular's HTML parser was synced with the upstream.
When proseWrap is always, Prettier follows Chinese and Japanese rules that prohibit certain characters at line beginnings or endings.
Removes unnecessary parentheses around class expressions.
A line break is printed after the file path before errors for options other than
--writeand when no options are used.Prettier displays paths in POSIX style on Windows.
Prettier recognizes decorated arrow functions and keeps the arrow function hugged even when its signature breaks.
A shareable config package can now be a pure ESM package.
Places parentheses around the head of an ExpressionStatement instead of around the whole statement.
Supports trailing comments for RestElement, ArrayPattern, and ObjectPattern function parameters.
Inline JavaScript code in Less is kept as it is instead of being reformatted.
Supports nestled JSDoc comments, used to document overloaded functions.
The label doc builder now allows arbitrary truthy values.
A plugin parser's parse function can return a Promise, enabling async parsers.
A printer's preprocess method can now return a promise.
The CLI accepts multiple
--ignore-pathoptions.Adds support for the regexp modifiers proposal.
Prettier formats script content inside SVG elements.
textToDoc now returns docs without trailing hard lines, making embed printing easier for plugins.
Flow type parameters and tuple types now print trailing commas when trailingComma is es5.
Supports line breaking after extends in type parameters.
TypeScript expressions in Vue attribute bindings are formatted.
Formatting Vue SFC root blocks ignores
htmlWhitespaceSensitivity.
Tooling 14
Prettier supports Angular 22.2.
Adds support for
writeonly,in, andoutvariance modifiers.Prettier now supports newer GraphQL.js v17 syntax, including directives on directive definitions and fragment arguments.
Prettier supports Angular v21.2.
Plugin type declarations now include available printers, allowing plugin authors to access them in their types.
Prettier now supports Angular v21.1.
Adds support for Angular 21 syntax, including regular expressions and new assignment operators.
The Stage 2 Discard Bindings proposal is now supported via Babel.
The failure message changes from “Forgot to run Prettier?” to “Run Prettier with --write to fix.”
Adds Flow support for conditional types and infer types.
Supports the Stage 2 Import Reflection proposal via Babel 7.20.0.
Adds Flow support for Mapped Types and keyof.
Prettier adds
.d.tsfiles for using its JavaScript API from TypeScript, eliminating the need to install@types/prettier.Supports the Explicit Resource Management proposal via Babel 7.20.0 and 7.22.0.
Fixes and other changes 200
Fixes Markdown text containing
$being incorrectly parsed as math syntax, preserving spaces between inline code spans.Fixes Markdown text containing $ being incorrectly parsed as math syntax.
Markdown paragraphs are no longer interrupted by Liquid objects.
Formatting embedded template literals is now idempotent across repeated runs.
Fixes indentation drift for HTML blocks inside Markdown list items.
Preserves Liquid blocks following Markdown tables instead of formatting them as table content.
Fixes formatting of Markdown blockquotes containing > characters.
Prevents indentation drift in wrapped paragraphs inside Markdown list-item code blocks.
Fixes regressions in v3.9.
Single-tilde spans are preserved; only double tildes are treated as strike-through, matching GitHub.
Preserves quotes for methods named new when formatting.
Prettier no longer corrupts adjacent block comments in Less.
Prettier removes the extra space inside comment-only TypeScript object types.
The comment.placement property is available again after comment attachment, restoring a property already used by plugins.
Prettier preserves the <> in inline links and images with an empty URL and a title, avoiding a change in interpretation.
Prettier removes extra spaces after [ in Less map lookups.
Prettier removes spaces between Less merge markers and colons.
Comments inside mapped types no longer cause Prettier to treat them as type parameter comments, avoiding unwanted formatting changes.
Angular formatting preserves expressions used for exhaustive typechecking in @default branches.
Markdown formatting caps ordered list item numbers at 999,999,999 so CommonMark parsers correctly recognize them as list items; larger numbers remain unchanged.
Prettier no longer drops comments on shorthand type import and export specifiers or errors when printing them.
Prettier correctly handles dangling comments inside JavaScript switch statements.
Prettier no longer adds a space before + in CSS type() declarations, which made the resulting CSS invalid.
Prettier preserves wiki links with aliases instead of dropping the alias.
Formats Angular @content(name) as @content (name) to align with other block syntax.
Allows decorators to be used with declare on TypeScript class fields.
Fixes unexpected removal of characters in Liquid syntax.
Fixes ignored files being cached incorrectly by the CLI.
Fixes trailing comment formatting in abstract method parameters.
Comments in arrow function assignment expression bodies remain inside the parentheses and format stably.
Comments in arrow function sequence expression bodies remain inside the parentheses and format stably.
Makes formatting of arrow functions consistent.
Blank line detection between statements is improved, including in no-semi mode.
Fixes content-based cache comparison, which was silently disabled because Prettier passed an outdated option casing.
Comments in call expressions no longer move or reformat inconsistently between successive runs.
Prevents comments from moving in class properties.
Fixes inconsistent formatting of class superclasses.
Comments above else and else if are kept in their expected position.
Fixes comment indentation in conditional types.
Angular templates can now format @content blocks instead of failing with a syntax error.
Fixes line breaks when CSS attribute values contain literal newlines.
Prettier no longer inserts an unexpected space before an expression in a CSS selector.
Comments on debugger statements are printed instead of triggering a comment-not-printed error.
do..while formatting in no-semi mode is improved, including comments after the condition.
Alignment in embedded template interpolations is improved.
Prettier avoids introducing line breaks inside embedded template interpolations in the shown case.
Short comments no longer force empty arrays and objects to break across lines.
Comment handling around empty call argument lists is improved.
Long comments in empty call argument lists can break across lines.
Comments in empty branches are no longer duplicated when experimental ternaries are enabled.
Preserves Flow comment syntax annotations instead of printing them as regular Flow syntax.
Prints the
asynckeyword for component declarations.Fixes dangling comment printing in components.
Fixes dangling comment printing in hooks.
Improves comment formatting in inexact tuples.
Improves formatting of long mapped types across multiple lines.
Prevents object types with inline comments from expanding.
Fixes parentheses for optional functions used as return types.
Unneeded spaces are removed from for statements without an update expression.
Dangling comments in function parameters are printed in the parameter list rather than after the function or arrow.
Prevents crashes when object or list values contain only comments.
Preserves comments in Angular HTML element attributes during formatting.
Fixes Unicode handling in front matter, prevents pre-like closing tags from splitting across lines, and keeps inline comments attached to the preceding node.
Comments on IIFE functions are kept inside the parentheses.
Adds missing parentheses around instantiation expressions.
Trailing double spaces in JSDoc are preserved because some tools treat them as meaningful.
Alignment of multiline JSDoc-style comments in assignments is fixed.
Adds parentheses support for the
keyoftype operator.Prevents line comments between a member expression object and property from moving past subsequent content like
asexpressions.Logical not expressions avoid unnecessary double parentheses, and conditions in if, while, and do..while are inlined to reduce diffs when negated.
Keeps comments in mapped types inline.
Preserves underscore-style emphasis adjacent to Unicode whitespace instead of rewriting it to asterisks.
Avoids collapsing line breaks before list-like numbers followed by CJK characters.
Removes the extra blank line that was forced between a list and an indented code block.
The Markdown parser now uses micromark v4, improving CommonMark and GFM compliance and resolving long-standing parsing bugs.
Improves Chinese and Japanese text wrapping by treating U+3000 and U+FF5E as CJK punctuation-equivalent.
Escapes unindented lines made only of = or - so they are not mistakenly parsed as setext headers.
Fixes formatting for new expressions with type casts.
Comment attachment is consistent between NewExpression and CallExpression.
An existing empty line before a semicolon is preserved in no-semi mode.
Avoids an unnecessary semicolon before call signatures in
no-semimode.Prints non-null assertions consistently.
Parentheses are retained where needed around optional chaining before a member access.
Preserves non-null assertions around optional chaining.
Comment printing for parenthesized callees is fixed.
Fixes formatting directory names containing special characters.
Fixes formatting explicitly specified files whose names begin with a quote.
Formatting a range that includes a variable declaration no longer leaves trailing syntax outside the formatted range.
Redundant parentheses around a sequence expression in a return statement are no longer added.
Removes the space before the
;delimiter in the SCSSif()function.Fixes comment printing in maps.
Prevents adding a trailing comma in math expressions within function arguments.
Avoids adding a trailing comma to parenthesized scalars.
Trailing comments stay inside the parentheses of sequence and assignment expressions.
Preserves comment position after
=in type alias declarations.Improves comment printing inside type arguments.
In no-semi mode, the leading semicolon is printed before a type cast comment.
Adds parentheses to conditional types in type parameter constraints.
Respects
quotePropswhen printing enum keys.Respects
quotePropswhen printing method signatures.Line breaks in TypeScript member chains are fixed so type arguments and chained calls format appropriately.
Fixes comment printing for the last operand of union types.
Removes extra indentation for union types in conditional types.
Preserves an empty line after a block scalar.
Avoids adding an extra blank line when a block value ends with whitespace.
Fixes formatting of mappings when a key wraps across lines.
The YAML parser now uses yaml v2, fixing many long-standing parse issues.
Fixes printing of Flow variance annotations.
Fixes blank lines between list items and nested sub-lists being removed in Markdown and MDX.
Prevents a trailing comma in the SCSS if() function.
Prettier supports consecutive @case statements in Angular @switch blocks.
Avoids adding quotes around LWC interpolations.
Fixes duplicated comments in union types.
Fixes unstable comment printing in union types.
Fixes a change to prettier.getFileInfo() that broke the VSCode extension.
Fixes comments in empty type literals.
Preserves quotes for embedded HTML attribute values.
Fixes string printing when switching quotes.
Prevents comments in interpolations from being duplicated.
Fixes formatting of non-null assertions in Angular templates.
Fixes inconsistent line breaking for array literals.
Comments after an arrow are no longer moved into its parameters.
Makes comment formatting around
as constconsistent between Flow and TypeScript parsers.Fixes comment formatting that could cause a syntax error on a subsequent format.
Can access properties of nullish properties without throwing an error.
Adds missing parentheses in bitwise operator expressions.
Preserves the semicolon before call signatures when formatting with
--no-semi.Makes formatting consistent between CallExpression and NewExpression.
TypeScript and Flow class and interface formatting is more consistent: type parameter indentation, heritage printing, and class body opening braces are adjusted.
Fixes inconsistent comment formatting in logical expressions.
Makes comment printing consistent between the TypeScript and Flow parsers.
Handles case-sensitive and uppercase case-insensitive flags in attribute selectors.
Fixes extra indentation after a block comment in comma-separated CSS values.
Prevents a crash when formatting special custom property values.
Removes the unexpected space between font size and line height.
Preserves selector case instead of incorrectly lowercasing it inside CSS modules.
Fixes formatting of CSS selectors containing
//.Preserves
else ifsyntax for custom helpers instead of rewriting it as nestedifblocks.Improves emoji size measurement and table alignment in all languages.
Improves comment printing around empty statements.
Adds GraphQL support for executable descriptions, which previously caused a syntax error.
Fixes comment handling for for-statements.
Removes an empty line in for statements that have no update expression.
With
ignore, no longer forces elements to break.Improves how comments are handled inside if statements.
Adds parentheses around arrow functions in instantiation expressions so they format correctly.
Preserves variable-name case instead of incorrectly lowercasing it.
Fixes inconsistent printing of logical expressions in call and new expressions.
Improves formatting of a logical expression used as the callee of a new expression.
Adds basic support for Flow match syntax, which previously caused a syntax error.
Fixes parsing so the words import and export in list items are not treated as syntax.
Fixes inconsistent comment printing between class methods and object methods.
Avoids breaking import, require.resolve, require.resolve.paths, and import.meta.resolve calls when the module name is long.
Running prettier . without --cache no longer creates an empty node_modules/.cache/ directory.
Improves formatting of CommonJS module require expressions that contain comments.
Improves formatting of require() calls that contain comments.
Fixes spacing around parentheses in mixin arguments.
Fixes formatting of space-separated values in SCSS.
Fixes strong emphasis formatting when the contents on either side are not both words.
Removes extra blank lines in style tags.
Improves formatting of super classes.
Infers the TOML parser for Front Matter so an appropriate plugin can process it, including in HTML and CSS files.
Fixes formatting that previously threw a TypeError for this TypeScript mapped-type case.
Removes unexpected blank lines before union types; this also affects Flow syntax.
Fixes misaligned union types and removes an extra empty line in their output.
Preserves the explicit document end marker.
Uses explicit key style for flow-mapping keys with trailing comments.
Preserves an empty line between a map and a comment.
Computed optional chaining expressions are supported.
Parentheses around expressions using the nullish coalescing operator are preserved.
Angular expressions support shorthand object properties.
Fixes indentation of arrow function chains in call arguments and binary expressions.
Improves formatting of custom properties and handles previously failing edge cases.
Fixes line breaks in CSS declarations containing commas.
Makes conditional-expression formatting more consistent between curried and non-curried arrow functions.
Fixes edge cases in how the first call argument is expanded during formatting.
Cursor positioning is corrected for files containing emoji.
Improves comment printing and cursor tracking around type annotations.
Preserves the signature of a hugged function expression when its parameters are identifiers without types.
The filename is cleared before the code from an ignored file is printed to the screen.
Formats interleaved comments without merging them onto one line.
Prettier no longer adds an unnecessary leading semicolon in Vue event bindings when using
--no-semi.Less interpolation no longer causes a parse error.
Improves new-line detection when formatting mapped types.
Fixes incorrect memoization of plugin instances.
Fixes missing parentheses and semicolons around ignored nodes.
Fixes double semicolons caused by prettier-ignore on a call signature line.
Fixes leading comments in mapped types containing readonly.
Fixes formatting of string values containing escaped backslashes.
Prettier recognizes the HTML
<search>element and formats its tag name in lowercase.Prevents unstable formatting of template literals with embedded languages when they are the only call argument or an arrow function body and have leading and trailing whitespace.
Fixes indentation of expressions inside template literals.
Keeps parentheses around TSInstantiationExpression when followed by a property access.
Makes dangling-comment formatting consistent between tuple types and arrays.
Preserves the required trailing comma in type parameters for .mts and .cts files as well as .tsx files.
Prints union types in multiline form when they contain comments.
Fixes formatting of union types with a single type.
Preserves commas in CSS URLs.
Preserves the trailing comma in CSS var functions.
Vue filter detection is fixed, improving formatting of expressions that contain bitwise operators and filters.
prettier 293 changes
Breaking changes 30
The default changed to always wrap arrow function arguments in parentheses.
Comments retain their position before the assigned value instead of moving before the equals sign.
Preserves original casing of element names in CSS selectors instead of lowercasing HTML element names.
Function composition formatting no longer splits decorator call arguments across multiple lines.
The default changed from auto to lf, avoiding line-ending differences between files and operating systems.
Formatting now adds a space after the function keyword, except for generator declarations where function* is treated as a whole word.
Treats colons as ordinary characters in HTML tag names rather than as XML namespace prefix delimiters.
HTML template literals now respect whitespace significance instead of adding newlines by default; ignore retains the prior behavior.
When running from a subdirectory, ignored-file filtering uses filenames relative to --ignore-path when it is present.
Method chains are now broken based on the complexity of their arguments rather than their length.
The minimum required Node.js version is now 10.13.0.
The old babylon parser value was removed; it had been renamed to babel.
The old postcss parser value was removed; it had been renamed to css.
The old typescript-eslint parser alias was removed.
The version parameter was removed; the API no longer provides support information for previous versions.
The third argument is now locEnd instead of options.
The third argument is now locEnd instead of options.
The third argument is now locStart instead of options.
Removed from prettier.util; use prettier.doc.utils.mapDoc instead.
When a passed glob also names an existing file, the CLI tries that literal file name before treating the argument as a glob.
File processing follows the order of specified paths; resolved files for each path are sorted, but the combined list is not.
The CLI reports a no-matching-files error for individual patterns that match no files.
The false option value was removed; use never instead.
The true option value was removed; use always instead.
Removes the redundant CLI flag; stdin is already read when no file paths or glob patterns are provided.
The default changed from none to es5, adding trailing commas where supported by the es5 setting.
The false option value was removed; use none instead.
The true option value was removed; use es5 instead.
undefined is no longer wrapped in parentheses in conditional expressions within JSX.
The deprecated useFlowParser option and its --flow-parser CLI option were removed.
New APIs and options 5
Adds support for decorators in Flow.
Added babel-ts, an alternative TypeScript parser using Babel's TypeScript plugin, which supports some JavaScript features not yet supported by TypeScript.
Handlebars now supports prettier-ignore comments to preserve the following content's formatting.
Plugin search results are cached; this API clears the cache.
Formats Vue single-file components containing a JSX script.
Behavior and default changes 14
Formats broken HTML instead of throwing.
Formats the value of HTML class attributes.
Formats the value of HTML style attributes.
Prettier can now print inline Handlebars expressions in HTML.
MDX parsing and formatting now support JSX fragments.
Prettier now formats expressions in the AngularJS ng-class directive when using the Angular parser.
Prettier now formats expressions in the AngularJS ng-hide directive when using the Angular parser.
Prettier now formats expressions in the AngularJS ng-if directive when using the Angular parser.
Prettier now formats expressions in the AngularJS ng-show directive when using the Angular parser.
Prettier now formats expressions in the AngularJS ng-style directive when using the Angular parser.
Supports
<!-- prettier-ignore -->for text, extending its previous support for tags.The CLI can expand directory arguments, including the current directory, and format supported files in their subdirectories.
Throw statements are formatted like return statements, including parenthesizing multiline expressions.
Keeps sole string literals in attributes on the same line instead of printing them on a new line.
Tooling 3
The CLI can now infer a parser for .cjs files.
Prettier supports TypeScript 3.8 syntax, including type-only imports and exports, ECMAScript private fields, and export namespace syntax.
The CLI now supports the .yaml.sed file extension.
Fixes and other changes 41
Fixes indentation of arrow functions in variable declarations followed by comments.
Fixes formatting of complex types in arrow function return type annotations.
Fixes stripped attribute values in Handlebars, preserving the value instead of outputting only the attribute name.
Fixes superfluous line breaks when formatting Handlebars ConcatStatement values.
Configuration override patterns now apply to files whose names begin with a dot.
Parentheses around comma expressions are retained so the resulting export remains valid code.
Fixes printing of comments in empty type parameters.
Fixes formatting of comments for function-like nodes, including cases that previously caused an error.
Fixes printing of comments in function types.
Prettier no longer inserts indentation that breaks the relationship between opening and closing HTML tags after a Markdown list item.
Fixes formatting of i18n attributes so the closing quote no longer moves to a new line and breaks custom ids.
Fixes detection of GraphQL interface separators while preserving the original comma or ampersand separator.
Keeps output parseable for index signatures without type annotations or with multiple parameters.
Prints JSDoc-only types as is instead of throwing errors, helping users migrating from Flow to TypeScript.
Parenthesized JSDoc type assertions are preserved instead of being corrupted during formatting.
Fixes MDX parsing failures for JSX elements that are not parsable as HTML.
Formatting of labeled statements with comments is now stable across repeated runs.
Fixes several Less formatting issues involving each, !important in mixin parameters, comments in mixin-call rulesets, and ::before.
Formatting of logical expressions is now stable across repeated runs.
Fixes printing of mapped types with the template type omitted.
Fixes formatting of multi-line Markdown footnotes.
Fixes a falling mustache issue when formatting Handlebars.
Improves printing of Handlebars MustacheStatement expressions.
Parentheses are retained in edge cases where removing them changes optional-chaining expression formatting.
Fixes bad formatting of a closing tag after comments in pre tags.
Fixes printing of private class field declarations so the private field marker is preserved.
An empty return statement with a comment now places its semicolon before the comment.
Fixes whitespace in SCSS concatenation.
Stops adding an extra comma after the last comment in an SCSS map when trailingComma is set to es5.
Fixes inconsistent formatting of self-closing tags.
Fixes a parse error when formatting srcset values.
Recognizes Flow's symbol type annotation introduced in flow@0.114.0.
Prevents unexpected empty lines from being added after table tags.
Fixed formatting of logical, binary, and sequence expressions inside template literals.
Fixed indentation for ternaries nested in conditions of other ternaries.
Stops printing trailing commas after rest elements in tuples, avoiding output Babel cannot parse.
Fixes an error thrown on an unclosed tag in a pre tag.
Fixes indentation of expressions in Vue templates.
Preserves Handlebars whitespace control characters during formatting.
Unnecessary parentheses around JSX yielded from generator functions are removed.
Markdown formatting now handles zero-based lists correctly instead of changing subsequent list numbers.