Skip to content
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

[pull] main from prettier:main #1914

Merged
merged 66 commits into from
May 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
3bfabd0
chore(deps): update dependency jest to v30.0.0-alpha.3 (#16106)
renovate[bot] Feb 24, 2024
1079517
chore(deps): update eslint related dependencies (#16118)
renovate[bot] Feb 24, 2024
0d1868c
chore(deps): update babel to v7.24.0 (#16128)
renovate[bot] Feb 29, 2024
a28164e
chore(deps): update typescript-eslint to v7.1.0 (#16129)
renovate[bot] Feb 29, 2024
765aa10
fix: no semi for readonly class field (#16133)
sxzz Mar 9, 2024
765fd08
Exclude optional call from `isTestCall` (#16084)
fisker Mar 9, 2024
a8d9536
Remove outdated hack for `diff` package (#16083)
fisker Mar 9, 2024
3ba7396
Add unit test coverage for parser-and-printer.js (#16082)
teechap Mar 9, 2024
41baabd
Stricter AST check for property keys (#16060)
fisker Mar 9, 2024
d50a4e4
allow linebreaks in member expressions in template interpolations (#1…
bakkot Mar 10, 2024
f62bf4a
Format embedded GQL in template literal statements (#16064)
keithlayne Mar 11, 2024
6d2418f
fix: corrected the error in config file name (#16154)
0xflotus Mar 16, 2024
d970dee
Improve wrapping for codeblock in markdown and jsx in mdx (#15993)
seiyab Mar 20, 2024
7a3c4df
chore(deps): update dependency hermes-parser to v0.20.1 (#16180)
renovate[bot] Mar 28, 2024
ba000be
chore(deps): update dependency rollup-plugin-license to v3.3.1 (#16176)
renovate[bot] Mar 29, 2024
83fa3e7
chore(deps): update dependency postcss to v8.4.38 (#16175)
renovate[bot] Mar 29, 2024
9984fec
chore(deps): update dependency magic-string to v0.30.8 (#16174)
renovate[bot] Mar 29, 2024
ae742c2
chore(deps): update dependency esbuild to v0.20.2 (#16173)
renovate[bot] Mar 29, 2024
724120a
chore(deps): update typescript-eslint to v7.5.0 (#16172)
renovate[bot] Apr 3, 2024
02e62ac
chore(deps): update dependency meriyah to v4.4.1 (#16170)
renovate[bot] Apr 3, 2024
a9dfd18
chore(deps): update dependency @angular/compiler to v17.3.2 (#16178)
renovate[bot] Apr 3, 2024
7982771
chore(deps): update actions-cool/issues-helper action to v3.6.0 (#16177)
renovate[bot] Apr 3, 2024
48c9bc4
Yield expression parens (#16194)
kirkwaiblinger Apr 4, 2024
b6c1867
Bump actions-cool/issues-helper from 3.5.2 to 3.6.0 (#16122)
dependabot[bot] Apr 4, 2024
be0f56c
chore(deps): update babel (#16130)
renovate[bot] Apr 4, 2024
8497706
chore(deps): update eslint related dependencies (#16200)
renovate[bot] Apr 4, 2024
5041907
chore(deps): update dependency html-element-attributes to v3.4.0 (#16…
renovate[bot] Apr 4, 2024
197f964
chore(deps): update dependency magic-string to v0.30.9 (#16196)
renovate[bot] Apr 4, 2024
579b1c4
chore(deps): update dependency eslint-plugin-unicorn to v52 (#16201)
renovate[bot] Apr 4, 2024
d498b6f
Claim prettier/prettier on Drips (#16195)
BenJam Apr 4, 2024
ae8dcc4
Component syntax and related language features printing support (#16191)
SamChou19815 Apr 4, 2024
4a2ef72
chore(deps): update babel to v7.24.4 (#16202)
renovate[bot] Apr 4, 2024
38c0680
chore(deps): update dependency flow-parser to v0.233.0 (#16179)
renovate[bot] Apr 4, 2024
4fa4756
Update yarn to v4.1.1 (#16203)
fisker Apr 4, 2024
57d2d2a
chore(deps): update dependency meriyah to v4.4.2 (#16197)
renovate[bot] Apr 4, 2024
e8e4672
chore(deps): update dependency cspell to v8.6.1 (#16198)
renovate[bot] Apr 4, 2024
6c0e24d
docs: Fix broken link to Helix wiki (#16185)
luehmann Apr 4, 2024
9416e76
Bump express from 4.18.2 to 4.19.2 in /website (#16182)
dependabot[bot] Apr 4, 2024
6215520
docs: add `@see` to improve self-documentation (#16188)
hamirmahal Apr 6, 2024
063978a
Correct invalid `fill()` in markdown paragraph print (#16158)
seiyab Apr 6, 2024
5ceeccf
chore(deps): update dependency typescript to v5.4.3 (#16181)
renovate[bot] Apr 8, 2024
5dcef9c
Remove `@types/find-cache-dir` (#16210)
fisker Apr 8, 2024
ca93851
chore(deps): update codecov/codecov-action action to v4 (#16020)
renovate[bot] Apr 9, 2024
bb30e20
chore(deps): update typescript-eslint to v7.6.0 (#16213)
renovate[bot] Apr 10, 2024
f8f7582
Bump tar from 6.2.0 to 6.2.1 (#16214)
dependabot[bot] Apr 10, 2024
a9ccba6
chore(deps): update dependency html-ua-styles to v0.0.6 (#16215)
renovate[bot] Apr 10, 2024
09316aa
docs: Add documentation for Bun.sh (#16153)
Pietrucci-Blacher Apr 10, 2024
df998cd
chore(deps): update dependency eslint-plugin-regexp to v2.5.0 (#16216)
renovate[bot] Apr 10, 2024
1264a4c
chore(deps): update dependency typescript to v5.4.5 (#16219)
renovate[bot] Apr 12, 2024
3861ff3
Bump preactjs/compressed-size-action from 2.5.0 to 2.6.0 (#16237)
dependabot[bot] Apr 28, 2024
22e9d52
chore: fix some typos in comments (#16221)
StevenMia Apr 28, 2024
470d04e
Remove pre-commit from precommit.md (#16229)
louwers Apr 28, 2024
9026b1c
chore: fix some typos (#16149)
kaifulee Apr 28, 2024
923eec3
docs: `getValue()` replaced with `node` (#16224)
ssssota Apr 30, 2024
55ddfab
Run tests on Node 22 (#16247)
sosukesuzuki Apr 30, 2024
a32fca0
Fix tests on Node.js 14 x MacOS (#16250)
sosukesuzuki Apr 30, 2024
1663d59
docs: directly link files in `CONTRIBUTING.md` (#16209)
hamirmahal May 6, 2024
16449ce
renaming `jsfmt.spec.js` to `format.test.js` (#16244)
Janther May 6, 2024
b9c1181
chore(deps): update dependency import-meta-resolve to v4.1.0 (#16258)
renovate[bot] May 6, 2024
598b6ae
chore(deps): update typescript-eslint to v7.8.0 (#16259)
renovate[bot] May 6, 2024
0a2325a
Add #16259 to .git-blame-ignore-revs
fisker May 6, 2024
77d9bcf
Use `matchDepNames` instead of `matchPackageNames` in renovate.json5 …
fisker May 6, 2024
36bdf95
chore(deps): update glimmer to v0.91.1 (#16171)
renovate[bot] May 6, 2024
05f3bee
chore(deps): update babel to v7.24.5 (#16260)
renovate[bot] May 6, 2024
b521a7d
chore(deps): update glimmer to v0.92.0 (#16263)
renovate[bot] May 6, 2024
708bb1f
chore(deps): update babel to v7.24.5 (#16262)
renovate[bot] May 6, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ trim_trailing_whitespace = false
[tests/{**/__snapshots__/*, tests/format/**/*}]
trim_trailing_whitespace = false

[tests/format/**/jsfmt.spec.js]
[tests/format/**/format.test.js]
trim_trailing_whitespace = true
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
# Do not use `tests/format/**/*`, since it will ignore directories
# https://github.com/eslint/eslint/issues/17964#issuecomment-1879772142
tests/format/**/*.*
!tests/format/**/format.test.js
# TODO: Remove this in 2025
!tests/format/**/jsfmt.spec.js
tests/integration/cli/
test*.*
Expand Down
3 changes: 3 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,6 @@ b6225788966a4a6b49e652044337436642dcd627
# Reverted changes to the printer (#13210 #13104)
cdb149417068f3de364fd8db5e9baaf9d2ff4f8c
8dae4abf41e1ccec3515e8acea159505bbd55f33

# Format test file rename (#16259)
16449ce9140cac682eab3fb11e15beed14960da6
6 changes: 3 additions & 3 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
prConcurrentLimit: 0,
packageRules: [
{
matchPackageNames: ["react", "react-dom"],
matchDepNames: ["react", "react-dom"],
groupName: "react",
},
{
Expand All @@ -25,7 +25,7 @@
groupName: "glimmer",
},
{
matchPackageNames: [
matchDepNames: [
"eslint",
"@eslint/eslintrc",
"@eslint/js",
Expand All @@ -42,7 +42,7 @@
groupName: "ESLint related dependencies",
},
{
matchPackageNames: ["@angular/compiler", "angular-estree-parser"],
matchDepNames: ["@angular/compiler", "angular-estree-parser"],
groupName: "Angular Estree",
},
{
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check-sizes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
cache: "yarn"

- name: Check Sizes
uses: preactjs/compressed-size-action@2.5.0
uses: preactjs/compressed-size-action@2.6.0
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
pattern: "./dist/**/*"
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/dev-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ jobs:
- "windows-latest"
node:
# Latest even version
- "20"
- "22"
# Minimal version for development
- "18"
include:
- os: "ubuntu-latest"
# Pick a version that is fast (normally highest LTS version)
node: "20"
node: "22"
ENABLE_CODE_COVERAGE: true
FULL_TEST: true
CHECK_TEST_PARSERS: true
Expand Down Expand Up @@ -69,8 +69,9 @@ jobs:
run: yarn c8 yarn test

- name: Upload Coverage
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
if: ${{ matrix.ENABLE_CODE_COVERAGE }}
with:
fail_ci_if_error: true
files: coverage/lcov.info
token: ${{ secrets.CODECOV_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/mark-issue-duplicate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
if: ${{ !github.event.issue.pull_request && startsWith(github.event.comment.body, 'Duplicate of ') }}
steps:
- uses: actions-cool/issues-helper@v3.5.2
- uses: actions-cool/issues-helper@v3.6.0
with:
actions: "mark-duplicate"
token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
18 changes: 15 additions & 3 deletions .github/workflows/prod-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,20 +56,27 @@ jobs:
- "windows-latest"
node:
# Latest even version
- "20"
- "22"
# Minimal version for production
- "14"
include:
- os: "ubuntu-latest"
# Pick a version that is fast (normally highest LTS version)
node: "20"
node: "22"
FULL_TEST: true
# Versions not tested on linux, normally only even versions
# If latest version is an odd number, it can be listed bellow too
- os: "ubuntu-latest"
node: "16"
- os: "ubuntu-latest"
node: "21"
# Tests on Intel Mac x Node.js 14
- os: "macos-13"
node: "14"
# setup-node does not support Node.js 14 x M1 Mac
exclude:
- os: "macos-latest"
node: "14"
env:
FULL_TEST: ${{ matrix.FULL_TEST }}
name: ${{ matrix.FULL_TEST && '[Full Test] ' || '' }} Node.js ${{ matrix.node }} on ${{ startsWith(matrix.os, 'macos') && 'MacOS' || startsWith(matrix.os, 'windows') && 'Windows' || 'Linux' }}
Expand All @@ -91,10 +98,15 @@ jobs:
node-version: ${{ matrix.node }}
cache: "yarn"

# `jest@30.0.0-alpha.2` is the last version that supports Node.js v14
- name: Install jest@30.0.0-alpha.2
if: ${{ matrix.node == '14' }}
run: node ./scripts/prepare-nodejs-14-test.js

- name: Install Dependencies(yarn@3,mutable)
if: ${{ matrix.node == '14' || matrix.node == '16' }}
env:
YARN_ENABLE_IMMUTABLE_INSTALLS: false
if: ${{ matrix.node == '14' || matrix.node == '16' }}
run: yarn install

- name: Install Dependencies
Expand Down
2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
**/.yarn/*

/tests/format/**/*.*
!/tests/format/**/jsfmt.spec.js
!/tests/format/**/format.test.js
/tests/integration/cli/
/tests/integration/plugins/**/*.*
!/tests/integration/plugins/automatic/node_modules/@prettier/plugin-foo/index.js
Expand Down
324 changes: 162 additions & 162 deletions .yarn/releases/yarn-4.1.0.cjs → .yarn/releases/yarn-4.1.1.cjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ nodeLinker: node-modules
plugins:
- .yarn/plugins/plugin-setup-editor.cjs

yarnPath: .yarn/releases/yarn-4.1.0.cjs
yarnPath: .yarn/releases/yarn-4.1.1.cjs
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,15 @@ export class AppComponent {}

#### Use `"json"` parser for `tsconfig.json` by default ([#16012](https://github.com/prettier/prettier/pull/16012) by [@sosukesuzuki](https://github.com/sosukesuzuki))

In [v3.2.0](https://prettier.io/blog/2024/01/12/3.2.0#new-jsonc-parser-added-15831httpsgithubcomprettierprettierpull15831-by-fiskerhttpsgithubcomfisker), we introduced `"jsonc"` parser which adds trialing comma **by default**.
In [v3.2.0](https://prettier.io/blog/2024/01/12/3.2.0#new-jsonc-parser-added-15831httpsgithubcomprettierprettierpull15831-by-fiskerhttpsgithubcomfisker), we introduced `"jsonc"` parser which adds trailing comma **by default**.

When adding a new parser we also define how it will be used based on the [`linguist-languages`](https://www.npmjs.com/package/linguist-languages) data.

`tsconfig.json` is a special file used by [TypeScript](https://www.typescriptlang.org/docs/handbook/tsconfig-json.html#using-tsconfigjson-or-jsconfigjson), it uses `.json` file extension, but it actually uses the [JSON with Comments](https://code.visualstudio.com/docs/languages/json#_json-with-comments) syntax. However, we found that there are many third-party tools not recognize it correctly because of the confusing `.json` file extension.

We decide to treat it as a JSON file for now to avoid the extra configuration step.

To keep using the `"jsonc"` parser for your `tsconfig.json` files, add the following to your `.pretterrc` file
To keep using the `"jsonc"` parser for your `tsconfig.json` files, add the following to your `.prettierrc` file

```json
{
Expand Down
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ yarn test

The tests use [Jest snapshots](https://facebook.github.io/jest/docs/en/snapshot-testing.html). You can make changes and run `jest -u` (or `yarn test -u`) to update the snapshots. Then run `git diff` to take a look at what changed. Always update the snapshots when opening a PR.

Each test directory in `tests/format` has a `jsfmt.spec.js` file that controls how exactly the rest of the files in the directory are used for tests. This file must contain one or more calls to the `runFormatTest` global function. For example, in directories with JavaScript formatting tests, `jsfmt.spec.js` generally looks like this:
Each test directory in `tests/format` has a `format.test.js` file that controls how exactly the rest of the files in the directory are used for tests. This file must contain one or more calls to the `runFormatTest` global function. For example, in directories with JavaScript formatting tests, `format.test.js` generally looks like this:

```js
runFormatTest(import.meta, ["babel", "flow", "typescript"]);
Expand Down Expand Up @@ -87,7 +87,7 @@ If you're contributing a performance improvement, the following Prettier CLI opt
- `--debug-repeat N` uses a naïve loop to repeat the formatting `N` times and measures the average run duration. It can be useful to highlight hot functions in the profiler. This can also set by environment variable `PRETTIER_PERF_REPEAT`.
- `--debug-benchmark` uses [`benchmark`](https://npm.im/benchmark) module to produce statistically significant duration measurements.

For convenience, the following commands for profiling are available via `package.json` `scripts`.
For convenience, the following commands for profiling are available via [`package.json`](package.json) `scripts`.

- `PRETTIER_PERF_REPEAT=1000 yarn perf <filename>` starts the naïve loop. See the CLI output for when the measurements finish, and stop profiling at that moment.
- `PRETTIER_PERF_REPEAT=1000 yarn perf:inspect <filename>` starts the naïve loop with `node --inspect-brk` flag that pauses execution and waits for Chromium/Chrome/Node Inspector to attach. Open [`chrome://inspect`](chrome://inspect), select the process to inspect, and activate the CPU Profiler, this will unpause execution. See the CLI output for when the measurements finish, and stop the CPU Profiler at that moment to avoid collecting more data than needed.
Expand All @@ -101,7 +101,7 @@ In the above commands:

In addition to the options above, you can use [`node --prof` and `node --prof-process`](https://nodejs.org/en/docs/guides/simple-profiling/), as well as `node --trace-opt --trace-deopt`, to get more advanced performance insights.

The script `scripts/benchmark/compare.sh` can be used to compare performance of two or more commits/branches using [hyperfine](https://github.com/sharkdp/hyperfine). Usage (don't forget to install hyperfine):
The script [`scripts/benchmark/compare.sh`](scripts/benchmark/compare.sh) can be used to compare performance of two or more commits/branches using [hyperfine](https://github.com/sharkdp/hyperfine). Usage (don't forget to install hyperfine):

```sh
PRETTIER_PERF_FILENAME=my.js ./compare.sh main some-pr-branch
Expand Down
7 changes: 7 additions & 0 deletions FUNDING.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"drips": {
"ethereum": {
"ownedBy": "0x3A39F5E9BFe0a90e394982492e166C5635893141"
}
}
}
23 changes: 23 additions & 0 deletions changelog_unreleased/flow/16191.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#### Component syntax printing support for Flow (#16191 by @SamChou19815)

<!-- prettier-ignore -->
```jsx
// Input
component MyComponent(a: string, b: number) renders SomeComponent {
return <OtherComponent />;
}
hook useMyHook(a: string) {
return useState(a);
}

// Prettier stable
// does not parse

// Prettier main
component MyComponent(a: string, b: number) renders SomeComponent {
return <OtherComponent />;
}
hook useMyHook(a: string) {
return useState(a);
}
```
21 changes: 21 additions & 0 deletions changelog_unreleased/javascript/16064.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#### Format embedded GQL in template literal statements (#16064 by @keithlayne)

<!-- prettier-ignore -->
```jsx
// Input
/* GraphQL */ `
query foo { id }
`;

// Prettier stable
/* GraphQL */ `
query foo { id }
`;

// Prettier main
/* GraphQL */ `
query foo {
id
}
`;
```
19 changes: 19 additions & 0 deletions changelog_unreleased/javascript/16116.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#### Allow linebreaks in member expressions in template interpolations (#16116 by @bakkot)

When there is already a linebreak in a template interpolation, allow it to stay there even if it is a member expression. Note that (as of [#15209](https://github.com/prettier/prettier/pull/15209)) Prettier will not insert a linebreak inside an interpolation when one is not already present.

<!-- prettier-ignore -->
```jsx
// Input
`template with ${
very.very.very.very.very.very.very.very.very.very.very.long.chain
}`;

// Prettier stable
`template with ${very.very.very.very.very.very.very.very.very.very.very.long.chain}`;

// Prettier main
`template with ${
very.very.very.very.very.very.very.very.very.very.very.long.chain
}`;
```
51 changes: 51 additions & 0 deletions changelog_unreleased/markdown/15993.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#### Improve wrapping for code block in markdown and jsx in mdx (#15993 by @seiyab)

<!-- prettier-ignore -->
````md
<!-- Input -->
```css
img {
filter: drop-shadow(2px 2px 0 hsl(300deg 100% 50%)) drop-shadow(
-2px -2px 0 hsl(210deg 100% 50%)
)
drop-shadow(2px 2px 0 hsl(120deg 100% 50%)) drop-shadow(
-2px -2px 0 hsl(30deg 100% 50%)
);
}
```

<!-- Prettier stable -->
```css
img {
filter: drop-shadow(2px 2px 0 hsl(300deg 100% 50%)) drop-shadow(
-2px -2px 0 hsl(210deg 100% 50%)
)
drop-shadow(2px 2px 0 hsl(120deg 100% 50%)) drop-shadow(
-2px -2px 0 hsl(30deg 100% 50%)
);
}
```

<!-- Prettier main -->
```css
img {
filter: drop-shadow(2px 2px 0 hsl(300deg 100% 50%))
drop-shadow(-2px -2px 0 hsl(210deg 100% 50%))
drop-shadow(2px 2px 0 hsl(120deg 100% 50%))
drop-shadow(-2px -2px 0 hsl(30deg 100% 50%));
}
```
````

<!-- prettier-ignore -->
```md
<!-- Input -->
<ExternalLink href="http://example.com">Prettier</ExternalLink> is an opinionated-code-formatter-that-support-many-languages-and-integrate-with-most-editors

<!-- Prettier stable -->
<ExternalLink href="http://example.com">Prettier</ExternalLink> is an opinionated-code-formatter-that-support-many-languages-and-integrate-with-most-editors

<!-- Prettier main -->
<ExternalLink href="http://example.com">Prettier</ExternalLink> is an
opinionated-code-formatter-that-support-many-languages-and-integrate-with-most-editors
```
21 changes: 21 additions & 0 deletions changelog_unreleased/markdown/16158.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#### Improve wrapping for markdown / mdx (#16158 by @seiyab)

```json
{ "proseWrap": "always" }
```

<!-- prettier-ignore -->
```md
<!-- Input -->
\
word very-very-very-very-very-very-very-very-very-very-long-word very-very-very-very-very-very-very-very-very-very-long-word

<!-- Prettier stable -->
\
word very-very-very-very-very-very-very-very-very-very-long-word very-very-very-very-very-very-very-very-very-very-long-word

<!-- Prettier main -->
\
word very-very-very-very-very-very-very-very-very-very-long-word
very-very-very-very-very-very-very-very-very-very-long-word
```
22 changes: 22 additions & 0 deletions changelog_unreleased/typescript/16133.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#### Respect `--no-semi` for readonly class field (#16133 by @sxzz)

<!-- prettier-ignore -->
```tsx
// Input
class A {
field
readonly [expr] = true
}

// Prettier stable
class A {
field;
readonly [expr] = true
}

// Prettier main
class A {
field
readonly [expr] = true
}
```
21 changes: 21 additions & 0 deletions changelog_unreleased/typescript/16194.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#### Add necessary parentheses to yield expressions (#16194 by @kirkwaiblinger)

Add parentheses around yield expressions if parent is an angle-bracket type assertion.

<!-- prettier-ignore -->
```ts
// Input
function* g() {
const y = <T>(yield x);
}

// Prettier stable
function* g() {
const y = <T>yield x;
}

// Prettier main
function* g() {
const y = <T>(yield x);
}
```
Loading
Loading