unstale

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 init

@unstale/cli on npm

prettier 3339 changes

Breaking changes 50

  • Strips blockquote markers from continuation lines instead of keeping them as literal text.

    3.9.7release notes

  • The legacy import assertion syntax using assert is no longer supported; migrate to the current with syntax.

    3.9.0release notes

  • Prints a semicolon before a type assertion in no-semi mode.

    3.9.0release notes

  • Prettier no longer adds a trailing comma to SCSS if() function calls.

    3.8.3release notes

  • Prettier removes the space after a pipe name in Angular pipe expressions.

    3.0.0upgrade guide

  • Support for Angular quote expressions is dropped.

    3.0.0upgrade guide

  • 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.

    3.0.0upgrade guide

  • The CLI executable moved from bin-prettier.js to bin/prettier.cjs.

    3.0.0upgrade guide

  • Prettier no longer inserts spaces between Chinese or Japanese and Western characters, while preserving existing spaces.

    3.0.0upgrade guide

  • GraphQL no longer accepts the comma-separated interfaces syntax.

    3.0.0upgrade guide

  • The css parser now accepts only vanilla CSS; use the appropriate parser or let Prettier detect Less and SCSS by file extension.

    3.0.0upgrade guide

  • The legacy custom parser feature has been removed because its functionality was a subset of the Plugin API.

    3.0.0upgrade guide

  • HTML5 doctype is printed in lowercase.

    3.0.0upgrade guide

  • The printer embed method has a new, incompatible signature to support async parsers for embedded languages.

    3.0.0upgrade guide

  • Plugins are loaded with import(), allowing ESM plugins; directory paths and extensionless file paths may no longer load.

    3.0.0upgrade guide

  • 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.

    3.0.0upgrade guide

  • An object type in a declare function signature now breaks before the return type, matching TypeScript formatting.

    3.0.0upgrade guide

  • The resolveConfig option now defaults to true.

    3.0.0upgrade guide

  • Prettier now ignores files listed in .gitignore by default; set --ignore-path=.prettierignore for the old behavior.

    3.0.0upgrade guide

  • Multiple whitespace characters in Markdown inline code are preserved instead of being collapsed.

    3.0.0upgrade guide

  • Prettier no longer breaks lines inside Korean words when proseWrap is always, avoiding unintended word divisions when text is unwrapped.

    3.0.0upgrade guide

  • Node.js 10 and 12 are no longer supported; the minimum required version is 14.

    3.0.0upgrade guide

  • Prettier no longer falls back to the babel parser when no parser or filepath is provided; formatting now throws an UndefinedParserError.

    3.0.0upgrade guide

  • The second parsers argument was removed from parse; parser access can be obtained through imports or the options argument.

    3.0.0upgrade guide

  • Automatic plugin search and its CLI flags and API option have been removed; use --plugin and plugins instead.

    3.0.0upgrade guide

  • 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.

    3.0.0upgrade guide

  • The CLI option is renamed from --loglevel to --log-level.

    3.0.0upgrade guide

  • The API now returns Promise<boolean>.

    3.0.0upgrade guide

  • The API now returns Promise<void>.

    3.0.0upgrade guide

  • The previously deprecated concat builder has been removed.

    3.0.0upgrade guide

  • This undocumented internal API has been removed.

    3.0.0upgrade guide

  • This undocumented internal API has been removed.

    3.0.0upgrade guide

  • This undocumented internal API has been removed.

    3.0.0upgrade guide

  • This undocumented internal API has been removed.

    3.0.0upgrade guide

  • This undocumented internal API has been removed.

    3.0.0upgrade guide

  • The API now returns Promise<string> instead of a string.

    3.0.0upgrade guide

  • The API now returns Promise<string>.

    3.0.0upgrade guide

  • The API now returns a Promise of the formatted result and cursor offset.

    3.0.0upgrade guide

  • The synchronous getFileInfo API has been removed.

    3.0.0upgrade guide

  • The API now returns a Promise.

    3.0.0upgrade guide

  • The synchronous resolveConfig API has been removed.

    3.0.0upgrade guide

  • The synchronous resolveConfigFile API has been removed.

    3.0.0upgrade guide

  • The signature now takes text and startIndex instead of a node and location callback.

    3.0.0upgrade guide

  • The signature now takes text and startIndex instead of a node and location callback.

    3.0.0upgrade guide

  • The signature now takes text and startIndex instead of a node and location callback.

    3.0.0upgrade guide

  • undefined and null are no longer passed to a plugin's print function; plugins should check them in the parent node instead.

    3.0.0upgrade guide

  • Prettier no longer follows symbolic links while expanding command line arguments, avoiding issues such as cycles and links to ignored files.

    3.0.0upgrade guide

  • The default is now all instead of es5; configure es5 to retain the old behavior.

    3.0.0upgrade guide

  • Breaks constructor parameters onto separate lines when formatting TypeScript parameter properties.

    3.0.0upgrade guide

  • Vue template expressions are formatted as TypeScript when any script tag has lang="ts".

    3.0.0upgrade guide

Deprecations 1

  • This utility is deprecated; use prettier.util.isNextLineEmpty instead.

    3.0.0upgrade guide

