Browse Source

style(js): Fix curly usage (#30943)

Evan Purkhiser 3 years ago
parent
commit
03393eb102

+ 9 - 3
static/app/components/demoSandboxButton.tsx

@@ -49,11 +49,17 @@ function DemoSandboxButton({
   const organization: Organization = useOrganization();
   const url = new URL('https://try.sentry-demo.com/demo/start/');
 
-  if (scenario) url.searchParams.append('scenario', scenario);
+  if (scenario) {
+    url.searchParams.append('scenario', scenario);
+  }
 
-  if (projectSlug) url.searchParams.append('projectSlug', projectSlug);
+  if (projectSlug) {
+    url.searchParams.append('projectSlug', projectSlug);
+  }
 
-  if (errorType) url.searchParams.append('errorType', errorType);
+  if (errorType) {
+    url.searchParams.append('errorType', errorType);
+  }
   // always skip adding email when coming from in-product
   const clientOptions: SandboxData = {
     skipEmail: true,

+ 3 - 1
static/app/utils/profiling/jsSelfProfiling.tsx

@@ -31,7 +31,9 @@ export function resolveJSSelfProfilingStack(
     callStack.unshift(createMarkerFrame(marker));
   }
 
-  if (stackId === undefined) return callStack;
+  if (stackId === undefined) {
+    return callStack;
+  }
 
   let stack: JSSelfProfiling.Stack | undefined = trace.stacks[stackId];
 

+ 6 - 2
static/app/utils/profiling/profile/eventedProfile.tsx

@@ -59,7 +59,9 @@ export class EventedProfile extends Profile {
     }
 
     const top = lastOfArray(this.stack);
-    if (top) top.addToSelfWeight(weight);
+    if (top) {
+      top.addToSelfWeight(weight);
+    }
   }
 
   addWeightsToNodes(value: number) {
@@ -132,7 +134,9 @@ export class EventedProfile extends Profile {
     this.addWeightsToNodes(at);
 
     const leavingStackTop = this.appendOrderStack.pop();
-    if (!leavingStackTop) throw new Error('Unbalanced stack');
+    if (!leavingStackTop) {
+      throw new Error('Unbalanced stack');
+    }
 
     // Lock the stack node, so we make sure we dont mutate it in the future.
     // The samples should be ordered by timestamp when processed so we should never

+ 3 - 1
tests/js/spec/utils/profiling/profile/profile.spec.tsx

@@ -44,7 +44,9 @@ stack top -> stack bottom`;
   const visit = (node: CallTreeNode, str: string[]) => {
     str.push(`${node.frame.name}`);
 
-    if (node.parent) visit(node.parent, str);
+    if (node.parent) {
+      visit(node.parent, str);
+    }
   };
 
   for (const stackTop of samples) {