Browse Source

deps(ui): Upgrade prettier (#86634)

Scott Cooper 3 days ago
parent
commit
e34c7e8248

+ 1 - 1
package.json

@@ -140,7 +140,7 @@
     "peggy": "^4.1.1",
     "platformicons": "^8.0.0",
     "po-catalog-loader": "2.1.0",
-    "prettier": "3.3.2",
+    "prettier": "3.5.3",
     "prismjs": "^1.29.0",
     "process": "^0.11.10",
     "qrcode.react": "^3.1.0",

+ 1 - 1
static/app/actionCreators/pageFilters.tsx

@@ -361,7 +361,7 @@ export function initializeUrlState({
 
   const pinnedFilters = organization.features.includes('new-page-filter')
     ? new Set<PinnedPageFilter>(['projects', 'environments', 'datetime'])
-    : storedPageFilters?.pinnedFilters ?? new Set();
+    : (storedPageFilters?.pinnedFilters ?? new Set());
 
   PageFiltersStore.onInitializeUrlState(pageFilters, pinnedFilters, shouldPersist);
   if (shouldUpdateLocalStorage) {

+ 4 - 3
static/app/components/avatarUploader.tsx

@@ -455,12 +455,13 @@ const ImageCropper = styled('div')<{resizeDirection: Position | null}>`
     10px -10px,
     -10px 0px;
   background-color: ${p => p.theme.background};
-  background-image: linear-gradient(
-      45deg,
+  background-image:
+    linear-gradient(45deg, ${p => p.theme.backgroundSecondary} 25%, rgba(0, 0, 0, 0) 25%),
+    linear-gradient(
+      -45deg,
       ${p => p.theme.backgroundSecondary} 25%,
       rgba(0, 0, 0, 0) 25%
     ),
-    linear-gradient(-45deg, ${p => p.theme.backgroundSecondary} 25%, rgba(0, 0, 0, 0) 25%),
     linear-gradient(45deg, rgba(0, 0, 0, 0) 75%, ${p => p.theme.backgroundSecondary} 75%),
     linear-gradient(-45deg, rgba(0, 0, 0, 0) 75%, ${p => p.theme.backgroundSecondary} 75%);
 `;

+ 1 - 1
static/app/components/breadcrumbs.tsx

@@ -110,7 +110,7 @@ export function Breadcrumbs({crumbs, linkLastItem = false, ...props}: Props) {
         const {label, to, preservePageFilters, key} = crumb;
         const labelKey = typeof label === 'string' ? label : '';
         const mapKey =
-          key ?? typeof to === 'string' ? `${labelKey}${to}` : `${labelKey}${index}`;
+          (key ?? typeof to === 'string') ? `${labelKey}${to}` : `${labelKey}${index}`;
 
         return (
           <Fragment key={mapKey}>

+ 1 - 1
static/app/components/charts/components/tooltip.tsx

@@ -401,7 +401,7 @@ export function computeChartTooltip(
 
       const chartElement: Element =
         props.appendToBody && chartId
-          ? document.getElementById(chartId) ?? parentNode
+          ? (document.getElementById(chartId) ?? parentNode)
           : parentNode;
 
       // Get the left offset of the tip container (the chart)

+ 2 - 2
static/app/components/charts/eventsChart.tsx

@@ -274,8 +274,8 @@ class Chart extends Component<ChartProps, State> {
       );
     }
     const chartColors = timeseriesData.length
-      ? colors?.slice(0, series.length) ??
-        getChartColorPalette(timeseriesData.length - 2 - (hasOther ? 1 : 0)).slice()
+      ? (colors?.slice(0, series.length) ??
+        getChartColorPalette(timeseriesData.length - 2 - (hasOther ? 1 : 0)).slice())
       : undefined;
     if (chartColors?.length && hasOther) {
       chartColors.push(theme.chartOther);

+ 2 - 1
static/app/components/checkInTimeline/utils/getTickStyle.tsx

@@ -19,7 +19,8 @@ export function getTickStyle<Status extends string>(
     border: 1px solid ${theme[style.tickColor]};
     background-size: 3px 3px;
     opacity: 0.5;
-    background-image: linear-gradient(
+    background-image:
+      linear-gradient(
         -45deg,
         ${theme[style.hatchTick]} 25%,
         transparent 25%,

+ 1 - 1
static/app/components/circleIndicator.tsx

@@ -24,7 +24,7 @@ const CircleIndicator = styled('div')<Props>`
   height: ${p => p.size ?? defaultProps.size}px;
   width: ${p => p.size ?? defaultProps.size}px;
   background: ${p =>
-    p.color ?? (p.enabled ?? defaultProps.enabled ? p.theme.success : p.theme.error)};
+    p.color ?? ((p.enabled ?? defaultProps.enabled) ? p.theme.success : p.theme.error)};
 `;
 
 export default CircleIndicator;

+ 1 - 1
static/app/components/clippedBox.tsx

@@ -287,7 +287,7 @@ function ClippedBox(props: ClippedBoxProps) {
         {props.title ? <Title>{props.title}</Title> : null}
         {props.children}
         {clipped
-          ? props.clipFade?.({showMoreButton}) ?? <ClipFade>{showMoreButton}</ClipFade>
+          ? (props.clipFade?.({showMoreButton}) ?? <ClipFade>{showMoreButton}</ClipFade>)
           : null}
       </div>
     </Wrapper>

+ 2 - 2
static/app/components/commitRow.tsx

@@ -118,7 +118,7 @@ function CommitRow({
             isHoverable
           >
             <AuthorWrapper>
-              {isUser ? t('You') : commit.author?.name ?? t('Unknown author')}
+              {isUser ? t('You') : (commit.author?.name ?? t('Unknown author'))}
               {commit.author && commit.author.id === undefined && (
                 <IconQuestion size="xs" />
               )}
@@ -209,7 +209,7 @@ function CommitRow({
           {tct('[author] committed [commitLink] \u2022 [date]', {
             author: (
               <strong>
-                {isUser ? t('You') : commit.author?.name ?? t('Unknown author')}
+                {isUser ? t('You') : (commit.author?.name ?? t('Unknown author'))}
               </strong>
             ),
             commitLink: (

Some files were not shown because too many files changed in this diff