New APIs and options 19

  • Adds support for Angular @boundary error boundaries.

    3.9.7release notes

  • The typescript parser now supports import defer.

    3.9.6release notes

  • A new official plugin is available.

    3.9.6release notes

  • A new official plugin is available separately and includes the yuku and yuku-ts parsers for JavaScript and TypeScript syntax.

    3.9.6release notes

  • Adds formatting support for Flow match instance patterns and Flow records.

    3.9.0release notes

  • Formats Lightning Web Components syntax in Markdown code blocks tagged lwc.

    3.9.0release notes

  • Updates the Printer interface so print accepts an optional selector and optional args parameter.

    3.9.0release notes

  • A plugin can provide an estree printer without also providing parsers.

    3.7.0release notes

  • Adds support for front matter in Handlebars.

    3.7.0release notes

  • Adds support for opaque types with lower and upper bounds.

    3.7.0release notes

  • Receives ancestors, allowing plugins to prevent comments from attaching to a specific child node.

    3.7.0release notes

  • Plugins can provide printPrettierIgnored() to customize how nodes with prettier-ignore comments are printed, including handling parentheses or leading semicolons.

    3.7.0release notes

  • Adds support for the Import Attributes proposal.

    3.0.0upgrade guide

  • ESM configuration is supported in this filename when package.json sets type to module.

    3.0.0upgrade guide

  • ESM configuration files are supported.

    3.0.0upgrade guide

  • Adds a utility that returns the next non-space, non-comment character.

    3.0.0upgrade guide

  • ESM configuration is supported in this filename when package.json sets type to module.

    3.0.0upgrade guide

  • ESM configuration files are supported.

    3.0.0upgrade guide

  • Adds support for Flow type guards.

    3.0.0upgrade guide

Performance 3

  • Updated the Markdown table parser dependency to fix a table parse performance issue.

    3.9.10release notes

  • Prettier now uses Flow's Rust-based parser, improving parsing performance for Flow-typed code.

    3.9.0release notes

  • Fixes a performance regression in the doc printer.

    3.7.1release notes

Behavior and default changes 52

  • Prettier no longer expands empty Flow module declarations onto multiple lines.

    3.9.5release notes

  • Supports literal initializers and multiple declarations in DeclareVariable.

    3.9.0release notes

  • Adds support for implicit declared functions and components.

    3.9.0release notes

  • Treats a .git file as a project root marker, preventing EditorConfig settings above Git worktrees or submodules from being applied.

    3.9.0release notes

  • Long interface implementation lists can now break across lines.

    3.9.0release notes

  • Aligns JSDoc before union type elements.

    3.9.0release notes

  • Preserves original number and string representations, avoiding rounding large or small numbers and unescaping special characters.

    3.9.0release notes

  • One existing blank line between JSX attributes is preserved; multiple blank lines are still collapsed to one.

    3.9.0release notes

  • Formatting around comments after break and continue is stable in no-semi mode, avoiding the previous awkward line break and leading semicolon.

    3.9.0release notes

  • Comment formatting in objects is improved, including spacing before a property.

    3.9.0release notes

  • Preserves setext headings rather than converting them to ATX headings.

    3.9.0release notes

  • Keeps union types on one line when they fit.

    3.9.0release notes

  • Prettier now accepts and prints Flow’s readonly property variance annotation, equivalent to + (covariant/read-only).

    3.8.5release notes

  • Prettier now formats arrow function expressions in Angular templates.

    3.8.2release notes

  • Prettier now supports Angular’s exhaustive typechecking syntax using @default never;.

    3.8.2release notes

  • Prettier now formats instanceof expressions in Angular templates.

    3.8.2release notes

  • Prettier formats Angular syntax in Markdown code blocks tagged angular-html.

    3.8.0release notes

  • Prettier formats Angular syntax in Markdown code blocks tagged angular-ts.

    3.8.0release notes

  • Prettier formats spread elements in array literals, object literals, and function calls inside Angular templates.

    3.8.0release notes

  • Prettier no longer prints attribute values that are single template or string literals on new lines.

    3.8.0release notes

  • Removes extra indentation in logical expressions inside Boolean() calls to reduce diffs when changing conditions or switching between Boolean() and !!.

    3.7.0release notes

  • Formats the allow attribute of iframe elements.

    3.7.0release notes

  • Import attributes can now break across multiple lines when formatted.

    3.7.0release notes

  • Formats JavaScript in inline event handler attributes.

    3.7.0release notes

  • Removes redundant parentheses around JSX elements.

    3.7.0release notes

  • Keeps property and variable accessors tight without inserting spaces.

    3.7.0release notes

  • Prettier now preserves indentation for test.fixme, test.describe.skip, and test.describe.fixme, as it already does for test.skip.

    3.7.0release notes

  • May now return a Promise, aligning with plugin.printer.preprocess(); the notes still suggest moving async work to plugin.parser.parse().

    3.7.0release notes

  • Prints the trailing comma in TypeScript import type attributes.

    3.7.0release notes

  • Breaks a line after = when formatting long type parameter defaults.

    3.7.0release notes

  • Prettier's fork of Angular's HTML parser was synced with the upstream.

    3.0.0upgrade guide

  • When proseWrap is always, Prettier follows Chinese and Japanese rules that prohibit certain characters at line beginnings or endings.

    3.0.0upgrade guide

  • Removes unnecessary parentheses around class expressions.

    3.0.0upgrade guide

  • A line break is printed after the file path before errors for options other than --write and when no options are used.

    3.0.0upgrade guide

  • Prettier displays paths in POSIX style on Windows.

    3.0.0upgrade guide

  • Prettier recognizes decorated arrow functions and keeps the arrow function hugged even when its signature breaks.

    3.0.0upgrade guide

  • A shareable config package can now be a pure ESM package.

    3.0.0upgrade guide

  • Places parentheses around the head of an ExpressionStatement instead of around the whole statement.

    3.0.0upgrade guide

  • Supports trailing comments for RestElement, ArrayPattern, and ObjectPattern function parameters.

    3.0.0upgrade guide

  • Inline JavaScript code in Less is kept as it is instead of being reformatted.

    3.0.0upgrade guide

  • Supports nestled JSDoc comments, used to document overloaded functions.

    3.0.0upgrade guide

  • The label doc builder now allows arbitrary truthy values.

    3.0.0upgrade guide

  • A plugin parser's parse function can return a Promise, enabling async parsers.

    3.0.0upgrade guide

  • A printer's preprocess method can now return a promise.

    3.0.0upgrade guide

  • The CLI accepts multiple --ignore-path options.

    3.0.0upgrade guide

  • Adds support for the regexp modifiers proposal.

    3.0.0upgrade guide

  • Prettier formats script content inside SVG elements.

    3.0.0upgrade guide

  • textToDoc now returns docs without trailing hard lines, making embed printing easier for plugins.

    3.0.0upgrade guide

  • Flow type parameters and tuple types now print trailing commas when trailingComma is es5.

    3.0.0upgrade guide

  • Supports line breaking after extends in type parameters.

    3.0.0upgrade guide

  • TypeScript expressions in Vue attribute bindings are formatted.

    3.0.0upgrade guide

  • Formatting Vue SFC root blocks ignores htmlWhitespaceSensitivity.

    3.0.0upgrade guide

