Commit 55479309 authored by yann300's avatar yann300

linting

parent 02effc55
...@@ -114,24 +114,23 @@ export class SlitherClient extends PluginClient { ...@@ -114,24 +114,23 @@ export class SlitherClient extends PluginClient {
// Allow paths and set solc remapping for import URLs // Allow paths and set solc remapping for import URLs
const fileContent = readFileSync(`${this.currentSharedFolder}/${filePath}`, 'utf8') const fileContent = readFileSync(`${this.currentSharedFolder}/${filePath}`, 'utf8')
const importsArr = fileContent.match(/import ['"][^.|..](.+?)['"];/g) const importsArr = fileContent.match(/import ['"][^.|..](.+?)['"];/g)
let allowPaths = ''; let remaps = '' let remaps = ''
if (importsArr?.length) { if (importsArr?.length) {
const { remapString, allowPathString } = this.mapNpmDepsDir(importsArr) const { remapString } = this.mapNpmDepsDir(importsArr)
allowPaths = allowPathString
remaps = remapString.trim() remaps = remapString.trim()
} }
const optimizeOption: string = optimize ? '--optimize' : '' const optimizeOption: string = optimize ? '--optimize' : ''
const evmOption: string = evmVersion ? `--evm-version ${evmVersion}` : '' const evmOption: string = evmVersion ? `--evm-version ${evmVersion}` : ''
let solcArgs = '' let solcArgs = ''
if (optimizeOption) { if (optimizeOption) {
solcArgs += optimizeOption + ' ' solcArgs += optimizeOption + ' '
} }
if (evmOption) { if (evmOption) {
if (!solcArgs.endsWith(' ')) solcArgs += ' ' if (!solcArgs.endsWith(' ')) solcArgs += ' '
solcArgs += evmOption; solcArgs += evmOption
} }
if (solcArgs) { if (solcArgs) {
solcArgs = `--solc-args "${solcArgs.trimStart()}"`; solcArgs = `--solc-args "${solcArgs.trimStart()}"`
} }
const solcRemaps = remaps ? `--solc-remaps "${remaps}"` : '' const solcRemaps = remaps ? `--solc-remaps "${remaps}"` : ''
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment