Add 2.5 blog#11823
Conversation
|
|
||
| <!-- Prettier 2.5 --> | ||
| ```tsx | ||
| const test = <T>(value: T) => {}; |
f5d9b87 to
efa5a60
Compare
|
If anyone wants to proofread the post, note that Preview URL has changed:
|
5a31ea7 to
b2ae0f4
Compare
j-f1
left a comment
There was a problem hiding this comment.
Made a bunch of suggestions. I’m not particularly attached to them, so feel free to reject any you don’t agree with :)
| #### [HIGHLIGHT]Avoid extra offset in arrow function body when using long types (#11515 by @kachkaev and @thorn0) | ||
|
|
||
| Starting with Prettier 2.3.0, type declarations in arrow functions could affect function body offset. Changing the length of the type annotation could produce large diffs and thus increased the chance of git conflicts. To prevent this, function body offset was stabilized. | ||
| However, this change can make a big difference from 2.4.1. Please be careful. |
There was a problem hiding this comment.
The use of the term “offset” here wasn’t clear to me — maybe change it to “indentation?” Additionally, I would reword the last sentence like so:
| However, this change can make a big difference from 2.4.1. Please be careful. | |
| **Note**: This change may affect a large number of lines in your codebase. |
(or something similar?)
j-f1
left a comment
There was a problem hiding this comment.
LGTM with one small formatting suggestion:
Co-authored-by: Lucas Azzola <[email protected]>
Co-authored-by: Lucas Azzola <[email protected]>
Co-authored-by: Jed Fox <[email protected]>
8e9da6d to
acd68e1
Compare
|
I just noticed that #11823 (comment) was marked as resolved but my first sentence about the use of “offset” was not addressed. |
| // Input | ||
| @use 'library' with ( | ||
| $black: #222, | ||
| $border-radius: 0.1rem $font-family: 'Helvetica, sans-serif' |
There was a problem hiding this comment.
Is this supposed to be invalid Sass? If not, there's a missing comma. (below as well + newline)
There was a problem hiding this comment.
I think it is valid scss
There was a problem hiding this comment.
I'm not familiar with SCSS, but at least there is a below code on the scss docs.
@use 'library' with (
$black: #222,
$border-radius: 0.1rem
);There was a problem hiding this comment.
Woops sorry I didn't notice that. I'll fix later, thank you!
|
Great work @sosukesuzuki 👏👏👏 |

Description
https://deploy-preview-11823--prettier.netlify.app/blog/2021/11/25/2.5.0.html
Checklist
✨Try the playground for this PR✨