1- import { CustomTooltip } from "@remix-ui/helper" ;
1+ import { CustomTooltip } from "@remix-ui/helper"
22import React from "react" ; //eslint-disable-line
3- import { RemixUiStaticAnalyserState } from "../staticanalyser" ;
3+ import { RemixUiStaticAnalyserState } from "../staticanalyser"
44
55interface ErrorRendererProps {
66 message : any ;
@@ -13,45 +13,45 @@ interface ErrorRendererProps {
1313
1414const ErrorRenderer = ( { message, opt, editor, name, ssaState } : ErrorRendererProps ) => {
1515 const getPositionDetails = ( msg : any ) => {
16- const result = { } as Record < string , number | string > ;
16+ const result = { } as Record < string , number | string >
1717
1818 // To handle some compiler warning without location like SPDX license warning etc
19- if ( ! msg . includes ( ":" ) ) return { errLine : - 1 , errCol : - 1 , errFile : msg } ;
19+ if ( ! msg . includes ( ":" ) ) return { errLine : - 1 , errCol : - 1 , errFile : msg }
2020
2121 // extract line / column
22- let position = msg . match ( / ^ ( .* ?) : ( [ 0 - 9 ] * ?) : ( [ 0 - 9 ] * ?) ? / ) ;
23- result . errLine = position ? parseInt ( position [ 2 ] ) - 1 : - 1 ;
24- result . errCol = position ? parseInt ( position [ 3 ] ) : - 1 ;
22+ let position = msg . match ( / ^ ( .* ?) : ( [ 0 - 9 ] * ?) : ( [ 0 - 9 ] * ?) ? / )
23+ result . errLine = position ? parseInt ( position [ 2 ] ) - 1 : - 1
24+ result . errCol = position ? parseInt ( position [ 3 ] ) : - 1
2525
2626 // extract file
27- position = msg . match ( / ^ ( h t t p s : .* ?| h t t p : .* ?| .* ?) : / ) ;
28- result . errFile = position ? position [ 1 ] : "" ;
27+ position = msg . match ( / ^ ( h t t p s : .* ?| h t t p : .* ?| .* ?) : / )
28+ result . errFile = position ? position [ 1 ] : ""
2929 return result ;
30- } ;
30+ }
3131
3232 const handlePointToErrorOnClick = async ( location , fileName ) => {
33- await editor . call ( "editor" , "discardHighlight" ) ;
33+ await editor . call ( "editor" , "discardHighlight" )
3434 await editor . call ( "editor" , "highlight" , location , fileName , "" , {
3535 focus : true ,
36- } ) ;
37- } ;
36+ } )
37+ }
3838
39- if ( ! message ) return ;
40- let position = getPositionDetails ( message ) ;
39+ if ( ! message ) return
40+ let position = getPositionDetails ( message )
4141 if (
4242 ! position . errFile ||
4343 ( opt . errorType && opt . errorType === position . errFile )
4444 ) {
4545 // Updated error reported includes '-->' before file details
46- const errorDetails = message . split ( "-->" ) ;
46+ const errorDetails = message . split ( "-->" )
4747 // errorDetails[1] will have file details
48- if ( errorDetails . length > 1 ) position = getPositionDetails ( errorDetails [ 1 ] ) ;
48+ if ( errorDetails . length > 1 ) position = getPositionDetails ( errorDetails [ 1 ] )
4949 }
50- opt . errLine = position . errLine ;
51- opt . errCol = position . errCol ;
52- opt . errFile = position . errFile . trim ( ) ;
50+ opt . errLine = position . errLine
51+ opt . errCol = position . errCol
52+ opt . errFile = position . errFile . trim ( )
5353 const classList =
54- opt . type === "error" ? "alert alert-danger" : "alert alert-warning" ;
54+ opt . type === "error" ? "alert alert-danger" : "alert alert-warning"
5555 return (
5656 < div >
5757 < div className = { `sol ${ opt . type } ${ classList } ` } >
@@ -91,7 +91,7 @@ const ErrorRenderer = ({ message, opt, editor, name, ssaState }: ErrorRendererPr
9191 </ div >
9292 </ div >
9393 </ div >
94- ) ;
95- } ;
94+ )
95+ }
9696
97- export default ErrorRenderer ;
97+ export default ErrorRenderer
0 commit comments