Tooling 14

  • Prettier supports Angular 22.2.

    3.9.7release notes

  • Adds support for writeonly, in, and out variance modifiers.

    3.9.0release notes

  • Prettier now supports newer GraphQL.js v17 syntax, including directives on directive definitions and fragment arguments.

    3.9.0release notes

  • Prettier supports Angular v21.2.

    3.8.2release notes

  • Plugin type declarations now include available printers, allowing plugin authors to access them in their types.

    3.8.1release notes

  • Prettier now supports Angular v21.1.

    3.8.0release notes

  • Adds support for Angular 21 syntax, including regular expressions and new assignment operators.

    3.7.0release notes

  • The Stage 2 Discard Bindings proposal is now supported via Babel.

    3.7.0release notes

  • The failure message changes from “Forgot to run Prettier?” to “Run Prettier with --write to fix.”

    3.0.0upgrade guide

  • Adds Flow support for conditional types and infer types.

    3.0.0upgrade guide

  • Supports the Stage 2 Import Reflection proposal via Babel 7.20.0.

    3.0.0upgrade guide

  • Adds Flow support for Mapped Types and keyof.

    3.0.0upgrade guide

  • Prettier adds .d.ts files for using its JavaScript API from TypeScript, eliminating the need to install @types/prettier.

    3.0.0upgrade guide

  • Supports the Explicit Resource Management proposal via Babel 7.20.0 and 7.22.0.

    3.0.0upgrade guide

