-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Upgrade wp-prettier to 2.8.5 #49258
Upgrade wp-prettier to 2.8.5 #49258
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,7 +43,7 @@ const colors = [ | |
|
||
const Template: ComponentStory< typeof BorderBoxControl > = ( props ) => { | ||
const { onChange, ...otherProps } = props; | ||
const [ borders, setBorders ] = useState< typeof props[ 'value' ] >(); | ||
const [ borders, setBorders ] = useState< ( typeof props )[ 'value' ] >(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This does make sense IMO 👍 |
||
|
||
const onChangeMerged: ComponentProps< | ||
typeof BorderBoxControl | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -294,7 +294,7 @@ export const showBlockTypes = | |
( type ) => | ||
! ( | ||
Array.isArray( blockNames ) ? blockNames : [ blockNames ] | ||
).includes( type ) | ||
).includes( type ) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh, I love this. I hated how it added that extra space! |
||
); | ||
|
||
registry | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,3 @@ | |
}, | ||
"include": [ "src/**/*" ] | ||
} | ||
|
||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm curious why those were needed as separate variables. Is the new version breaking these expressions somehow?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not breaking them, the formatting was just not pretty. The conditional JSX:
was already over 80 columns, but the old Prettier didn't break it. The new Prettier breaks it like:
which looks bad and also adds a new level of indentation for the inner markup. I decided to make it look good again by extracting the condition.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, thank you for clarifying 👍