chore(deps): upgrade prettier to v3 - #4674
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
brandyscarney
left a comment
There was a problem hiding this comment.
I left some comments on some of the trailing commas. I think some of the trailing commas are overkill, like inside of console.log or after <IonApp> in React apps. It might make more sense if we use this setting:
{
"trailingComma": "es5"
}
Let me know your thoughts.
| ready() { | ||
| console.log( | ||
| 'App is being served from cache by a service worker.\n' + 'For more details, visit https://goo.gl/AFskqB' | ||
| 'App is being served from cache by a service worker.\n' + 'For more details, visit https://goo.gl/AFskqB', |
There was a problem hiding this comment.
Why does this add a comma to the end?
| @@ -71,7 +71,7 @@ export class ExampleComponent implements OnInit { | |||
| // Listen for changes to the media queries | |||
| prefersDark.addEventListener('change', (mediaQuery) => this.initializeDarkPalette(mediaQuery.matches)); | |||
| prefersHighContrast.addEventListener('change', (mediaQuery) => | |||
| this.initializeHighContrastPalette(mediaQuery.matches) | |||
| this.initializeHighContrastPalette(mediaQuery.matches), | |||
There was a problem hiding this comment.
Why does this add a comma to the end?
| @@ -31,7 +31,7 @@ | |||
| const selectedValue = event.detail.value; | |||
|
|
|||
| console.log( | |||
| `Expanded: ${selectedValue === undefined ? 'None' : event.detail.value} | Collapsed: ${collapsedItems.join(', ')}` | |||
| `Expanded: ${selectedValue === undefined ? 'None' : event.detail.value} | Collapsed: ${collapsedItems.join(', ')}`, | |||
There was a problem hiding this comment.
Why does this add a comma to the end?
| @@ -21,7 +21,7 @@ | |||
|
|
|||
| const validateEmail = (email) => { | |||
| return email.match( | |||
| /^(?=.{1,254}$)(?=.{1,64}@)[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+)*@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/ | |||
| /^(?=.{1,254}$)(?=.{1,64}@)[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+)*@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/, | |||
There was a problem hiding this comment.
Why does this add a comma to the end?
| @@ -20,7 +20,7 @@ | |||
|
|
|||
| const validateEmail = (email) => { | |||
| return email.match( | |||
| /^(?=.{1,254}$)(?=.{1,64}@)[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+)*@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/ | |||
| /^(?=.{1,254}$)(?=.{1,64}@)[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+)*@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/, | |||
There was a problem hiding this comment.
Why does this add a comma to the end?
| @@ -22,11 +22,16 @@ function Example() { | |||
| <IonText color="warning"> | |||
| <IonIcon icon={warning}></IonIcon> | |||
| </IonText> | |||
| I saw a werewolf with a Chinese menu in his hand. Walking through the <IonText color="success"> | |||
| I saw a werewolf with a Chinese menu in his hand. Walking through the{' '} | |||
There was a problem hiding this comment.
Can we remove these spaces?
| I saw a werewolf with a Chinese menu in his hand. Walking through the{' '} | |
| I saw a werewolf with a Chinese menu in his hand. Walking through the |
| <sub>streets</sub> | ||
| </IonText> of Soho in the rain. He <IonText color="medium"> | ||
| </IonText>{' '} |
There was a problem hiding this comment.
| </IonText>{' '} | |
| </IonText> |
| <sub>streets</sub> | ||
| </IonText> of Soho in the rain. He <IonText color="medium"> | ||
| </IonText>{' '} | ||
| of Soho in the rain. He{' '} |
There was a problem hiding this comment.
| of Soho in the rain. He{' '} | |
| of Soho in the rain. He |
| <i>was</i> | ||
| </IonText> looking for a place called Lee Ho Fook's. Gonna get a <IonText color="danger">big dish of beef chow mein.</IonText> | ||
| </IonText>{' '} |
There was a problem hiding this comment.
| </IonText>{' '} | |
| </IonText> |
| <i>was</i> | ||
| </IonText> looking for a place called Lee Ho Fook's. Gonna get a <IonText color="danger">big dish of beef chow mein.</IonText> | ||
| </IonText>{' '} | ||
| looking for a place called Lee Ho Fook's. Gonna get a{' '} |
There was a problem hiding this comment.
| looking for a place called Lee Ho Fook's. Gonna get a{' '} | |
| looking for a place called Lee Ho Fook's. Gonna get a |
Issue URL: internal
What is the current behavior?
Prettier is on 2.8.8, released in 2023.
@ionic/prettier-configis on v3.What is the new behavior?
@ionic/prettier-configv4<strong>,<b>,<em>,<i>) to markdown indocs/andversioned_docs/version-v8Does this introduce a breaking change?
Other information
1009 files, but almost all of it is one line each. The breakdown:
<!DOCTYPE html>→<!doctype html>. Prettier 3 lowercases it. Browsers don't care@ionic/prettier-configv4, whose only change istrailingComma: 'es5'→'all'. That adds commas after function parameters, which then breaks long signatures one-per-line. Mostly Angular constructor injection in code samplesWhy the HTML conversion is here. Raw HTML in a markdown paragraph makes prettier treat it as JSX and hard-wrap the prose at 120 chars, splitting sentences mid-line. Prettier 3 made that more visible, so converting to
**removes the cause. Bold and italics render identically.