diff --git a/libs/remix-ui/static-analyser/src/lib/remix-ui-static-analyser.tsx b/libs/remix-ui/static-analyser/src/lib/remix-ui-static-analyser.tsx index 21acfe376a..383bfa7643 100644 --- a/libs/remix-ui/static-analyser/src/lib/remix-ui-static-analyser.tsx +++ b/libs/remix-ui/static-analyser/src/lib/remix-ui-static-analyser.tsx @@ -105,6 +105,20 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => { return () => { } }, [autoRun, categoryIndex]) + const message = (name, warning, more, fileName, locationString) : string => { + return (` + + ${name} + ${warning} + ${more + ? (more) + : ( ) + } + Pos: ${locationString} + ` + ) + } + const run = (lastCompilationResult, lastCompilationSource, currentFile) => { if (autoRun) { setResult({ lastCompilationResult, lastCompilationSource, currentFile }) @@ -150,16 +164,7 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => { fileName = Object.keys(lastCompilationResult.contracts)[file] } warningCount++ - const msg = ` - - ${result.name} - ${item.warning} - ${item.more - ? `more` - : ' ' - } - Pos: ${locationString} - ` + const msg = message(item.name, item.warning, item.more, fileName, locationString) const options = { type: 'warning', useSpan: true,