linting fix

pull/5370/head
aniket-engg 4 years ago committed by Aniket
parent d5f7c9a977
commit 4a16e0798c
  1. 34
      libs/remix-ui/static-analyser/src/lib/remix-ui-static-analyser.tsx

@ -134,10 +134,10 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
const showWarningsByModule = (showOnlyModule: string) => { const showWarningsByModule = (showOnlyModule: string) => {
let count = 0 let count = 0
if(allWarnings[showOnlyModule]) { if (allWarnings[showOnlyModule]) {
const newWarningState = {} const newWarningState = {}
newWarningState[showOnlyModule] = allWarnings[showOnlyModule] newWarningState[showOnlyModule] = allWarnings[showOnlyModule]
setWarningState({[showOnlyModule]: allWarnings[showOnlyModule]}) setWarningState({ [showOnlyModule]: allWarnings[showOnlyModule] })
count = allWarnings[showOnlyModule].length count = allWarnings[showOnlyModule].length
} else if (showOnlyModule === 'all') { } else if (showOnlyModule === 'all') {
setWarningState(allWarnings) setWarningState(allWarnings)
@ -153,7 +153,7 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
const warningMessage = [] const warningMessage = []
const warningErrors = [] const warningErrors = []
/******************** Remix Analysis ********************/ // Remix Analysis
runner.run(lastCompilationResult, categoryIndex, results => { runner.run(lastCompilationResult, categoryIndex, results => {
results.map((result) => { results.map((result) => {
let moduleName let moduleName
@ -207,7 +207,7 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
warningMessage.push({ msg, options, hasWarning: true, warningModuleName: moduleName }) warningMessage.push({ msg, options, hasWarning: true, warningModuleName: moduleName })
}) })
}) })
/******************** Slither Analysis ********************/ // Slither Analysis
if (slitherEnabled) { if (slitherEnabled) {
props.analysisModule.call('solidity-logic', 'getCompilerState').then((compilerState) => { props.analysisModule.call('solidity-logic', 'getCompilerState').then((compilerState) => {
const { currentVersion, optimize, evmVersion } = compilerState const { currentVersion, optimize, evmVersion } = compilerState
@ -245,7 +245,7 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
fileName, fileName,
errLine: row, errLine: row,
errCol: column, errCol: column,
item: { warning: item.description}, item: { warning: item.description },
name: item.title, name: item.title,
locationString, locationString,
more: item.more, more: item.more,
@ -265,8 +265,8 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
setShowSlitherResult('node') setShowSlitherResult('node')
if (categoryIndex.length > 0) { if (categoryIndex.length > 0) {
props.event.trigger('staticAnaysisWarning', [warningCount]) props.event.trigger('staticAnaysisWarning', [warningCount])
}
} }
}
}) })
} else { } else {
if (categoryIndex.length) { if (categoryIndex.length) {
@ -451,15 +451,15 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
</span> </span>
</div> </div>
<div className="d-flex" id="onlySlitherResult"> <div className="d-flex" id="onlySlitherResult">
<RemixUiCheckbox <RemixUiCheckbox
id="showOnlySlitherResult" id="showOnlySlitherResult"
inputType="checkbox" inputType="checkbox"
onClick={handleShowSlitherResultEnabled} onClick={handleShowSlitherResultEnabled}
checked={slitherResultEnabled} checked={slitherResultEnabled}
label="Show Only Slither Analysis" label="Show Only Slither Analysis"
onChange={() => {}} onChange={() => {}}
display = {showSlitherResult} display = {showSlitherResult}
/> />
</div> </div>
<br/> <br/>
{Object.entries(warningState).length > 0 && {Object.entries(warningState).length > 0 &&
@ -469,8 +469,8 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
(Object.entries(warningState).map((element, index) => ( (Object.entries(warningState).map((element, index) => (
<div key={index}> <div key={index}>
<span className="text-dark h6">{element[0]}</span> <span className="text-dark h6">{element[0]}</span>
{element[1]['map']((x, i) => ( {element[1]['map']((x, i) => ( // eslint-disable-line dot-notation
x.hasWarning ? ( x.hasWarning ? ( // eslint-disable-next-line dot-notation
<div id={`staticAnalysisModule${element[1]['warningModuleName']}`} key={i}> <div id={`staticAnalysisModule${element[1]['warningModuleName']}`} key={i}>
<ErrorRenderer message={x.msg} opt={x.options} warningErrors={ x.warningErrors} editor={props.analysisModule}/> <ErrorRenderer message={x.msg} opt={x.options} warningErrors={ x.warningErrors} editor={props.analysisModule}/>
</div> </div>

Loading…
Cancel
Save