- JavaScript: Add an option to modify when Prettier quotes object properties ([#5934] by [@azz]) **`--quote-props `** `as-needed` **(default)** - Only add quotes around object properties where required. Current behaviour. `preserve` - Respect the input. This is useful for users of Google's Closure Compiler in Advanced Mode, which treats quoted properties differently. `consistent` - If _at least one_ property in an object requires quotes, quote all properties - this is like ESLint's [`consistent-as-needed`](https://eslint.org/docs/rules/quote-props) option. ```js // Input const headers = { accept: "application/json", "content-type": "application/json", "origin": "prettier.io" }; // Output --quote-props=as-needed const headers = { accept: "application/json", "content-type": "application/json", origin: "prettier.io" }; // Output --quote-props=consistent const headers = { "accept": "application/json", "content-type": "application/json", "origin": "prettier.io" }; // Output --quote-props=preserve const headers = { accept: "application/json", "content-type": "application/json", "origin": "prettier.io" }; ``` - CLI: Honor stdin-filepath when outputting error messages. - Markdown: Do not align table contents if it exceeds the print width and `--prose-wrap never` is set ([#5701] by [@chenshuai2144]) The aligned table is less readable than the compact one if it's particularly long and the word wrapping is not enabled in the editor so we now print them as compact tables in these situations. ```md | Property | Description | Type | Default | | -------- | ----------- | ---- | ------- | | bordered | Toggles rendering of the border around the list | boolean | false | | itemLayout | The layout of list, default is `horizontal`, If a vertical list is desired, set the itemLayout property to `vertical` | string | - | | Property | Description | Type | Default | | ---------- | --------------------------------------------------------------------------------------------------------------------- | ------- | ------- | | bordered | Toggles rendering of the border around the list | boolean | false | | itemLayout | The layout of list, default is `horizontal`, If a vertical list is desired, set the itemLayout property to `vertical` | string | - | | Property | Description | Type | Default | | --- | --- | --- | --- | | bordered | Toggles rendering of the border around the list | boolean | false | | itemLayout | The layout of list, default is `horizontal`, If a vertical list is desired, set the itemLayout property to `vertical` | string | - | ``` - LWC: Add support for Lightning Web Components ([#5800] by [@ntotten]) Supports [Lightning Web Components (LWC)](https://developer.salesforce.com/docs/component-library/documentation/lwc) template format for HTML attributes by adding a new parser called `lwc`. ```html // Input // Output (Prettier stable) // Output (Prettier master) ``` - JavaScript: Fix parens logic for optional chaining expressions and closure type casts ([#5843] by [@yangsu]) Logic introduced in #4542 will print parens in the wrong places and produce invalid code for optional chaining expressions (with more than 2 nodes) or closure type casts that end in function calls. ```js // Input (a?.b[c]).c(); let value = /** @type {string} */ (this.members[0]).functionCall(); // Output (Prettier stable) a(?.b[c]).c(); let value = /** @type {string} */ this(.members[0]).functionCall(); // Output (Prettier master) (a?.b[c]).c(); let value = /** @type {string} */ (this.members[0]).functionCall(); ```