Fixes and other changes 200

  • Fixes Markdown text containing $ being incorrectly parsed as math syntax, preserving spaces between inline code spans.

    3.9.9release notes

  • Fixes Markdown text containing $ being incorrectly parsed as math syntax.

    3.9.9release notes

  • Markdown paragraphs are no longer interrupted by Liquid objects.

    3.9.8release notes

  • Formatting embedded template literals is now idempotent across repeated runs.

    3.9.7release notes

  • Fixes indentation drift for HTML blocks inside Markdown list items.

    3.9.7release notes

  • Preserves Liquid blocks following Markdown tables instead of formatting them as table content.

    3.9.7release notes

  • Fixes formatting of Markdown blockquotes containing > characters.

    3.9.7release notes

  • Prevents indentation drift in wrapped paragraphs inside Markdown list-item code blocks.

    3.9.7release notes

  • Fixes regressions in v3.9.

    3.9.7release notes

  • Single-tilde spans are preserved; only double tildes are treated as strike-through, matching GitHub.

    3.9.7release notes

  • Preserves quotes for methods named new when formatting.

    3.9.6release notes

  • Prettier no longer corrupts adjacent block comments in Less.

    3.9.5release notes

  • Prettier removes the extra space inside comment-only TypeScript object types.

    3.9.5release notes

  • The comment.placement property is available again after comment attachment, restoring a property already used by plugins.

    3.9.5release notes

  • Prettier preserves the <> in inline links and images with an empty URL and a title, avoiding a change in interpretation.

    3.9.5release notes

  • Prettier removes extra spaces after [ in Less map lookups.

    3.9.5release notes

  • Prettier removes spaces between Less merge markers and colons.

    3.9.5release notes

  • Comments inside mapped types no longer cause Prettier to treat them as type parameter comments, avoiding unwanted formatting changes.

    3.9.5release notes

  • Angular formatting preserves expressions used for exhaustive typechecking in @default branches.

    3.9.5release notes

  • Markdown formatting caps ordered list item numbers at 999,999,999 so CommonMark parsers correctly recognize them as list items; larger numbers remain unchanged.

    3.9.5release notes

  • Prettier no longer drops comments on shorthand type import and export specifiers or errors when printing them.

    3.9.5release notes

  • Prettier correctly handles dangling comments inside JavaScript switch statements.

    3.9.5release notes

  • Prettier no longer adds a space before + in CSS type() declarations, which made the resulting CSS invalid.

    3.9.5release notes

  • Prettier preserves wiki links with aliases instead of dropping the alias.

    3.9.5release notes

  • Formats Angular @content(name) as @content (name) to align with other block syntax.

    3.9.4release notes

  • Allows decorators to be used with declare on TypeScript class fields.

    3.9.3release notes

  • Fixes unexpected removal of characters in Liquid syntax.

    3.9.3release notes

  • Fixes ignored files being cached incorrectly by the CLI.

    3.9.1release notes

  • Fixes trailing comment formatting in abstract method parameters.

    3.9.0release notes

  • Comments in arrow function assignment expression bodies remain inside the parentheses and format stably.

    3.9.0release notes

  • Comments in arrow function sequence expression bodies remain inside the parentheses and format stably.

    3.9.0release notes

  • Makes formatting of arrow functions consistent.

    3.9.0release notes

  • Blank line detection between statements is improved, including in no-semi mode.

    3.9.0release notes

  • Fixes content-based cache comparison, which was silently disabled because Prettier passed an outdated option casing.

    3.9.0release notes

  • Comments in call expressions no longer move or reformat inconsistently between successive runs.

    3.9.0release notes

  • Prevents comments from moving in class properties.

    3.9.0release notes

  • Fixes inconsistent formatting of class superclasses.

    3.9.0release notes

  • Comments above else and else if are kept in their expected position.

    3.9.0release notes

  • Fixes comment indentation in conditional types.

    3.9.0release notes

  • Angular templates can now format @content blocks instead of failing with a syntax error.

    3.9.0release notes

  • Fixes line breaks when CSS attribute values contain literal newlines.

    3.9.0release notes

  • Prettier no longer inserts an unexpected space before an expression in a CSS selector.

    3.9.0release notes

  • Comments on debugger statements are printed instead of triggering a comment-not-printed error.

    3.9.0release notes

  • do..while formatting in no-semi mode is improved, including comments after the condition.

    3.9.0release notes

  • Alignment in embedded template interpolations is improved.

    3.9.0release notes

  • Prettier avoids introducing line breaks inside embedded template interpolations in the shown case.

    3.9.0release notes

  • Short comments no longer force empty arrays and objects to break across lines.

    3.9.0release notes

  • Comment handling around empty call argument lists is improved.

    3.9.0release notes

  • Long comments in empty call argument lists can break across lines.

    3.9.0release notes

  • Comments in empty branches are no longer duplicated when experimental ternaries are enabled.

    3.9.0release notes

  • Preserves Flow comment syntax annotations instead of printing them as regular Flow syntax.

    3.9.0release notes

  • Prints the async keyword for component declarations.

    3.9.0release notes

  • Fixes dangling comment printing in components.

    3.9.0release notes

  • Fixes dangling comment printing in hooks.

    3.9.0release notes

  • Improves comment formatting in inexact tuples.

    3.9.0release notes

  • Improves formatting of long mapped types across multiple lines.

    3.9.0release notes

  • Prevents object types with inline comments from expanding.

    3.9.0release notes

  • Fixes parentheses for optional functions used as return types.

    3.9.0release notes

  • Unneeded spaces are removed from for statements without an update expression.

    3.9.0release notes

  • Dangling comments in function parameters are printed in the parameter list rather than after the function or arrow.

    3.9.0release notes

  • Prevents crashes when object or list values contain only comments.

    3.9.0release notes

  • Preserves comments in Angular HTML element attributes during formatting.

    3.9.0release notes

  • Fixes Unicode handling in front matter, prevents pre-like closing tags from splitting across lines, and keeps inline comments attached to the preceding node.

    3.9.0release notes

  • Comments on IIFE functions are kept inside the parentheses.

    3.9.0release notes

  • Adds missing parentheses around instantiation expressions.

    3.9.0release notes

  • Trailing double spaces in JSDoc are preserved because some tools treat them as meaningful.

    3.9.0release notes

  • Alignment of multiline JSDoc-style comments in assignments is fixed.

    3.9.0release notes

  • Adds parentheses support for the keyof type operator.

    3.9.0release notes

  • Prevents line comments between a member expression object and property from moving past subsequent content like as expressions.

    3.9.0release notes

  • Logical not expressions avoid unnecessary double parentheses, and conditions in if, while, and do..while are inlined to reduce diffs when negated.

    3.9.0release notes

  • Keeps comments in mapped types inline.

    3.9.0release notes

  • Preserves underscore-style emphasis adjacent to Unicode whitespace instead of rewriting it to asterisks.

    3.9.0release notes

  • Avoids collapsing line breaks before list-like numbers followed by CJK characters.

    3.9.0release notes

  • Removes the extra blank line that was forced between a list and an indented code block.

    3.9.0release notes

  • The Markdown parser now uses micromark v4, improving CommonMark and GFM compliance and resolving long-standing parsing bugs.

    3.9.0release notes

  • Improves Chinese and Japanese text wrapping by treating U+3000 and U+FF5E as CJK punctuation-equivalent.

    3.9.0release notes

  • Escapes unindented lines made only of = or - so they are not mistakenly parsed as setext headers.

    3.9.0release notes

  • Fixes formatting for new expressions with type casts.

    3.9.0release notes

  • Comment attachment is consistent between NewExpression and CallExpression.

    3.9.0release notes

  • An existing empty line before a semicolon is preserved in no-semi mode.

    3.9.0release notes

  • Avoids an unnecessary semicolon before call signatures in no-semi mode.

    3.9.0release notes

  • Prints non-null assertions consistently.

    3.9.0release notes

  • Parentheses are retained where needed around optional chaining before a member access.

    3.9.0release notes

  • Preserves non-null assertions around optional chaining.

    3.9.0release notes

  • Comment printing for parenthesized callees is fixed.

    3.9.0release notes

  • Fixes formatting directory names containing special characters.

    3.9.0release notes

  • Fixes formatting explicitly specified files whose names begin with a quote.

    3.9.0release notes

  • Formatting a range that includes a variable declaration no longer leaves trailing syntax outside the formatted range.

    3.9.0release notes

  • Redundant parentheses around a sequence expression in a return statement are no longer added.

    3.9.0release notes

  • Removes the space before the ; delimiter in the SCSS if() function.

    3.9.0release notes

  • Fixes comment printing in maps.

    3.9.0release notes

  • Prevents adding a trailing comma in math expressions within function arguments.

    3.9.0release notes

  • Avoids adding a trailing comma to parenthesized scalars.

    3.9.0release notes

  • Trailing comments stay inside the parentheses of sequence and assignment expressions.

    3.9.0release notes

  • Preserves comment position after = in type alias declarations.

    3.9.0release notes

  • Improves comment printing inside type arguments.

    3.9.0release notes

  • In no-semi mode, the leading semicolon is printed before a type cast comment.

    3.9.0release notes

  • Adds parentheses to conditional types in type parameter constraints.

    3.9.0release notes

  • Respects quoteProps when printing enum keys.

    3.9.0release notes

  • Respects quoteProps when printing method signatures.

    3.9.0release notes

  • Line breaks in TypeScript member chains are fixed so type arguments and chained calls format appropriately.

    3.9.0release notes

  • Fixes comment printing for the last operand of union types.

    3.9.0release notes

  • Removes extra indentation for union types in conditional types.

    3.9.0release notes

  • Preserves an empty line after a block scalar.

    3.9.0release notes

  • Avoids adding an extra blank line when a block value ends with whitespace.

    3.9.0release notes

  • Fixes formatting of mappings when a key wraps across lines.

    3.9.0release notes

  • The YAML parser now uses yaml v2, fixing many long-standing parse issues.

    3.9.0release notes

  • Fixes printing of Flow variance annotations.

    3.8.5release notes

  • Fixes blank lines between list items and nested sub-lists being removed in Markdown and MDX.

    3.8.4release notes

  • Prevents a trailing comma in the SCSS if() function.

    3.8.3release notes

  • Prettier supports consecutive @case statements in Angular @switch blocks.

    3.8.0release notes

  • Avoids adding quotes around LWC interpolations.

    3.7.4release notes

  • Fixes duplicated comments in union types.

    3.7.4release notes

  • Fixes unstable comment printing in union types.

    3.7.4release notes

  • Fixes a change to prettier.getFileInfo() that broke the VSCode extension.

    3.7.3release notes

  • Fixes comments in empty type literals.

    3.7.2release notes

  • Preserves quotes for embedded HTML attribute values.

    3.7.2release notes

  • Fixes string printing when switching quotes.

    3.7.2release notes

  • Prevents comments in interpolations from being duplicated.

    3.7.0release notes

  • Fixes formatting of non-null assertions in Angular templates.

    3.7.0release notes

  • Fixes inconsistent line breaking for array literals.

    3.7.0release notes

  • Comments after an arrow are no longer moved into its parameters.

    3.7.0release notesrelease notes

  • Makes comment formatting around as const consistent between Flow and TypeScript parsers.

    3.7.0release notes

  • Fixes comment formatting that could cause a syntax error on a subsequent format.

    3.7.0release notes

  • Can access properties of nullish properties without throwing an error.

    3.7.0release notes

  • Adds missing parentheses in bitwise operator expressions.

    3.7.0release notes

  • Preserves the semicolon before call signatures when formatting with --no-semi.

    3.7.0release notes

  • Makes formatting consistent between CallExpression and NewExpression.

    3.7.0release notes

  • TypeScript and Flow class and interface formatting is more consistent: type parameter indentation, heritage printing, and class body opening braces are adjusted.

    3.7.0release notes

  • Fixes inconsistent comment formatting in logical expressions.

    3.7.0release notes

  • Makes comment printing consistent between the TypeScript and Flow parsers.

    3.7.0release notes

  • Handles case-sensitive and uppercase case-insensitive flags in attribute selectors.

    3.7.0release notes

  • Fixes extra indentation after a block comment in comma-separated CSS values.

    3.7.0release notes

  • Prevents a crash when formatting special custom property values.

    3.7.0release notes

  • Removes the unexpected space between font size and line height.

    3.7.0release notes

  • Preserves selector case instead of incorrectly lowercasing it inside CSS modules.

    3.7.0release notes

  • Fixes formatting of CSS selectors containing //.

    3.7.0release notes

  • Preserves else if syntax for custom helpers instead of rewriting it as nested if blocks.

    3.7.0release notes

  • Improves emoji size measurement and table alignment in all languages.

    3.7.0release notes

  • Improves comment printing around empty statements.

    3.7.0release notes

  • Adds GraphQL support for executable descriptions, which previously caused a syntax error.

    3.7.0release notes

  • Fixes comment handling for for-statements.

    3.7.0release notes

  • Removes an empty line in for statements that have no update expression.

    3.7.0release notes

  • With ignore, no longer forces elements to break.

    3.7.0release notes

  • Improves how comments are handled inside if statements.

    3.7.0release notes

  • Adds parentheses around arrow functions in instantiation expressions so they format correctly.

    3.7.0release notes

  • Preserves variable-name case instead of incorrectly lowercasing it.

    3.7.0release notes

  • Fixes inconsistent printing of logical expressions in call and new expressions.

    3.7.0release notes

  • Improves formatting of a logical expression used as the callee of a new expression.

    3.7.0release notes

  • Adds basic support for Flow match syntax, which previously caused a syntax error.

    3.7.0release notes

  • Fixes parsing so the words import and export in list items are not treated as syntax.

    3.7.0release notes

  • Fixes inconsistent comment printing between class methods and object methods.

    3.7.0release notes

  • Avoids breaking import, require.resolve, require.resolve.paths, and import.meta.resolve calls when the module name is long.

    3.7.0release notes

  • Running prettier . without --cache no longer creates an empty node_modules/.cache/ directory.

    3.7.0release notes

  • Improves formatting of CommonJS module require expressions that contain comments.

    3.7.0release notes

  • Improves formatting of require() calls that contain comments.

    3.7.0release notes

  • Fixes spacing around parentheses in mixin arguments.

    3.7.0release notes

  • Fixes formatting of space-separated values in SCSS.

    3.7.0release notes

  • Fixes strong emphasis formatting when the contents on either side are not both words.

    3.7.0release notes

  • Removes extra blank lines in style tags.

    3.7.0release notes

  • Improves formatting of super classes.

    3.7.0release notes

  • Infers the TOML parser for Front Matter so an appropriate plugin can process it, including in HTML and CSS files.

    3.7.0release notes

  • Fixes formatting that previously threw a TypeError for this TypeScript mapped-type case.

    3.7.0release notes

  • Removes unexpected blank lines before union types; this also affects Flow syntax.

    3.7.0release notes

  • Fixes misaligned union types and removes an extra empty line in their output.

    3.7.0release notes

  • Preserves the explicit document end marker.

    3.7.0release notes

  • Uses explicit key style for flow-mapping keys with trailing comments.

    3.7.0release notes

  • Preserves an empty line between a map and a comment.

    3.7.0release notes

  • Computed optional chaining expressions are supported.

    3.0.0upgrade guide

  • Parentheses around expressions using the nullish coalescing operator are preserved.

    3.0.0upgrade guide

  • Angular expressions support shorthand object properties.

    3.0.0upgrade guide

  • Fixes indentation of arrow function chains in call arguments and binary expressions.

    3.0.0upgrade guide

  • Improves formatting of custom properties and handles previously failing edge cases.

    3.0.0upgrade guide

  • Fixes line breaks in CSS declarations containing commas.

    3.0.0upgrade guide

  • Makes conditional-expression formatting more consistent between curried and non-curried arrow functions.

    3.0.0upgrade guide

  • Fixes edge cases in how the first call argument is expanded during formatting.

    3.0.0upgrade guide

  • Cursor positioning is corrected for files containing emoji.

    3.0.0upgrade guide

  • Improves comment printing and cursor tracking around type annotations.

    3.0.0upgrade guide

  • Preserves the signature of a hugged function expression when its parameters are identifiers without types.

    3.0.0upgrade guide

  • The filename is cleared before the code from an ignored file is printed to the screen.

    3.0.0upgrade guide

  • Formats interleaved comments without merging them onto one line.

    3.0.0upgrade guide

  • Prettier no longer adds an unnecessary leading semicolon in Vue event bindings when using --no-semi.

    3.0.0upgrade guide

  • Less interpolation no longer causes a parse error.

    3.0.0upgrade guide

  • Improves new-line detection when formatting mapped types.

    3.0.0upgrade guide

  • Fixes incorrect memoization of plugin instances.

    3.0.0upgrade guide

  • Fixes missing parentheses and semicolons around ignored nodes.

    3.0.0upgrade guide

  • Fixes double semicolons caused by prettier-ignore on a call signature line.

    3.0.0upgrade guide

  • Fixes leading comments in mapped types containing readonly.

    3.0.0upgrade guide

  • Fixes formatting of string values containing escaped backslashes.

    3.0.0upgrade guide

  • Prettier recognizes the HTML <search> element and formats its tag name in lowercase.

    3.0.0upgrade guide

  • 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.

    3.0.0upgrade guide

  • Fixes indentation of expressions inside template literals.

    3.0.0upgrade guide

  • Keeps parentheses around TSInstantiationExpression when followed by a property access.

    3.0.0upgrade guide

  • Makes dangling-comment formatting consistent between tuple types and arrays.

    3.0.0upgrade guide

  • Preserves the required trailing comma in type parameters for .mts and .cts files as well as .tsx files.

    3.0.0upgrade guide

  • Prints union types in multiline form when they contain comments.

    3.0.0upgrade guide

  • Fixes formatting of union types with a single type.

    3.0.0upgrade guide

  • Preserves commas in CSS URLs.

    3.0.0upgrade guide

  • Preserves the trailing comma in CSS var functions.

    3.0.0upgrade guide

  • Vue filter detection is fixed, improving formatting of expressions that contain bitwise operators and filters.

    3.0.0upgrade guide

prettier 293 changes

Breaking changes 30

  • The default changed to always wrap arrow function arguments in parentheses.

    2.0.0upgrade guide

  • Comments retain their position before the assigned value instead of moving before the equals sign.

    2.0.0upgrade guide

  • Preserves original casing of element names in CSS selectors instead of lowercasing HTML element names.

    2.0.0upgrade guide

  • Function composition formatting no longer splits decorator call arguments across multiple lines.

    2.0.0upgrade guide

  • The default changed from auto to lf, avoiding line-ending differences between files and operating systems.

    2.0.0upgrade guide

  • Formatting now adds a space after the function keyword, except for generator declarations where function* is treated as a whole word.

    2.0.0upgrade guide

  • Treats colons as ordinary characters in HTML tag names rather than as XML namespace prefix delimiters.

    2.0.0upgrade guide

  • HTML template literals now respect whitespace significance instead of adding newlines by default; ignore retains the prior behavior.

    2.0.0upgrade guide

  • When running from a subdirectory, ignored-file filtering uses filenames relative to --ignore-path when it is present.

    2.0.0upgrade guide

  • Method chains are now broken based on the complexity of their arguments rather than their length.

    2.0.0upgrade guide

  • The minimum required Node.js version is now 10.13.0.

    2.0.0upgrade guide

  • The old babylon parser value was removed; it had been renamed to babel.

    2.0.0upgrade guide

  • The old postcss parser value was removed; it had been renamed to css.

    2.0.0upgrade guide

  • The old typescript-eslint parser alias was removed.

    2.0.0upgrade guide

  • The version parameter was removed; the API no longer provides support information for previous versions.

    2.0.0upgrade guide

  • The third argument is now locEnd instead of options.

    2.0.0upgrade guide

  • The third argument is now locEnd instead of options.

    2.0.0upgrade guide

  • The third argument is now locStart instead of options.

    2.0.0upgrade guide

  • Removed from prettier.util; use prettier.doc.utils.mapDoc instead.

    2.0.0upgrade guide

  • When a passed glob also names an existing file, the CLI tries that literal file name before treating the argument as a glob.

    2.0.0upgrade guide

  • File processing follows the order of specified paths; resolved files for each path are sorted, but the combined list is not.

    2.0.0upgrade guide

  • The CLI reports a no-matching-files error for individual patterns that match no files.

    2.0.0upgrade guide

  • The false option value was removed; use never instead.

    2.0.0upgrade guide

  • The true option value was removed; use always instead.

    2.0.0upgrade guide

  • Removes the redundant CLI flag; stdin is already read when no file paths or glob patterns are provided.

    2.0.0upgrade guide

  • The default changed from none to es5, adding trailing commas where supported by the es5 setting.

    2.0.0upgrade guide

  • The false option value was removed; use none instead.

    2.0.0upgrade guide

  • The true option value was removed; use es5 instead.

    2.0.0upgrade guide

  • undefined is no longer wrapped in parentheses in conditional expressions within JSX.

    2.0.0upgrade guide

  • The deprecated useFlowParser option and its --flow-parser CLI option were removed.

    2.0.0upgrade guide

New APIs and options 5

  • Adds support for decorators in Flow.

    2.0.0upgrade guide

  • Added babel-ts, an alternative TypeScript parser using Babel's TypeScript plugin, which supports some JavaScript features not yet supported by TypeScript.

    2.0.0upgrade guide

  • Handlebars now supports prettier-ignore comments to preserve the following content's formatting.

    2.0.0upgrade guide

  • Plugin search results are cached; this API clears the cache.

    2.0.0upgrade guide

  • Formats Vue single-file components containing a JSX script.

    2.0.0upgrade guide

Behavior and default changes 14

  • Formats broken HTML instead of throwing.

    2.0.0upgrade guide

  • Formats the value of HTML class attributes.

    2.0.0upgrade guide

  • Formats the value of HTML style attributes.

    2.0.0upgrade guide

  • Prettier can now print inline Handlebars expressions in HTML.

    2.0.0upgrade guide

  • MDX parsing and formatting now support JSX fragments.

    2.0.0upgrade guide

  • Prettier now formats expressions in the AngularJS ng-class directive when using the Angular parser.

    2.0.0upgrade guide

  • Prettier now formats expressions in the AngularJS ng-hide directive when using the Angular parser.

    2.0.0upgrade guide

  • Prettier now formats expressions in the AngularJS ng-if directive when using the Angular parser.

    2.0.0upgrade guide

  • Prettier now formats expressions in the AngularJS ng-show directive when using the Angular parser.

    2.0.0upgrade guide

  • Prettier now formats expressions in the AngularJS ng-style directive when using the Angular parser.

    2.0.0upgrade guide

  • Supports <!-- prettier-ignore --> for text, extending its previous support for tags.

    2.0.0upgrade guide

  • The CLI can expand directory arguments, including the current directory, and format supported files in their subdirectories.

    2.0.0upgrade guide

  • Throw statements are formatted like return statements, including parenthesizing multiline expressions.

    2.0.0upgrade guide

  • Keeps sole string literals in attributes on the same line instead of printing them on a new line.

    2.0.0upgrade guide

Tooling 3

  • The CLI can now infer a parser for .cjs files.

    2.0.0upgrade guide

  • Prettier supports TypeScript 3.8 syntax, including type-only imports and exports, ECMAScript private fields, and export namespace syntax.

    2.0.0upgrade guide

  • The CLI now supports the .yaml.sed file extension.

    2.0.0upgrade guide

Fixes and other changes 41

  • Fixes indentation of arrow functions in variable declarations followed by comments.

    2.0.0upgrade guide

  • Fixes formatting of complex types in arrow function return type annotations.

    2.0.0upgrade guide

  • Fixes stripped attribute values in Handlebars, preserving the value instead of outputting only the attribute name.

    2.0.0upgrade guide

  • Fixes superfluous line breaks when formatting Handlebars ConcatStatement values.

    2.0.0upgrade guide

  • Configuration override patterns now apply to files whose names begin with a dot.

    2.0.0upgrade guide

  • Parentheses around comma expressions are retained so the resulting export remains valid code.

    2.0.0upgrade guide

  • Fixes printing of comments in empty type parameters.

    2.0.0upgrade guide

  • Fixes formatting of comments for function-like nodes, including cases that previously caused an error.

    2.0.0upgrade guide

  • Fixes printing of comments in function types.

    2.0.0upgrade guide

  • Prettier no longer inserts indentation that breaks the relationship between opening and closing HTML tags after a Markdown list item.

    2.0.0upgrade guide

  • Fixes formatting of i18n attributes so the closing quote no longer moves to a new line and breaks custom ids.

    2.0.0upgrade guide

  • Fixes detection of GraphQL interface separators while preserving the original comma or ampersand separator.

    2.0.0upgrade guide

  • Keeps output parseable for index signatures without type annotations or with multiple parameters.

    2.0.0upgrade guide

  • Prints JSDoc-only types as is instead of throwing errors, helping users migrating from Flow to TypeScript.

    2.0.0upgrade guide

  • Parenthesized JSDoc type assertions are preserved instead of being corrupted during formatting.

    2.0.0upgrade guide

  • Fixes MDX parsing failures for JSX elements that are not parsable as HTML.

    2.0.0upgrade guide

  • Formatting of labeled statements with comments is now stable across repeated runs.

    2.0.0upgrade guide

  • Fixes several Less formatting issues involving each, !important in mixin parameters, comments in mixin-call rulesets, and ::before.

    2.0.0upgrade guide

  • Formatting of logical expressions is now stable across repeated runs.

    2.0.0upgrade guide

  • Fixes printing of mapped types with the template type omitted.

    2.0.0upgrade guide

  • Fixes formatting of multi-line Markdown footnotes.

    2.0.0upgrade guide

  • Fixes a falling mustache issue when formatting Handlebars.

    2.0.0upgrade guide

  • Improves printing of Handlebars MustacheStatement expressions.

    2.0.0upgrade guide

  • Parentheses are retained in edge cases where removing them changes optional-chaining expression formatting.

    2.0.0upgrade guide

  • Fixes bad formatting of a closing tag after comments in pre tags.

    2.0.0upgrade guide

  • Fixes printing of private class field declarations so the private field marker is preserved.

    2.0.0upgrade guide

  • An empty return statement with a comment now places its semicolon before the comment.

    2.0.0upgrade guide

  • Fixes whitespace in SCSS concatenation.

    2.0.0upgrade guide

  • Stops adding an extra comma after the last comment in an SCSS map when trailingComma is set to es5.

    2.0.0upgrade guide

  • Fixes inconsistent formatting of self-closing tags.

    2.0.0upgrade guide

  • Fixes a parse error when formatting srcset values.

    2.0.0upgrade guide

  • Recognizes Flow's symbol type annotation introduced in flow@0.114.0.

    2.0.0upgrade guide

  • Prevents unexpected empty lines from being added after table tags.

    2.0.0upgrade guide

  • Fixed formatting of logical, binary, and sequence expressions inside template literals.

    2.0.0upgrade guide

  • Fixed indentation for ternaries nested in conditions of other ternaries.

    2.0.0upgrade guide

  • Stops printing trailing commas after rest elements in tuples, avoiding output Babel cannot parse.

    2.0.0upgrade guide

  • Fixes an error thrown on an unclosed tag in a pre tag.

    2.0.0upgrade guide

  • Fixes indentation of expressions in Vue templates.

    2.0.0upgrade guide

  • Preserves Handlebars whitespace control characters during formatting.

    2.0.0upgrade guide

  • Unnecessary parentheses around JSX yielded from generator functions are removed.

    2.0.0upgrade guide

  • Markdown formatting now handles zero-based lists correctly instead of changing subsequent list numbers.

    2.0.0upgrade guide