@@ -35,7 +35,7 @@ import {
3535} from "../common/fetchers" ;
3636import { print } from "src/utils" ;
3737import { isFileUrl } from "../common/utils" ;
38- import Sentry from ' ../../common/sentry' ;
38+ import Sentry from " ../../common/sentry" ;
3939
4040const globals : {
4141 coverageReport ?: FileCoverageReport ;
@@ -47,7 +47,7 @@ const globals: {
4747 prompt ?: HTMLElement ;
4848} = { } ;
4949
50- init ( )
50+ init ( ) ;
5151
5252function init ( ) : Promise < void > {
5353 // this event discovered by "reverse-engineering GitHub"
@@ -73,10 +73,10 @@ async function main(): Promise<void> {
7373
7474 globals . coverageButton = createCoverageButton ( ) ;
7575
76- process ( metadata )
76+ process ( metadata ) ;
7777 } catch ( e ) {
78- Sentry . captureException ( e )
79- throw e
78+ Sentry . captureException ( e ) ;
79+ throw e ;
8080 }
8181}
8282
@@ -111,17 +111,16 @@ async function process(metadata: FileMetadata): Promise<void> {
111111 previousElement : globals . coverageButton ! ,
112112 selectedOptions : selectedFlags ,
113113 onClick : handleFlagClick ,
114- } )
115- . then ( ( { button, list } ) => {
116- globals . flagsButton = button ;
117- globals . flagsDrop = new Drop ( {
118- target : button ,
119- content : list ,
120- classes : "drop-theme-arrows codecov-z1 codecov-bg-white" ,
121- position : "bottom right" ,
122- openOn : "click" ,
123- } ) ;
124- } )
114+ } ) . then ( ( { button, list } ) => {
115+ globals . flagsButton = button ;
116+ globals . flagsDrop = new Drop ( {
117+ target : button ,
118+ content : list ,
119+ classes : "drop-theme-arrows codecov-z1 codecov-bg-white" ,
120+ position : "bottom right" ,
121+ openOn : "click" ,
122+ } ) ;
123+ } ) ;
125124 }
126125
127126 const components = await getComponents ( metadata ) ;
@@ -151,17 +150,16 @@ async function process(metadata: FileMetadata): Promise<void> {
151150 previousElement : globals . coverageButton ! ,
152151 onClick : handleComponentClick ,
153152 selectedOptions : selectedComponents ,
154- } )
155- . then ( ( { button, list } ) => {
156- globals . componentsButton = button ;
157- globals . componentsDrop = new Drop ( {
158- target : button ,
159- content : list ,
160- classes : "drop-theme-arrows codecov-z1 codecov-bg-white" ,
161- position : "bottom right" ,
162- openOn : "click" ,
163- } ) ;
164- } )
153+ } ) . then ( ( { button, list } ) => {
154+ globals . componentsButton = button ;
155+ globals . componentsDrop = new Drop ( {
156+ target : button ,
157+ content : list ,
158+ classes : "drop-theme-arrows codecov-z1 codecov-bg-white" ,
159+ position : "bottom right" ,
160+ openOn : "click" ,
161+ } ) ;
162+ } ) ;
165163 }
166164
167165 let coverageReportResponses : Array < FileCoverageReportResponse > ;
@@ -241,7 +239,9 @@ async function promptPastReport(metadata: FileMetadata): Promise<void> {
241239 const matches = regexp . exec ( response . commit_file_url ) ;
242240 const commit = matches ?. groups ?. commit ;
243241 if ( ! commit ) {
244- throw new Error ( "Could not parse commit hash from response for past coverage report" )
242+ throw new Error (
243+ "Could not parse commit hash from response for past coverage report"
244+ ) ;
245245 }
246246 const link = document . URL . replace (
247247 `blob/${ metadata . branch } ` ,
@@ -260,7 +260,7 @@ function createPrompt(child: any) {
260260 const ref = document . querySelector ( '[data-testid="latest-commit"]' )
261261 ?. parentElement ?. parentElement ;
262262 if ( ! ref ) {
263- throw new Error ( "Could not find reference element to render prompt" )
263+ throw new Error ( "Could not find reference element to render prompt" ) ;
264264 }
265265 const prompt = < div className = "codecov-mb2 codecov-mx1" > { child } </ div > ;
266266 return ref . insertAdjacentElement ( "afterend" , prompt ) as HTMLElement ;
0 commit comments