Edit changelog entries (JS)

This commit is contained in:
Georgii Dolzhykov committed 2021-04-12 12:43:47 +03:00
1 parent c428872657
commit 22f9256faa
14 files changed
+14 -94

No files matched your search

-2
View File
@@ -1,7 +1,5 @@
#### Support for Flow's indexed access type (#10594 by @gkz)
Support for Flow's indexed access type.
<!-- prettier-ignore -->
```js
// Input
-9
View File
@@ -2,14 +2,6 @@
<!-- prettier-ignore -->
```ts
// Input
class loooooooooooooooooooong
extends looooooooooooooooooong
implements loooooooooooooooooooong
{
property: string;
}
// Prettier stable
class loooooooooooooooooooong
extends looooooooooooooooooong
@@ -24,5 +16,4 @@ class loooooooooooooooooooong
{
property: string;
}
```
+1 -3
View File
@@ -26,11 +26,10 @@ const lazyCatererNumbers = [
22,
29,
37,
// ... ✂ a lot of lines ✂ ...
// ... ✂ 46 lines ✂ ...
1379,
];
// Prettier main
const lazyCatererNumbers = [
1, 2, 4, 7, 11, 16, 22, 29, 37, 46,
@@ -41,5 +40,4 @@ const lazyCatererNumbers = [
// n > 40
821, 862, 904, 947, 991, 1036, 1082, 1129, 1177, 1226, 1276, 1327, 1379,
];
```
+6 -22
View File
@@ -2,42 +2,23 @@
<!-- prettier-ignore -->
```ts
// Input
const dotNotationMemberExpression = (
callNode.parent?.type === AST_NODE_TYPES.ChainExpression
? callNode.parent.parent
: callNode.parent
).TSESTree.BinaryExpression;
const computedMemberExpression = (
callNode.parent?.type === AST_NODE_TYPES.ChainExpression
? callNode.parent.parent
: callNode.parent
)[TSESTree.BinaryExpression];
const callExpressionCallee = (
callNode.parent?.type === AST_NODE_TYPES.ChainExpression
? callNode.parent.parent
: callNode.parent
)(TSESTree.BinaryExpression);
const typeScriptAsExpression = (
callNode.parent?.type === AST_NODE_TYPES.ChainExpression
? callNode.parent.parent
: callNode.parent
) as TSESTree.BinaryExpression;
// Prettier stable
const dotNotationMemberExpression = (callNode.parent?.type ===
AST_NODE_TYPES.ChainExpression
? callNode.parent.parent
: callNode.parent
).TSESTree.BinaryExpression;
const computedMemberExpression = (callNode.parent?.type ===
AST_NODE_TYPES.ChainExpression
? callNode.parent.parent
: callNode.parent)[TSESTree.BinaryExpression];
const callExpressionCallee = (callNode.parent?.type ===
AST_NODE_TYPES.ChainExpression
? callNode.parent.parent
: callNode.parent)(TSESTree.BinaryExpression);
const typeScriptAsExpression = (callNode.parent?.type ===
AST_NODE_TYPES.ChainExpression
? callNode.parent.parent
@@ -49,16 +30,19 @@ const dotNotationMemberExpression = (
? callNode.parent.parent
: callNode.parent
).TSESTree.BinaryExpression;
const computedMemberExpression = (
callNode.parent?.type === AST_NODE_TYPES.ChainExpression
? callNode.parent.parent
: callNode.parent
)[TSESTree.BinaryExpression];
const callExpressionCallee = (
callNode.parent?.type === AST_NODE_TYPES.ChainExpression
? callNode.parent.parent
: callNode.parent
)(TSESTree.BinaryExpression);
const typeScriptAsExpression = (
callNode.parent?.type === AST_NODE_TYPES.ChainExpression
? callNode.parent.parent
-16
View File
@@ -4,22 +4,6 @@ Previously, Prettier had a lot of trouble with figuring out how to break lines i
<!-- prettier-ignore -->
```ts
// Input
aParticularlyLongAndObnoxiousNameForIllustrativePurposes =
anotherVeryLongNameForIllustrativePurposes;
aParticularlyLongAndObnoxiousNameForIllustrativePurposes =
'a very long string for illustrative purposes'.length;
someReallyLongThingStoredInAMapWithAReallyBigName[pageletID] =
_someVariableThatWeAreCheckingForFalsiness
? Date.now() - _someVariableThatWeAreCheckingForFalsiness
: 0;
class x {
private readonly rawConfigFromFile$: BehaviorSubject<any> = new BehaviorSubject(notRead);
}
// Prettier stable
aParticularlyLongAndObnoxiousNameForIllustrativePurposes = anotherVeryLongNameForIllustrativePurposes;
-7
View File
@@ -2,12 +2,6 @@
<!-- prettier-ignore -->
```js
// Input
const { firstName, lastName } = useMemo(
() => parseFullName(fullName),
[fullName]
);
// Prettier stable
const { firstName, lastName } = useMemo(() => parseFullName(fullName), [
fullName,
@@ -18,5 +12,4 @@ const { firstName, lastName } = useMemo(
() => parseFullName(fullName),
[fullName]
);
```
-5
View File
@@ -4,11 +4,6 @@ Line breaks after short property names in object literals often look unnatural.
<!-- prettier-ignore -->
```js
// Input
const importantLink = {
url: "https://prettier.io/docs/en/rationale.html#what-prettier-is-concerned-about"
};
// Prettier stable
const importantLink = {
url:
+1 -1
View File
@@ -1,4 +1,4 @@
#### Fix missing parentheses for `yield` in `pipeline` (#10446 by @fisker)
#### Fix missing parentheses for `yield` in a pipeline (#10446 by @fisker)
<!-- prettier-ignore -->
```jsx
-7
View File
@@ -4,13 +4,6 @@ Prettier special-cases AMD `define` calls to avoid unexpected line breaks in the
<!-- prettier-ignore -->
```jsx
// Input
const someVariable = define(
"some string literal",
anotherVariable,
yetAnotherVariable
);
// Prettier stable
const someVariable = define("some string literal", anotherVariable, yetAnotherVariable);
+1 -1
View File
@@ -1,4 +1,4 @@
#### Fix duplicated prettier-ignore comments (#10666 by @fisker)
#### Fix duplicated `prettier-ignore` comments (#10666 by @fisker)
<!-- prettier-ignore -->
```jsx
+1 -7
View File
@@ -1,13 +1,7 @@
#### Improve formatting for do expression (#10693 by @sosukesuzuki)
#### Improve formatting for `do` expressions (#10693 by @sosukesuzuki)
<!-- prettier-ignore -->
```js
// Input
expect(do {
var bar = "foo";
bar;
}).toBe("foo");
// Prettier stable
expect(
do {
+2 -4
View File
@@ -1,9 +1,7 @@
#### Improve comment format (#9672 by @fisker)
When multiple comments on same line, the result became unstable.
#### Fix unstable multiple comments on the same line (#9672 by @fisker)
<!-- prettier-ignore -->
```jsx
```js
// Input
a;
/*1*//*2*/
+2
View File
@@ -1,5 +1,7 @@
#### Fix inconsistent language comment detection (#9743 by @fisker)
An `/* HTML */` comment should directly precede a template literal for the latter to be recognized as HTML-in-JS. Previously, the comment was erroneously recognized is some other locations.
<!-- prettier-ignore -->
```jsx
// Input
-10
View File
@@ -2,16 +2,6 @@
<!-- prettier-ignore -->
```js
// Input
const currying =
(argument1) =>
(argument2) =>
(argument3) =>
(argument4) =>
(argument5) =>
(argument6) =>
foo;
// Prettier stable
const currying = (argument1) => (argument2) => (argument3) => (argument4) => (
argument5