Clean changelog_unreleased
This commit is contained in:
1 parent
848a8809d5
commit
2406fee590
20 files changed
-427
No files matched your search
@@ -1,42 +0,0 @@
|
|||||||
#### Respect `trailingComma` in Angular templates (#15926 by @fisker)
|
|
||||||
|
|
||||||
If you are using an old version of Angular doesn't support trailing comma, make sure add
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
overrides:
|
|
||||||
- files: "<patterns-of-my-angular-files>"
|
|
||||||
options:
|
|
||||||
trailingComma: none
|
|
||||||
```
|
|
||||||
|
|
||||||
to your `.prettierrc` file.
|
|
||||||
|
|
||||||
<!-- prettier-ignore -->
|
|
||||||
```jsx
|
|
||||||
// Input
|
|
||||||
<div
|
|
||||||
[ngClass]="{
|
|
||||||
'px-lg': ctx.spacing == 'lg',
|
|
||||||
'px-md': ctx.spacing == 'md',
|
|
||||||
'px-xs': ctx.spacing == 'xs',
|
|
||||||
}"
|
|
||||||
></div>
|
|
||||||
|
|
||||||
// Prettier stable
|
|
||||||
<div
|
|
||||||
[ngClass]="{
|
|
||||||
'px-lg': ctx.spacing == 'lg',
|
|
||||||
'px-md': ctx.spacing == 'md',
|
|
||||||
'px-xs': ctx.spacing == 'xs'
|
|
||||||
}"
|
|
||||||
></div>
|
|
||||||
|
|
||||||
// Prettier main
|
|
||||||
<div
|
|
||||||
[ngClass]="{
|
|
||||||
'px-lg': ctx.spacing == 'lg',
|
|
||||||
'px-md': ctx.spacing == 'md',
|
|
||||||
'px-xs': ctx.spacing == 'xs',
|
|
||||||
}"
|
|
||||||
></div>
|
|
||||||
```
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
#### Add support for `package.yaml` config (#16157 by @danielbayley)
|
|
||||||
|
|
||||||
Enable support for reading `prettier` configuration from [`package.yaml`](https://github.com/pnpm/pnpm/pull/1799).
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
# package.yaml
|
|
||||||
prettier:
|
|
||||||
semi: false
|
|
||||||
singleQuote: true
|
|
||||||
```
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
#### `declare namespace` printing support for Flow (#16066 by @SamChou19815)
|
|
||||||
|
|
||||||
<!-- prettier-ignore -->
|
|
||||||
```jsx
|
|
||||||
// Input
|
|
||||||
declare namespace foo {
|
|
||||||
declare var bar: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Prettier stable
|
|
||||||
// does not parse
|
|
||||||
|
|
||||||
// Prettier main
|
|
||||||
declare namespace foo {
|
|
||||||
declare var bar: string;
|
|
||||||
}
|
|
||||||
```
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
#### 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);
|
|
||||||
}
|
|
||||||
```
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
#### Support big int Flow Enums (#16268 by @gkz)
|
|
||||||
|
|
||||||
Adds support for big int [Flow Enums](https://flow.org/en/docs/enums/).
|
|
||||||
|
|
||||||
<!-- prettier-ignore -->
|
|
||||||
```jsx
|
|
||||||
// Input
|
|
||||||
enum E {
|
|
||||||
A = 0n,
|
|
||||||
B = 1n,
|
|
||||||
}
|
|
||||||
|
|
||||||
// Prettier stable
|
|
||||||
// error
|
|
||||||
|
|
||||||
// Prettier main
|
|
||||||
enum E {
|
|
||||||
A = 0n,
|
|
||||||
B = 1n,
|
|
||||||
}
|
|
||||||
```
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
#### Support Flow's inexact tuple types (#16271 by @gkz)
|
|
||||||
|
|
||||||
Adds support for Flow's inexact tuple types.
|
|
||||||
|
|
||||||
<!-- prettier-ignore -->
|
|
||||||
```jsx
|
|
||||||
// Input
|
|
||||||
type T = [number, ...];
|
|
||||||
|
|
||||||
// Prettier stable
|
|
||||||
type T = [number];
|
|
||||||
|
|
||||||
// Prettier main
|
|
||||||
type T = [number, ...];
|
|
||||||
```
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
#### Support Flow's 'implies' type guard variant (#16272 by @gkz)
|
|
||||||
|
|
||||||
Adds support for Flow's `implies` type guard variant. Also updates the `flow-parser` dependency.
|
|
||||||
|
|
||||||
<!-- prettier-ignore -->
|
|
||||||
```jsx
|
|
||||||
// Input
|
|
||||||
declare function f(x: mixed): implies x is T;
|
|
||||||
|
|
||||||
// Prettier stable
|
|
||||||
// error
|
|
||||||
|
|
||||||
// Prettier main
|
|
||||||
declare function f(x: mixed): implies x is T;
|
|
||||||
```
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
#### Unquote keys in import attributes (#15888 by @sosukesuzuki)
|
|
||||||
|
|
||||||
<!-- prettier-ignore -->
|
|
||||||
```jsx
|
|
||||||
// Input
|
|
||||||
import json from "./mod.json" with { "type": "json" };
|
|
||||||
|
|
||||||
// Prettier stable
|
|
||||||
import json from "./mod.json" with { "type": "json" };
|
|
||||||
|
|
||||||
// Prettier main
|
|
||||||
import json from "./mod.json" with { type: "json" };
|
|
||||||
```
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
#### Fix unstable object print (#16058 by @fisker)
|
|
||||||
|
|
||||||
<!-- prettier-ignore -->
|
|
||||||
```jsx
|
|
||||||
// Input
|
|
||||||
a = {"\a": 1, "b": 2}
|
|
||||||
|
|
||||||
// Prettier stable (--quote-props consistent)
|
|
||||||
a = { "a": 1, "b": 2 };
|
|
||||||
|
|
||||||
// Prettier stable (--quote-props as-needed)
|
|
||||||
a = { "a": 1, b: 2 };
|
|
||||||
|
|
||||||
// Prettier main
|
|
||||||
a = { a: 1, b: 2 };
|
|
||||||
```
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
#### 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
|
|
||||||
}
|
|
||||||
`;
|
|
||||||
```
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
#### Improve formatting of React `useImperativeHandle` hook (#16070 by @Jaswanth-Sriram-Veturi)
|
|
||||||
|
|
||||||
<!-- prettier-ignore -->
|
|
||||||
```jsx
|
|
||||||
// Input
|
|
||||||
useImperativeHandle(ref, () => {
|
|
||||||
/* Function body */
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
// Prettier stable
|
|
||||||
useImperativeHandle(
|
|
||||||
ref,
|
|
||||||
() => {
|
|
||||||
/* Function body */
|
|
||||||
},
|
|
||||||
[],
|
|
||||||
);
|
|
||||||
|
|
||||||
// Prettier main
|
|
||||||
useImperativeHandle(ref, () => {
|
|
||||||
/* Function body */
|
|
||||||
}, []);
|
|
||||||
```
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
#### 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
|
|
||||||
}`;
|
|
||||||
```
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
#### Fix dynamic import when the module source is a template string (#16267 by @fisker)
|
|
||||||
|
|
||||||
<!-- prettier-ignore -->
|
|
||||||
```jsx
|
|
||||||
// Input
|
|
||||||
const module = await import(`data:text/javascript,
|
|
||||||
console.log("RUN");
|
|
||||||
`);
|
|
||||||
|
|
||||||
// Prettier stable
|
|
||||||
const module = await (`data:text/javascript,
|
|
||||||
console.log("RUN");
|
|
||||||
`);
|
|
||||||
|
|
||||||
// Prettier main
|
|
||||||
const module = await import(`data:text/javascript,
|
|
||||||
console.log("RUN");
|
|
||||||
`);
|
|
||||||
```
|
|
||||||
@@ -1,51 +0,0 @@
|
|||||||
#### 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
|
|
||||||
```
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
#### Add newline between markdown footnote definitions (#16063 by @Atema)
|
|
||||||
|
|
||||||
<!-- prettier-ignore -->
|
|
||||||
```md
|
|
||||||
<!-- Input -->
|
|
||||||
[^a]: Footnote A
|
|
||||||
|
|
||||||
[^b]: Footnote B
|
|
||||||
|
|
||||||
<!-- Prettier stable -->
|
|
||||||
[^a]: Footnote A
|
|
||||||
[^b]: Footnote B
|
|
||||||
|
|
||||||
<!-- Prettier main -->
|
|
||||||
[^a]: Footnote A
|
|
||||||
|
|
||||||
[^b]: Footnote B
|
|
||||||
```
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
#### 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
|
|
||||||
```
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
#### Add missing parentheses to `TSInferType` (#16031 by @fisker)
|
|
||||||
|
|
||||||
<!-- prettier-ignore -->
|
|
||||||
```jsx
|
|
||||||
// Input
|
|
||||||
type Foo<T> = T extends (infer U extends number) | { a: infer U extends number }
|
|
||||||
? U
|
|
||||||
: never;
|
|
||||||
|
|
||||||
// Prettier stable
|
|
||||||
type Foo<T> = T extends infer U extends number | { a: infer U extends number }
|
|
||||||
? U
|
|
||||||
: never;
|
|
||||||
|
|
||||||
// Prettier main
|
|
||||||
type Foo<T> = T extends (infer U extends number) | { a: infer U extends number }
|
|
||||||
? U
|
|
||||||
: never;
|
|
||||||
```
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
#### Throw errors for duplicated accessibility modifiers (#16040 by @fisker, @auvred)
|
|
||||||
|
|
||||||
<!-- prettier-ignore -->
|
|
||||||
```jsx
|
|
||||||
// Input
|
|
||||||
class Foo {
|
|
||||||
public public bar() {};
|
|
||||||
}
|
|
||||||
|
|
||||||
// Prettier stable
|
|
||||||
class Foo {
|
|
||||||
public bar() {}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Prettier main
|
|
||||||
SyntaxError: Accessibility modifier already seen. (2:10)
|
|
||||||
1 | class Foo {
|
|
||||||
> 2 | public public bar() {};
|
|
||||||
| ^^^^^^
|
|
||||||
3 | }
|
|
||||||
```
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
#### 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
|
|
||||||
}
|
|
||||||
```
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
#### 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);
|
|
||||||
}
|
|
||||||
```
|
|
||||||
Reference in new issue
Block a user