diff --git a/.github/ISSUE_TEMPLATE/formatting.md b/.github/ISSUE_TEMPLATE/formatting.md index f2a21f21f198..e02c535869b0 100644 --- a/.github/ISSUE_TEMPLATE/formatting.md +++ b/.github/ISSUE_TEMPLATE/formatting.md @@ -26,7 +26,7 @@ Don't fill the form below manually! Let a program create a report for you: --> -**Prettier 2.8.4** +**Prettier 2.8.5** [Playground link](https://prettier.io/playground/#.....) ```sh diff --git a/.github/ISSUE_TEMPLATE/integration.md b/.github/ISSUE_TEMPLATE/integration.md index 58f004f6cdc4..12e84bc26950 100644 --- a/.github/ISSUE_TEMPLATE/integration.md +++ b/.github/ISSUE_TEMPLATE/integration.md @@ -20,7 +20,7 @@ BEFORE SUBMITTING AN ISSUE: **Environments:** -- Prettier Version: 2.8.4 +- Prettier Version: 2.8.5 - Running Prettier via: - Runtime: - Operating System: diff --git a/CHANGELOG.md b/CHANGELOG.md index 92259f95cc78..889c0273059d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,73 @@ +# 2.8.5 + +[diff](https://github.com/prettier/prettier/compare/2.8.4...2.8.5) + +#### Support TypeScript 5.0 ([#14391](https://github.com/prettier/prettier/pull/14391) by [@fisker](https://github.com/fisker), [#13819](https://github.com/prettier/prettier/pull/13819) by [@fisker](https://github.com/fisker), [@sosukesuzuki](https://github.com/sosukesuzuki)) + +TypeScript 5.0 introduces two new syntactic features: + +- `const` modifiers for type parameters +- `export type *` declarations + +#### Add missing parentheses for decorator ([#14393](https://github.com/prettier/prettier/pull/14393) by [@fisker](https://github.com/fisker)) + + +```jsx +// Input +class Person { + @(myDecoratorArray[0]) + greet() {} +} + +// Prettier 2.8.4 +class Person { + @myDecoratorArray[0] + greet() {} +} + +// Prettier 2.8.5 +class Person { + @(myDecoratorArray[0]) + greet() {} +} +``` + +#### Add parentheses for `TypeofTypeAnnotation` to improve readability ([#14458](https://github.com/prettier/prettier/pull/14458) by [@fisker](https://github.com/fisker)) + + +```tsx +// Input +type A = (typeof node.children)[]; + +// Prettier 2.8.4 +type A = typeof node.children[]; + +// Prettier 2.8.5 +type A = (typeof node.children)[]; +``` + +#### Support `max_line_length=off` when parsing `.editorconfig` ([#14516](https://github.com/prettier/prettier/pull/14516) by [@josephfrazier](https://github.com/josephfrazier)) + +If an .editorconfig file is in your project and it sets `max_line_length=off` for the file you're formatting, +it will be interpreted as a `printWidth` of `Infinity` rather than being ignored +(which previously resulted in the default `printWidth` of 80 being applied, if not overridden by Prettier-specific configuration). + + +```html + +
+ + +
; + + +
; +``` + # 2.8.4 [diff](https://github.com/prettier/prettier/compare/2.8.3...2.8.4) diff --git a/docs/browser.md b/docs/browser.md index da1e69b7d596..e196886d916f 100644 --- a/docs/browser.md +++ b/docs/browser.md @@ -20,8 +20,8 @@ Required options: - **`plugins`**: Unlike the `format` function from the [Node.js-based API](api.md#prettierformatsource--options), this function doesn’t load plugins automatically. The `plugins` option is required because all the parsers included in the Prettier package come as plugins (for reasons of file size). These plugins are files named - - `parser-*.js` in and - - `parser-*.mjs` in + - `parser-*.js` in and + - `parser-*.mjs` in You need to load the ones that you’re going to use and pass them to `prettier.format` using the `plugins` option. @@ -32,8 +32,8 @@ See below for examples. ### Global ```html - - + + - + +