Clean changelog_unreleased
This commit is contained in:
1 parent
79f6cdfd98
commit
05cf896cfc
104 files changed
-2472
No files matched your search
@@ -1,31 +0,0 @@
|
||||
#### Fix linebreak in member chain (#17251 by @fisker)
|
||||
|
||||
<!-- prettier-ignore -->
|
||||
```tsx
|
||||
// Input
|
||||
model = types
|
||||
.model({ something: mxSomething })
|
||||
.volatile<| "a" | "b">(() => [
|
||||
annularThingamabobWrapper,
|
||||
octahedralWeevilService,
|
||||
cantileveredRhubarbProcessor,
|
||||
annularPlatypusGenerator,
|
||||
]);
|
||||
|
||||
// Prettier stable
|
||||
model = types
|
||||
.model({ something: mxSomething })
|
||||
.volatile<
|
||||
"a" | "b"
|
||||
>(() => [annularThingamabobWrapper, octahedralWeevilService, cantileveredRhubarbProcessor, annularPlatypusGenerator]);
|
||||
|
||||
// Prettier main
|
||||
model = types
|
||||
.model({ something: mxSomething })
|
||||
.volatile<"a" | "b">(() => [
|
||||
annularThingamabobWrapper,
|
||||
octahedralWeevilService,
|
||||
cantileveredRhubarbProcessor,
|
||||
annularPlatypusGenerator,
|
||||
]);
|
||||
```
|
||||
@@ -1,45 +0,0 @@
|
||||
#### Fix formatting for new expression with type cast (#18507 by @fisker)
|
||||
|
||||
<!-- prettier-ignore -->
|
||||
```tsx
|
||||
// Input
|
||||
new (require("./webpack/plugins/next-trace-entrypoints-plugin")
|
||||
.TraceEntryPointsPlugin as P)({
|
||||
rootDir: dir,
|
||||
});
|
||||
|
||||
(
|
||||
require("./webpack/plugins/next-trace-entrypoints-plugin")
|
||||
.TraceEntryPointsPlugin as P
|
||||
)({
|
||||
rootDir: dir,
|
||||
});
|
||||
|
||||
// Prettier stable
|
||||
new (require("./webpack/plugins/next-trace-entrypoints-plugin")
|
||||
.TraceEntryPointsPlugin as P)({
|
||||
rootDir: dir,
|
||||
});
|
||||
|
||||
(
|
||||
require("./webpack/plugins/next-trace-entrypoints-plugin")
|
||||
.TraceEntryPointsPlugin as P
|
||||
)({
|
||||
rootDir: dir,
|
||||
});
|
||||
|
||||
// Prettier main
|
||||
new (
|
||||
require("./webpack/plugins/next-trace-entrypoints-plugin")
|
||||
.TraceEntryPointsPlugin as P
|
||||
)({
|
||||
rootDir: dir,
|
||||
});
|
||||
|
||||
(
|
||||
require("./webpack/plugins/next-trace-entrypoints-plugin")
|
||||
.TraceEntryPointsPlugin as P
|
||||
)({
|
||||
rootDir: dir,
|
||||
});
|
||||
```
|
||||
@@ -1,35 +0,0 @@
|
||||
#### Fix line comments jumping past member expression lookups (#18522 by @ulrichstark)
|
||||
|
||||
Line comments between a member expression object and property were incorrectly moved past subsequent content like `as` expressions.
|
||||
|
||||
<!-- prettier-ignore -->
|
||||
```tsx
|
||||
// Input
|
||||
function getClassNameFromPrototypeMethod(container) {
|
||||
return ((container // a
|
||||
.left as PropertyAccessExpression) // b
|
||||
.expression as PropertyAccessExpression) // c
|
||||
.expression; // d
|
||||
}
|
||||
|
||||
// Prettier stable
|
||||
function getClassNameFromPrototypeMethod(container) {
|
||||
return (
|
||||
(
|
||||
container.left as PropertyAccessExpression // a
|
||||
).expression as PropertyAccessExpression // b
|
||||
).expression; // c // d
|
||||
}
|
||||
|
||||
// Prettier main
|
||||
function getClassNameFromPrototypeMethod(container) {
|
||||
return (
|
||||
(
|
||||
container // a
|
||||
.left as PropertyAccessExpression
|
||||
) // b
|
||||
.expression as PropertyAccessExpression
|
||||
) // c
|
||||
.expression; // d
|
||||
}
|
||||
```
|
||||
@@ -1,39 +0,0 @@
|
||||
#### Fix inconsistent formatting of arrow function (#18589 by @fisker)
|
||||
|
||||
<!-- prettier-ignore -->
|
||||
```tsx
|
||||
// Input
|
||||
a.map(() => ({
|
||||
name,
|
||||
}));
|
||||
a.map(():A => ({
|
||||
name,
|
||||
}));
|
||||
a.map(():{A} => ({
|
||||
name,
|
||||
}));
|
||||
|
||||
// Prettier stable
|
||||
a.map(() => ({
|
||||
name,
|
||||
}));
|
||||
a.map(
|
||||
(): A => ({
|
||||
name,
|
||||
}),
|
||||
);
|
||||
a.map((): { A } => ({
|
||||
name,
|
||||
}));
|
||||
|
||||
// Prettier main
|
||||
a.map(() => ({
|
||||
name,
|
||||
}));
|
||||
a.map((): A => ({
|
||||
name,
|
||||
}));
|
||||
a.map((): { A } => ({
|
||||
name,
|
||||
}));
|
||||
```
|
||||
@@ -1,37 +0,0 @@
|
||||
#### Improve comment print inside type arguments (#18619 by @fisker)
|
||||
|
||||
<!-- prettier-ignore -->
|
||||
```tsx
|
||||
// Input
|
||||
foo<
|
||||
// Comment
|
||||
Type
|
||||
>(
|
||||
// Comment
|
||||
value
|
||||
)
|
||||
foo<
|
||||
Type // Comment
|
||||
>(
|
||||
)
|
||||
|
||||
// Prettier stable
|
||||
foo<// Comment
|
||||
Type>(
|
||||
// Comment
|
||||
value,
|
||||
);
|
||||
foo<Type>(); // Comment
|
||||
|
||||
// Prettier main
|
||||
foo<
|
||||
// Comment
|
||||
Type
|
||||
>(
|
||||
// Comment
|
||||
value,
|
||||
);
|
||||
foo<
|
||||
Type // Comment
|
||||
>();
|
||||
```
|
||||
@@ -1,25 +0,0 @@
|
||||
#### Fix conditional type comment indentation (#18644 by @lindsaycode05)
|
||||
|
||||
<!-- prettier-ignore -->
|
||||
```tsx
|
||||
// Input
|
||||
type T = any extends B
|
||||
// Comment
|
||||
// Multiline comment
|
||||
? undefined | NonNullable<B>[foo]
|
||||
: B[foo];
|
||||
|
||||
// Prettier stable
|
||||
type T = any extends B
|
||||
? // Comment
|
||||
// Multiline comment
|
||||
undefined | NonNullable<B>[foo]
|
||||
: B[foo];
|
||||
|
||||
// Prettier main
|
||||
type T = any extends B
|
||||
? // Comment
|
||||
// Multiline comment
|
||||
undefined | NonNullable<B>[foo]
|
||||
: B[foo];
|
||||
```
|
||||
@@ -1,22 +0,0 @@
|
||||
#### Fix inconsistent formatting of class superClass (#18652, #18659 by @fisker)
|
||||
|
||||
<!-- prettier-ignore -->
|
||||
```tsx
|
||||
// Input
|
||||
class ALongLongLongLongLongLongLongLongLongLongLongLongClassName
|
||||
extends foo.bar.Baz {}
|
||||
class ALongLongLongLongLongLongLongLongLongLongLongLongClassName
|
||||
extends foo.bar.Baz! {}
|
||||
|
||||
// Prettier stable
|
||||
class ALongLongLongLongLongLongLongLongLongLongLongLongClassName
|
||||
extends foo.bar.Baz {}
|
||||
class ALongLongLongLongLongLongLongLongLongLongLongLongClassName extends (foo
|
||||
.bar.Baz!) {}
|
||||
|
||||
// Prettier main
|
||||
class ALongLongLongLongLongLongLongLongLongLongLongLongClassName
|
||||
extends foo.bar.Baz {}
|
||||
class ALongLongLongLongLongLongLongLongLongLongLongLongClassName
|
||||
extends foo.bar.Baz! {}
|
||||
```
|
||||
@@ -1,53 +0,0 @@
|
||||
#### Consistent print non-null assertions (#18654 by @fisker)
|
||||
|
||||
<!-- prettier-ignore -->
|
||||
```tsx
|
||||
// Input
|
||||
const corners = baseCorners.map((corner) =>
|
||||
curveCatmullRomCubicApproxPoints(curveOffsetPoints(corner, offset))!,
|
||||
);
|
||||
const corners = baseCorners.map((corner) =>
|
||||
curveCatmullRomCubicApproxPoints(curveOffsetPoints(corner, offset)),
|
||||
);
|
||||
|
||||
// Prettier stable
|
||||
const corners = baseCorners.map(
|
||||
(corner) =>
|
||||
curveCatmullRomCubicApproxPoints(curveOffsetPoints(corner, offset))!,
|
||||
);
|
||||
const corners = baseCorners.map((corner) =>
|
||||
curveCatmullRomCubicApproxPoints(curveOffsetPoints(corner, offset)),
|
||||
);
|
||||
|
||||
// Prettier main
|
||||
const corners = baseCorners.map((corner) =>
|
||||
curveCatmullRomCubicApproxPoints(curveOffsetPoints(corner, offset))!,
|
||||
);
|
||||
const corners = baseCorners.map((corner) =>
|
||||
curveCatmullRomCubicApproxPoints(curveOffsetPoints(corner, offset)),
|
||||
);
|
||||
```
|
||||
|
||||
<!-- prettier-ignore -->
|
||||
```tsx
|
||||
// Input
|
||||
isEqual(a?.map(([t, _]) => t?.id)!, b?.map(([t, _]) => t?.id));
|
||||
isEqual(a?.map(([t, _]) => t?.id)!, b?.map(([t, _]) => t?.id)!);
|
||||
|
||||
// Prettier stable
|
||||
isEqual(
|
||||
a?.map(([t, _]) => t?.id)!,
|
||||
b?.map(([t, _]) => t?.id),
|
||||
);
|
||||
isEqual(a?.map(([t, _]) => t?.id)!, b?.map(([t, _]) => t?.id)!);
|
||||
|
||||
// Prettier main
|
||||
isEqual(
|
||||
a?.map(([t, _]) => t?.id)!,
|
||||
b?.map(([t, _]) => t?.id),
|
||||
);
|
||||
isEqual(
|
||||
a?.map(([t, _]) => t?.id)!,
|
||||
b?.map(([t, _]) => t?.id)!,
|
||||
);
|
||||
```
|
||||
@@ -1,19 +0,0 @@
|
||||
#### Preserve non-null assertion around optional chaining (#18661 by @fisker)
|
||||
|
||||
<!-- prettier-ignore -->
|
||||
```tsx
|
||||
// Input
|
||||
(a?.b!).c;
|
||||
(a?.b)!.c;
|
||||
(a?.b!)!.c;
|
||||
|
||||
// Prettier stable
|
||||
(a?.b)!.c;
|
||||
(a?.b)!.c;
|
||||
a?.b!!.c;
|
||||
|
||||
// Prettier main
|
||||
(a?.b!).c;
|
||||
(a?.b)!.c;
|
||||
(a?.b!)!.c;
|
||||
```
|
||||
@@ -1,32 +0,0 @@
|
||||
#### Respect `quoteProps` option when printing enum keys (#18700, #18703 by @fisker)
|
||||
|
||||
<!-- prettier-ignore -->
|
||||
```tsx
|
||||
// Input
|
||||
enum E {
|
||||
A1 = 0,
|
||||
"A2" = 1,
|
||||
"A-3" = 2,
|
||||
}
|
||||
|
||||
// Prettier stable
|
||||
enum E {
|
||||
A1 = 0,
|
||||
"A2" = 1,
|
||||
"A-3" = 2,
|
||||
}
|
||||
|
||||
// Prettier main (--quote-props=as-needed)
|
||||
enum E {
|
||||
A1 = 0,
|
||||
A2 = 1,
|
||||
"A-3" = 2,
|
||||
}
|
||||
|
||||
// Prettier main (--quote-props=consistent)
|
||||
enum E {
|
||||
"A1" = 0,
|
||||
"A2" = 1,
|
||||
"A-3" = 2,
|
||||
}
|
||||
```
|
||||
@@ -1,32 +0,0 @@
|
||||
#### Respect `quoteProps` in method signature (#18702 by @fisker)
|
||||
|
||||
<!-- prettier-ignore -->
|
||||
```tsx
|
||||
// Input
|
||||
type T = {
|
||||
method1(): string;
|
||||
"method2"(): string;
|
||||
"method-3"(): string;
|
||||
};
|
||||
|
||||
// Prettier stable
|
||||
type T = {
|
||||
method1(): string;
|
||||
"method2"(): string;
|
||||
"method-3"(): string;
|
||||
};
|
||||
|
||||
// Prettier main (--quote-props=as-needed)
|
||||
type T = {
|
||||
method1(): string;
|
||||
method2(): string;
|
||||
"method-3"(): string;
|
||||
};
|
||||
|
||||
// Prettier main (--quote-props=consistent)
|
||||
type T = {
|
||||
"method1"(): string;
|
||||
"method2"(): string;
|
||||
"method-3"(): string;
|
||||
};
|
||||
```
|
||||
@@ -1,20 +0,0 @@
|
||||
#### Keep comments in mapped type inline (#18731 by @fisker)
|
||||
|
||||
<!-- prettier-ignore -->
|
||||
```tsx
|
||||
// Input
|
||||
type B = {
|
||||
/* comment */ [b in B]: string
|
||||
};
|
||||
|
||||
// Prettier stable
|
||||
type B = {
|
||||
/* comment */
|
||||
[b in B]: string;
|
||||
};
|
||||
|
||||
// Prettier main
|
||||
type B = {
|
||||
/* comment */ [b in B]: string;
|
||||
};
|
||||
```
|
||||
@@ -1,19 +0,0 @@
|
||||
#### Print semicolon before type assertion in `no-semi` mode (#18738 by @fisker)
|
||||
|
||||
<!-- prettier-ignore -->
|
||||
```tsx
|
||||
// Input
|
||||
a;
|
||||
<b>c;
|
||||
|
||||
// Prettier stable (--no-semi, first format)
|
||||
a
|
||||
<b>c
|
||||
|
||||
// Prettier stable (--no-semi, second format)
|
||||
a < b > c
|
||||
|
||||
// Prettier main (--no-semi)
|
||||
a
|
||||
;<b>c
|
||||
```
|
||||
@@ -1,13 +0,0 @@
|
||||
#### Add parentheses to conditional types in type parameter constraint (#18760 by @kovsu)
|
||||
|
||||
<!-- prettier-ignore -->
|
||||
```ts
|
||||
// Input
|
||||
const foo = <Foo extends (Bar extends Baz ? A : B)>() => true;
|
||||
|
||||
// Prettier stable
|
||||
const foo = <Foo extends Bar extends Baz ? A : B>() => true;
|
||||
|
||||
// Prettier main
|
||||
const foo = <Foo extends (Bar extends Baz ? A : B)>() => true;
|
||||
```
|
||||
@@ -1,40 +0,0 @@
|
||||
#### Fix printing comment for the last operand of union types (#18798 by @fisker)
|
||||
|
||||
<!-- prettier-ignore -->
|
||||
```tsx
|
||||
// Input
|
||||
type Foo2 = (
|
||||
| "thing1" // Comment1
|
||||
| "thing2" // Comment2
|
||||
) & Bar; // Final comment2
|
||||
type Foo2 = (
|
||||
| "thing1" // Comment1
|
||||
| "thing2" // Comment2
|
||||
) | Bar; // Final comment2
|
||||
|
||||
// Prettier stable
|
||||
type Foo2 = (
|
||||
| "thing1" // Comment1
|
||||
| "thing2" // Comment2
|
||||
) &
|
||||
Bar; // Final comment2
|
||||
type Foo2 =
|
||||
| (
|
||||
| "thing1" // Comment1
|
||||
| "thing2"
|
||||
) // Comment2
|
||||
| Bar; // Final comment2
|
||||
|
||||
// Prettier main
|
||||
type Foo2 = (
|
||||
| "thing1" // Comment1
|
||||
| "thing2" // Comment2
|
||||
) &
|
||||
Bar; // Final comment2
|
||||
type Foo2 =
|
||||
| (
|
||||
| "thing1" // Comment1
|
||||
| "thing2" // Comment2
|
||||
)
|
||||
| Bar; // Final comment2
|
||||
```
|
||||
@@ -1,19 +0,0 @@
|
||||
#### Don't break union type when it can fit (#18827 by @fisker)
|
||||
|
||||
<!-- prettier-ignore -->
|
||||
```tsx
|
||||
// Input
|
||||
type Browser = "chromium" | "webkit" | "firefox" | "chromium-msedge" | "chromium-chrome";
|
||||
|
||||
// Prettier stable
|
||||
type Browser =
|
||||
| "chromium"
|
||||
| "webkit"
|
||||
| "firefox"
|
||||
| "chromium-msedge"
|
||||
| "chromium-chrome";
|
||||
|
||||
// Prettier main
|
||||
type Browser =
|
||||
"chromium" | "webkit" | "firefox" | "chromium-msedge" | "chromium-chrome";
|
||||
```
|
||||
@@ -1,22 +0,0 @@
|
||||
#### Remove extra indention for union type in conditional type (#18827 by @fisker)
|
||||
|
||||
<!-- prettier-ignore -->
|
||||
```tsx
|
||||
// Input
|
||||
type A = T extends "arrow"
|
||||
? ExcalidrawArrowElement["startBinding"] | ExcalidrawElbowArrowElement["startBinding"]
|
||||
: never;
|
||||
|
||||
// Prettier stable
|
||||
type A = T extends "arrow"
|
||||
?
|
||||
| ExcalidrawArrowElement["startBinding"]
|
||||
| ExcalidrawElbowArrowElement["startBinding"]
|
||||
: never;
|
||||
|
||||
// Prettier main
|
||||
type A = T extends "arrow"
|
||||
? | ExcalidrawArrowElement["startBinding"]
|
||||
| ExcalidrawElbowArrowElement["startBinding"]
|
||||
: never;
|
||||
```
|
||||
@@ -1,42 +0,0 @@
|
||||
#### Align JSDoc before union type elements (#18833 by @fisker)
|
||||
|
||||
<!-- prettier-ignore -->
|
||||
```tsx
|
||||
// Input
|
||||
type A =
|
||||
|
|
||||
/**
|
||||
* Comment
|
||||
*/
|
||||
a
|
||||
| (b | c);
|
||||
type A2 =
|
||||
|
|
||||
// comment
|
||||
a
|
||||
| (b | c);
|
||||
|
||||
// Prettier stable
|
||||
type A =
|
||||
| /**
|
||||
* Comment
|
||||
*/
|
||||
a
|
||||
| (b | c);
|
||||
type A2 =
|
||||
| // comment
|
||||
a
|
||||
| (b | c);
|
||||
|
||||
// Prettier main
|
||||
type A =
|
||||
| /**
|
||||
* Comment
|
||||
*/
|
||||
a
|
||||
| (b | c);
|
||||
type A2 =
|
||||
| // comment
|
||||
a
|
||||
| (b | c);
|
||||
```
|
||||
@@ -1,22 +0,0 @@
|
||||
#### Prevent moving comment in class properties (#18837 by @fisker)
|
||||
|
||||
<!-- prettier-ignore -->
|
||||
```tsx
|
||||
// Input
|
||||
class foo {
|
||||
bar () /* bar */;
|
||||
baz /* baz */ ();
|
||||
}
|
||||
|
||||
// Prettier stable
|
||||
class foo {
|
||||
bar /* bar */();
|
||||
baz /* baz */();
|
||||
}
|
||||
|
||||
// Prettier main
|
||||
class foo {
|
||||
bar(); /* bar */
|
||||
baz /* baz */();
|
||||
}
|
||||
```
|
||||
@@ -1,26 +0,0 @@
|
||||
#### Fix trailing comment in abstract method parameters (#19200 by @itsybitsybootsy)
|
||||
|
||||
<!-- prettier-ignore -->
|
||||
```tsx
|
||||
// Input
|
||||
abstract class Foo {
|
||||
abstract method(
|
||||
param1: number,
|
||||
// param2: number,
|
||||
): void;
|
||||
}
|
||||
|
||||
// Prettier stable
|
||||
abstract class Foo {
|
||||
abstract method(param1: number) // param2: number,
|
||||
: void;
|
||||
}
|
||||
|
||||
// Prettier main
|
||||
abstract class Foo {
|
||||
abstract method(
|
||||
param1: number,
|
||||
// param2: number,
|
||||
): void;
|
||||
}
|
||||
```
|
||||
@@ -1,25 +0,0 @@
|
||||
#### Avoid unnecessary semicolon before call signatures in `no-semi` mode (#19212 by @fisker)
|
||||
|
||||
<!-- prettier-ignore -->
|
||||
```tsx
|
||||
// Input
|
||||
export interface MyInterface {
|
||||
someMethod: (a: number) => Promise<number>
|
||||
anotherMethod: (a: string) => Promise<string>
|
||||
(a: string): Promise<string>
|
||||
}
|
||||
|
||||
// Prettier stable (--no-semi)
|
||||
export interface MyInterface {
|
||||
someMethod: (a: number) => Promise<number>
|
||||
anotherMethod: (a: string) => Promise<string>;
|
||||
(a: string): Promise<string>
|
||||
}
|
||||
|
||||
// Prettier main
|
||||
export interface MyInterface {
|
||||
someMethod: (a: number) => Promise<number>
|
||||
anotherMethod: (a: string) => Promise<string>
|
||||
(a: string): Promise<string>
|
||||
}
|
||||
```
|
||||
@@ -1,22 +0,0 @@
|
||||
#### Preserve comment position after `=` in type alias declarations (#19410 by @WhoamiI00)
|
||||
|
||||
<!-- prettier-ignore -->
|
||||
```ts
|
||||
// Input
|
||||
type A =
|
||||
/* 1 */ | /* 2 */ (
|
||||
/* 3 */ | /* 4 */ {
|
||||
key: string;
|
||||
}
|
||||
);
|
||||
|
||||
// Prettier stable
|
||||
type A /* 2 */ = /* 1 */ /* 3 */ /* 4 */ {
|
||||
key: string;
|
||||
};
|
||||
|
||||
// Prettier main
|
||||
type A = /* 1 */ /* 2 */ /* 3 */ /* 4 */ {
|
||||
key: string;
|
||||
};
|
||||
```
|
||||
@@ -1,25 +0,0 @@
|
||||
#### Fix missing parentheses around instantiation expression (#19442 by @fisker)
|
||||
|
||||
<!-- prettier-ignore -->
|
||||
```tsx
|
||||
// Input
|
||||
async function* f() {
|
||||
makeRecord = (yield* makeRecordFactory)<ManualValue>;
|
||||
makeRecord = (yield makeRecordFactory)<ManualValue>;
|
||||
makeRecord = (await makeRecordFactory)<ManualValue>;
|
||||
}
|
||||
|
||||
// Prettier stable
|
||||
async function* f() {
|
||||
makeRecord = yield* makeRecordFactory<ManualValue>;
|
||||
makeRecord = yield makeRecordFactory<ManualValue>;
|
||||
makeRecord = await makeRecordFactory<ManualValue>;
|
||||
}
|
||||
|
||||
// Prettier main
|
||||
async function* f() {
|
||||
makeRecord = (yield* makeRecordFactory)<ManualValue>;
|
||||
makeRecord = (yield makeRecordFactory)<ManualValue>;
|
||||
makeRecord = (await makeRecordFactory)<ManualValue>;
|
||||
}
|
||||
```
|
||||
Reference in new issue
Block a user