-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] cannot unpublish 2 minutes after publishing #1686
Comments
I had the same error message but I didn't even run https://github.com/vercel/vercel/runs/1076007594#step:6:649 My best guess is that there is a consistency problem after publishing a package and immediately running another command. It may or may not be related to the original issue posted here. |
Happened to me too. I know there's one dependent package but it has a fixed version. How come I cannot unpublish a newer version that nobody is dependent on? |
The current policy is unfortunately that if any version is depended on, then no version can be unpublished. You can try filing a support ticket to see if they can help, but in the meantime, your best bet is to file a patch version that's later than the one you want to unpublish (changing "latest" won't help people who have already upgraded), and then |
Got it. That's sad that any dependent version is a blocker :( |
npm If your bug is preproducible on If your issue was a feature request, please consider opening a new RRFC or RFC. If your issue was a question or other idea that was not CLI-specific, consider opening a discussion on our feedback repo Closing: This is an automated message. |
This is quite surprising. I do not think there is a gain in preventing the author to unpublish a new version that nobody depends on. On the other end, I can see several reasons why this may be bad for the community... |
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [prettier](https://prettier.io) ([source](https://github.com/prettier/prettier)) | devDependencies | patch | [`2.8.7` -> `2.8.8`](https://renovatebot.com/diffs/npm/prettier/2.8.7/2.8.8) | --- ### Release Notes <details> <summary>prettier/prettier</summary> ### [`v2.8.8`](https://github.com/prettier/prettier/blob/HEAD/CHANGELOG.md#​288) [Compare Source](prettier/prettier@2.8.7...2.8.8) This version is a republished version of v2.8.7. A bad version was accidentally published and [it can't be unpublished](npm/cli#1686), apologies for the churn. </details> --- ### 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. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNS42MS4wIiwidXBkYXRlZEluVmVyIjoiMzUuNjMuMSJ9--> Co-authored-by: cabr2-bot <cabr2.help@gmail.com> Reviewed-on: https://codeberg.org/Calciumdibromid/CaBr2/pulls/1872 Reviewed-by: Epsilon_02 <epsilon_02@noreply.codeberg.org> Co-authored-by: Calciumdibromid Bot <cabr2_bot@noreply.codeberg.org> Co-committed-by: Calciumdibromid Bot <cabr2_bot@noreply.codeberg.org>
<h3>Snyk has created this PR to upgrade prettier from 2.8.7 to 2.8.8.</h3> :information_source: Keep your dependencies up-to-date. This makes it easier to fix existing vulnerabilities and to more quickly identify and fix newly disclosed vulnerabilities when they affect your project. <hr/> - The recommended version is **1 version** ahead of your current version. - The recommended version was released **21 days ago**, on 2023-04-23. <details> <summary><b>Release notes</b></summary> <br/> <details> <summary>Package name: <b>prettier</b></summary> <ul> <li> <b>2.8.8</b> - <a href="https://snyk.io/redirect/github/prettier/prettier/releases/tag/2.8.8">2023-04-23</a></br><p>This version is a republished version of v2.8.7.<br> A bad version was accidentally published and <a href="https://snyk.io/redirect/github/npm/cli/issues/1686" data-hovercard-type="issue" data-hovercard-url="/npm/cli/issues/1686/hovercard">it can't be unpublished</a>, apologies for the churn.</p> </li> <li> <b>2.8.7</b> - <a href="https://snyk.io/redirect/github/prettier/prettier/releases/tag/2.8.7">2023-03-24</a></br><ul> <li>Allow multiple decorators on same getter/setter</li> </ul> <p><g-emoji class="g-emoji" alias="link" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f517.png">🔗</g-emoji> <a href="https://snyk.io/redirect/github/prettier/prettier/blob/main/CHANGELOG.md#287">Changelog</a></p> </li> </ul> from <a href="https://snyk.io/redirect/github/prettier/prettier/releases">prettier GitHub release notes</a> </details> </details> <hr/> **Note:** *You are seeing this because you or someone else with access to this repository has authorized Snyk to open upgrade PRs.* For more information: <img src="https://api.segment.io/v1/pixel/track?data=eyJ3cml0ZUtleSI6InJyWmxZcEdHY2RyTHZsb0lYd0dUcVg4WkFRTnNCOUEwIiwiYW5vbnltb3VzSWQiOiI0MzBjM2RkMy0zMDQ1LTQyMDctOGFlYy1hNjdhNmFjNTM2MzQiLCJldmVudCI6IlBSIHZpZXdlZCIsInByb3BlcnRpZXMiOnsicHJJZCI6IjQzMGMzZGQzLTMwNDUtNDIwNy04YWVjLWE2N2E2YWM1MzYzNCJ9fQ==" width="0" height="0"/> 🧐 [View latest project report](https://app.snyk.io/org/sandbox-2ba/project/852e6e4f-be96-45c8-b370-1060f5ebee55?utm_source=github&utm_medium=referral&page=upgrade-pr) 🛠 [Adjust upgrade PR settings](https://app.snyk.io/org/sandbox-2ba/project/852e6e4f-be96-45c8-b370-1060f5ebee55/settings/integration?utm_source=github&utm_medium=referral&page=upgrade-pr) 🔕 [Ignore this dependency or unsubscribe from future upgrade PRs](https://app.snyk.io/org/sandbox-2ba/project/852e6e4f-be96-45c8-b370-1060f5ebee55/settings/integration?pkg=prettier&utm_source=github&utm_medium=referral&page=upgrade-pr#auto-dep-upgrades) <!--- (snyk:metadata:{"prId":"430c3dd3-3045-4207-8aec-a67a6ac53634","prPublicId":"430c3dd3-3045-4207-8aec-a67a6ac53634","dependencies":[{"name":"prettier","from":"2.8.7","to":"2.8.8"}],"packageManager":"npm","type":"auto","projectUrl":"https://app.snyk.io/org/sandbox-2ba/project/852e6e4f-be96-45c8-b370-1060f5ebee55?utm_source=github&utm_medium=referral&page=upgrade-pr","projectPublicId":"852e6e4f-be96-45c8-b370-1060f5ebee55","env":"prod","prType":"upgrade","vulns":[],"issuesToFix":[],"upgrade":[],"upgradeInfo":{"versionsDiff":1,"publishedDate":"2023-04-23T07:26:12.772Z"},"templateVariants":[],"hasFixes":false,"isMajorUpgrade":false,"isBreakingChange":false,"priorityScoreList":[]}) ---> --------- Co-authored-by: snyk-bot <snyk-bot@snyk.io>
<p>This PR was automatically created by Snyk using the credentials of a real user.</p><br /><h3>Snyk has created this PR to upgrade prettier from 2.8.4 to 3.0.3.</h3> :information_source: Keep your dependencies up-to-date. This makes it easier to fix existing vulnerabilities and to more quickly identify and fix newly disclosed vulnerabilities when they affect your project. <hr/> *Warning:* This is a major version upgrade, and may be a breaking change. - The recommended version is **21 versions** ahead of your current version. - The recommended version was released **2 months ago**, on 2023-08-29. <details> <summary><b>Release notes</b></summary> <br/> <details> <summary>Package name: <b>prettier</b></summary> <ul> <li> <b>3.0.3</b> - <a href="https://snyk.io/redirect/github/prettier/prettier/releases/tag/3.0.3">2023-08-29</a></br><p>🔗 <a href="https://snyk.io/redirect/github/prettier/prettier/blob/main/CHANGELOG.md#303">Changelog</a></p> </li> <li> <b>3.0.2</b> - <a href="https://snyk.io/redirect/github/prettier/prettier/releases/tag/3.0.2">2023-08-15</a></br><p>🔗 <a href="https://snyk.io/redirect/github/prettier/prettier/blob/main/CHANGELOG.md#302">Changelog</a></p> </li> <li> <b>3.0.1</b> - <a href="https://snyk.io/redirect/github/prettier/prettier/releases/tag/3.0.1">2023-08-03</a></br><p>🔗 <a href="https://snyk.io/redirect/github/prettier/prettier/blob/main/CHANGELOG.md#301">Changelog</a></p> </li> <li> <b>3.0.0</b> - <a href="https://snyk.io/redirect/github/prettier/prettier/releases/tag/3.0.0">2023-07-05</a></br><p><a href="https://snyk.io/redirect/github/prettier/prettier/compare/3.0.0-alpha.6...3.0.0">diff</a></p> <p>🔗 <a href="https://prettier.io/blog/2023/07/05/3.0.0.html" rel="nofollow">Release note</a></p> </li> <li> <b>3.0.0-alpha.9-for-vscode</b> - 2023-04-23 </li> <li> <b>3.0.0-alpha.8-for-vscode</b> - 2023-04-23 </li> <li> <b>3.0.0-alpha.7-for-vscode</b> - 2023-04-23 </li> <li> <b>3.0.0-alpha.12</b> - 2023-05-26 </li> <li> <b>3.0.0-alpha.11</b> - 2023-04-25 </li> <li> <b>3.0.0-alpha.10</b> - 2023-04-23 </li> <li> <b>3.0.0-alpha.6</b> - <a href="https://snyk.io/redirect/github/prettier/prettier/releases/tag/3.0.0-alpha.6">2023-03-02</a></br><h2>What's Changed</h2> <ul> <li>Update <code>.d.ts</code> files of plugins to use <code>export default ...</code> by <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/fisker/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://snyk.io/redirect/github/fisker">@ fisker</a> in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1606363376" data-permission-text="Title is private" data-url="prettier/prettier#14435" data-hovercard-type="pull_request" data-hovercard-url="/prettier/prettier/pull/14435/hovercard" href="https://snyk.io/redirect/github/prettier/prettier/pull/14435">#14435</a></li> </ul> <p>Other changes since v2, see <a href="https://snyk.io/redirect/github/prettier/prettier/releases/tag/3.0.0-alpha.1"><code>3.0.0-alpha.1</code> release notes</a></p> <p><strong>Full Changelog</strong>: <a class="commit-link" href="https://snyk.io/redirect/github/prettier/prettier/compare/3.0.0-alpha.5...3.0.0-alpha.6"><tt>3.0.0-alpha.5...3.0.0-alpha.6</tt></a></p> </li> <li> <b>3.0.0-alpha.5</b> - <a href="https://snyk.io/redirect/github/prettier/prettier/releases/tag/3.0.0-alpha.5">2023-03-01</a></br><h2>What's Changed</h2> <ul> <li>Add <code>.d.ts</code> files by <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/sosukesuzuki/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://snyk.io/redirect/github/sosukesuzuki">@ sosukesuzuki</a> in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1551827494" data-permission-text="Title is private" data-url="prettier/prettier#14212" data-hovercard-type="pull_request" data-hovercard-url="/prettier/prettier/pull/14212/hovercard" href="https://snyk.io/redirect/github/prettier/prettier/pull/14212">#14212</a></li> <li>Support TypeScript 5 via <code>babel-ts</code> parser by <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/fisker/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://snyk.io/redirect/github/fisker">@ fisker</a> in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1592662394" data-permission-text="Title is private" data-url="prettier/prettier#14391" data-hovercard-type="pull_request" data-hovercard-url="/prettier/prettier/pull/14391/hovercard" href="https://snyk.io/redirect/github/prettier/prettier/pull/14391">#14391</a></li> </ul> <p>Other changes since v2, see <a href="https://snyk.io/redirect/github/prettier/prettier/releases/tag/3.0.0-alpha.1"><code>3.0.0-alpha.1</code> release notes</a></p> <p><strong>Full Changelog</strong>: <a class="commit-link" href="https://snyk.io/redirect/github/prettier/prettier/compare/3.0.0-alpha.4...3.0.0-alpha.5"><tt>3.0.0-alpha.4...3.0.0-alpha.5</tt></a></p> </li> <li> <b>3.0.0-alpha.4</b> - 2022-10-26 </li> <li> <b>3.0.0-alpha.3</b> - 2022-10-20 </li> <li> <b>3.0.0-alpha.2</b> - 2022-10-13 </li> <li> <b>3.0.0-alpha.1</b> - 2022-10-08 </li> <li> <b>3.0.0-alpha.0</b> - 2022-08-17 </li> <li> <b>2.8.8</b> - <a href="https://snyk.io/redirect/github/prettier/prettier/releases/tag/2.8.8">2023-04-23</a></br><p>This version is a republished version of v2.8.7.<br> A bad version was accidentally published and <a href="https://snyk.io/redirect/github/npm/cli/issues/1686" data-hovercard-type="issue" data-hovercard-url="/npm/cli/issues/1686/hovercard">it can't be unpublished</a>, apologies for the churn.</p> </li> <li> <b>2.8.7</b> - <a href="https://snyk.io/redirect/github/prettier/prettier/releases/tag/2.8.7">2023-03-24</a></br><ul> <li>Allow multiple decorators on same getter/setter</li> </ul> <p>🔗 <a href="https://snyk.io/redirect/github/prettier/prettier/blob/main/CHANGELOG.md#287">Changelog</a></p> </li> <li> <b>2.8.6</b> - <a href="https://snyk.io/redirect/github/prettier/prettier/releases/tag/2.8.6">2023-03-21</a></br><ul> <li>Allow decorators on private members and class expressions</li> </ul> <p>🔗 <a href="https://snyk.io/redirect/github/prettier/prettier/blob/main/CHANGELOG.md#286">Changelog</a></p> </li> <li> <b>2.8.5</b> - <a href="https://snyk.io/redirect/github/prettier/prettier/releases/tag/2.8.5">2023-03-20</a></br><ul> <li>Support TypeScript 5.0</li> </ul> <p>🔗 <a href="https://snyk.io/redirect/github/prettier/prettier/blob/main/CHANGELOG.md#285">Changelog</a></p> </li> <li> <b>2.8.4</b> - 2023-02-08 </li> </ul> from <a href="https://snyk.io/redirect/github/prettier/prettier/releases">prettier GitHub release notes</a> </details> </details> <hr/> **Note:** *You are seeing this because you or someone else with access to this repository has authorized Snyk to open upgrade PRs.* For more information: <img src="https://api.segment.io/v1/pixel/track?data=eyJ3cml0ZUtleSI6InJyWmxZcEdHY2RyTHZsb0lYd0dUcVg4WkFRTnNCOUEwIiwiYW5vbnltb3VzSWQiOiIwZDMxM2Q5Ny01OTJjLTRmM2UtODI2OC1hYzE1ZWExNjA2ZmQiLCJldmVudCI6IlBSIHZpZXdlZCIsInByb3BlcnRpZXMiOnsicHJJZCI6IjBkMzEzZDk3LTU5MmMtNGYzZS04MjY4LWFjMTVlYTE2MDZmZCJ9fQ==" width="0" height="0"/> 🧐 [View latest project report](https://app.snyk.io/org/woodpile37/project/f9f1a542-e77b-401b-9d83-577aad2ba722?utm_source=github&utm_medium=referral&page=upgrade-pr) 🛠 [Adjust upgrade PR settings](https://app.snyk.io/org/woodpile37/project/f9f1a542-e77b-401b-9d83-577aad2ba722/settings/integration?utm_source=github&utm_medium=referral&page=upgrade-pr) 🔕 [Ignore this dependency or unsubscribe from future upgrade PRs](https://app.snyk.io/org/woodpile37/project/f9f1a542-e77b-401b-9d83-577aad2ba722/settings/integration?pkg=prettier&utm_source=github&utm_medium=referral&page=upgrade-pr#auto-dep-upgrades) <!--- (snyk:metadata:{"prId":"0d313d97-592c-4f3e-8268-ac15ea1606fd","prPublicId":"0d313d97-592c-4f3e-8268-ac15ea1606fd","dependencies":[{"name":"prettier","from":"2.8.4","to":"3.0.3"}],"packageManager":"npm","type":"auto","projectUrl":"https://app.snyk.io/org/woodpile37/project/f9f1a542-e77b-401b-9d83-577aad2ba722?utm_source=github&utm_medium=referral&page=upgrade-pr","projectPublicId":"f9f1a542-e77b-401b-9d83-577aad2ba722","env":"prod","prType":"upgrade","vulns":[],"issuesToFix":[],"upgrade":[],"upgradeInfo":{"versionsDiff":21,"publishedDate":"2023-08-29T12:30:11.880Z"},"templateVariants":[],"hasFixes":false,"isMajorUpgrade":true,"isBreakingChange":true,"priorityScoreList":[]}) --->
@ljharb This is disheartening. If I accidentally published a new version, can't unpublish it even the very next minute. Also, the command |
@Abhinandan-Kushwaha if you have 2fa enabled, as you should, then there is a confirmation already. |
| datasource | package | from | to | | ---------- | -------- | ----- | ----- | | npm | prettier | 2.7.0 | 2.8.8 | ##### [\`v2.8.8\`](https://github.com/prettier/prettier/blob/HEAD/CHANGELOG.md#288) This version is a republished version of v2.8.7. A bad version was accidentally published and [it can't be unpublished](npm/cli#1686), apologies for the churn. ##### [\`v2.8.7\`](https://github.com/prettier/prettier/blob/HEAD/CHANGELOG.md#287) [diff](prettier/prettier@2.8.6...2.8.7) ##### Allow multiple decorators on same getter/setter ([#14584](prettier/prettier#14584) by [@fisker](https://github.com/fisker)) <!-- prettier-ignore --> ```ts // Input class A { @decorator() get foo () {} @decorator() set foo (value) {} } // Prettier 2.8.6 SyntaxError: Decorators cannot be applied to multiple get/set accessors of the same name. (5:3) 3 | get foo () {} 4 | > 5 | @decorator() | ^^^^^^^^^^^^ 6 | set foo (value) {} 7 | } // Prettier 2.8.7 class A { @decorator() get foo() {} @decorator() set foo(value) {} } ``` ##### [\`v2.8.6\`](https://github.com/prettier/prettier/blob/HEAD/CHANGELOG.md#286) [diff](prettier/prettier@2.8.5...2.8.6) ##### Allow decorators on private members and class expressions ([#14548](prettier/prettier#14548) by [@fisker](https://github.com/fisker)) <!-- prettier-ignore --> ```ts // Input class A { @decorator() #privateMethod () {} } // Prettier 2.8.5 SyntaxError: Decorators are not valid here. (2:3) 1 | class A { > 2 | @decorator() | ^^^^^^^^^^^^ 3 | #privateMethod () {} 4 | } // Prettier 2.8.6 class A { @decorator() #privateMethod() {} } ``` ##### [\`v2.8.5\`](https://github.com/prettier/prettier/blob/HEAD/CHANGELOG.md#285) [diff](prettier/prettier@2.8.4...2.8.5) ##### Support TypeScript 5.0 ([#14391](prettier/prettier#14391) by [@fisker](https://github.com/fisker), [#13819](prettier/prettier#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](prettier/prettier#14393) by [@fisker](https://github.com/fisker)) <!-- prettier-ignore --> ```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](prettier/prettier#14458) by [@fisker](https://github.com/fisker)) <!-- prettier-ignore --> ```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](prettier/prettier#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). <!-- prettier-ignore --> ```html <!-- Input --> <div className='HelloWorld' title={`You are visitor number ${ num }`} onMouseOver={onMouseOver}/> <!-- Prettier 2.8.4 --> <div className="HelloWorld" title={`You are visitor number ${num}`} onMouseOver={onMouseOver} />; <!-- Prettier 2.8.5 --> <div className="HelloWorld" title={`You are visitor number ${num}`} onMouseOver={onMouseOver} />; ``` ##### [\`v2.8.4\`](https://github.com/prettier/prettier/blob/HEAD/CHANGELOG.md#284) [diff](prettier/prettier@2.8.3...2.8.4) ##### Fix leading comments in mapped types with `readonly` ([#13427](prettier/prettier#13427) by [@thorn0](https://github.com/thorn0), [@sosukesuzuki](https://github.com/sosukesuzuki)) <!-- prettier-ignore --> ```tsx // Input type Type = { // comment readonly [key in Foo]; }; // Prettier 2.8.3 type Type = { readonly // comment [key in Foo]; }; // Prettier 2.8.4 type Type = { // comment readonly [key in Foo]; }; ``` ##### Group params in opening block statements ([#14067](prettier/prettier#14067) by [@jamescdavis](https://github.com/jamescdavis)) This is a follow-up to [#13930](prettier/prettier#13930) to establish wrapping consistency between opening block statements and else blocks by grouping params in opening blocks. This causes params to break to a new line together and not be split across lines unless the length of params exceeds the print width. This also updates the else block wrapping to behave exactly the same as opening blocks. <!-- prettier-ignore --> ```hbs {{! Input }} {{#block param param param param param param param param param param as |blockParam|}} Hello {{else block param param param param param param param param param param as |blockParam|}} There {{/block}} {{! Prettier 2.8.3 }} {{#block param param param param param param param param param param as |blockParam| }} Hello {{else block param param param param param param param param param param}} There {{/block}} {{! Prettier 2.8.4 }} {{#block param param param param param param param param param param as |blockParam| }} Hello {{else block param param param param param param param param param param as |blockParam| }} There {{/block}} ``` ##### Ignore files in `.sl/` ([#14206](prettier/prettier#14206) by [@bolinfest](https://github.com/bolinfest)) In [Sapling SCM](https://sapling-scm.com/), `.sl/` is the folder where it stores its state, analogous to `.git/` in Git. It should be ignored in Prettier like the other SCM folders. ##### Recognize `@satisfies` in Closure-style type casts ([#14262](prettier/prettier#14262) by [@fisker](https://github.com/fisker)) <!-- prettier-ignore --> ```jsx // Input const a = /** @Satisfies {Record<string, string>} */ ({hello: 1337}); const b = /** @type {Record<string, string>} */ ({hello: 1337}); // Prettier 2.8.3 const a = /** @Satisfies {Record<string, string>} */ { hello: 1337 }; const b = /** @type {Record<string, string>} */ ({ hello: 1337 }); // Prettier 2.8.4 const a = /** @Satisfies {Record<string, string>} */ ({hello: 1337}); const b = /** @type {Record<string, string>} */ ({hello: 1337}); ``` ##### Fix parens in inferred function return types with `extends` ([#14279](prettier/prettier#14279) by [@fisker](https://github.com/fisker)) <!-- prettier-ignore --> ```ts // Input type Foo<T> = T extends ((a) => a is infer R extends string) ? R : never; // Prettier 2.8.3 (First format) type Foo<T> = T extends (a) => a is infer R extends string ? R : never; // Prettier 2.8.3 (Second format) SyntaxError: '?' expected. // Prettier 2.8.4 type Foo<T> = T extends ((a) => a is infer R extends string) ? R : never; ``` ##### [\`v2.8.3\`](https://github.com/prettier/prettier/blob/HEAD/CHANGELOG.md#283) [diff](prettier/prettier@2.8.2...2.8.3) ##### Allow self-closing tags on custom elements ([#14170](prettier/prettier#14170) by [@fisker](https://github.com/fisker)) See [Angular v15.1.0 release note](https://github.com/angular/angular/releases/tag/15.1.0) for details. <!-- prettier-ignore --> ```html // Input <app-test/> // Prettier 2.8.2 SyntaxError: Only void and foreign elements can be self closed "app-test" (1:1) > 1 | <app-test/> | ^^^^^^^^^ 2 | // Prettier 2.8.3 <app-test /> ``` ##### [\`v2.8.2\`](https://github.com/prettier/prettier/blob/HEAD/CHANGELOG.md#282) [diff](prettier/prettier@2.8.1...2.8.2) ##### Don't lowercase link references ([#13155](prettier/prettier#13155) by [@DerekNonGeneric](https://github.com/DerekNonGeneric) & [@fisker](https://github.com/fisker)) <!-- prettier-ignore --> ```markdown <!-- Input --> We now don't strictly follow the release notes format suggested by [Keep a Changelog]. [Keep a Changelog]: https://example.com/ <!-- Prettier 2.8.1 --> We now don't strictly follow the release notes format suggested by [Keep a Changelog]. [keep a changelog]: https://example.com/ <!-- ^^^^^^^^^^^^^^^^^^ lowercased --> <!-- Prettier 2.8.2 --> <Same as input> ``` ##### Preserve self-closing tags ([#13691](prettier/prettier#13691) by [@dcyriller](https://github.com/dcyriller)) <!-- prettier-ignore --> ```hbs {{! Input }} <div /> <div></div> <custom-component /> <custom-component></custom-component> <i /> <i></i> <Component /> <Component></Component> {{! Prettier 2.8.1 }} <div></div> <div></div> <custom-component></custom-component> <custom-component></custom-component> <i></i> <i></i> <Component /> <Component /> {{! Prettier 2.8.2 }} <div /> <div></div> <custom-component /> <custom-component></custom-component> <i /> <i></i> <Component /> <Component /> ``` ##### Allow custom "else if"-like blocks with block params ([#13930](prettier/prettier#13930) by [@jamescdavis](https://github.com/jamescdavis)) [#13507](prettier/prettier#13507) added support for custom block keywords used with `else`, but failed to allow block params. This updates printer-glimmer to allow block params with custom "else if"-like blocks. <!-- prettier-ignore --> ```hbs {{! Input }} {{#when isAtWork as |work|}} Ship that {{work}}! {{else when isReading as |book|}} You can finish {{book}} eventually... {{else}} Go to bed! {{/when}} {{! Prettier 2.8.1 }} {{#when isAtWork as |work|}} Ship that {{work}}! {{else when isReading}} You can finish {{book}} eventually... {{else}} Go to bed! {{/when}} {{! Prettier 2.8.2 }} {{#when isAtWork as |work|}} Ship that {{work}}! {{else when isReading as |book|}} You can finish {{book}} eventually... {{else}} Go to bed! {{/when}} ``` ##### Preserve empty lines between nested SCSS maps ([#13931](prettier/prettier#13931) by [@jneander](https://github.com/jneander)) <!-- prettier-ignore --> ```scss /* Input */ $map: ( 'one': ( 'key': 'value', ), 'two': ( 'key': 'value', ), ) /* Prettier 2.8.1 */ $map: ( 'one': ( 'key': 'value', ), 'two': ( 'key': 'value', ), ) /* Prettier 2.8.2 */ $map: ( 'one': ( 'key': 'value', ), 'two': ( 'key': 'value', ), ) ``` ##### Fix missing parentheses when an expression statement starts with `let[` ([#14000](prettier/prettier#14000), [#14044](prettier/prettier#14044) by [@fisker](https://github.com/fisker), [@thorn0](https://github.com/thorn0)) <!-- prettier-ignore --> ```jsx // Input (let[0] = 2); // Prettier 2.8.1 let[0] = 2; // Prettier 2.8.1 (second format) SyntaxError: Unexpected token (1:5) > 1 | let[0] = 2; | ^ 2 | // Prettier 2.8.2 (let)[0] = 2; ``` ##### Fix semicolon duplicated at the end of LESS file ([#14007](prettier/prettier#14007) by [@mvorisek](https://github.com/mvorisek)) <!-- prettier-ignore --> ```less // Input @variable: { field: something; }; // Prettier 2.8.1 @variable: { field: something; }; ; // Prettier 2.8.2 @variable: { field: something; }; ``` ##### Fix no space after unary minus when followed by opening parenthesis in LESS ([#14008](prettier/prettier#14008) by [@mvorisek](https://github.com/mvorisek)) <!-- prettier-ignore --> ```less // Input .unary_minus_single { margin: -(@A); } .unary_minus_multi { margin: 0 -(@A); } .binary_minus { margin: 0 - (@A); } // Prettier 2.8.1 .unary_minus_single { margin: - (@A); } .unary_minus_multi { margin: 0 - (@A); } .binary_minus { margin: 0 - (@A); } // Prettier 2.8.2 .unary_minus_single { margin: -(@A); } .unary_minus_multi { margin: 0 -(@A); } .binary_minus { margin: 0 - (@A); } ``` ##### Do not change case of property name if inside a variable declaration in LESS ([#14034](prettier/prettier#14034) by [@mvorisek](https://github.com/mvorisek)) <!-- prettier-ignore --> ```less // Input @var: { preserveCase: 0; }; // Prettier 2.8.1 @var: { preservecase: 0; }; // Prettier 2.8.2 @var: { preserveCase: 0; }; ``` ##### Fix formatting for auto-accessors with comments ([#14038](prettier/prettier#14038) by [@fisker](https://github.com/fisker)) <!-- prettier-ignore --> ```jsx // Input class A { @dec() // comment accessor b; } // Prettier 2.8.1 class A { @dec() accessor // comment b; } // Prettier 2.8.1 (second format) class A { @dec() accessor; // comment b; } // Prettier 2.8.2 class A { @dec() // comment accessor b; } ``` ##### Add parentheses for TSTypeQuery to improve readability ([#14042](prettier/prettier#14042) by [@onishi-kohei](https://github.com/onishi-kohei)) <!-- prettier-ignore --> ```tsx // Input a as (typeof node.children)[number] a as (typeof node.children)[] a as ((typeof node.children)[number])[] // Prettier 2.8.1 a as typeof node.children[number]; a as typeof node.children[]; a as typeof node.children[number][]; // Prettier 2.8.2 a as (typeof node.children)[number]; a as (typeof node.children)[]; a as (typeof node.children)[number][]; ``` ##### Fix displacing of comments in default switch case ([#14047](prettier/prettier#14047) by [@thorn0](https://github.com/thorn0)) It was a regression in Prettier 2.6.0. <!-- prettier-ignore --> ```jsx // Input switch (state) { default: result = state; // no change break; } // Prettier 2.8.1 switch (state) { default: // no change result = state; break; } // Prettier 2.8.2 switch (state) { default: result = state; // no change break; } ``` ##### Support type annotations on auto accessors via `babel-ts` ([#14049](prettier/prettier#14049) by [@sosukesuzuki](https://github.com/sosukesuzuki)) [The bug that `@babel/parser` cannot parse auto accessors with type annotations](babel/babel#15205) has been fixed. So we now support it via `babel-ts` parser. <!-- prettier-ignore --> ```tsx class Foo { accessor prop: number; } ``` ##### Fix formatting of empty type parameters ([#14073](prettier/prettier#14073) by [@fisker](https://github.com/fisker)) <!-- prettier-ignore --> ```jsx // Input const foo: bar</* comment */> = () => baz; // Prettier 2.8.1 Error: Comment "comment" was not printed. Please report this error! // Prettier 2.8.2 const foo: bar</* comment */> = () => baz; ``` ##### Add parentheses to head of `ExpressionStatement` instead of the whole statement ([#14077](prettier/prettier#14077) by [@fisker](https://github.com/fisker)) <!-- prettier-ignore --> ```jsx // Input ({}).toString.call(foo) === "[object Array]" ? foo.forEach(iterateArray) : iterateObject(foo); // Prettier 2.8.1 ({}.toString.call(foo) === "[object Array]" ? foo.forEach(iterateArray) : iterateObject(foo)); // Prettier 2.8.2 ({}).toString.call(foo.forEach) === "[object Array]" ? foo.forEach(iterateArray) : iterateObject(foo); ``` ##### Fix comments after directive ([#14081](prettier/prettier#14081) by [@fisker](https://github.com/fisker)) <!-- prettier-ignore --> ```jsx // Input "use strict" /* comment */; // Prettier 2.8.1 (with other js parsers except `babel`) Error: Comment "comment" was not printed. Please report this error! // Prettier 2.8.2 <Same as input> ``` ##### Fix formatting for comments inside JSX attribute ([#14082](prettier/prettier#14082) by [@fisker](https://github.com/fisker)) <!-- prettier-ignore --> ```jsx // Input function MyFunctionComponent() { <button label=/*old*/"new">button</button> } // Prettier 2.8.1 Error: Comment "old" was not printed. Please report this error! // Prettier 2.8.2 function MyFunctionComponent() { <button label=/*old*/ "new">button</button>; } ``` ##### Quote numeric keys for json-stringify parser ([#14083](prettier/prettier#14083) by [@fisker](https://github.com/fisker)) <!-- prettier-ignore --> ```jsx // Input {0: 'value'} // Prettier 2.8.1 { 0: "value" } // Prettier 2.8.2 { "0": "value" } ``` ##### Fix removing commas from function arguments in maps ([#14089](prettier/prettier#14089) by [@sosukesuzuki](https://github.com/sosukesuzuki)) <!-- prettier-ignore --> ```scss /* Input */ $foo: map-fn( ( "#{prop}": inner-fn($first, $second), ) ); /* Prettier 2.8.1 */ $foo: map-fn(("#{prop}": inner-fn($first $second))); /* Prettier 2.8.2 */ $foo: map-fn( ( "#{prop}": inner-fn($first, $second), ) ); ``` ##### Do not insert space in LESS property access ([#14103](prettier/prettier#14103) by [@fisker](https://github.com/fisker)) <!-- prettier-ignore --> ```less // Input a { color: @Colors[@white]; } // Prettier 2.8.1 a { color: @Colors[ @white]; } // Prettier 2.8.2 <Same as input> ``` ##### [\`v2.8.1\`](https://github.com/prettier/prettier/blob/HEAD/CHANGELOG.md#281) [diff](prettier/prettier@2.8.0...2.8.1) ##### Fix SCSS map in arguments ([#9184](prettier/prettier#9184) by [@agamkrbit](https://github.com/agamkrbit)) <!-- prettier-ignore --> ```scss // Input $display-breakpoints: map-deep-merge( ( "print-only": "only print", "screen-only": "only screen", "xs-only": "only screen and (max-width: #{map-get($grid-breakpoints, "sm")-1})", ), $display-breakpoints ); // Prettier 2.8.0 $display-breakpoints: map-deep-merge( ( "print-only": "only print", "screen-only": "only screen", "xs-only": "only screen and (max-width: #{map-get($grid-breakpoints, " sm ")-1})", ), $display-breakpoints ); // Prettier 2.8.1 $display-breakpoints: map-deep-merge( ( "print-only": "only print", "screen-only": "only screen", "xs-only": "only screen and (max-width: #{map-get($grid-breakpoints, "sm")-1})", ), $display-breakpoints ); ``` ##### Support auto accessors syntax ([#13919](prettier/prettier#13919) by [@sosukesuzuki](https://github.com/sosukesuzuki)) Support for [Auto Accessors Syntax](https://devblogs.microsoft.com/typescript/announcing-typescript-4-9/#auto-accessors-in-classes) landed in TypeScript 4.9. (Doesn't work well with `babel-ts` parser) <!-- prettier-ignore --> ```tsx class Foo { accessor foo: number = 3; } ``` ##### [\`v2.8.0\`](https://github.com/prettier/prettier/blob/HEAD/CHANGELOG.md#280) [diff](prettier/prettier@2.7.1...2.8.0) 🔗 [Release Notes](https://prettier.io/blog/2022/11/23/2.8.0.html) ##### [\`v2.7.1\`](https://github.com/prettier/prettier/blob/HEAD/CHANGELOG.md#271) [diff](prettier/prettier@2.7.0...2.7.1) ##### Keep useful empty lines in description ([#13013](prettier/prettier#13013) by [@chimurai](https://github.com/chimurai)) <!-- prettier-ignore --> ```graphql ```
| datasource | package | from | to | | ---------- | -------- | ----- | ----- | | npm | prettier | 2.7.0 | 2.8.8 | ##### [\`v2.8.8\`](https://github.com/prettier/prettier/blob/HEAD/CHANGELOG.md#288) This version is a republished version of v2.8.7. A bad version was accidentally published and [it can't be unpublished](npm/cli#1686), apologies for the churn. ##### [\`v2.8.7\`](https://github.com/prettier/prettier/blob/HEAD/CHANGELOG.md#287) [diff](prettier/prettier@2.8.6...2.8.7) ##### Allow multiple decorators on same getter/setter ([#14584](prettier/prettier#14584) by [@fisker](https://github.com/fisker)) <!-- prettier-ignore --> ```ts // Input class A { @decorator() get foo () {} @decorator() set foo (value) {} } // Prettier 2.8.6 SyntaxError: Decorators cannot be applied to multiple get/set accessors of the same name. (5:3) 3 | get foo () {} 4 | > 5 | @decorator() | ^^^^^^^^^^^^ 6 | set foo (value) {} 7 | } // Prettier 2.8.7 class A { @decorator() get foo() {} @decorator() set foo(value) {} } ``` ##### [\`v2.8.6\`](https://github.com/prettier/prettier/blob/HEAD/CHANGELOG.md#286) [diff](prettier/prettier@2.8.5...2.8.6) ##### Allow decorators on private members and class expressions ([#14548](prettier/prettier#14548) by [@fisker](https://github.com/fisker)) <!-- prettier-ignore --> ```ts // Input class A { @decorator() #privateMethod () {} } // Prettier 2.8.5 SyntaxError: Decorators are not valid here. (2:3) 1 | class A { > 2 | @decorator() | ^^^^^^^^^^^^ 3 | #privateMethod () {} 4 | } // Prettier 2.8.6 class A { @decorator() #privateMethod() {} } ``` ##### [\`v2.8.5\`](https://github.com/prettier/prettier/blob/HEAD/CHANGELOG.md#285) [diff](prettier/prettier@2.8.4...2.8.5) ##### Support TypeScript 5.0 ([#14391](prettier/prettier#14391) by [@fisker](https://github.com/fisker), [#13819](prettier/prettier#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](prettier/prettier#14393) by [@fisker](https://github.com/fisker)) <!-- prettier-ignore --> ```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](prettier/prettier#14458) by [@fisker](https://github.com/fisker)) <!-- prettier-ignore --> ```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](prettier/prettier#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). <!-- prettier-ignore --> ```html <!-- Input --> <div className='HelloWorld' title={`You are visitor number ${ num }`} onMouseOver={onMouseOver}/> <!-- Prettier 2.8.4 --> <div className="HelloWorld" title={`You are visitor number ${num}`} onMouseOver={onMouseOver} />; <!-- Prettier 2.8.5 --> <div className="HelloWorld" title={`You are visitor number ${num}`} onMouseOver={onMouseOver} />; ``` ##### [\`v2.8.4\`](https://github.com/prettier/prettier/blob/HEAD/CHANGELOG.md#284) [diff](prettier/prettier@2.8.3...2.8.4) ##### Fix leading comments in mapped types with `readonly` ([#13427](prettier/prettier#13427) by [@thorn0](https://github.com/thorn0), [@sosukesuzuki](https://github.com/sosukesuzuki)) <!-- prettier-ignore --> ```tsx // Input type Type = { // comment readonly [key in Foo]; }; // Prettier 2.8.3 type Type = { readonly // comment [key in Foo]; }; // Prettier 2.8.4 type Type = { // comment readonly [key in Foo]; }; ``` ##### Group params in opening block statements ([#14067](prettier/prettier#14067) by [@jamescdavis](https://github.com/jamescdavis)) This is a follow-up to [#13930](prettier/prettier#13930) to establish wrapping consistency between opening block statements and else blocks by grouping params in opening blocks. This causes params to break to a new line together and not be split across lines unless the length of params exceeds the print width. This also updates the else block wrapping to behave exactly the same as opening blocks. <!-- prettier-ignore --> ```hbs {{! Input }} {{#block param param param param param param param param param param as |blockParam|}} Hello {{else block param param param param param param param param param param as |blockParam|}} There {{/block}} {{! Prettier 2.8.3 }} {{#block param param param param param param param param param param as |blockParam| }} Hello {{else block param param param param param param param param param param}} There {{/block}} {{! Prettier 2.8.4 }} {{#block param param param param param param param param param param as |blockParam| }} Hello {{else block param param param param param param param param param param as |blockParam| }} There {{/block}} ``` ##### Ignore files in `.sl/` ([#14206](prettier/prettier#14206) by [@bolinfest](https://github.com/bolinfest)) In [Sapling SCM](https://sapling-scm.com/), `.sl/` is the folder where it stores its state, analogous to `.git/` in Git. It should be ignored in Prettier like the other SCM folders. ##### Recognize `@satisfies` in Closure-style type casts ([#14262](prettier/prettier#14262) by [@fisker](https://github.com/fisker)) <!-- prettier-ignore --> ```jsx // Input const a = /** @Satisfies {Record<string, string>} */ ({hello: 1337}); const b = /** @type {Record<string, string>} */ ({hello: 1337}); // Prettier 2.8.3 const a = /** @Satisfies {Record<string, string>} */ { hello: 1337 }; const b = /** @type {Record<string, string>} */ ({ hello: 1337 }); // Prettier 2.8.4 const a = /** @Satisfies {Record<string, string>} */ ({hello: 1337}); const b = /** @type {Record<string, string>} */ ({hello: 1337}); ``` ##### Fix parens in inferred function return types with `extends` ([#14279](prettier/prettier#14279) by [@fisker](https://github.com/fisker)) <!-- prettier-ignore --> ```ts // Input type Foo<T> = T extends ((a) => a is infer R extends string) ? R : never; // Prettier 2.8.3 (First format) type Foo<T> = T extends (a) => a is infer R extends string ? R : never; // Prettier 2.8.3 (Second format) SyntaxError: '?' expected. // Prettier 2.8.4 type Foo<T> = T extends ((a) => a is infer R extends string) ? R : never; ``` ##### [\`v2.8.3\`](https://github.com/prettier/prettier/blob/HEAD/CHANGELOG.md#283) [diff](prettier/prettier@2.8.2...2.8.3) ##### Allow self-closing tags on custom elements ([#14170](prettier/prettier#14170) by [@fisker](https://github.com/fisker)) See [Angular v15.1.0 release note](https://github.com/angular/angular/releases/tag/15.1.0) for details. <!-- prettier-ignore --> ```html // Input <app-test/> // Prettier 2.8.2 SyntaxError: Only void and foreign elements can be self closed "app-test" (1:1) > 1 | <app-test/> | ^^^^^^^^^ 2 | // Prettier 2.8.3 <app-test /> ``` ##### [\`v2.8.2\`](https://github.com/prettier/prettier/blob/HEAD/CHANGELOG.md#282) [diff](prettier/prettier@2.8.1...2.8.2) ##### Don't lowercase link references ([#13155](prettier/prettier#13155) by [@DerekNonGeneric](https://github.com/DerekNonGeneric) & [@fisker](https://github.com/fisker)) <!-- prettier-ignore --> ```markdown <!-- Input --> We now don't strictly follow the release notes format suggested by [Keep a Changelog]. [Keep a Changelog]: https://example.com/ <!-- Prettier 2.8.1 --> We now don't strictly follow the release notes format suggested by [Keep a Changelog]. [keep a changelog]: https://example.com/ <!-- ^^^^^^^^^^^^^^^^^^ lowercased --> <!-- Prettier 2.8.2 --> <Same as input> ``` ##### Preserve self-closing tags ([#13691](prettier/prettier#13691) by [@dcyriller](https://github.com/dcyriller)) <!-- prettier-ignore --> ```hbs {{! Input }} <div /> <div></div> <custom-component /> <custom-component></custom-component> <i /> <i></i> <Component /> <Component></Component> {{! Prettier 2.8.1 }} <div></div> <div></div> <custom-component></custom-component> <custom-component></custom-component> <i></i> <i></i> <Component /> <Component /> {{! Prettier 2.8.2 }} <div /> <div></div> <custom-component /> <custom-component></custom-component> <i /> <i></i> <Component /> <Component /> ``` ##### Allow custom "else if"-like blocks with block params ([#13930](prettier/prettier#13930) by [@jamescdavis](https://github.com/jamescdavis)) [#13507](prettier/prettier#13507) added support for custom block keywords used with `else`, but failed to allow block params. This updates printer-glimmer to allow block params with custom "else if"-like blocks. <!-- prettier-ignore --> ```hbs {{! Input }} {{#when isAtWork as |work|}} Ship that {{work}}! {{else when isReading as |book|}} You can finish {{book}} eventually... {{else}} Go to bed! {{/when}} {{! Prettier 2.8.1 }} {{#when isAtWork as |work|}} Ship that {{work}}! {{else when isReading}} You can finish {{book}} eventually... {{else}} Go to bed! {{/when}} {{! Prettier 2.8.2 }} {{#when isAtWork as |work|}} Ship that {{work}}! {{else when isReading as |book|}} You can finish {{book}} eventually... {{else}} Go to bed! {{/when}} ``` ##### Preserve empty lines between nested SCSS maps ([#13931](prettier/prettier#13931) by [@jneander](https://github.com/jneander)) <!-- prettier-ignore --> ```scss /* Input */ $map: ( 'one': ( 'key': 'value', ), 'two': ( 'key': 'value', ), ) /* Prettier 2.8.1 */ $map: ( 'one': ( 'key': 'value', ), 'two': ( 'key': 'value', ), ) /* Prettier 2.8.2 */ $map: ( 'one': ( 'key': 'value', ), 'two': ( 'key': 'value', ), ) ``` ##### Fix missing parentheses when an expression statement starts with `let[` ([#14000](prettier/prettier#14000), [#14044](prettier/prettier#14044) by [@fisker](https://github.com/fisker), [@thorn0](https://github.com/thorn0)) <!-- prettier-ignore --> ```jsx // Input (let[0] = 2); // Prettier 2.8.1 let[0] = 2; // Prettier 2.8.1 (second format) SyntaxError: Unexpected token (1:5) > 1 | let[0] = 2; | ^ 2 | // Prettier 2.8.2 (let)[0] = 2; ``` ##### Fix semicolon duplicated at the end of LESS file ([#14007](prettier/prettier#14007) by [@mvorisek](https://github.com/mvorisek)) <!-- prettier-ignore --> ```less // Input @variable: { field: something; }; // Prettier 2.8.1 @variable: { field: something; }; ; // Prettier 2.8.2 @variable: { field: something; }; ``` ##### Fix no space after unary minus when followed by opening parenthesis in LESS ([#14008](prettier/prettier#14008) by [@mvorisek](https://github.com/mvorisek)) <!-- prettier-ignore --> ```less // Input .unary_minus_single { margin: -(@A); } .unary_minus_multi { margin: 0 -(@A); } .binary_minus { margin: 0 - (@A); } // Prettier 2.8.1 .unary_minus_single { margin: - (@A); } .unary_minus_multi { margin: 0 - (@A); } .binary_minus { margin: 0 - (@A); } // Prettier 2.8.2 .unary_minus_single { margin: -(@A); } .unary_minus_multi { margin: 0 -(@A); } .binary_minus { margin: 0 - (@A); } ``` ##### Do not change case of property name if inside a variable declaration in LESS ([#14034](prettier/prettier#14034) by [@mvorisek](https://github.com/mvorisek)) <!-- prettier-ignore --> ```less // Input @var: { preserveCase: 0; }; // Prettier 2.8.1 @var: { preservecase: 0; }; // Prettier 2.8.2 @var: { preserveCase: 0; }; ``` ##### Fix formatting for auto-accessors with comments ([#14038](prettier/prettier#14038) by [@fisker](https://github.com/fisker)) <!-- prettier-ignore --> ```jsx // Input class A { @dec() // comment accessor b; } // Prettier 2.8.1 class A { @dec() accessor // comment b; } // Prettier 2.8.1 (second format) class A { @dec() accessor; // comment b; } // Prettier 2.8.2 class A { @dec() // comment accessor b; } ``` ##### Add parentheses for TSTypeQuery to improve readability ([#14042](prettier/prettier#14042) by [@onishi-kohei](https://github.com/onishi-kohei)) <!-- prettier-ignore --> ```tsx // Input a as (typeof node.children)[number] a as (typeof node.children)[] a as ((typeof node.children)[number])[] // Prettier 2.8.1 a as typeof node.children[number]; a as typeof node.children[]; a as typeof node.children[number][]; // Prettier 2.8.2 a as (typeof node.children)[number]; a as (typeof node.children)[]; a as (typeof node.children)[number][]; ``` ##### Fix displacing of comments in default switch case ([#14047](prettier/prettier#14047) by [@thorn0](https://github.com/thorn0)) It was a regression in Prettier 2.6.0. <!-- prettier-ignore --> ```jsx // Input switch (state) { default: result = state; // no change break; } // Prettier 2.8.1 switch (state) { default: // no change result = state; break; } // Prettier 2.8.2 switch (state) { default: result = state; // no change break; } ``` ##### Support type annotations on auto accessors via `babel-ts` ([#14049](prettier/prettier#14049) by [@sosukesuzuki](https://github.com/sosukesuzuki)) [The bug that `@babel/parser` cannot parse auto accessors with type annotations](babel/babel#15205) has been fixed. So we now support it via `babel-ts` parser. <!-- prettier-ignore --> ```tsx class Foo { accessor prop: number; } ``` ##### Fix formatting of empty type parameters ([#14073](prettier/prettier#14073) by [@fisker](https://github.com/fisker)) <!-- prettier-ignore --> ```jsx // Input const foo: bar</* comment */> = () => baz; // Prettier 2.8.1 Error: Comment "comment" was not printed. Please report this error! // Prettier 2.8.2 const foo: bar</* comment */> = () => baz; ``` ##### Add parentheses to head of `ExpressionStatement` instead of the whole statement ([#14077](prettier/prettier#14077) by [@fisker](https://github.com/fisker)) <!-- prettier-ignore --> ```jsx // Input ({}).toString.call(foo) === "[object Array]" ? foo.forEach(iterateArray) : iterateObject(foo); // Prettier 2.8.1 ({}.toString.call(foo) === "[object Array]" ? foo.forEach(iterateArray) : iterateObject(foo)); // Prettier 2.8.2 ({}).toString.call(foo.forEach) === "[object Array]" ? foo.forEach(iterateArray) : iterateObject(foo); ``` ##### Fix comments after directive ([#14081](prettier/prettier#14081) by [@fisker](https://github.com/fisker)) <!-- prettier-ignore --> ```jsx // Input "use strict" /* comment */; // Prettier 2.8.1 (with other js parsers except `babel`) Error: Comment "comment" was not printed. Please report this error! // Prettier 2.8.2 <Same as input> ``` ##### Fix formatting for comments inside JSX attribute ([#14082](prettier/prettier#14082) by [@fisker](https://github.com/fisker)) <!-- prettier-ignore --> ```jsx // Input function MyFunctionComponent() { <button label=/*old*/"new">button</button> } // Prettier 2.8.1 Error: Comment "old" was not printed. Please report this error! // Prettier 2.8.2 function MyFunctionComponent() { <button label=/*old*/ "new">button</button>; } ``` ##### Quote numeric keys for json-stringify parser ([#14083](prettier/prettier#14083) by [@fisker](https://github.com/fisker)) <!-- prettier-ignore --> ```jsx // Input {0: 'value'} // Prettier 2.8.1 { 0: "value" } // Prettier 2.8.2 { "0": "value" } ``` ##### Fix removing commas from function arguments in maps ([#14089](prettier/prettier#14089) by [@sosukesuzuki](https://github.com/sosukesuzuki)) <!-- prettier-ignore --> ```scss /* Input */ $foo: map-fn( ( "#{prop}": inner-fn($first, $second), ) ); /* Prettier 2.8.1 */ $foo: map-fn(("#{prop}": inner-fn($first $second))); /* Prettier 2.8.2 */ $foo: map-fn( ( "#{prop}": inner-fn($first, $second), ) ); ``` ##### Do not insert space in LESS property access ([#14103](prettier/prettier#14103) by [@fisker](https://github.com/fisker)) <!-- prettier-ignore --> ```less // Input a { color: @Colors[@white]; } // Prettier 2.8.1 a { color: @Colors[ @white]; } // Prettier 2.8.2 <Same as input> ``` ##### [\`v2.8.1\`](https://github.com/prettier/prettier/blob/HEAD/CHANGELOG.md#281) [diff](prettier/prettier@2.8.0...2.8.1) ##### Fix SCSS map in arguments ([#9184](prettier/prettier#9184) by [@agamkrbit](https://github.com/agamkrbit)) <!-- prettier-ignore --> ```scss // Input $display-breakpoints: map-deep-merge( ( "print-only": "only print", "screen-only": "only screen", "xs-only": "only screen and (max-width: #{map-get($grid-breakpoints, "sm")-1})", ), $display-breakpoints ); // Prettier 2.8.0 $display-breakpoints: map-deep-merge( ( "print-only": "only print", "screen-only": "only screen", "xs-only": "only screen and (max-width: #{map-get($grid-breakpoints, " sm ")-1})", ), $display-breakpoints ); // Prettier 2.8.1 $display-breakpoints: map-deep-merge( ( "print-only": "only print", "screen-only": "only screen", "xs-only": "only screen and (max-width: #{map-get($grid-breakpoints, "sm")-1})", ), $display-breakpoints ); ``` ##### Support auto accessors syntax ([#13919](prettier/prettier#13919) by [@sosukesuzuki](https://github.com/sosukesuzuki)) Support for [Auto Accessors Syntax](https://devblogs.microsoft.com/typescript/announcing-typescript-4-9/#auto-accessors-in-classes) landed in TypeScript 4.9. (Doesn't work well with `babel-ts` parser) <!-- prettier-ignore --> ```tsx class Foo { accessor foo: number = 3; } ``` ##### [\`v2.8.0\`](https://github.com/prettier/prettier/blob/HEAD/CHANGELOG.md#280) [diff](prettier/prettier@2.7.1...2.8.0) 🔗 [Release Notes](https://prettier.io/blog/2022/11/23/2.8.0.html) ##### [\`v2.7.1\`](https://github.com/prettier/prettier/blob/HEAD/CHANGELOG.md#271) [diff](prettier/prettier@2.7.0...2.7.1) ##### Keep useful empty lines in description ([#13013](prettier/prettier#13013) by [@chimurai](https://github.com/chimurai)) <!-- prettier-ignore --> ```graphql ```
| datasource | package | from | to | | ---------- | -------- | ----- | ----- | | npm | prettier | 2.7.0 | 2.8.8 | ## [v2.8.8](https://github.com/prettier/prettier/blob/HEAD/CHANGELOG.md#288) This version is a republished version of v2.8.7. A bad version was accidentally published and [it can't be unpublished](npm/cli#1686), apologies for the churn. ## [v2.8.7](https://github.com/prettier/prettier/blob/HEAD/CHANGELOG.md#287) [diff](prettier/prettier@2.8.6...2.8.7) ##### Allow multiple decorators on same getter/setter ([#14584](prettier/prettier#14584) by [@fisker](https://github.com/fisker)) <!-- prettier-ignore --> ```ts // Input class A { @decorator() get foo () {} @decorator() set foo (value) {} } // Prettier 2.8.6 SyntaxError: Decorators cannot be applied to multiple get/set accessors of the same name. (5:3) 3 | get foo () {} 4 | > 5 | @decorator() | ^^^^^^^^^^^^ 6 | set foo (value) {} 7 | } // Prettier 2.8.7 class A { @decorator() get foo() {} @decorator() set foo(value) {} } ``` ## [v2.8.6](https://github.com/prettier/prettier/blob/HEAD/CHANGELOG.md#286) [diff](prettier/prettier@2.8.5...2.8.6) ##### Allow decorators on private members and class expressions ([#14548](prettier/prettier#14548) by [@fisker](https://github.com/fisker)) <!-- prettier-ignore --> ```ts // Input class A { @decorator() #privateMethod () {} } // Prettier 2.8.5 SyntaxError: Decorators are not valid here. (2:3) 1 | class A { > 2 | @decorator() | ^^^^^^^^^^^^ 3 | #privateMethod () {} 4 | } // Prettier 2.8.6 class A { @decorator() #privateMethod() {} } ``` ## [v2.8.5](https://github.com/prettier/prettier/blob/HEAD/CHANGELOG.md#285) [diff](prettier/prettier@2.8.4...2.8.5) ##### Support TypeScript 5.0 ([#14391](prettier/prettier#14391) by [@fisker](https://github.com/fisker), [#13819](prettier/prettier#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](prettier/prettier#14393) by [@fisker](https://github.com/fisker)) <!-- prettier-ignore --> ```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](prettier/prettier#14458) by [@fisker](https://github.com/fisker)) <!-- prettier-ignore --> ```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](prettier/prettier#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). <!-- prettier-ignore --> ```html <!-- Input --> <div className='HelloWorld' title={`You are visitor number ${ num }`} onMouseOver={onMouseOver}/> <!-- Prettier 2.8.4 --> <div className="HelloWorld" title={`You are visitor number ${num}`} onMouseOver={onMouseOver} />; <!-- Prettier 2.8.5 --> <div className="HelloWorld" title={`You are visitor number ${num}`} onMouseOver={onMouseOver} />; ``` ## [v2.8.4](https://github.com/prettier/prettier/blob/HEAD/CHANGELOG.md#284) [diff](prettier/prettier@2.8.3...2.8.4) ##### Fix leading comments in mapped types with `readonly` ([#13427](prettier/prettier#13427) by [@thorn0](https://github.com/thorn0), [@sosukesuzuki](https://github.com/sosukesuzuki)) <!-- prettier-ignore --> ```tsx // Input type Type = { // comment readonly [key in Foo]; }; // Prettier 2.8.3 type Type = { readonly // comment [key in Foo]; }; // Prettier 2.8.4 type Type = { // comment readonly [key in Foo]; }; ``` ##### Group params in opening block statements ([#14067](prettier/prettier#14067) by [@jamescdavis](https://github.com/jamescdavis)) This is a follow-up to [#13930](prettier/prettier#13930) to establish wrapping consistency between opening block statements and else blocks by grouping params in opening blocks. This causes params to break to a new line together and not be split across lines unless the length of params exceeds the print width. This also updates the else block wrapping to behave exactly the same as opening blocks. <!-- prettier-ignore --> ```hbs {{! Input }} {{#block param param param param param param param param param param as |blockParam|}} Hello {{else block param param param param param param param param param param as |blockParam|}} There {{/block}} {{! Prettier 2.8.3 }} {{#block param param param param param param param param param param as |blockParam| }} Hello {{else block param param param param param param param param param param}} There {{/block}} {{! Prettier 2.8.4 }} {{#block param param param param param param param param param param as |blockParam| }} Hello {{else block param param param param param param param param param param as |blockParam| }} There {{/block}} ``` ##### Ignore files in `.sl/` ([#14206](prettier/prettier#14206) by [@bolinfest](https://github.com/bolinfest)) In [Sapling SCM](https://sapling-scm.com/), `.sl/` is the folder where it stores its state, analogous to `.git/` in Git. It should be ignored in Prettier like the other SCM folders. ##### Recognize `@satisfies` in Closure-style type casts ([#14262](prettier/prettier#14262) by [@fisker](https://github.com/fisker)) <!-- prettier-ignore --> ```jsx // Input const a = /** @Satisfies {Record<string, string>} */ ({hello: 1337}); const b = /** @type {Record<string, string>} */ ({hello: 1337}); // Prettier 2.8.3 const a = /** @Satisfies {Record<string, string>} */ { hello: 1337 }; const b = /** @type {Record<string, string>} */ ({ hello: 1337 }); // Prettier 2.8.4 const a = /** @Satisfies {Record<string, string>} */ ({hello: 1337}); const b = /** @type {Record<string, string>} */ ({hello: 1337}); ``` ##### Fix parens in inferred function return types with `extends` ([#14279](prettier/prettier#14279) by [@fisker](https://github.com/fisker)) <!-- prettier-ignore --> ```ts // Input type Foo<T> = T extends ((a) => a is infer R extends string) ? R : never; // Prettier 2.8.3 (First format) type Foo<T> = T extends (a) => a is infer R extends string ? R : never; // Prettier 2.8.3 (Second format) SyntaxError: '?' expected. // Prettier 2.8.4 type Foo<T> = T extends ((a) => a is infer R extends string) ? R : never; ``` ## [v2.8.3](https://github.com/prettier/prettier/blob/HEAD/CHANGELOG.md#283) [diff](prettier/prettier@2.8.2...2.8.3) ##### Allow self-closing tags on custom elements ([#14170](prettier/prettier#14170) by [@fisker](https://github.com/fisker)) See [Angular v15.1.0 release note](https://github.com/angular/angular/releases/tag/15.1.0) for details. <!-- prettier-ignore --> ```html // Input <app-test/> // Prettier 2.8.2 SyntaxError: Only void and foreign elements can be self closed "app-test" (1:1) > 1 | <app-test/> | ^^^^^^^^^ 2 | // Prettier 2.8.3 <app-test /> ``` ## [v2.8.2](https://github.com/prettier/prettier/blob/HEAD/CHANGELOG.md#282) [diff](prettier/prettier@2.8.1...2.8.2) ##### Don't lowercase link references ([#13155](prettier/prettier#13155) by [@DerekNonGeneric](https://github.com/DerekNonGeneric) & [@fisker](https://github.com/fisker)) <!-- prettier-ignore --> ```markdown <!-- Input --> We now don't strictly follow the release notes format suggested by [Keep a Changelog]. [Keep a Changelog]: https://example.com/ <!-- Prettier 2.8.1 --> We now don't strictly follow the release notes format suggested by [Keep a Changelog]. [keep a changelog]: https://example.com/ <!-- ^^^^^^^^^^^^^^^^^^ lowercased --> <!-- Prettier 2.8.2 --> <Same as input> ``` ##### Preserve self-closing tags ([#13691](prettier/prettier#13691) by [@dcyriller](https://github.com/dcyriller)) <!-- prettier-ignore --> ```hbs {{! Input }} <div /> <div></div> <custom-component /> <custom-component></custom-component> <i /> <i></i> <Component /> <Component></Component> {{! Prettier 2.8.1 }} <div></div> <div></div> <custom-component></custom-component> <custom-component></custom-component> <i></i> <i></i> <Component /> <Component /> {{! Prettier 2.8.2 }} <div /> <div></div> <custom-component /> <custom-component></custom-component> <i /> <i></i> <Component /> <Component /> ``` ##### Allow custom "else if"-like blocks with block params ([#13930](prettier/prettier#13930) by [@jamescdavis](https://github.com/jamescdavis)) [#13507](prettier/prettier#13507) added support for custom block keywords used with `else`, but failed to allow block params. This updates printer-glimmer to allow block params with custom "else if"-like blocks. <!-- prettier-ignore --> ```hbs {{! Input }} {{#when isAtWork as |work|}} Ship that {{work}}! {{else when isReading as |book|}} You can finish {{book}} eventually... {{else}} Go to bed! {{/when}} {{! Prettier 2.8.1 }} {{#when isAtWork as |work|}} Ship that {{work}}! {{else when isReading}} You can finish {{book}} eventually... {{else}} Go to bed! {{/when}} {{! Prettier 2.8.2 }} {{#when isAtWork as |work|}} Ship that {{work}}! {{else when isReading as |book|}} You can finish {{book}} eventually... {{else}} Go to bed! {{/when}} ``` ##### Preserve empty lines between nested SCSS maps ([#13931](prettier/prettier#13931) by [@jneander](https://github.com/jneander)) <!-- prettier-ignore --> ```scss /* Input */ $map: ( 'one': ( 'key': 'value', ), 'two': ( 'key': 'value', ), ) /* Prettier 2.8.1 */ $map: ( 'one': ( 'key': 'value', ), 'two': ( 'key': 'value', ), ) /* Prettier 2.8.2 */ $map: ( 'one': ( 'key': 'value', ), 'two': ( 'key': 'value', ), ) ``` ##### Fix missing parentheses when an expression statement starts with `let[` ([#14000](prettier/prettier#14000), [#14044](prettier/prettier#14044) by [@fisker](https://github.com/fisker), [@thorn0](https://github.com/thorn0)) <!-- prettier-ignore --> ```jsx // Input (let[0] = 2); // Prettier 2.8.1 let[0] = 2; // Prettier 2.8.1 (second format) SyntaxError: Unexpected token (1:5) > 1 | let[0] = 2; | ^ 2 | // Prettier 2.8.2 (let)[0] = 2; ``` ##### Fix semicolon duplicated at the end of LESS file ([#14007](prettier/prettier#14007) by [@mvorisek](https://github.com/mvorisek)) <!-- prettier-ignore --> ```less // Input @variable: { field: something; }; // Prettier 2.8.1 @variable: { field: something; }; ; // Prettier 2.8.2 @variable: { field: something; }; ``` ##### Fix no space after unary minus when followed by opening parenthesis in LESS ([#14008](prettier/prettier#14008) by [@mvorisek](https://github.com/mvorisek)) <!-- prettier-ignore --> ```less // Input .unary_minus_single { margin: -(@A); } .unary_minus_multi { margin: 0 -(@A); } .binary_minus { margin: 0 - (@A); } // Prettier 2.8.1 .unary_minus_single { margin: - (@A); } .unary_minus_multi { margin: 0 - (@A); } .binary_minus { margin: 0 - (@A); } // Prettier 2.8.2 .unary_minus_single { margin: -(@A); } .unary_minus_multi { margin: 0 -(@A); } .binary_minus { margin: 0 - (@A); } ``` ##### Do not change case of property name if inside a variable declaration in LESS ([#14034](prettier/prettier#14034) by [@mvorisek](https://github.com/mvorisek)) <!-- prettier-ignore --> ```less // Input @var: { preserveCase: 0; }; // Prettier 2.8.1 @var: { preservecase: 0; }; // Prettier 2.8.2 @var: { preserveCase: 0; }; ``` ##### Fix formatting for auto-accessors with comments ([#14038](prettier/prettier#14038) by [@fisker](https://github.com/fisker)) <!-- prettier-ignore --> ```jsx // Input class A { @dec() // comment accessor b; } // Prettier 2.8.1 class A { @dec() accessor // comment b; } // Prettier 2.8.1 (second format) class A { @dec() accessor; // comment b; } // Prettier 2.8.2 class A { @dec() // comment accessor b; } ``` ##### Add parentheses for TSTypeQuery to improve readability ([#14042](prettier/prettier#14042) by [@onishi-kohei](https://github.com/onishi-kohei)) <!-- prettier-ignore --> ```tsx // Input a as (typeof node.children)[number] a as (typeof node.children)[] a as ((typeof node.children)[number])[] // Prettier 2.8.1 a as typeof node.children[number]; a as typeof node.children[]; a as typeof node.children[number][]; // Prettier 2.8.2 a as (typeof node.children)[number]; a as (typeof node.children)[]; a as (typeof node.children)[number][]; ``` ##### Fix displacing of comments in default switch case ([#14047](prettier/prettier#14047) by [@thorn0](https://github.com/thorn0)) It was a regression in Prettier 2.6.0. <!-- prettier-ignore --> ```jsx // Input switch (state) { default: result = state; // no change break; } // Prettier 2.8.1 switch (state) { default: // no change result = state; break; } // Prettier 2.8.2 switch (state) { default: result = state; // no change break; } ``` ##### Support type annotations on auto accessors via `babel-ts` ([#14049](prettier/prettier#14049) by [@sosukesuzuki](https://github.com/sosukesuzuki)) [The bug that `@babel/parser` cannot parse auto accessors with type annotations](babel/babel#15205) has been fixed. So we now support it via `babel-ts` parser. <!-- prettier-ignore --> ```tsx class Foo { accessor prop: number; } ``` ##### Fix formatting of empty type parameters ([#14073](prettier/prettier#14073) by [@fisker](https://github.com/fisker)) <!-- prettier-ignore --> ```jsx // Input const foo: bar</* comment */> = () => baz; // Prettier 2.8.1 Error: Comment "comment" was not printed. Please report this error! // Prettier 2.8.2 const foo: bar</* comment */> = () => baz; ``` ##### Add parentheses to head of `ExpressionStatement` instead of the whole statement ([#14077](prettier/prettier#14077) by [@fisker](https://github.com/fisker)) <!-- prettier-ignore --> ```jsx // Input ({}).toString.call(foo) === "[object Array]" ? foo.forEach(iterateArray) : iterateObject(foo); // Prettier 2.8.1 ({}.toString.call(foo) === "[object Array]" ? foo.forEach(iterateArray) : iterateObject(foo)); // Prettier 2.8.2 ({}).toString.call(foo.forEach) === "[object Array]" ? foo.forEach(iterateArray) : iterateObject(foo); ``` ##### Fix comments after directive ([#14081](prettier/prettier#14081) by [@fisker](https://github.com/fisker)) <!-- prettier-ignore --> ```jsx // Input "use strict" /* comment */; // Prettier 2.8.1 (with other js parsers except `babel`) Error: Comment "comment" was not printed. Please report this error! // Prettier 2.8.2 <Same as input> ``` ##### Fix formatting for comments inside JSX attribute ([#14082](prettier/prettier#14082) by [@fisker](https://github.com/fisker)) <!-- prettier-ignore --> ```jsx // Input function MyFunctionComponent() { <button label=/*old*/"new">button</button> } // Prettier 2.8.1 Error: Comment "old" was not printed. Please report this error! // Prettier 2.8.2 function MyFunctionComponent() { <button label=/*old*/ "new">button</button>; } ``` ##### Quote numeric keys for json-stringify parser ([#14083](prettier/prettier#14083) by [@fisker](https://github.com/fisker)) <!-- prettier-ignore --> ```jsx // Input {0: 'value'} // Prettier 2.8.1 { 0: "value" } // Prettier 2.8.2 { "0": "value" } ``` ##### Fix removing commas from function arguments in maps ([#14089](prettier/prettier#14089) by [@sosukesuzuki](https://github.com/sosukesuzuki)) <!-- prettier-ignore --> ```scss /* Input */ $foo: map-fn( ( "#{prop}": inner-fn($first, $second), ) ); /* Prettier 2.8.1 */ $foo: map-fn(("#{prop}": inner-fn($first $second))); /* Prettier 2.8.2 */ $foo: map-fn( ( "#{prop}": inner-fn($first, $second), ) ); ``` ##### Do not insert space in LESS property access ([#14103](prettier/prettier#14103) by [@fisker](https://github.com/fisker)) <!-- prettier-ignore --> ```less // Input a { color: @Colors[@white]; } // Prettier 2.8.1 a { color: @Colors[ @white]; } // Prettier 2.8.2 <Same as input> ``` ## [v2.8.1](https://github.com/prettier/prettier/blob/HEAD/CHANGELOG.md#281) [diff](prettier/prettier@2.8.0...2.8.1) ##### Fix SCSS map in arguments ([#9184](prettier/prettier#9184) by [@agamkrbit](https://github.com/agamkrbit)) <!-- prettier-ignore --> ```scss // Input $display-breakpoints: map-deep-merge( ( "print-only": "only print", "screen-only": "only screen", "xs-only": "only screen and (max-width: #{map-get($grid-breakpoints, "sm")-1})", ), $display-breakpoints ); // Prettier 2.8.0 $display-breakpoints: map-deep-merge( ( "print-only": "only print", "screen-only": "only screen", "xs-only": "only screen and (max-width: #{map-get($grid-breakpoints, " sm ")-1})", ), $display-breakpoints ); // Prettier 2.8.1 $display-breakpoints: map-deep-merge( ( "print-only": "only print", "screen-only": "only screen", "xs-only": "only screen and (max-width: #{map-get($grid-breakpoints, "sm")-1})", ), $display-breakpoints ); ``` ##### Support auto accessors syntax ([#13919](prettier/prettier#13919) by [@sosukesuzuki](https://github.com/sosukesuzuki)) Support for [Auto Accessors Syntax](https://devblogs.microsoft.com/typescript/announcing-typescript-4-9/#auto-accessors-in-classes) landed in TypeScript 4.9. (Doesn't work well with `babel-ts` parser) <!-- prettier-ignore --> ```tsx class Foo { accessor foo: number = 3; } ``` ## [v2.8.0](https://github.com/prettier/prettier/blob/HEAD/CHANGELOG.md#280) [diff](prettier/prettier@2.7.1...2.8.0) 🔗 [Release Notes](https://prettier.io/blog/2022/11/23/2.8.0.html) ## [v2.7.1](https://github.com/prettier/prettier/blob/HEAD/CHANGELOG.md#271) [diff](prettier/prettier@2.7.0...2.7.1) ##### Keep useful empty lines in description ([#13013](prettier/prettier#13013) by [@chimurai](https://github.com/chimurai)) <!-- prettier-ignore --> ```graphql ```
| datasource | package | from | to | | ---------- | -------- | ----- | ----- | | npm | prettier | 2.7.0 | 2.8.8 | ## [v2.8.8](https://github.com/prettier/prettier/blob/HEAD/CHANGELOG.md#288) This version is a republished version of v2.8.7. A bad version was accidentally published and [it can't be unpublished](npm/cli#1686), apologies for the churn. ## [v2.8.7](https://github.com/prettier/prettier/blob/HEAD/CHANGELOG.md#287) [diff](prettier/prettier@2.8.6...2.8.7) ##### Allow multiple decorators on same getter/setter ([#14584](prettier/prettier#14584) by [@fisker](https://github.com/fisker)) <!-- prettier-ignore --> ```ts // Input class A { @decorator() get foo () {} @decorator() set foo (value) {} } // Prettier 2.8.6 SyntaxError: Decorators cannot be applied to multiple get/set accessors of the same name. (5:3) 3 | get foo () {} 4 | > 5 | @decorator() | ^^^^^^^^^^^^ 6 | set foo (value) {} 7 | } // Prettier 2.8.7 class A { @decorator() get foo() {} @decorator() set foo(value) {} } ``` ## [v2.8.6](https://github.com/prettier/prettier/blob/HEAD/CHANGELOG.md#286) [diff](prettier/prettier@2.8.5...2.8.6) ##### Allow decorators on private members and class expressions ([#14548](prettier/prettier#14548) by [@fisker](https://github.com/fisker)) <!-- prettier-ignore --> ```ts // Input class A { @decorator() #privateMethod () {} } // Prettier 2.8.5 SyntaxError: Decorators are not valid here. (2:3) 1 | class A { > 2 | @decorator() | ^^^^^^^^^^^^ 3 | #privateMethod () {} 4 | } // Prettier 2.8.6 class A { @decorator() #privateMethod() {} } ``` ## [v2.8.5](https://github.com/prettier/prettier/blob/HEAD/CHANGELOG.md#285) [diff](prettier/prettier@2.8.4...2.8.5) ##### Support TypeScript 5.0 ([#14391](prettier/prettier#14391) by [@fisker](https://github.com/fisker), [#13819](prettier/prettier#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](prettier/prettier#14393) by [@fisker](https://github.com/fisker)) <!-- prettier-ignore --> ```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](prettier/prettier#14458) by [@fisker](https://github.com/fisker)) <!-- prettier-ignore --> ```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](prettier/prettier#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). <!-- prettier-ignore --> ```html <!-- Input --> <div className='HelloWorld' title={`You are visitor number ${ num }`} onMouseOver={onMouseOver}/> <!-- Prettier 2.8.4 --> <div className="HelloWorld" title={`You are visitor number ${num}`} onMouseOver={onMouseOver} />; <!-- Prettier 2.8.5 --> <div className="HelloWorld" title={`You are visitor number ${num}`} onMouseOver={onMouseOver} />; ``` ## [v2.8.4](https://github.com/prettier/prettier/blob/HEAD/CHANGELOG.md#284) [diff](prettier/prettier@2.8.3...2.8.4) ##### Fix leading comments in mapped types with `readonly` ([#13427](prettier/prettier#13427) by [@thorn0](https://github.com/thorn0), [@sosukesuzuki](https://github.com/sosukesuzuki)) <!-- prettier-ignore --> ```tsx // Input type Type = { // comment readonly [key in Foo]; }; // Prettier 2.8.3 type Type = { readonly // comment [key in Foo]; }; // Prettier 2.8.4 type Type = { // comment readonly [key in Foo]; }; ``` ##### Group params in opening block statements ([#14067](prettier/prettier#14067) by [@jamescdavis](https://github.com/jamescdavis)) This is a follow-up to [#13930](prettier/prettier#13930) to establish wrapping consistency between opening block statements and else blocks by grouping params in opening blocks. This causes params to break to a new line together and not be split across lines unless the length of params exceeds the print width. This also updates the else block wrapping to behave exactly the same as opening blocks. <!-- prettier-ignore --> ```hbs {{! Input }} {{#block param param param param param param param param param param as |blockParam|}} Hello {{else block param param param param param param param param param param as |blockParam|}} There {{/block}} {{! Prettier 2.8.3 }} {{#block param param param param param param param param param param as |blockParam| }} Hello {{else block param param param param param param param param param param}} There {{/block}} {{! Prettier 2.8.4 }} {{#block param param param param param param param param param param as |blockParam| }} Hello {{else block param param param param param param param param param param as |blockParam| }} There {{/block}} ``` ##### Ignore files in `.sl/` ([#14206](prettier/prettier#14206) by [@bolinfest](https://github.com/bolinfest)) In [Sapling SCM](https://sapling-scm.com/), `.sl/` is the folder where it stores its state, analogous to `.git/` in Git. It should be ignored in Prettier like the other SCM folders. ##### Recognize `@satisfies` in Closure-style type casts ([#14262](prettier/prettier#14262) by [@fisker](https://github.com/fisker)) <!-- prettier-ignore --> ```jsx // Input const a = /** @Satisfies {Record<string, string>} */ ({hello: 1337}); const b = /** @type {Record<string, string>} */ ({hello: 1337}); // Prettier 2.8.3 const a = /** @Satisfies {Record<string, string>} */ { hello: 1337 }; const b = /** @type {Record<string, string>} */ ({ hello: 1337 }); // Prettier 2.8.4 const a = /** @Satisfies {Record<string, string>} */ ({hello: 1337}); const b = /** @type {Record<string, string>} */ ({hello: 1337}); ``` ##### Fix parens in inferred function return types with `extends` ([#14279](prettier/prettier#14279) by [@fisker](https://github.com/fisker)) <!-- prettier-ignore --> ```ts // Input type Foo<T> = T extends ((a) => a is infer R extends string) ? R : never; // Prettier 2.8.3 (First format) type Foo<T> = T extends (a) => a is infer R extends string ? R : never; // Prettier 2.8.3 (Second format) SyntaxError: '?' expected. // Prettier 2.8.4 type Foo<T> = T extends ((a) => a is infer R extends string) ? R : never; ``` ## [v2.8.3](https://github.com/prettier/prettier/blob/HEAD/CHANGELOG.md#283) [diff](prettier/prettier@2.8.2...2.8.3) ##### Allow self-closing tags on custom elements ([#14170](prettier/prettier#14170) by [@fisker](https://github.com/fisker)) See [Angular v15.1.0 release note](https://github.com/angular/angular/releases/tag/15.1.0) for details. <!-- prettier-ignore --> ```html // Input <app-test/> // Prettier 2.8.2 SyntaxError: Only void and foreign elements can be self closed "app-test" (1:1) > 1 | <app-test/> | ^^^^^^^^^ 2 | // Prettier 2.8.3 <app-test /> ``` ## [v2.8.2](https://github.com/prettier/prettier/blob/HEAD/CHANGELOG.md#282) [diff](prettier/prettier@2.8.1...2.8.2) ##### Don't lowercase link references ([#13155](prettier/prettier#13155) by [@DerekNonGeneric](https://github.com/DerekNonGeneric) & [@fisker](https://github.com/fisker)) <!-- prettier-ignore --> ```markdown <!-- Input --> We now don't strictly follow the release notes format suggested by [Keep a Changelog]. [Keep a Changelog]: https://example.com/ <!-- Prettier 2.8.1 --> We now don't strictly follow the release notes format suggested by [Keep a Changelog]. [keep a changelog]: https://example.com/ <!-- ^^^^^^^^^^^^^^^^^^ lowercased --> <!-- Prettier 2.8.2 --> <Same as input> ``` ##### Preserve self-closing tags ([#13691](prettier/prettier#13691) by [@dcyriller](https://github.com/dcyriller)) <!-- prettier-ignore --> ```hbs {{! Input }} <div /> <div></div> <custom-component /> <custom-component></custom-component> <i /> <i></i> <Component /> <Component></Component> {{! Prettier 2.8.1 }} <div></div> <div></div> <custom-component></custom-component> <custom-component></custom-component> <i></i> <i></i> <Component /> <Component /> {{! Prettier 2.8.2 }} <div /> <div></div> <custom-component /> <custom-component></custom-component> <i /> <i></i> <Component /> <Component /> ``` ##### Allow custom "else if"-like blocks with block params ([#13930](prettier/prettier#13930) by [@jamescdavis](https://github.com/jamescdavis)) [#13507](prettier/prettier#13507) added support for custom block keywords used with `else`, but failed to allow block params. This updates printer-glimmer to allow block params with custom "else if"-like blocks. <!-- prettier-ignore --> ```hbs {{! Input }} {{#when isAtWork as |work|}} Ship that {{work}}! {{else when isReading as |book|}} You can finish {{book}} eventually... {{else}} Go to bed! {{/when}} {{! Prettier 2.8.1 }} {{#when isAtWork as |work|}} Ship that {{work}}! {{else when isReading}} You can finish {{book}} eventually... {{else}} Go to bed! {{/when}} {{! Prettier 2.8.2 }} {{#when isAtWork as |work|}} Ship that {{work}}! {{else when isReading as |book|}} You can finish {{book}} eventually... {{else}} Go to bed! {{/when}} ``` ##### Preserve empty lines between nested SCSS maps ([#13931](prettier/prettier#13931) by [@jneander](https://github.com/jneander)) <!-- prettier-ignore --> ```scss /* Input */ $map: ( 'one': ( 'key': 'value', ), 'two': ( 'key': 'value', ), ) /* Prettier 2.8.1 */ $map: ( 'one': ( 'key': 'value', ), 'two': ( 'key': 'value', ), ) /* Prettier 2.8.2 */ $map: ( 'one': ( 'key': 'value', ), 'two': ( 'key': 'value', ), ) ``` ##### Fix missing parentheses when an expression statement starts with `let[` ([#14000](prettier/prettier#14000), [#14044](prettier/prettier#14044) by [@fisker](https://github.com/fisker), [@thorn0](https://github.com/thorn0)) <!-- prettier-ignore --> ```jsx // Input (let[0] = 2); // Prettier 2.8.1 let[0] = 2; // Prettier 2.8.1 (second format) SyntaxError: Unexpected token (1:5) > 1 | let[0] = 2; | ^ 2 | // Prettier 2.8.2 (let)[0] = 2; ``` ##### Fix semicolon duplicated at the end of LESS file ([#14007](prettier/prettier#14007) by [@mvorisek](https://github.com/mvorisek)) <!-- prettier-ignore --> ```less // Input @variable: { field: something; }; // Prettier 2.8.1 @variable: { field: something; }; ; // Prettier 2.8.2 @variable: { field: something; }; ``` ##### Fix no space after unary minus when followed by opening parenthesis in LESS ([#14008](prettier/prettier#14008) by [@mvorisek](https://github.com/mvorisek)) <!-- prettier-ignore --> ```less // Input .unary_minus_single { margin: -(@A); } .unary_minus_multi { margin: 0 -(@A); } .binary_minus { margin: 0 - (@A); } // Prettier 2.8.1 .unary_minus_single { margin: - (@A); } .unary_minus_multi { margin: 0 - (@A); } .binary_minus { margin: 0 - (@A); } // Prettier 2.8.2 .unary_minus_single { margin: -(@A); } .unary_minus_multi { margin: 0 -(@A); } .binary_minus { margin: 0 - (@A); } ``` ##### Do not change case of property name if inside a variable declaration in LESS ([#14034](prettier/prettier#14034) by [@mvorisek](https://github.com/mvorisek)) <!-- prettier-ignore --> ```less // Input @var: { preserveCase: 0; }; // Prettier 2.8.1 @var: { preservecase: 0; }; // Prettier 2.8.2 @var: { preserveCase: 0; }; ``` ##### Fix formatting for auto-accessors with comments ([#14038](prettier/prettier#14038) by [@fisker](https://github.com/fisker)) <!-- prettier-ignore --> ```jsx // Input class A { @dec() // comment accessor b; } // Prettier 2.8.1 class A { @dec() accessor // comment b; } // Prettier 2.8.1 (second format) class A { @dec() accessor; // comment b; } // Prettier 2.8.2 class A { @dec() // comment accessor b; } ``` ##### Add parentheses for TSTypeQuery to improve readability ([#14042](prettier/prettier#14042) by [@onishi-kohei](https://github.com/onishi-kohei)) <!-- prettier-ignore --> ```tsx // Input a as (typeof node.children)[number] a as (typeof node.children)[] a as ((typeof node.children)[number])[] // Prettier 2.8.1 a as typeof node.children[number]; a as typeof node.children[]; a as typeof node.children[number][]; // Prettier 2.8.2 a as (typeof node.children)[number]; a as (typeof node.children)[]; a as (typeof node.children)[number][]; ``` ##### Fix displacing of comments in default switch case ([#14047](prettier/prettier#14047) by [@thorn0](https://github.com/thorn0)) It was a regression in Prettier 2.6.0. <!-- prettier-ignore --> ```jsx // Input switch (state) { default: result = state; // no change break; } // Prettier 2.8.1 switch (state) { default: // no change result = state; break; } // Prettier 2.8.2 switch (state) { default: result = state; // no change break; } ``` ##### Support type annotations on auto accessors via `babel-ts` ([#14049](prettier/prettier#14049) by [@sosukesuzuki](https://github.com/sosukesuzuki)) [The bug that `@babel/parser` cannot parse auto accessors with type annotations](babel/babel#15205) has been fixed. So we now support it via `babel-ts` parser. <!-- prettier-ignore --> ```tsx class Foo { accessor prop: number; } ``` ##### Fix formatting of empty type parameters ([#14073](prettier/prettier#14073) by [@fisker](https://github.com/fisker)) <!-- prettier-ignore --> ```jsx // Input const foo: bar</* comment */> = () => baz; // Prettier 2.8.1 Error: Comment "comment" was not printed. Please report this error! // Prettier 2.8.2 const foo: bar</* comment */> = () => baz; ``` ##### Add parentheses to head of `ExpressionStatement` instead of the whole statement ([#14077](prettier/prettier#14077) by [@fisker](https://github.com/fisker)) <!-- prettier-ignore --> ```jsx // Input ({}).toString.call(foo) === "[object Array]" ? foo.forEach(iterateArray) : iterateObject(foo); // Prettier 2.8.1 ({}.toString.call(foo) === "[object Array]" ? foo.forEach(iterateArray) : iterateObject(foo)); // Prettier 2.8.2 ({}).toString.call(foo.forEach) === "[object Array]" ? foo.forEach(iterateArray) : iterateObject(foo); ``` ##### Fix comments after directive ([#14081](prettier/prettier#14081) by [@fisker](https://github.com/fisker)) <!-- prettier-ignore --> ```jsx // Input "use strict" /* comment */; // Prettier 2.8.1 (with other js parsers except `babel`) Error: Comment "comment" was not printed. Please report this error! // Prettier 2.8.2 <Same as input> ``` ##### Fix formatting for comments inside JSX attribute ([#14082](prettier/prettier#14082) by [@fisker](https://github.com/fisker)) <!-- prettier-ignore --> ```jsx // Input function MyFunctionComponent() { <button label=/*old*/"new">button</button> } // Prettier 2.8.1 Error: Comment "old" was not printed. Please report this error! // Prettier 2.8.2 function MyFunctionComponent() { <button label=/*old*/ "new">button</button>; } ``` ##### Quote numeric keys for json-stringify parser ([#14083](prettier/prettier#14083) by [@fisker](https://github.com/fisker)) <!-- prettier-ignore --> ```jsx // Input {0: 'value'} // Prettier 2.8.1 { 0: "value" } // Prettier 2.8.2 { "0": "value" } ``` ##### Fix removing commas from function arguments in maps ([#14089](prettier/prettier#14089) by [@sosukesuzuki](https://github.com/sosukesuzuki)) <!-- prettier-ignore --> ```scss /* Input */ $foo: map-fn( ( "#{prop}": inner-fn($first, $second), ) ); /* Prettier 2.8.1 */ $foo: map-fn(("#{prop}": inner-fn($first $second))); /* Prettier 2.8.2 */ $foo: map-fn( ( "#{prop}": inner-fn($first, $second), ) ); ``` ##### Do not insert space in LESS property access ([#14103](prettier/prettier#14103) by [@fisker](https://github.com/fisker)) <!-- prettier-ignore --> ```less // Input a { color: @Colors[@white]; } // Prettier 2.8.1 a { color: @Colors[ @white]; } // Prettier 2.8.2 <Same as input> ``` ## [v2.8.1](https://github.com/prettier/prettier/blob/HEAD/CHANGELOG.md#281) [diff](prettier/prettier@2.8.0...2.8.1) ##### Fix SCSS map in arguments ([#9184](prettier/prettier#9184) by [@agamkrbit](https://github.com/agamkrbit)) <!-- prettier-ignore --> ```scss // Input $display-breakpoints: map-deep-merge( ( "print-only": "only print", "screen-only": "only screen", "xs-only": "only screen and (max-width: #{map-get($grid-breakpoints, "sm")-1})", ), $display-breakpoints ); // Prettier 2.8.0 $display-breakpoints: map-deep-merge( ( "print-only": "only print", "screen-only": "only screen", "xs-only": "only screen and (max-width: #{map-get($grid-breakpoints, " sm ")-1})", ), $display-breakpoints ); // Prettier 2.8.1 $display-breakpoints: map-deep-merge( ( "print-only": "only print", "screen-only": "only screen", "xs-only": "only screen and (max-width: #{map-get($grid-breakpoints, "sm")-1})", ), $display-breakpoints ); ``` ##### Support auto accessors syntax ([#13919](prettier/prettier#13919) by [@sosukesuzuki](https://github.com/sosukesuzuki)) Support for [Auto Accessors Syntax](https://devblogs.microsoft.com/typescript/announcing-typescript-4-9/#auto-accessors-in-classes) landed in TypeScript 4.9. (Doesn't work well with `babel-ts` parser) <!-- prettier-ignore --> ```tsx class Foo { accessor foo: number = 3; } ``` ## [v2.8.0](https://github.com/prettier/prettier/blob/HEAD/CHANGELOG.md#280) [diff](prettier/prettier@2.7.1...2.8.0) 🔗 [Release Notes](https://prettier.io/blog/2022/11/23/2.8.0.html) ## [v2.7.1](https://github.com/prettier/prettier/blob/HEAD/CHANGELOG.md#271) [diff](prettier/prettier@2.7.0...2.7.1) ##### Keep useful empty lines in description ([#13013](prettier/prettier#13013) by [@chimurai](https://github.com/chimurai)) <!-- prettier-ignore --> ```graphql ```
| datasource | package | from | to | | ---------- | -------- | ----- | ----- | | npm | prettier | 2.7.0 | 2.8.8 | ## [v2.8.8](https://github.com/prettier/prettier/blob/HEAD/CHANGELOG.md#288) This version is a republished version of v2.8.7. A bad version was accidentally published and [it can't be unpublished](npm/cli#1686), apologies for the churn. ## [v2.8.7](https://github.com/prettier/prettier/blob/HEAD/CHANGELOG.md#287) [diff](prettier/prettier@2.8.6...2.8.7) ##### Allow multiple decorators on same getter/setter ([#14584](prettier/prettier#14584) by [@fisker](https://github.com/fisker)) <!-- prettier-ignore --> ```ts // Input class A { @decorator() get foo () {} @decorator() set foo (value) {} } // Prettier 2.8.6 SyntaxError: Decorators cannot be applied to multiple get/set accessors of the same name. (5:3) 3 | get foo () {} 4 | > 5 | @decorator() | ^^^^^^^^^^^^ 6 | set foo (value) {} 7 | } // Prettier 2.8.7 class A { @decorator() get foo() {} @decorator() set foo(value) {} } ``` ## [v2.8.6](https://github.com/prettier/prettier/blob/HEAD/CHANGELOG.md#286) [diff](prettier/prettier@2.8.5...2.8.6) ##### Allow decorators on private members and class expressions ([#14548](prettier/prettier#14548) by [@fisker](https://github.com/fisker)) <!-- prettier-ignore --> ```ts // Input class A { @decorator() #privateMethod () {} } // Prettier 2.8.5 SyntaxError: Decorators are not valid here. (2:3) 1 | class A { > 2 | @decorator() | ^^^^^^^^^^^^ 3 | #privateMethod () {} 4 | } // Prettier 2.8.6 class A { @decorator() #privateMethod() {} } ``` ## [v2.8.5](https://github.com/prettier/prettier/blob/HEAD/CHANGELOG.md#285) [diff](prettier/prettier@2.8.4...2.8.5) ##### Support TypeScript 5.0 ([#14391](prettier/prettier#14391) by [@fisker](https://github.com/fisker), [#13819](prettier/prettier#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](prettier/prettier#14393) by [@fisker](https://github.com/fisker)) <!-- prettier-ignore --> ```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](prettier/prettier#14458) by [@fisker](https://github.com/fisker)) <!-- prettier-ignore --> ```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](prettier/prettier#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). <!-- prettier-ignore --> ```html <!-- Input --> <div className='HelloWorld' title={`You are visitor number ${ num }`} onMouseOver={onMouseOver}/> <!-- Prettier 2.8.4 --> <div className="HelloWorld" title={`You are visitor number ${num}`} onMouseOver={onMouseOver} />; <!-- Prettier 2.8.5 --> <div className="HelloWorld" title={`You are visitor number ${num}`} onMouseOver={onMouseOver} />; ``` ## [v2.8.4](https://github.com/prettier/prettier/blob/HEAD/CHANGELOG.md#284) [diff](prettier/prettier@2.8.3...2.8.4) ##### Fix leading comments in mapped types with `readonly` ([#13427](prettier/prettier#13427) by [@thorn0](https://github.com/thorn0), [@sosukesuzuki](https://github.com/sosukesuzuki)) <!-- prettier-ignore --> ```tsx // Input type Type = { // comment readonly [key in Foo]; }; // Prettier 2.8.3 type Type = { readonly // comment [key in Foo]; }; // Prettier 2.8.4 type Type = { // comment readonly [key in Foo]; }; ``` ##### Group params in opening block statements ([#14067](prettier/prettier#14067) by [@jamescdavis](https://github.com/jamescdavis)) This is a follow-up to [#13930](prettier/prettier#13930) to establish wrapping consistency between opening block statements and else blocks by grouping params in opening blocks. This causes params to break to a new line together and not be split across lines unless the length of params exceeds the print width. This also updates the else block wrapping to behave exactly the same as opening blocks. <!-- prettier-ignore --> ```hbs {{! Input }} {{#block param param param param param param param param param param as |blockParam|}} Hello {{else block param param param param param param param param param param as |blockParam|}} There {{/block}} {{! Prettier 2.8.3 }} {{#block param param param param param param param param param param as |blockParam| }} Hello {{else block param param param param param param param param param param}} There {{/block}} {{! Prettier 2.8.4 }} {{#block param param param param param param param param param param as |blockParam| }} Hello {{else block param param param param param param param param param param as |blockParam| }} There {{/block}} ``` ##### Ignore files in `.sl/` ([#14206](prettier/prettier#14206) by [@bolinfest](https://github.com/bolinfest)) In [Sapling SCM](https://sapling-scm.com/), `.sl/` is the folder where it stores its state, analogous to `.git/` in Git. It should be ignored in Prettier like the other SCM folders. ##### Recognize `@satisfies` in Closure-style type casts ([#14262](prettier/prettier#14262) by [@fisker](https://github.com/fisker)) <!-- prettier-ignore --> ```jsx // Input const a = /** @Satisfies {Record<string, string>} */ ({hello: 1337}); const b = /** @type {Record<string, string>} */ ({hello: 1337}); // Prettier 2.8.3 const a = /** @Satisfies {Record<string, string>} */ { hello: 1337 }; const b = /** @type {Record<string, string>} */ ({ hello: 1337 }); // Prettier 2.8.4 const a = /** @Satisfies {Record<string, string>} */ ({hello: 1337}); const b = /** @type {Record<string, string>} */ ({hello: 1337}); ``` ##### Fix parens in inferred function return types with `extends` ([#14279](prettier/prettier#14279) by [@fisker](https://github.com/fisker)) <!-- prettier-ignore --> ```ts // Input type Foo<T> = T extends ((a) => a is infer R extends string) ? R : never; // Prettier 2.8.3 (First format) type Foo<T> = T extends (a) => a is infer R extends string ? R : never; // Prettier 2.8.3 (Second format) SyntaxError: '?' expected. // Prettier 2.8.4 type Foo<T> = T extends ((a) => a is infer R extends string) ? R : never; ``` ## [v2.8.3](https://github.com/prettier/prettier/blob/HEAD/CHANGELOG.md#283) [diff](prettier/prettier@2.8.2...2.8.3) ##### Allow self-closing tags on custom elements ([#14170](prettier/prettier#14170) by [@fisker](https://github.com/fisker)) See [Angular v15.1.0 release note](https://github.com/angular/angular/releases/tag/15.1.0) for details. <!-- prettier-ignore --> ```html // Input <app-test/> // Prettier 2.8.2 SyntaxError: Only void and foreign elements can be self closed "app-test" (1:1) > 1 | <app-test/> | ^^^^^^^^^ 2 | // Prettier 2.8.3 <app-test /> ``` ## [v2.8.2](https://github.com/prettier/prettier/blob/HEAD/CHANGELOG.md#282) [diff](prettier/prettier@2.8.1...2.8.2) ##### Don't lowercase link references ([#13155](prettier/prettier#13155) by [@DerekNonGeneric](https://github.com/DerekNonGeneric) & [@fisker](https://github.com/fisker)) <!-- prettier-ignore --> ```markdown <!-- Input --> We now don't strictly follow the release notes format suggested by [Keep a Changelog]. [Keep a Changelog]: https://example.com/ <!-- Prettier 2.8.1 --> We now don't strictly follow the release notes format suggested by [Keep a Changelog]. [keep a changelog]: https://example.com/ <!-- ^^^^^^^^^^^^^^^^^^ lowercased --> <!-- Prettier 2.8.2 --> <Same as input> ``` ##### Preserve self-closing tags ([#13691](prettier/prettier#13691) by [@dcyriller](https://github.com/dcyriller)) <!-- prettier-ignore --> ```hbs {{! Input }} <div /> <div></div> <custom-component /> <custom-component></custom-component> <i /> <i></i> <Component /> <Component></Component> {{! Prettier 2.8.1 }} <div></div> <div></div> <custom-component></custom-component> <custom-component></custom-component> <i></i> <i></i> <Component /> <Component /> {{! Prettier 2.8.2 }} <div /> <div></div> <custom-component /> <custom-component></custom-component> <i /> <i></i> <Component /> <Component /> ``` ##### Allow custom "else if"-like blocks with block params ([#13930](prettier/prettier#13930) by [@jamescdavis](https://github.com/jamescdavis)) [#13507](prettier/prettier#13507) added support for custom block keywords used with `else`, but failed to allow block params. This updates printer-glimmer to allow block params with custom "else if"-like blocks. <!-- prettier-ignore --> ```hbs {{! Input }} {{#when isAtWork as |work|}} Ship that {{work}}! {{else when isReading as |book|}} You can finish {{book}} eventually... {{else}} Go to bed! {{/when}} {{! Prettier 2.8.1 }} {{#when isAtWork as |work|}} Ship that {{work}}! {{else when isReading}} You can finish {{book}} eventually... {{else}} Go to bed! {{/when}} {{! Prettier 2.8.2 }} {{#when isAtWork as |work|}} Ship that {{work}}! {{else when isReading as |book|}} You can finish {{book}} eventually... {{else}} Go to bed! {{/when}} ``` ##### Preserve empty lines between nested SCSS maps ([#13931](prettier/prettier#13931) by [@jneander](https://github.com/jneander)) <!-- prettier-ignore --> ```scss /* Input */ $map: ( 'one': ( 'key': 'value', ), 'two': ( 'key': 'value', ), ) /* Prettier 2.8.1 */ $map: ( 'one': ( 'key': 'value', ), 'two': ( 'key': 'value', ), ) /* Prettier 2.8.2 */ $map: ( 'one': ( 'key': 'value', ), 'two': ( 'key': 'value', ), ) ``` ##### Fix missing parentheses when an expression statement starts with `let[` ([#14000](prettier/prettier#14000), [#14044](prettier/prettier#14044) by [@fisker](https://github.com/fisker), [@thorn0](https://github.com/thorn0)) <!-- prettier-ignore --> ```jsx // Input (let[0] = 2); // Prettier 2.8.1 let[0] = 2; // Prettier 2.8.1 (second format) SyntaxError: Unexpected token (1:5) > 1 | let[0] = 2; | ^ 2 | // Prettier 2.8.2 (let)[0] = 2; ``` ##### Fix semicolon duplicated at the end of LESS file ([#14007](prettier/prettier#14007) by [@mvorisek](https://github.com/mvorisek)) <!-- prettier-ignore --> ```less // Input @variable: { field: something; }; // Prettier 2.8.1 @variable: { field: something; }; ; // Prettier 2.8.2 @variable: { field: something; }; ``` ##### Fix no space after unary minus when followed by opening parenthesis in LESS ([#14008](prettier/prettier#14008) by [@mvorisek](https://github.com/mvorisek)) <!-- prettier-ignore --> ```less // Input .unary_minus_single { margin: -(@A); } .unary_minus_multi { margin: 0 -(@A); } .binary_minus { margin: 0 - (@A); } // Prettier 2.8.1 .unary_minus_single { margin: - (@A); } .unary_minus_multi { margin: 0 - (@A); } .binary_minus { margin: 0 - (@A); } // Prettier 2.8.2 .unary_minus_single { margin: -(@A); } .unary_minus_multi { margin: 0 -(@A); } .binary_minus { margin: 0 - (@A); } ``` ##### Do not change case of property name if inside a variable declaration in LESS ([#14034](prettier/prettier#14034) by [@mvorisek](https://github.com/mvorisek)) <!-- prettier-ignore --> ```less // Input @var: { preserveCase: 0; }; // Prettier 2.8.1 @var: { preservecase: 0; }; // Prettier 2.8.2 @var: { preserveCase: 0; }; ``` ##### Fix formatting for auto-accessors with comments ([#14038](prettier/prettier#14038) by [@fisker](https://github.com/fisker)) <!-- prettier-ignore --> ```jsx // Input class A { @dec() // comment accessor b; } // Prettier 2.8.1 class A { @dec() accessor // comment b; } // Prettier 2.8.1 (second format) class A { @dec() accessor; // comment b; } // Prettier 2.8.2 class A { @dec() // comment accessor b; } ``` ##### Add parentheses for TSTypeQuery to improve readability ([#14042](prettier/prettier#14042) by [@onishi-kohei](https://github.com/onishi-kohei)) <!-- prettier-ignore --> ```tsx // Input a as (typeof node.children)[number] a as (typeof node.children)[] a as ((typeof node.children)[number])[] // Prettier 2.8.1 a as typeof node.children[number]; a as typeof node.children[]; a as typeof node.children[number][]; // Prettier 2.8.2 a as (typeof node.children)[number]; a as (typeof node.children)[]; a as (typeof node.children)[number][]; ``` ##### Fix displacing of comments in default switch case ([#14047](prettier/prettier#14047) by [@thorn0](https://github.com/thorn0)) It was a regression in Prettier 2.6.0. <!-- prettier-ignore --> ```jsx // Input switch (state) { default: result = state; // no change break; } // Prettier 2.8.1 switch (state) { default: // no change result = state; break; } // Prettier 2.8.2 switch (state) { default: result = state; // no change break; } ``` ##### Support type annotations on auto accessors via `babel-ts` ([#14049](prettier/prettier#14049) by [@sosukesuzuki](https://github.com/sosukesuzuki)) [The bug that `@babel/parser` cannot parse auto accessors with type annotations](babel/babel#15205) has been fixed. So we now support it via `babel-ts` parser. <!-- prettier-ignore --> ```tsx class Foo { accessor prop: number; } ``` ##### Fix formatting of empty type parameters ([#14073](prettier/prettier#14073) by [@fisker](https://github.com/fisker)) <!-- prettier-ignore --> ```jsx // Input const foo: bar</* comment */> = () => baz; // Prettier 2.8.1 Error: Comment "comment" was not printed. Please report this error! // Prettier 2.8.2 const foo: bar</* comment */> = () => baz; ``` ##### Add parentheses to head of `ExpressionStatement` instead of the whole statement ([#14077](prettier/prettier#14077) by [@fisker](https://github.com/fisker)) <!-- prettier-ignore --> ```jsx // Input ({}).toString.call(foo) === "[object Array]" ? foo.forEach(iterateArray) : iterateObject(foo); // Prettier 2.8.1 ({}.toString.call(foo) === "[object Array]" ? foo.forEach(iterateArray) : iterateObject(foo)); // Prettier 2.8.2 ({}).toString.call(foo.forEach) === "[object Array]" ? foo.forEach(iterateArray) : iterateObject(foo); ``` ##### Fix comments after directive ([#14081](prettier/prettier#14081) by [@fisker](https://github.com/fisker)) <!-- prettier-ignore --> ```jsx // Input "use strict" /* comment */; // Prettier 2.8.1 (with other js parsers except `babel`) Error: Comment "comment" was not printed. Please report this error! // Prettier 2.8.2 <Same as input> ``` ##### Fix formatting for comments inside JSX attribute ([#14082](prettier/prettier#14082) by [@fisker](https://github.com/fisker)) <!-- prettier-ignore --> ```jsx // Input function MyFunctionComponent() { <button label=/*old*/"new">button</button> } // Prettier 2.8.1 Error: Comment "old" was not printed. Please report this error! // Prettier 2.8.2 function MyFunctionComponent() { <button label=/*old*/ "new">button</button>; } ``` ##### Quote numeric keys for json-stringify parser ([#14083](prettier/prettier#14083) by [@fisker](https://github.com/fisker)) <!-- prettier-ignore --> ```jsx // Input {0: 'value'} // Prettier 2.8.1 { 0: "value" } // Prettier 2.8.2 { "0": "value" } ``` ##### Fix removing commas from function arguments in maps ([#14089](prettier/prettier#14089) by [@sosukesuzuki](https://github.com/sosukesuzuki)) <!-- prettier-ignore --> ```scss /* Input */ $foo: map-fn( ( "#{prop}": inner-fn($first, $second), ) ); /* Prettier 2.8.1 */ $foo: map-fn(("#{prop}": inner-fn($first $second))); /* Prettier 2.8.2 */ $foo: map-fn( ( "#{prop}": inner-fn($first, $second), ) ); ``` ##### Do not insert space in LESS property access ([#14103](prettier/prettier#14103) by [@fisker](https://github.com/fisker)) <!-- prettier-ignore --> ```less // Input a { color: @Colors[@white]; } // Prettier 2.8.1 a { color: @Colors[ @white]; } // Prettier 2.8.2 <Same as input> ``` ## [v2.8.1](https://github.com/prettier/prettier/blob/HEAD/CHANGELOG.md#281) [diff](prettier/prettier@2.8.0...2.8.1) ##### Fix SCSS map in arguments ([#9184](prettier/prettier#9184) by [@agamkrbit](https://github.com/agamkrbit)) <!-- prettier-ignore --> ```scss // Input $display-breakpoints: map-deep-merge( ( "print-only": "only print", "screen-only": "only screen", "xs-only": "only screen and (max-width: #{map-get($grid-breakpoints, "sm")-1})", ), $display-breakpoints ); // Prettier 2.8.0 $display-breakpoints: map-deep-merge( ( "print-only": "only print", "screen-only": "only screen", "xs-only": "only screen and (max-width: #{map-get($grid-breakpoints, " sm ")-1})", ), $display-breakpoints ); // Prettier 2.8.1 $display-breakpoints: map-deep-merge( ( "print-only": "only print", "screen-only": "only screen", "xs-only": "only screen and (max-width: #{map-get($grid-breakpoints, "sm")-1})", ), $display-breakpoints ); ``` ##### Support auto accessors syntax ([#13919](prettier/prettier#13919) by [@sosukesuzuki](https://github.com/sosukesuzuki)) Support for [Auto Accessors Syntax](https://devblogs.microsoft.com/typescript/announcing-typescript-4-9/#auto-accessors-in-classes) landed in TypeScript 4.9. (Doesn't work well with `babel-ts` parser) <!-- prettier-ignore --> ```tsx class Foo { accessor foo: number = 3; } ``` ## [v2.8.0](https://github.com/prettier/prettier/blob/HEAD/CHANGELOG.md#280) [diff](prettier/prettier@2.7.1...2.8.0) 🔗 [Release Notes](https://prettier.io/blog/2022/11/23/2.8.0.html) ## [v2.7.1](https://github.com/prettier/prettier/blob/HEAD/CHANGELOG.md#271) [diff](prettier/prettier@2.7.0...2.7.1) ##### Keep useful empty lines in description ([#13013](prettier/prettier#13013) by [@chimurai](https://github.com/chimurai)) <!-- prettier-ignore --> ```graphql ```
| datasource | package | from | to | | ---------- | -------- | ----- | ----- | | npm | prettier | 2.7.0 | 2.8.8 | ## [v2.8.8](https://github.com/prettier/prettier/blob/HEAD/CHANGELOG.md#288) This version is a republished version of v2.8.7. A bad version was accidentally published and [it can't be unpublished](npm/cli#1686), apologies for the churn. ## [v2.8.7](https://github.com/prettier/prettier/blob/HEAD/CHANGELOG.md#287) [diff](prettier/prettier@2.8.6...2.8.7) ##### Allow multiple decorators on same getter/setter ([#14584](prettier/prettier#14584) by [@fisker](https://github.com/fisker)) <!-- prettier-ignore --> ```ts // Input class A { @decorator() get foo () {} @decorator() set foo (value) {} } // Prettier 2.8.6 SyntaxError: Decorators cannot be applied to multiple get/set accessors of the same name. (5:3) 3 | get foo () {} 4 | > 5 | @decorator() | ^^^^^^^^^^^^ 6 | set foo (value) {} 7 | } // Prettier 2.8.7 class A { @decorator() get foo() {} @decorator() set foo(value) {} } ``` ## [v2.8.6](https://github.com/prettier/prettier/blob/HEAD/CHANGELOG.md#286) [diff](prettier/prettier@2.8.5...2.8.6) ##### Allow decorators on private members and class expressions ([#14548](prettier/prettier#14548) by [@fisker](https://github.com/fisker)) <!-- prettier-ignore --> ```ts // Input class A { @decorator() #privateMethod () {} } // Prettier 2.8.5 SyntaxError: Decorators are not valid here. (2:3) 1 | class A { > 2 | @decorator() | ^^^^^^^^^^^^ 3 | #privateMethod () {} 4 | } // Prettier 2.8.6 class A { @decorator() #privateMethod() {} } ``` ## [v2.8.5](https://github.com/prettier/prettier/blob/HEAD/CHANGELOG.md#285) [diff](prettier/prettier@2.8.4...2.8.5) ##### Support TypeScript 5.0 ([#14391](prettier/prettier#14391) by [@fisker](https://github.com/fisker), [#13819](prettier/prettier#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](prettier/prettier#14393) by [@fisker](https://github.com/fisker)) <!-- prettier-ignore --> ```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](prettier/prettier#14458) by [@fisker](https://github.com/fisker)) <!-- prettier-ignore --> ```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](prettier/prettier#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). <!-- prettier-ignore --> ```html <!-- Input --> <div className='HelloWorld' title={`You are visitor number ${ num }`} onMouseOver={onMouseOver}/> <!-- Prettier 2.8.4 --> <div className="HelloWorld" title={`You are visitor number ${num}`} onMouseOver={onMouseOver} />; <!-- Prettier 2.8.5 --> <div className="HelloWorld" title={`You are visitor number ${num}`} onMouseOver={onMouseOver} />; ``` ## [v2.8.4](https://github.com/prettier/prettier/blob/HEAD/CHANGELOG.md#284) [diff](prettier/prettier@2.8.3...2.8.4) ##### Fix leading comments in mapped types with `readonly` ([#13427](prettier/prettier#13427) by [@thorn0](https://github.com/thorn0), [@sosukesuzuki](https://github.com/sosukesuzuki)) <!-- prettier-ignore --> ```tsx // Input type Type = { // comment readonly [key in Foo]; }; // Prettier 2.8.3 type Type = { readonly // comment [key in Foo]; }; // Prettier 2.8.4 type Type = { // comment readonly [key in Foo]; }; ``` ##### Group params in opening block statements ([#14067](prettier/prettier#14067) by [@jamescdavis](https://github.com/jamescdavis)) This is a follow-up to [#13930](prettier/prettier#13930) to establish wrapping consistency between opening block statements and else blocks by grouping params in opening blocks. This causes params to break to a new line together and not be split across lines unless the length of params exceeds the print width. This also updates the else block wrapping to behave exactly the same as opening blocks. <!-- prettier-ignore --> ```hbs {{! Input }} {{#block param param param param param param param param param param as |blockParam|}} Hello {{else block param param param param param param param param param param as |blockParam|}} There {{/block}} {{! Prettier 2.8.3 }} {{#block param param param param param param param param param param as |blockParam| }} Hello {{else block param param param param param param param param param param}} There {{/block}} {{! Prettier 2.8.4 }} {{#block param param param param param param param param param param as |blockParam| }} Hello {{else block param param param param param param param param param param as |blockParam| }} There {{/block}} ``` ##### Ignore files in `.sl/` ([#14206](prettier/prettier#14206) by [@bolinfest](https://github.com/bolinfest)) In [Sapling SCM](https://sapling-scm.com/), `.sl/` is the folder where it stores its state, analogous to `.git/` in Git. It should be ignored in Prettier like the other SCM folders. ##### Recognize `@satisfies` in Closure-style type casts ([#14262](prettier/prettier#14262) by [@fisker](https://github.com/fisker)) <!-- prettier-ignore --> ```jsx // Input const a = /** @Satisfies {Record<string, string>} */ ({hello: 1337}); const b = /** @type {Record<string, string>} */ ({hello: 1337}); // Prettier 2.8.3 const a = /** @Satisfies {Record<string, string>} */ { hello: 1337 }; const b = /** @type {Record<string, string>} */ ({ hello: 1337 }); // Prettier 2.8.4 const a = /** @Satisfies {Record<string, string>} */ ({hello: 1337}); const b = /** @type {Record<string, string>} */ ({hello: 1337}); ``` ##### Fix parens in inferred function return types with `extends` ([#14279](prettier/prettier#14279) by [@fisker](https://github.com/fisker)) <!-- prettier-ignore --> ```ts // Input type Foo<T> = T extends ((a) => a is infer R extends string) ? R : never; // Prettier 2.8.3 (First format) type Foo<T> = T extends (a) => a is infer R extends string ? R : never; // Prettier 2.8.3 (Second format) SyntaxError: '?' expected. // Prettier 2.8.4 type Foo<T> = T extends ((a) => a is infer R extends string) ? R : never; ``` ## [v2.8.3](https://github.com/prettier/prettier/blob/HEAD/CHANGELOG.md#283) [diff](prettier/prettier@2.8.2...2.8.3) ##### Allow self-closing tags on custom elements ([#14170](prettier/prettier#14170) by [@fisker](https://github.com/fisker)) See [Angular v15.1.0 release note](https://github.com/angular/angular/releases/tag/15.1.0) for details. <!-- prettier-ignore --> ```html // Input <app-test/> // Prettier 2.8.2 SyntaxError: Only void and foreign elements can be self closed "app-test" (1:1) > 1 | <app-test/> | ^^^^^^^^^ 2 | // Prettier 2.8.3 <app-test /> ``` ## [v2.8.2](https://github.com/prettier/prettier/blob/HEAD/CHANGELOG.md#282) [diff](prettier/prettier@2.8.1...2.8.2) ##### Don't lowercase link references ([#13155](prettier/prettier#13155) by [@DerekNonGeneric](https://github.com/DerekNonGeneric) & [@fisker](https://github.com/fisker)) <!-- prettier-ignore --> ```markdown <!-- Input --> We now don't strictly follow the release notes format suggested by [Keep a Changelog]. [Keep a Changelog]: https://example.com/ <!-- Prettier 2.8.1 --> We now don't strictly follow the release notes format suggested by [Keep a Changelog]. [keep a changelog]: https://example.com/ <!-- ^^^^^^^^^^^^^^^^^^ lowercased --> <!-- Prettier 2.8.2 --> <Same as input> ``` ##### Preserve self-closing tags ([#13691](prettier/prettier#13691) by [@dcyriller](https://github.com/dcyriller)) <!-- prettier-ignore --> ```hbs {{! Input }} <div /> <div></div> <custom-component /> <custom-component></custom-component> <i /> <i></i> <Component /> <Component></Component> {{! Prettier 2.8.1 }} <div></div> <div></div> <custom-component></custom-component> <custom-component></custom-component> <i></i> <i></i> <Component /> <Component /> {{! Prettier 2.8.2 }} <div /> <div></div> <custom-component /> <custom-component></custom-component> <i /> <i></i> <Component /> <Component /> ``` ##### Allow custom "else if"-like blocks with block params ([#13930](prettier/prettier#13930) by [@jamescdavis](https://github.com/jamescdavis)) [#13507](prettier/prettier#13507) added support for custom block keywords used with `else`, but failed to allow block params. This updates printer-glimmer to allow block params with custom "else if"-like blocks. <!-- prettier-ignore --> ```hbs {{! Input }} {{#when isAtWork as |work|}} Ship that {{work}}! {{else when isReading as |book|}} You can finish {{book}} eventually... {{else}} Go to bed! {{/when}} {{! Prettier 2.8.1 }} {{#when isAtWork as |work|}} Ship that {{work}}! {{else when isReading}} You can finish {{book}} eventually... {{else}} Go to bed! {{/when}} {{! Prettier 2.8.2 }} {{#when isAtWork as |work|}} Ship that {{work}}! {{else when isReading as |book|}} You can finish {{book}} eventually... {{else}} Go to bed! {{/when}} ``` ##### Preserve empty lines between nested SCSS maps ([#13931](prettier/prettier#13931) by [@jneander](https://github.com/jneander)) <!-- prettier-ignore --> ```scss /* Input */ $map: ( 'one': ( 'key': 'value', ), 'two': ( 'key': 'value', ), ) /* Prettier 2.8.1 */ $map: ( 'one': ( 'key': 'value', ), 'two': ( 'key': 'value', ), ) /* Prettier 2.8.2 */ $map: ( 'one': ( 'key': 'value', ), 'two': ( 'key': 'value', ), ) ``` ##### Fix missing parentheses when an expression statement starts with `let[` ([#14000](prettier/prettier#14000), [#14044](prettier/prettier#14044) by [@fisker](https://github.com/fisker), [@thorn0](https://github.com/thorn0)) <!-- prettier-ignore --> ```jsx // Input (let[0] = 2); // Prettier 2.8.1 let[0] = 2; // Prettier 2.8.1 (second format) SyntaxError: Unexpected token (1:5) > 1 | let[0] = 2; | ^ 2 | // Prettier 2.8.2 (let)[0] = 2; ``` ##### Fix semicolon duplicated at the end of LESS file ([#14007](prettier/prettier#14007) by [@mvorisek](https://github.com/mvorisek)) <!-- prettier-ignore --> ```less // Input @variable: { field: something; }; // Prettier 2.8.1 @variable: { field: something; }; ; // Prettier 2.8.2 @variable: { field: something; }; ``` ##### Fix no space after unary minus when followed by opening parenthesis in LESS ([#14008](prettier/prettier#14008) by [@mvorisek](https://github.com/mvorisek)) <!-- prettier-ignore --> ```less // Input .unary_minus_single { margin: -(@A); } .unary_minus_multi { margin: 0 -(@A); } .binary_minus { margin: 0 - (@A); } // Prettier 2.8.1 .unary_minus_single { margin: - (@A); } .unary_minus_multi { margin: 0 - (@A); } .binary_minus { margin: 0 - (@A); } // Prettier 2.8.2 .unary_minus_single { margin: -(@A); } .unary_minus_multi { margin: 0 -(@A); } .binary_minus { margin: 0 - (@A); } ``` ##### Do not change case of property name if inside a variable declaration in LESS ([#14034](prettier/prettier#14034) by [@mvorisek](https://github.com/mvorisek)) <!-- prettier-ignore --> ```less // Input @var: { preserveCase: 0; }; // Prettier 2.8.1 @var: { preservecase: 0; }; // Prettier 2.8.2 @var: { preserveCase: 0; }; ``` ##### Fix formatting for auto-accessors with comments ([#14038](prettier/prettier#14038) by [@fisker](https://github.com/fisker)) <!-- prettier-ignore --> ```jsx // Input class A { @dec() // comment accessor b; } // Prettier 2.8.1 class A { @dec() accessor // comment b; } // Prettier 2.8.1 (second format) class A { @dec() accessor; // comment b; } // Prettier 2.8.2 class A { @dec() // comment accessor b; } ``` ##### Add parentheses for TSTypeQuery to improve readability ([#14042](prettier/prettier#14042) by [@onishi-kohei](https://github.com/onishi-kohei)) <!-- prettier-ignore --> ```tsx // Input a as (typeof node.children)[number] a as (typeof node.children)[] a as ((typeof node.children)[number])[] // Prettier 2.8.1 a as typeof node.children[number]; a as typeof node.children[]; a as typeof node.children[number][]; // Prettier 2.8.2 a as (typeof node.children)[number]; a as (typeof node.children)[]; a as (typeof node.children)[number][]; ``` ##### Fix displacing of comments in default switch case ([#14047](prettier/prettier#14047) by [@thorn0](https://github.com/thorn0)) It was a regression in Prettier 2.6.0. <!-- prettier-ignore --> ```jsx // Input switch (state) { default: result = state; // no change break; } // Prettier 2.8.1 switch (state) { default: // no change result = state; break; } // Prettier 2.8.2 switch (state) { default: result = state; // no change break; } ``` ##### Support type annotations on auto accessors via `babel-ts` ([#14049](prettier/prettier#14049) by [@sosukesuzuki](https://github.com/sosukesuzuki)) [The bug that `@babel/parser` cannot parse auto accessors with type annotations](babel/babel#15205) has been fixed. So we now support it via `babel-ts` parser. <!-- prettier-ignore --> ```tsx class Foo { accessor prop: number; } ``` ##### Fix formatting of empty type parameters ([#14073](prettier/prettier#14073) by [@fisker](https://github.com/fisker)) <!-- prettier-ignore --> ```jsx // Input const foo: bar</* comment */> = () => baz; // Prettier 2.8.1 Error: Comment "comment" was not printed. Please report this error! // Prettier 2.8.2 const foo: bar</* comment */> = () => baz; ``` ##### Add parentheses to head of `ExpressionStatement` instead of the whole statement ([#14077](prettier/prettier#14077) by [@fisker](https://github.com/fisker)) <!-- prettier-ignore --> ```jsx // Input ({}).toString.call(foo) === "[object Array]" ? foo.forEach(iterateArray) : iterateObject(foo); // Prettier 2.8.1 ({}.toString.call(foo) === "[object Array]" ? foo.forEach(iterateArray) : iterateObject(foo)); // Prettier 2.8.2 ({}).toString.call(foo.forEach) === "[object Array]" ? foo.forEach(iterateArray) : iterateObject(foo); ``` ##### Fix comments after directive ([#14081](prettier/prettier#14081) by [@fisker](https://github.com/fisker)) <!-- prettier-ignore --> ```jsx // Input "use strict" /* comment */; // Prettier 2.8.1 (with other js parsers except `babel`) Error: Comment "comment" was not printed. Please report this error! // Prettier 2.8.2 <Same as input> ``` ##### Fix formatting for comments inside JSX attribute ([#14082](prettier/prettier#14082) by [@fisker](https://github.com/fisker)) <!-- prettier-ignore --> ```jsx // Input function MyFunctionComponent() { <button label=/*old*/"new">button</button> } // Prettier 2.8.1 Error: Comment "old" was not printed. Please report this error! // Prettier 2.8.2 function MyFunctionComponent() { <button label=/*old*/ "new">button</button>; } ``` ##### Quote numeric keys for json-stringify parser ([#14083](prettier/prettier#14083) by [@fisker](https://github.com/fisker)) <!-- prettier-ignore --> ```jsx // Input {0: 'value'} // Prettier 2.8.1 { 0: "value" } // Prettier 2.8.2 { "0": "value" } ``` ##### Fix removing commas from function arguments in maps ([#14089](prettier/prettier#14089) by [@sosukesuzuki](https://github.com/sosukesuzuki)) <!-- prettier-ignore --> ```scss /* Input */ $foo: map-fn( ( "#{prop}": inner-fn($first, $second), ) ); /* Prettier 2.8.1 */ $foo: map-fn(("#{prop}": inner-fn($first $second))); /* Prettier 2.8.2 */ $foo: map-fn( ( "#{prop}": inner-fn($first, $second), ) ); ``` ##### Do not insert space in LESS property access ([#14103](prettier/prettier#14103) by [@fisker](https://github.com/fisker)) <!-- prettier-ignore --> ```less // Input a { color: @Colors[@white]; } // Prettier 2.8.1 a { color: @Colors[ @white]; } // Prettier 2.8.2 <Same as input> ``` ## [v2.8.1](https://github.com/prettier/prettier/blob/HEAD/CHANGELOG.md#281) [diff](prettier/prettier@2.8.0...2.8.1) ##### Fix SCSS map in arguments ([#9184](prettier/prettier#9184) by [@agamkrbit](https://github.com/agamkrbit)) <!-- prettier-ignore --> ```scss // Input $display-breakpoints: map-deep-merge( ( "print-only": "only print", "screen-only": "only screen", "xs-only": "only screen and (max-width: #{map-get($grid-breakpoints, "sm")-1})", ), $display-breakpoints ); // Prettier 2.8.0 $display-breakpoints: map-deep-merge( ( "print-only": "only print", "screen-only": "only screen", "xs-only": "only screen and (max-width: #{map-get($grid-breakpoints, " sm ")-1})", ), $display-breakpoints ); // Prettier 2.8.1 $display-breakpoints: map-deep-merge( ( "print-only": "only print", "screen-only": "only screen", "xs-only": "only screen and (max-width: #{map-get($grid-breakpoints, "sm")-1})", ), $display-breakpoints ); ``` ##### Support auto accessors syntax ([#13919](prettier/prettier#13919) by [@sosukesuzuki](https://github.com/sosukesuzuki)) Support for [Auto Accessors Syntax](https://devblogs.microsoft.com/typescript/announcing-typescript-4-9/#auto-accessors-in-classes) landed in TypeScript 4.9. (Doesn't work well with `babel-ts` parser) <!-- prettier-ignore --> ```tsx class Foo { accessor foo: number = 3; } ``` ## [v2.8.0](https://github.com/prettier/prettier/blob/HEAD/CHANGELOG.md#280) [diff](prettier/prettier@2.7.1...2.8.0) 🔗 [Release Notes](https://prettier.io/blog/2022/11/23/2.8.0.html) ## [v2.7.1](https://github.com/prettier/prettier/blob/HEAD/CHANGELOG.md#271) [diff](prettier/prettier@2.7.0...2.7.1) ##### Keep useful empty lines in description ([#13013](prettier/prettier#13013) by [@chimurai](https://github.com/chimurai)) <!-- prettier-ignore --> ```graphql ```
| datasource | package | from | to | | ---------- | -------- | ----- | ----- | | npm | prettier | 2.7.0 | 2.8.8 | ## [v2.8.8](https://github.com/prettier/prettier/blob/HEAD/CHANGELOG.md#288) This version is a republished version of v2.8.7. A bad version was accidentally published and [it can't be unpublished](npm/cli#1686), apologies for the churn. ## [v2.8.7](https://github.com/prettier/prettier/blob/HEAD/CHANGELOG.md#287) [diff](prettier/prettier@2.8.6...2.8.7) ##### Allow multiple decorators on same getter/setter ([#14584](prettier/prettier#14584) by [@fisker](https://github.com/fisker)) <!-- prettier-ignore --> ```ts // Input class A { @decorator() get foo () {} @decorator() set foo (value) {} } // Prettier 2.8.6 SyntaxError: Decorators cannot be applied to multiple get/set accessors of the same name. (5:3) 3 | get foo () {} 4 | > 5 | @decorator() | ^^^^^^^^^^^^ 6 | set foo (value) {} 7 | } // Prettier 2.8.7 class A { @decorator() get foo() {} @decorator() set foo(value) {} } ``` ## [v2.8.6](https://github.com/prettier/prettier/blob/HEAD/CHANGELOG.md#286) [diff](prettier/prettier@2.8.5...2.8.6) ##### Allow decorators on private members and class expressions ([#14548](prettier/prettier#14548) by [@fisker](https://github.com/fisker)) <!-- prettier-ignore --> ```ts // Input class A { @decorator() #privateMethod () {} } // Prettier 2.8.5 SyntaxError: Decorators are not valid here. (2:3) 1 | class A { > 2 | @decorator() | ^^^^^^^^^^^^ 3 | #privateMethod () {} 4 | } // Prettier 2.8.6 class A { @decorator() #privateMethod() {} } ``` ## [v2.8.5](https://github.com/prettier/prettier/blob/HEAD/CHANGELOG.md#285) [diff](prettier/prettier@2.8.4...2.8.5) ##### Support TypeScript 5.0 ([#14391](prettier/prettier#14391) by [@fisker](https://github.com/fisker), [#13819](prettier/prettier#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](prettier/prettier#14393) by [@fisker](https://github.com/fisker)) <!-- prettier-ignore --> ```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](prettier/prettier#14458) by [@fisker](https://github.com/fisker)) <!-- prettier-ignore --> ```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](prettier/prettier#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). <!-- prettier-ignore --> ```html <!-- Input --> <div className='HelloWorld' title={`You are visitor number ${ num }`} onMouseOver={onMouseOver}/> <!-- Prettier 2.8.4 --> <div className="HelloWorld" title={`You are visitor number ${num}`} onMouseOver={onMouseOver} />; <!-- Prettier 2.8.5 --> <div className="HelloWorld" title={`You are visitor number ${num}`} onMouseOver={onMouseOver} />; ``` ## [v2.8.4](https://github.com/prettier/prettier/blob/HEAD/CHANGELOG.md#284) [diff](prettier/prettier@2.8.3...2.8.4) ##### Fix leading comments in mapped types with `readonly` ([#13427](prettier/prettier#13427) by [@thorn0](https://github.com/thorn0), [@sosukesuzuki](https://github.com/sosukesuzuki)) <!-- prettier-ignore --> ```tsx // Input type Type = { // comment readonly [key in Foo]; }; // Prettier 2.8.3 type Type = { readonly // comment [key in Foo]; }; // Prettier 2.8.4 type Type = { // comment readonly [key in Foo]; }; ``` ##### Group params in opening block statements ([#14067](prettier/prettier#14067) by [@jamescdavis](https://github.com/jamescdavis)) This is a follow-up to [#13930](prettier/prettier#13930) to establish wrapping consistency between opening block statements and else blocks by grouping params in opening blocks. This causes params to break to a new line together and not be split across lines unless the length of params exceeds the print width. This also updates the else block wrapping to behave exactly the same as opening blocks. <!-- prettier-ignore --> ```hbs {{! Input }} {{#block param param param param param param param param param param as |blockParam|}} Hello {{else block param param param param param param param param param param as |blockParam|}} There {{/block}} {{! Prettier 2.8.3 }} {{#block param param param param param param param param param param as |blockParam| }} Hello {{else block param param param param param param param param param param}} There {{/block}} {{! Prettier 2.8.4 }} {{#block param param param param param param param param param param as |blockParam| }} Hello {{else block param param param param param param param param param param as |blockParam| }} There {{/block}} ``` ##### Ignore files in `.sl/` ([#14206](prettier/prettier#14206) by [@bolinfest](https://github.com/bolinfest)) In [Sapling SCM](https://sapling-scm.com/), `.sl/` is the folder where it stores its state, analogous to `.git/` in Git. It should be ignored in Prettier like the other SCM folders. ##### Recognize `@satisfies` in Closure-style type casts ([#14262](prettier/prettier#14262) by [@fisker](https://github.com/fisker)) <!-- prettier-ignore --> ```jsx // Input const a = /** @Satisfies {Record<string, string>} */ ({hello: 1337}); const b = /** @type {Record<string, string>} */ ({hello: 1337}); // Prettier 2.8.3 const a = /** @Satisfies {Record<string, string>} */ { hello: 1337 }; const b = /** @type {Record<string, string>} */ ({ hello: 1337 }); // Prettier 2.8.4 const a = /** @Satisfies {Record<string, string>} */ ({hello: 1337}); const b = /** @type {Record<string, string>} */ ({hello: 1337}); ``` ##### Fix parens in inferred function return types with `extends` ([#14279](prettier/prettier#14279) by [@fisker](https://github.com/fisker)) <!-- prettier-ignore --> ```ts // Input type Foo<T> = T extends ((a) => a is infer R extends string) ? R : never; // Prettier 2.8.3 (First format) type Foo<T> = T extends (a) => a is infer R extends string ? R : never; // Prettier 2.8.3 (Second format) SyntaxError: '?' expected. // Prettier 2.8.4 type Foo<T> = T extends ((a) => a is infer R extends string) ? R : never; ``` ## [v2.8.3](https://github.com/prettier/prettier/blob/HEAD/CHANGELOG.md#283) [diff](prettier/prettier@2.8.2...2.8.3) ##### Allow self-closing tags on custom elements ([#14170](prettier/prettier#14170) by [@fisker](https://github.com/fisker)) See [Angular v15.1.0 release note](https://github.com/angular/angular/releases/tag/15.1.0) for details. <!-- prettier-ignore --> ```html // Input <app-test/> // Prettier 2.8.2 SyntaxError: Only void and foreign elements can be self closed "app-test" (1:1) > 1 | <app-test/> | ^^^^^^^^^ 2 | // Prettier 2.8.3 <app-test /> ``` ## [v2.8.2](https://github.com/prettier/prettier/blob/HEAD/CHANGELOG.md#282) [diff](prettier/prettier@2.8.1...2.8.2) ##### Don't lowercase link references ([#13155](prettier/prettier#13155) by [@DerekNonGeneric](https://github.com/DerekNonGeneric) & [@fisker](https://github.com/fisker)) <!-- prettier-ignore --> ```markdown <!-- Input --> We now don't strictly follow the release notes format suggested by [Keep a Changelog]. [Keep a Changelog]: https://example.com/ <!-- Prettier 2.8.1 --> We now don't strictly follow the release notes format suggested by [Keep a Changelog]. [keep a changelog]: https://example.com/ <!-- ^^^^^^^^^^^^^^^^^^ lowercased --> <!-- Prettier 2.8.2 --> <Same as input> ``` ##### Preserve self-closing tags ([#13691](prettier/prettier#13691) by [@dcyriller](https://github.com/dcyriller)) <!-- prettier-ignore --> ```hbs {{! Input }} <div /> <div></div> <custom-component /> <custom-component></custom-component> <i /> <i></i> <Component /> <Component></Component> {{! Prettier 2.8.1 }} <div></div> <div></div> <custom-component></custom-component> <custom-component></custom-component> <i></i> <i></i> <Component /> <Component /> {{! Prettier 2.8.2 }} <div /> <div></div> <custom-component /> <custom-component></custom-component> <i /> <i></i> <Component /> <Component /> ``` ##### Allow custom "else if"-like blocks with block params ([#13930](prettier/prettier#13930) by [@jamescdavis](https://github.com/jamescdavis)) [#13507](prettier/prettier#13507) added support for custom block keywords used with `else`, but failed to allow block params. This updates printer-glimmer to allow block params with custom "else if"-like blocks. <!-- prettier-ignore --> ```hbs {{! Input }} {{#when isAtWork as |work|}} Ship that {{work}}! {{else when isReading as |book|}} You can finish {{book}} eventually... {{else}} Go to bed! {{/when}} {{! Prettier 2.8.1 }} {{#when isAtWork as |work|}} Ship that {{work}}! {{else when isReading}} You can finish {{book}} eventually... {{else}} Go to bed! {{/when}} {{! Prettier 2.8.2 }} {{#when isAtWork as |work|}} Ship that {{work}}! {{else when isReading as |book|}} You can finish {{book}} eventually... {{else}} Go to bed! {{/when}} ``` ##### Preserve empty lines between nested SCSS maps ([#13931](prettier/prettier#13931) by [@jneander](https://github.com/jneander)) <!-- prettier-ignore --> ```scss /* Input */ $map: ( 'one': ( 'key': 'value', ), 'two': ( 'key': 'value', ), ) /* Prettier 2.8.1 */ $map: ( 'one': ( 'key': 'value', ), 'two': ( 'key': 'value', ), ) /* Prettier 2.8.2 */ $map: ( 'one': ( 'key': 'value', ), 'two': ( 'key': 'value', ), ) ``` ##### Fix missing parentheses when an expression statement starts with `let[` ([#14000](prettier/prettier#14000), [#14044](prettier/prettier#14044) by [@fisker](https://github.com/fisker), [@thorn0](https://github.com/thorn0)) <!-- prettier-ignore --> ```jsx // Input (let[0] = 2); // Prettier 2.8.1 let[0] = 2; // Prettier 2.8.1 (second format) SyntaxError: Unexpected token (1:5) > 1 | let[0] = 2; | ^ 2 | // Prettier 2.8.2 (let)[0] = 2; ``` ##### Fix semicolon duplicated at the end of LESS file ([#14007](prettier/prettier#14007) by [@mvorisek](https://github.com/mvorisek)) <!-- prettier-ignore --> ```less // Input @variable: { field: something; }; // Prettier 2.8.1 @variable: { field: something; }; ; // Prettier 2.8.2 @variable: { field: something; }; ``` ##### Fix no space after unary minus when followed by opening parenthesis in LESS ([#14008](prettier/prettier#14008) by [@mvorisek](https://github.com/mvorisek)) <!-- prettier-ignore --> ```less // Input .unary_minus_single { margin: -(@A); } .unary_minus_multi { margin: 0 -(@A); } .binary_minus { margin: 0 - (@A); } // Prettier 2.8.1 .unary_minus_single { margin: - (@A); } .unary_minus_multi { margin: 0 - (@A); } .binary_minus { margin: 0 - (@A); } // Prettier 2.8.2 .unary_minus_single { margin: -(@A); } .unary_minus_multi { margin: 0 -(@A); } .binary_minus { margin: 0 - (@A); } ``` ##### Do not change case of property name if inside a variable declaration in LESS ([#14034](prettier/prettier#14034) by [@mvorisek](https://github.com/mvorisek)) <!-- prettier-ignore --> ```less // Input @var: { preserveCase: 0; }; // Prettier 2.8.1 @var: { preservecase: 0; }; // Prettier 2.8.2 @var: { preserveCase: 0; }; ``` ##### Fix formatting for auto-accessors with comments ([#14038](prettier/prettier#14038) by [@fisker](https://github.com/fisker)) <!-- prettier-ignore --> ```jsx // Input class A { @dec() // comment accessor b; } // Prettier 2.8.1 class A { @dec() accessor // comment b; } // Prettier 2.8.1 (second format) class A { @dec() accessor; // comment b; } // Prettier 2.8.2 class A { @dec() // comment accessor b; } ``` ##### Add parentheses for TSTypeQuery to improve readability ([#14042](prettier/prettier#14042) by [@onishi-kohei](https://github.com/onishi-kohei)) <!-- prettier-ignore --> ```tsx // Input a as (typeof node.children)[number] a as (typeof node.children)[] a as ((typeof node.children)[number])[] // Prettier 2.8.1 a as typeof node.children[number]; a as typeof node.children[]; a as typeof node.children[number][]; // Prettier 2.8.2 a as (typeof node.children)[number]; a as (typeof node.children)[]; a as (typeof node.children)[number][]; ``` ##### Fix displacing of comments in default switch case ([#14047](prettier/prettier#14047) by [@thorn0](https://github.com/thorn0)) It was a regression in Prettier 2.6.0. <!-- prettier-ignore --> ```jsx // Input switch (state) { default: result = state; // no change break; } // Prettier 2.8.1 switch (state) { default: // no change result = state; break; } // Prettier 2.8.2 switch (state) { default: result = state; // no change break; } ``` ##### Support type annotations on auto accessors via `babel-ts` ([#14049](prettier/prettier#14049) by [@sosukesuzuki](https://github.com/sosukesuzuki)) [The bug that `@babel/parser` cannot parse auto accessors with type annotations](babel/babel#15205) has been fixed. So we now support it via `babel-ts` parser. <!-- prettier-ignore --> ```tsx class Foo { accessor prop: number; } ``` ##### Fix formatting of empty type parameters ([#14073](prettier/prettier#14073) by [@fisker](https://github.com/fisker)) <!-- prettier-ignore --> ```jsx // Input const foo: bar</* comment */> = () => baz; // Prettier 2.8.1 Error: Comment "comment" was not printed. Please report this error! // Prettier 2.8.2 const foo: bar</* comment */> = () => baz; ``` ##### Add parentheses to head of `ExpressionStatement` instead of the whole statement ([#14077](prettier/prettier#14077) by [@fisker](https://github.com/fisker)) <!-- prettier-ignore --> ```jsx // Input ({}).toString.call(foo) === "[object Array]" ? foo.forEach(iterateArray) : iterateObject(foo); // Prettier 2.8.1 ({}.toString.call(foo) === "[object Array]" ? foo.forEach(iterateArray) : iterateObject(foo)); // Prettier 2.8.2 ({}).toString.call(foo.forEach) === "[object Array]" ? foo.forEach(iterateArray) : iterateObject(foo); ``` ##### Fix comments after directive ([#14081](prettier/prettier#14081) by [@fisker](https://github.com/fisker)) <!-- prettier-ignore --> ```jsx // Input "use strict" /* comment */; // Prettier 2.8.1 (with other js parsers except `babel`) Error: Comment "comment" was not printed. Please report this error! // Prettier 2.8.2 <Same as input> ``` ##### Fix formatting for comments inside JSX attribute ([#14082](prettier/prettier#14082) by [@fisker](https://github.com/fisker)) <!-- prettier-ignore --> ```jsx // Input function MyFunctionComponent() { <button label=/*old*/"new">button</button> } // Prettier 2.8.1 Error: Comment "old" was not printed. Please report this error! // Prettier 2.8.2 function MyFunctionComponent() { <button label=/*old*/ "new">button</button>; } ``` ##### Quote numeric keys for json-stringify parser ([#14083](prettier/prettier#14083) by [@fisker](https://github.com/fisker)) <!-- prettier-ignore --> ```jsx // Input {0: 'value'} // Prettier 2.8.1 { 0: "value" } // Prettier 2.8.2 { "0": "value" } ``` ##### Fix removing commas from function arguments in maps ([#14089](prettier/prettier#14089) by [@sosukesuzuki](https://github.com/sosukesuzuki)) <!-- prettier-ignore --> ```scss /* Input */ $foo: map-fn( ( "#{prop}": inner-fn($first, $second), ) ); /* Prettier 2.8.1 */ $foo: map-fn(("#{prop}": inner-fn($first $second))); /* Prettier 2.8.2 */ $foo: map-fn( ( "#{prop}": inner-fn($first, $second), ) ); ``` ##### Do not insert space in LESS property access ([#14103](prettier/prettier#14103) by [@fisker](https://github.com/fisker)) <!-- prettier-ignore --> ```less // Input a { color: @Colors[@white]; } // Prettier 2.8.1 a { color: @Colors[ @white]; } // Prettier 2.8.2 <Same as input> ``` ## [v2.8.1](https://github.com/prettier/prettier/blob/HEAD/CHANGELOG.md#281) [diff](prettier/prettier@2.8.0...2.8.1) ##### Fix SCSS map in arguments ([#9184](prettier/prettier#9184) by [@agamkrbit](https://github.com/agamkrbit)) <!-- prettier-ignore --> ```scss // Input $display-breakpoints: map-deep-merge( ( "print-only": "only print", "screen-only": "only screen", "xs-only": "only screen and (max-width: #{map-get($grid-breakpoints, "sm")-1})", ), $display-breakpoints ); // Prettier 2.8.0 $display-breakpoints: map-deep-merge( ( "print-only": "only print", "screen-only": "only screen", "xs-only": "only screen and (max-width: #{map-get($grid-breakpoints, " sm ")-1})", ), $display-breakpoints ); // Prettier 2.8.1 $display-breakpoints: map-deep-merge( ( "print-only": "only print", "screen-only": "only screen", "xs-only": "only screen and (max-width: #{map-get($grid-breakpoints, "sm")-1})", ), $display-breakpoints ); ``` ##### Support auto accessors syntax ([#13919](prettier/prettier#13919) by [@sosukesuzuki](https://github.com/sosukesuzuki)) Support for [Auto Accessors Syntax](https://devblogs.microsoft.com/typescript/announcing-typescript-4-9/#auto-accessors-in-classes) landed in TypeScript 4.9. (Doesn't work well with `babel-ts` parser) <!-- prettier-ignore --> ```tsx class Foo { accessor foo: number = 3; } ``` ## [v2.8.0](https://github.com/prettier/prettier/blob/HEAD/CHANGELOG.md#280) [diff](prettier/prettier@2.7.1...2.8.0) 🔗 [Release Notes](https://prettier.io/blog/2022/11/23/2.8.0.html) ## [v2.7.1](https://github.com/prettier/prettier/blob/HEAD/CHANGELOG.md#271) [diff](prettier/prettier@2.7.0...2.7.1) ##### Keep useful empty lines in description ([#13013](prettier/prettier#13013) by [@chimurai](https://github.com/chimurai)) <!-- prettier-ignore --> ```graphql ```
| datasource | package | from | to | | ---------- | -------- | ----- | ----- | | npm | prettier | 2.7.0 | 2.8.8 | ## [v2.8.8](https://github.com/prettier/prettier/blob/HEAD/CHANGELOG.md#288) This version is a republished version of v2.8.7. A bad version was accidentally published and [it can't be unpublished](npm/cli#1686), apologies for the churn. ## [v2.8.7](https://github.com/prettier/prettier/blob/HEAD/CHANGELOG.md#287) [diff](prettier/prettier@2.8.6...2.8.7) ##### Allow multiple decorators on same getter/setter ([#14584](prettier/prettier#14584) by [@fisker](https://github.com/fisker)) <!-- prettier-ignore --> ```ts // Input class A { @decorator() get foo () {} @decorator() set foo (value) {} } // Prettier 2.8.6 SyntaxError: Decorators cannot be applied to multiple get/set accessors of the same name. (5:3) 3 | get foo () {} 4 | > 5 | @decorator() | ^^^^^^^^^^^^ 6 | set foo (value) {} 7 | } // Prettier 2.8.7 class A { @decorator() get foo() {} @decorator() set foo(value) {} } ``` ## [v2.8.6](https://github.com/prettier/prettier/blob/HEAD/CHANGELOG.md#286) [diff](prettier/prettier@2.8.5...2.8.6) ##### Allow decorators on private members and class expressions ([#14548](prettier/prettier#14548) by [@fisker](https://github.com/fisker)) <!-- prettier-ignore --> ```ts // Input class A { @decorator() #privateMethod () {} } // Prettier 2.8.5 SyntaxError: Decorators are not valid here. (2:3) 1 | class A { > 2 | @decorator() | ^^^^^^^^^^^^ 3 | #privateMethod () {} 4 | } // Prettier 2.8.6 class A { @decorator() #privateMethod() {} } ``` ## [v2.8.5](https://github.com/prettier/prettier/blob/HEAD/CHANGELOG.md#285) [diff](prettier/prettier@2.8.4...2.8.5) ##### Support TypeScript 5.0 ([#14391](prettier/prettier#14391) by [@fisker](https://github.com/fisker), [#13819](prettier/prettier#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](prettier/prettier#14393) by [@fisker](https://github.com/fisker)) <!-- prettier-ignore --> ```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](prettier/prettier#14458) by [@fisker](https://github.com/fisker)) <!-- prettier-ignore --> ```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](prettier/prettier#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). <!-- prettier-ignore --> ```html <!-- Input --> <div className='HelloWorld' title={`You are visitor number ${ num }`} onMouseOver={onMouseOver}/> <!-- Prettier 2.8.4 --> <div className="HelloWorld" title={`You are visitor number ${num}`} onMouseOver={onMouseOver} />; <!-- Prettier 2.8.5 --> <div className="HelloWorld" title={`You are visitor number ${num}`} onMouseOver={onMouseOver} />; ``` ## [v2.8.4](https://github.com/prettier/prettier/blob/HEAD/CHANGELOG.md#284) [diff](prettier/prettier@2.8.3...2.8.4) ##### Fix leading comments in mapped types with `readonly` ([#13427](prettier/prettier#13427) by [@thorn0](https://github.com/thorn0), [@sosukesuzuki](https://github.com/sosukesuzuki)) <!-- prettier-ignore --> ```tsx // Input type Type = { // comment readonly [key in Foo]; }; // Prettier 2.8.3 type Type = { readonly // comment [key in Foo]; }; // Prettier 2.8.4 type Type = { // comment readonly [key in Foo]; }; ``` ##### Group params in opening block statements ([#14067](prettier/prettier#14067) by [@jamescdavis](https://github.com/jamescdavis)) This is a follow-up to [#13930](prettier/prettier#13930) to establish wrapping consistency between opening block statements and else blocks by grouping params in opening blocks. This causes params to break to a new line together and not be split across lines unless the length of params exceeds the print width. This also updates the else block wrapping to behave exactly the same as opening blocks. <!-- prettier-ignore --> ```hbs {{! Input }} {{#block param param param param param param param param param param as |blockParam|}} Hello {{else block param param param param param param param param param param as |blockParam|}} There {{/block}} {{! Prettier 2.8.3 }} {{#block param param param param param param param param param param as |blockParam| }} Hello {{else block param param param param param param param param param param}} There {{/block}} {{! Prettier 2.8.4 }} {{#block param param param param param param param param param param as |blockParam| }} Hello {{else block param param param param param param param param param param as |blockParam| }} There {{/block}} ``` ##### Ignore files in `.sl/` ([#14206](prettier/prettier#14206) by [@bolinfest](https://github.com/bolinfest)) In [Sapling SCM](https://sapling-scm.com/), `.sl/` is the folder where it stores its state, analogous to `.git/` in Git. It should be ignored in Prettier like the other SCM folders. ##### Recognize `@satisfies` in Closure-style type casts ([#14262](prettier/prettier#14262) by [@fisker](https://github.com/fisker)) <!-- prettier-ignore --> ```jsx // Input const a = /** @Satisfies {Record<string, string>} */ ({hello: 1337}); const b = /** @type {Record<string, string>} */ ({hello: 1337}); // Prettier 2.8.3 const a = /** @Satisfies {Record<string, string>} */ { hello: 1337 }; const b = /** @type {Record<string, string>} */ ({ hello: 1337 }); // Prettier 2.8.4 const a = /** @Satisfies {Record<string, string>} */ ({hello: 1337}); const b = /** @type {Record<string, string>} */ ({hello: 1337}); ``` ##### Fix parens in inferred function return types with `extends` ([#14279](prettier/prettier#14279) by [@fisker](https://github.com/fisker)) <!-- prettier-ignore --> ```ts // Input type Foo<T> = T extends ((a) => a is infer R extends string) ? R : never; // Prettier 2.8.3 (First format) type Foo<T> = T extends (a) => a is infer R extends string ? R : never; // Prettier 2.8.3 (Second format) SyntaxError: '?' expected. // Prettier 2.8.4 type Foo<T> = T extends ((a) => a is infer R extends string) ? R : never; ``` ## [v2.8.3](https://github.com/prettier/prettier/blob/HEAD/CHANGELOG.md#283) [diff](prettier/prettier@2.8.2...2.8.3) ##### Allow self-closing tags on custom elements ([#14170](prettier/prettier#14170) by [@fisker](https://github.com/fisker)) See [Angular v15.1.0 release note](https://github.com/angular/angular/releases/tag/15.1.0) for details. <!-- prettier-ignore --> ```html // Input <app-test/> // Prettier 2.8.2 SyntaxError: Only void and foreign elements can be self closed "app-test" (1:1) > 1 | <app-test/> | ^^^^^^^^^ 2 | // Prettier 2.8.3 <app-test /> ``` ## [v2.8.2](https://github.com/prettier/prettier/blob/HEAD/CHANGELOG.md#282) [diff](prettier/prettier@2.8.1...2.8.2) ##### Don't lowercase link references ([#13155](prettier/prettier#13155) by [@DerekNonGeneric](https://github.com/DerekNonGeneric) & [@fisker](https://github.com/fisker)) <!-- prettier-ignore --> ```markdown <!-- Input --> We now don't strictly follow the release notes format suggested by [Keep a Changelog]. [Keep a Changelog]: https://example.com/ <!-- Prettier 2.8.1 --> We now don't strictly follow the release notes format suggested by [Keep a Changelog]. [keep a changelog]: https://example.com/ <!-- ^^^^^^^^^^^^^^^^^^ lowercased --> <!-- Prettier 2.8.2 --> <Same as input> ``` ##### Preserve self-closing tags ([#13691](prettier/prettier#13691) by [@dcyriller](https://github.com/dcyriller)) <!-- prettier-ignore --> ```hbs {{! Input }} <div /> <div></div> <custom-component /> <custom-component></custom-component> <i /> <i></i> <Component /> <Component></Component> {{! Prettier 2.8.1 }} <div></div> <div></div> <custom-component></custom-component> <custom-component></custom-component> <i></i> <i></i> <Component /> <Component /> {{! Prettier 2.8.2 }} <div /> <div></div> <custom-component /> <custom-component></custom-component> <i /> <i></i> <Component /> <Component /> ``` ##### Allow custom "else if"-like blocks with block params ([#13930](prettier/prettier#13930) by [@jamescdavis](https://github.com/jamescdavis)) [#13507](prettier/prettier#13507) added support for custom block keywords used with `else`, but failed to allow block params. This updates printer-glimmer to allow block params with custom "else if"-like blocks. <!-- prettier-ignore --> ```hbs {{! Input }} {{#when isAtWork as |work|}} Ship that {{work}}! {{else when isReading as |book|}} You can finish {{book}} eventually... {{else}} Go to bed! {{/when}} {{! Prettier 2.8.1 }} {{#when isAtWork as |work|}} Ship that {{work}}! {{else when isReading}} You can finish {{book}} eventually... {{else}} Go to bed! {{/when}} {{! Prettier 2.8.2 }} {{#when isAtWork as |work|}} Ship that {{work}}! {{else when isReading as |book|}} You can finish {{book}} eventually... {{else}} Go to bed! {{/when}} ``` ##### Preserve empty lines between nested SCSS maps ([#13931](prettier/prettier#13931) by [@jneander](https://github.com/jneander)) <!-- prettier-ignore --> ```scss /* Input */ $map: ( 'one': ( 'key': 'value', ), 'two': ( 'key': 'value', ), ) /* Prettier 2.8.1 */ $map: ( 'one': ( 'key': 'value', ), 'two': ( 'key': 'value', ), ) /* Prettier 2.8.2 */ $map: ( 'one': ( 'key': 'value', ), 'two': ( 'key': 'value', ), ) ``` ##### Fix missing parentheses when an expression statement starts with `let[` ([#14000](prettier/prettier#14000), [#14044](prettier/prettier#14044) by [@fisker](https://github.com/fisker), [@thorn0](https://github.com/thorn0)) <!-- prettier-ignore --> ```jsx // Input (let[0] = 2); // Prettier 2.8.1 let[0] = 2; // Prettier 2.8.1 (second format) SyntaxError: Unexpected token (1:5) > 1 | let[0] = 2; | ^ 2 | // Prettier 2.8.2 (let)[0] = 2; ``` ##### Fix semicolon duplicated at the end of LESS file ([#14007](prettier/prettier#14007) by [@mvorisek](https://github.com/mvorisek)) <!-- prettier-ignore --> ```less // Input @variable: { field: something; }; // Prettier 2.8.1 @variable: { field: something; }; ; // Prettier 2.8.2 @variable: { field: something; }; ``` ##### Fix no space after unary minus when followed by opening parenthesis in LESS ([#14008](prettier/prettier#14008) by [@mvorisek](https://github.com/mvorisek)) <!-- prettier-ignore --> ```less // Input .unary_minus_single { margin: -(@A); } .unary_minus_multi { margin: 0 -(@A); } .binary_minus { margin: 0 - (@A); } // Prettier 2.8.1 .unary_minus_single { margin: - (@A); } .unary_minus_multi { margin: 0 - (@A); } .binary_minus { margin: 0 - (@A); } // Prettier 2.8.2 .unary_minus_single { margin: -(@A); } .unary_minus_multi { margin: 0 -(@A); } .binary_minus { margin: 0 - (@A); } ``` ##### Do not change case of property name if inside a variable declaration in LESS ([#14034](prettier/prettier#14034) by [@mvorisek](https://github.com/mvorisek)) <!-- prettier-ignore --> ```less // Input @var: { preserveCase: 0; }; // Prettier 2.8.1 @var: { preservecase: 0; }; // Prettier 2.8.2 @var: { preserveCase: 0; }; ``` ##### Fix formatting for auto-accessors with comments ([#14038](prettier/prettier#14038) by [@fisker](https://github.com/fisker)) <!-- prettier-ignore --> ```jsx // Input class A { @dec() // comment accessor b; } // Prettier 2.8.1 class A { @dec() accessor // comment b; } // Prettier 2.8.1 (second format) class A { @dec() accessor; // comment b; } // Prettier 2.8.2 class A { @dec() // comment accessor b; } ``` ##### Add parentheses for TSTypeQuery to improve readability ([#14042](prettier/prettier#14042) by [@onishi-kohei](https://github.com/onishi-kohei)) <!-- prettier-ignore --> ```tsx // Input a as (typeof node.children)[number] a as (typeof node.children)[] a as ((typeof node.children)[number])[] // Prettier 2.8.1 a as typeof node.children[number]; a as typeof node.children[]; a as typeof node.children[number][]; // Prettier 2.8.2 a as (typeof node.children)[number]; a as (typeof node.children)[]; a as (typeof node.children)[number][]; ``` ##### Fix displacing of comments in default switch case ([#14047](prettier/prettier#14047) by [@thorn0](https://github.com/thorn0)) It was a regression in Prettier 2.6.0. <!-- prettier-ignore --> ```jsx // Input switch (state) { default: result = state; // no change break; } // Prettier 2.8.1 switch (state) { default: // no change result = state; break; } // Prettier 2.8.2 switch (state) { default: result = state; // no change break; } ``` ##### Support type annotations on auto accessors via `babel-ts` ([#14049](prettier/prettier#14049) by [@sosukesuzuki](https://github.com/sosukesuzuki)) [The bug that `@babel/parser` cannot parse auto accessors with type annotations](babel/babel#15205) has been fixed. So we now support it via `babel-ts` parser. <!-- prettier-ignore --> ```tsx class Foo { accessor prop: number; } ``` ##### Fix formatting of empty type parameters ([#14073](prettier/prettier#14073) by [@fisker](https://github.com/fisker)) <!-- prettier-ignore --> ```jsx // Input const foo: bar</* comment */> = () => baz; // Prettier 2.8.1 Error: Comment "comment" was not printed. Please report this error! // Prettier 2.8.2 const foo: bar</* comment */> = () => baz; ``` ##### Add parentheses to head of `ExpressionStatement` instead of the whole statement ([#14077](prettier/prettier#14077) by [@fisker](https://github.com/fisker)) <!-- prettier-ignore --> ```jsx // Input ({}).toString.call(foo) === "[object Array]" ? foo.forEach(iterateArray) : iterateObject(foo); // Prettier 2.8.1 ({}.toString.call(foo) === "[object Array]" ? foo.forEach(iterateArray) : iterateObject(foo)); // Prettier 2.8.2 ({}).toString.call(foo.forEach) === "[object Array]" ? foo.forEach(iterateArray) : iterateObject(foo); ``` ##### Fix comments after directive ([#14081](prettier/prettier#14081) by [@fisker](https://github.com/fisker)) <!-- prettier-ignore --> ```jsx // Input "use strict" /* comment */; // Prettier 2.8.1 (with other js parsers except `babel`) Error: Comment "comment" was not printed. Please report this error! // Prettier 2.8.2 <Same as input> ``` ##### Fix formatting for comments inside JSX attribute ([#14082](prettier/prettier#14082) by [@fisker](https://github.com/fisker)) <!-- prettier-ignore --> ```jsx // Input function MyFunctionComponent() { <button label=/*old*/"new">button</button> } // Prettier 2.8.1 Error: Comment "old" was not printed. Please report this error! // Prettier 2.8.2 function MyFunctionComponent() { <button label=/*old*/ "new">button</button>; } ``` ##### Quote numeric keys for json-stringify parser ([#14083](prettier/prettier#14083) by [@fisker](https://github.com/fisker)) <!-- prettier-ignore --> ```jsx // Input {0: 'value'} // Prettier 2.8.1 { 0: "value" } // Prettier 2.8.2 { "0": "value" } ``` ##### Fix removing commas from function arguments in maps ([#14089](prettier/prettier#14089) by [@sosukesuzuki](https://github.com/sosukesuzuki)) <!-- prettier-ignore --> ```scss /* Input */ $foo: map-fn( ( "#{prop}": inner-fn($first, $second), ) ); /* Prettier 2.8.1 */ $foo: map-fn(("#{prop}": inner-fn($first $second))); /* Prettier 2.8.2 */ $foo: map-fn( ( "#{prop}": inner-fn($first, $second), ) ); ``` ##### Do not insert space in LESS property access ([#14103](prettier/prettier#14103) by [@fisker](https://github.com/fisker)) <!-- prettier-ignore --> ```less // Input a { color: @Colors[@white]; } // Prettier 2.8.1 a { color: @Colors[ @white]; } // Prettier 2.8.2 <Same as input> ``` ## [v2.8.1](https://github.com/prettier/prettier/blob/HEAD/CHANGELOG.md#281) [diff](prettier/prettier@2.8.0...2.8.1) ##### Fix SCSS map in arguments ([#9184](prettier/prettier#9184) by [@agamkrbit](https://github.com/agamkrbit)) <!-- prettier-ignore --> ```scss // Input $display-breakpoints: map-deep-merge( ( "print-only": "only print", "screen-only": "only screen", "xs-only": "only screen and (max-width: #{map-get($grid-breakpoints, "sm")-1})", ), $display-breakpoints ); // Prettier 2.8.0 $display-breakpoints: map-deep-merge( ( "print-only": "only print", "screen-only": "only screen", "xs-only": "only screen and (max-width: #{map-get($grid-breakpoints, " sm ")-1})", ), $display-breakpoints ); // Prettier 2.8.1 $display-breakpoints: map-deep-merge( ( "print-only": "only print", "screen-only": "only screen", "xs-only": "only screen and (max-width: #{map-get($grid-breakpoints, "sm")-1})", ), $display-breakpoints ); ``` ##### Support auto accessors syntax ([#13919](prettier/prettier#13919) by [@sosukesuzuki](https://github.com/sosukesuzuki)) Support for [Auto Accessors Syntax](https://devblogs.microsoft.com/typescript/announcing-typescript-4-9/#auto-accessors-in-classes) landed in TypeScript 4.9. (Doesn't work well with `babel-ts` parser) <!-- prettier-ignore --> ```tsx class Foo { accessor foo: number = 3; } ``` ## [v2.8.0](https://github.com/prettier/prettier/blob/HEAD/CHANGELOG.md#280) [diff](prettier/prettier@2.7.1...2.8.0) 🔗 [Release Notes](https://prettier.io/blog/2022/11/23/2.8.0.html) ## [v2.7.1](https://github.com/prettier/prettier/blob/HEAD/CHANGELOG.md#271) [diff](prettier/prettier@2.7.0...2.7.1) ##### Keep useful empty lines in description ([#13013](prettier/prettier#13013) by [@chimurai](https://github.com/chimurai)) <!-- prettier-ignore --> ```graphql ```
Current Behavior:
I received an error message at the command line:
$ npm unpublish my-lib@1.4.0
npm ERR! code E405
npm ERR! 405 Method Not Allowed - PUT https://registry.npmjs.org/my-lib/-rev/14-878ad331638f5b05ac5eb9a52ff15fc0 - You can no longer unpublish this package.
npm ERR! Failed criteria:
npm ERR! has dependent packages in the registry
npm ERR!
npm ERR! Please deprecate it instead:
npm ERR! npm deprecate -f 'my-lib@1.4.0' "this package has been deprecated"
npm ERR! To learn more about our unpublish policies, see https://www.npmjs.com/policies/unpublish
Expected Behavior:
I expected the package to be unpublished, like described in https://docs.npmjs.com/cli/unpublish
An other page, https://www.npmjs.com/policies/unpublish talks about "newly created packages"
The description of both pages do not match.
Anyhow, i think it should be possible to remove packages with errors within a few minutes.
Steps To Reproduce:
publish in the root directory of a before published package
unpublish with package name and version number
Environment:
The text was updated successfully, but these errors were encountered: