Skip to content

Conversation

sosukesuzuki
Copy link
Member

@sosukesuzuki sosukesuzuki commented Jun 4, 2022

Description

https://deploy-preview-12966--prettier.netlify.app/blog/2022/06/11/2.7.0.html

Checklist

  • I’ve added tests to confirm my change works.
  • (If changing the API or CLI) I’ve documented the changes I’ve made (in the docs/ directory).
  • (If the change is user-facing) I’ve added my changes to changelog_unreleased/*/XXXX.md file following changelog_unreleased/TEMPLATE.md.
  • I’ve read the contributing guidelines.

Try the playground for this PR

@sosukesuzuki sosukesuzuki mentioned this pull request Jun 4, 2022
13 tasks
title: "Prettier 2.7: new --cache CLI option and TypeScript 4.7 syntax!"
---

This release includes a new `--cache` CLI option. Enabling this option will use some attributes as cache keys and format files only if they have changed. This could dramatically improve CLI performance.

This comment was marked as resolved.

##### [`extends` constraints for `infer`](https://devblogs.microsoft.com/typescript/announcing-typescript-4-7/#extends-constraints-on-infer-type-variables)

```ts
type FirstString<T> = T extends [infer extends string, ...unknown[]]
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
type FirstString<T> = T extends [infer extends string, ...unknown[]]
type FirstString<T> = T extends [infer S extends string, ...unknown[]]

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! ee06ea9


This release includes a new `--cache` CLI option. Enabling this option will use some attributes as cache keys and format files only if they have changed. This could dramatically improve CLI performance.

We've also added support formatting for TypeScript 4.7 syntax!
Copy link

@thebanjomatic thebanjomatic Jun 10, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
We've also added support formatting for TypeScript 4.7 syntax!
We've also added support for formatting TypeScript 4.7 syntax!


This release includes a new `--cache` CLI option. Enabling this option will use some attributes as cache keys and format files only if they have changed. This could dramatically improve CLI performance.

We've also added support formatting for TypeScript 4.7 syntax!

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
We've also added support formatting for TypeScript 4.7 syntax!
We've also added support for formatting TypeScript 4.7 syntax!

@sosukesuzuki sosukesuzuki marked this pull request as ready for review June 11, 2022 14:41
const makeWrenchBox = makeBox<Wrench>;
```

##### [Optional Variance](https://devblogs.microsoft.com/typescript/announcing-typescript-4-7/#optional-variance-annotations-for-type-parameters)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
##### [Optional Variance](https://devblogs.microsoft.com/typescript/announcing-typescript-4-7/#optional-variance-annotations-for-type-parameters)
##### [Optional Variance Annotations](https://devblogs.microsoft.com/typescript/announcing-typescript-4-7/#optional-variance-annotations-for-type-parameters)


#### Fix comment formats in ([#12860](https://github.com/prettier/prettier/pull/12860) by [@HosokawaR](https://github.com/HosokawaR))

This change fixes comments format in `exports` to algin with the comment format in `import`

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This change fixes comments format in `exports` to algin with the comment format in `import`
This change fixes the comment format in `exports` to align with the comment format in `import`.


#### Support Speculation Rules API formatting in HTML ([#12882](https://github.com/prettier/prettier/pull/12882) by [@sosukesuzuki](https://github.com/sosukesuzuki))

Please read https://web.dev/speculative-prerendering/ for about Speculation Rules API.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Please read https://web.dev/speculative-prerendering/ for about Speculation Rules API.
Please read https://web.dev/speculative-prerendering/ for more information about the Speculation Rules API.


### CLI

#### Add `--cache` and `--cache-strategy` CLI option ([#12800](https://github.com/prettier/prettier/pull/12800) by [@sosukesuzuki](https://github.com/sosukesuzuki))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#### Add `--cache` and `--cache-strategy` CLI option ([#12800](https://github.com/prettier/prettier/pull/12800) by [@sosukesuzuki](https://github.com/sosukesuzuki))
#### Add `--cache` and `--cache-strategy` CLI options ([#12800](https://github.com/prettier/prettier/pull/12800) by [@sosukesuzuki](https://github.com/sosukesuzuki))


This change fixes the comment format in `exports` to align with the comment format in `import`.

Although this change does not affect the comments format in `import`, follows change log contains examples of comments in `import` for reference.
Copy link

@Josh-Cena Josh-Cena Jun 11, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Although this change does not affect the comments format in `import`, follows change log contains examples of comments in `import` for reference.
Although this change does not affect the comments format in `import`, the following changeset still contains examples of comments in `import` for reference.

(Skeptical about either "change log" or "changeset" being the right word, but nothing better on my mind)

@sosukesuzuki sosukesuzuki requested review from fisker and kachkaev June 11, 2022 15:31

#### Infer parser for `.importmap` files ([#12603](https://github.com/prettier/prettier/pull/12603) by [@fisker](https://github.com/fisker))

Format [`.importmap`](https://github.com/WICG/import-maps#import-map-processing) files as a JSON files.
Copy link
Member

@fisker fisker Jun 11, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Format [`.importmap`](https://github.com/WICG/import-maps#import-map-processing) files as a JSON files.
Format [`.importmap`](https://github.com/WICG/import-maps#import-map-processing) files as JSON files.

@fisker fisker merged commit 934068a into prettier:main Jun 14, 2022
medikoo pushed a commit to medikoo/prettier-elastic that referenced this pull request Jan 4, 2024
Co-authored-by: fisker Cheung <lionkay@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants