diff --git a/.github/ISSUE_TEMPLATE/formatting.md b/.github/ISSUE_TEMPLATE/formatting.md index bdfd0ec05..dbeac4a00 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 3.4.1** +**Prettier 3.4.2** [Playground link](https://prettier.io/playground/#.....) ```sh diff --git a/.github/ISSUE_TEMPLATE/integration.md b/.github/ISSUE_TEMPLATE/integration.md index 0fcd19932..e6fb58c3a 100644 --- a/.github/ISSUE_TEMPLATE/integration.md +++ b/.github/ISSUE_TEMPLATE/integration.md @@ -20,7 +20,7 @@ BEFORE SUBMITTING AN ISSUE: **Environments:** -- Prettier Version: 3.4.1 +- Prettier Version: 3.4.2 - Running Prettier via: - Runtime: - Operating System: diff --git a/CHANGELOG.md b/CHANGELOG.md index a33b76892..30008ed1a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,110 @@ +# 3.4.2 + +[diff](https://github.com/prettier/prettier/compare/3.4.1...3.4.2) + +#### Treat U+30A0 & U+30FB in Katakana Block as CJK ([#16796](https://github.com/prettier/prettier/pull/16796) by [@tats-u](https://github.com/tats-u)) + +Prettier doesn't treat U+30A0 & U+30FB as Japanese. U+30FB is commonly used in Japanese to represent the delimitation of first and last names of non-Japanese people or “and”. The following “C言語・C++・Go・Rust” means “C language & C++ & Go & Rust” in Japanese. + + +```md + + +C言 +語 +・ +C++ +・ +Go +・ +Rust + + +C言語・ C++ ・ Go ・ Rust + + +C言語・C++・Go・Rust +``` + +U+30A0 can be used as the replacement of the `-` in non-Japanese names (e.g. “Saint-Saëns” (Charles Camille Saint-Saëns) can be represented as “サン゠サーンス” in Japanese), but substituted by ASCII hyphen (U+002D) or U+FF1D (full width hyphen) in many cases (e.g. “サン=サーンス” or “サン=サーンス”). + +#### Fix comments print on class methods with decorators ([#16891](https://github.com/prettier/prettier/pull/16891) by [@fisker](https://github.com/fisker)) + + +```jsx +// Input +class A { + @decorator + /** + * The method description + * + */ + async method(foo: Foo, bar: Bar) { + console.log(foo); + } +} + +// Prettier 3.4.1 +class A { + @decorator + async /** + * The method description + * + */ + method(foo: Foo, bar: Bar) { + console.log(foo); + } +} + +// Prettier 3.4.2 +class A { + @decorator + /** + * The method description + * + */ + async method(foo: Foo, bar: Bar) { + console.log(foo); + } +} +``` + +#### Fix non-idempotent formatting ([#16899](https://github.com/prettier/prettier/pull/16899) by [@seiyab](https://github.com/seiyab)) + +This bug fix is not language-specific. You may see similar change in any languages. This fixes regression in 3.4.0 so change caused by it should yield same formatting as 3.3.3. + + +```jsx +// Input +
+ foo + longlonglonglonglonglonglonglonglonglonglonglonglonglonglongl foo + , abc +
; + +// Prettier 3.4.1 (first) +
+ foo + + longlonglonglonglonglonglonglonglonglonglonglonglonglonglongl foo + , abc +
; + +// Prettier 3.4.1 (second) +
+ foo + longlonglonglonglonglonglonglonglonglonglonglonglonglonglongl foo + , abc +
; + +// Prettier 3.4.2 +
+ foo + longlonglonglonglonglonglonglonglonglonglonglonglonglonglongl foo + , abc +
; +``` + # 3.4.1 [diff](https://github.com/prettier/prettier/compare/3.4.0...3.4.1) diff --git a/package.json b/package.json index f50f7cd0e..5c7d1d1a3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "prettier", - "version": "3.5.0-dev", + "version": "3.4.2", "description": "Prettier is an opinionated code formatter", "bin": "./bin/prettier.cjs", "repository": "prettier/prettier", diff --git a/website/versioned_docs/version-stable/browser.md b/website/versioned_docs/version-stable/browser.md index cf8178146..ef8e0b236 100644 --- a/website/versioned_docs/version-stable/browser.md +++ b/website/versioned_docs/version-stable/browser.md @@ -19,7 +19,7 @@ Required options: - **[`parser`](options.md#parser) (or [`filepath`](options.md#file-path))**: One of these options has to be specified for Prettier to know which parser to use. -- **`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 in . Note that `estree` plugin should be loaded when printing JavaScript, TypeScript, Flow, or JSON. +- **`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 in . Note that `estree` plugin should be loaded when printing JavaScript, TypeScript, Flow, or JSON. You need to load the ones that you’re going to use and pass them to `prettier.format` using the `plugins` option. @@ -30,8 +30,8 @@ See below for examples. ### Global ```html - - + +