@@ -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,16 +111,17 @@ async function process(metadata: FileMetadata): Promise<void> {
111111 previousElement : globals . coverageButton ! ,
112112 selectedOptions : selectedFlags ,
113113 onClick : handleFlagClick ,
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- } ) ;
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+ } )
124125 }
125126
126127 const components = await getComponents ( metadata ) ;
@@ -150,16 +151,17 @@ async function process(metadata: FileMetadata): Promise<void> {
150151 previousElement : globals . coverageButton ! ,
151152 onClick : handleComponentClick ,
152153 selectedOptions : selectedComponents ,
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- } ) ;
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+ } )
163165 }
164166
165167 let coverageReportResponses : Array < FileCoverageReportResponse > ;
@@ -239,9 +241,7 @@ async function promptPastReport(metadata: FileMetadata): Promise<void> {
239241 const matches = regexp . exec ( response . commit_file_url ) ;
240242 const commit = matches ?. groups ?. commit ;
241243 if ( ! commit ) {
242- throw new Error (
243- "Could not parse commit hash from response for past coverage report"
244- ) ;
244+ throw new Error ( "Could not parse commit hash from response for past coverage report" )
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