prettier/prettier (prettier)
Compare Source
diff
Markdown: Add missing blank line around code block (#17675 by@fisker)
<!-- Input-->1. Some text, and code block below, with newline after code block```yaml---foo:bar``` 1. Another 2. List<!-- Prettier 3.6.1 -->1. Some text, and code block below, with newline after code block```yaml---foo:bar``` 1. Another 2. List<!-- Prettier 3.6.2 -->1. Some text, and code block below, with newline after code block```yaml---foo:bar``` 1. Another 2. List
Compare Source
diff
TypeScript: Allow const without initializer (#17650,#17654 by@fisker)
// Inputexportconstversion:string;// Prettier 3.6.0 (--parser=babel-ts)SyntaxError:Unexpectedtoken(1:21)>1|exportconstversion:string;|^// Prettier 3.6.0 (--parser=oxc-ts)SyntaxError:Missinginitializerinconstdeclaration(1:14)>1|exportconstversion:string;|^^^^^^^^^^^^^^^// Prettier 3.6.1exportconstversion:string;
Miscellaneous: Avoid closing files multiple times (#17665 by@43081j)
When reading a file to infer the interpreter from a shebang, we use the
n-readlines library to read the first line in order to get the shebang.
This library closes files when it reaches EOF, and we later try close the same
files again. We now close files only ifn-readlines did not already close
them.
Compare Source
diff
🔗Release Notes
Compare Source
diff
Flow: Fix missing parentheses inConditionalTypeAnnotation (#17196 by@fisker)
// InputtypeT<U>='a'|('b'extendsU ?'c' :empty);typeT<U>='a'&('b'extendsU ?'c' :empty);// Prettier 3.5.2typeT<U>="a"|"b"extendsU ?"c" :empty;typeT<U>="a"&"b"extendsU ?"c" :empty;// Prettier 3.5.3typeT<U>="a"|("b"extendsU ?"c" :empty);typeT<U>="a"&("b"extendsU ?"c" :empty);Compare Source
diff
Removemodule-sync condition (#17156 by@fisker)
In Prettier 3.5.0,we addedmodule-sync condition topackage.json, so thatrequire("prettier") can use ESM version, but turns out it doesn't work if CommonJS and ESM plugins both imports builtin plugins. To solve this problem, we decide simply remove themodule-sync condition, sorequire("prettier") will still use the CommonJS version, we'll revisit untilrequire(ESM) feature is more stable.
Compare Source
diff
Fix CLI crash when cache for old version exists (#17100 by@sosukesuzuki)
Prettier 3.5 uses a different cache format than previous versions, Prettier 3.5.0 crashes when reading existing cache file, Prettier 3.5.1 fixed the problem.
Support dockercompose and github-actions-workflow in VSCode (#17101 by@remcohaszing)
Prettier now supports thedockercompose andgithub-actions-workflow languages in Visual Studio Code.
Compare Source
diff
🔗Release Notes
Compare Source
diff
Treat U+30A0 & U+30FB in Katakana Block as CJK (#16796 by@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.
<!-- Input (--prose-wrap=never)-->C言語・C++・Go・Rust<!-- Prettier 3.4.1-->C言語・ C++ ・ Go ・ Rust<!-- Prettier 3.4.2-->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 by@fisker)
// InputclassA{ @​decorator/** * The method description * */asyncmethod(foo:Foo,bar:Bar){console.log(foo);}}// Prettier 3.4.1classA{ @​decoratorasync/** * The method description * */method(foo:Foo,bar:Bar){console.log(foo);}}// Prettier 3.4.2classA{ @​decorator/** * The method description * */asyncmethod(foo:Foo,bar:Bar){console.log(foo);}}Fix non-idempotent formatting (#16899 by@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.
// Input<div> foo<span>longlonglonglonglonglonglonglonglonglonglonglonglonglonglongl foo</span> , abc</div>;// Prettier 3.4.1 (first)<div> foo<span> longlonglonglonglonglonglonglonglonglonglonglonglonglonglongl foo</span>, abc</div>;// Prettier 3.4.1 (second)<div> foo<span>longlonglonglonglonglonglonglonglonglonglonglonglonglonglongl foo</span> , abc</div>;// Prettier 3.4.2<div> foo<span>longlonglonglonglonglonglonglonglonglonglonglonglonglonglongl foo</span> , abc</div>;
Compare Source
diff
Remove unnecessary parentheses around assignment inv-on (#16887 by@fisker)
<!-- Input--><template> <button@​click="foo += 2">Click</button></template><!-- Prettier 3.4.0--><template> <button@​click="(foo += 2)">Click</button></template><!-- Prettier 3.4.1--><template> <button@​click="foo += 2">Click</button></template>
Compare Source
diff
🔗Release Notes
Compare Source
diff
Add parentheses for nullish coalescing in ternary (#16391 by@cdignam-segment)
This change adds clarity to operator precedence.
// Inputfoo ?bar??foo :baz;foo??bar ?a :b;a ?b :foo??bar;// Prettier 3.3.2foo ?bar??foo :baz;foo??bar ?a :b;a ?b :foo??bar;// Prettier 3.3.3foo ?(bar??foo) :baz;(foo??bar) ?a :b;a ?b :(foo??bar);
Add parentheses for decorator expressions (#16458 by@y-schneider)
Prevent parentheses around member expressions or tagged template literals from being removed to follow the stricter parsing rules of TypeScript 5.5.
// Input@​(foo`tagged template`)classX{}// Prettier 3.3.2@​foo`tagged template`classX{}// Prettier 3.3.3@​(foo`tagged template`)classX{}Adds support for Angular v18@let declaration syntax.
Please see the following code example. The@let declaration allows you to define local variables within the template:
@​let name = 'Frodo';<h1>Dashboard for {{name}}</h1>Hello, {{name}}For more details, please refer to the excellent blog post by the Angular Team:Introducing @let in Angular.
We also appreciate the Angular Team for kindly answering our questions to implement this feature.
Compare Source
diff
Fix handlebars path expressions starts with@ (#16358 by@Princeyadav05)
{{! Input }}<div>{{@​x.y.z}}</div>{{! Prettier 3.3.1 }}<div>{{@​x}}</div>{{! Prettier 3.3.2 }}<div>{{@​x.y.z}}</div>Compare Source
diff
Preserve empty lines in front matter (#16347 by@fisker)
<!-- Input-->---foo:- bar1- bar2- bar3---Markdown<!-- Prettier 3.3.0-->---foo:- bar1- bar2- bar3---Markdown<!-- Prettier 3.3.1-->---foo:- bar1- bar2- bar3---Markdown
Preserve explicit language in front matter (#16348 by@fisker)
<!-- Input-->---yamltitle: Helloslug: home---<!-- Prettier 3.3.0-->---title: Helloslug: home---<!-- Prettier 3.3.1-->---yamltitle: Helloslug: home---
Avoid line breaks in import attributes (#16349 by@fisker)
// Inputimportsomethingfrom"./some-very-very-very-very-very-very-very-very-long-path.json"with{type:"json"};// Prettier 3.3.0importsomethingfrom"./some-very-very-very-very-very-very-very-very-long-path.json"with{type:"json"};// Prettier 3.3.1importsomethingfrom"./some-very-very-very-very-very-very-very-very-long-path.json"with{type:"json"};Compare Source
diff
🔗Release Notes
Uh oh!
There was an error while loading.Please reload this page.
This PR contains the following updates:
3.2.5->3.6.2Release Notes
prettier/prettier (prettier)
v3.6.2Compare Source
diff
Markdown: Add missing blank line around code block (#17675 by@fisker)
v3.6.1Compare Source
diff
TypeScript: Allow const without initializer (#17650,#17654 by@fisker)
Miscellaneous: Avoid closing files multiple times (#17665 by@43081j)
When reading a file to infer the interpreter from a shebang, we use the
n-readlineslibrary to read the first line in order to get the shebang.This library closes files when it reaches EOF, and we later try close the same
files again. We now close files only if
n-readlinesdid not already closethem.
v3.6.0Compare Source
diff
🔗Release Notes
v3.5.3Compare Source
diff
Flow: Fix missing parentheses in
ConditionalTypeAnnotation(#17196 by@fisker)v3.5.2Compare Source
diff
Remove
module-synccondition (#17156 by@fisker)In Prettier 3.5.0,we added
module-synccondition topackage.json, so thatrequire("prettier")can use ESM version, but turns out it doesn't work if CommonJS and ESM plugins both imports builtin plugins. To solve this problem, we decide simply remove themodule-synccondition, sorequire("prettier")will still use the CommonJS version, we'll revisit untilrequire(ESM)feature is more stable.v3.5.1Compare Source
diff
Fix CLI crash when cache for old version exists (#17100 by@sosukesuzuki)
Prettier 3.5 uses a different cache format than previous versions, Prettier 3.5.0 crashes when reading existing cache file, Prettier 3.5.1 fixed the problem.
Support dockercompose and github-actions-workflow in VSCode (#17101 by@remcohaszing)
Prettier now supports the
dockercomposeandgithub-actions-workflowlanguages in Visual Studio Code.v3.5.0Compare Source
diff
🔗Release Notes
v3.4.2Compare Source
diff
Treat U+30A0 & U+30FB in Katakana Block as CJK (#16796 by@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.
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 by@fisker)
Fix non-idempotent formatting (#16899 by@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.
v3.4.1Compare Source
diff
Remove unnecessary parentheses around assignment in
v-on(#16887 by@fisker)v3.4.0Compare Source
diff
🔗Release Notes
v3.3.3Compare Source
diff
Add parentheses for nullish coalescing in ternary (#16391 by@cdignam-segment)
This change adds clarity to operator precedence.
Add parentheses for decorator expressions (#16458 by@y-schneider)
Prevent parentheses around member expressions or tagged template literals from being removed to follow the stricter parsing rules of TypeScript 5.5.
Support
@letdeclaration syntax (#16474 by@sosukesuzuki)Adds support for Angular v18
@letdeclaration syntax.Please see the following code example. The
@letdeclaration allows you to define local variables within the template:For more details, please refer to the excellent blog post by the Angular Team:Introducing @let in Angular.
We also appreciate the Angular Team for kindly answering our questions to implement this feature.
v3.3.2Compare Source
diff
Fix handlebars path expressions starts with
@(#16358 by@Princeyadav05)v3.3.1Compare Source
diff
Preserve empty lines in front matter (#16347 by@fisker)
Preserve explicit language in front matter (#16348 by@fisker)
Avoid line breaks in import attributes (#16349 by@fisker)
v3.3.0Compare Source
diff
🔗Release Notes
Configuration
📅Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated byMend Renovate. View therepository job log.