fixing linting for remix-solidity

pull/4771/head
lianahus 7 months ago
parent 395033f4a8
commit e0a2012a78
  1. 2
      libs/remix-solidity/src/compiler/compiler-input.ts
  2. 2
      libs/remix-solidity/src/compiler/compiler.ts
  3. 2
      libs/remix-solidity/src/compiler/helper.ts
  4. 2
      libs/remix-solidity/src/compiler/types.ts
  5. 2
      libs/remix-solidity/tests/compiler-input.spec.ts

@ -20,7 +20,7 @@ export default (sources: Source, opts: CompilerInputOptions): string => {
}, },
remappings: opts.remappings || [] remappings: opts.remappings || []
} }
} }
if (opts.evmVersion) { if (opts.evmVersion) {
if (opts.evmVersion.toLowerCase() == 'default') { if (opts.evmVersion.toLowerCase() == 'default') {
opts.evmVersion = null opts.evmVersion = null

@ -82,7 +82,7 @@ export class Compiler {
*/ */
internalCompile(files: Source, missingInputs?: string[], timeStamp?: number): void { internalCompile(files: Source, missingInputs?: string[], timeStamp?: number): void {
if(timeStamp < this.state.compilationStartTime && this.state.compilerRetriggerMode == CompilerRetriggerMode.retrigger ) { if (timeStamp < this.state.compilationStartTime && this.state.compilerRetriggerMode == CompilerRetriggerMode.retrigger ) {
return return
} }
this.gatherImports(files, missingInputs, (error, input) => { this.gatherImports(files, missingInputs, (error, input) => {

@ -36,7 +36,7 @@ export default {
} }
} }
}, },
// ^ e.g: // ^ e.g:
// browser/gm.sol: Warning: Source file does not specify required compiler version! Consider adding "pragma solidity ^0.6.12 // browser/gm.sol: Warning: Source file does not specify required compiler version! Consider adding "pragma solidity ^0.6.12
// https://github.com/OpenZeppelin/openzeppelin-contracts/blob/release-v3.2.0/contracts/introspection/IERC1820Registry.sol:3:1: ParserError: Source file requires different compiler version (current compiler is 0.7.4+commit.3f05b770.Emscripten.clang) - note that nightly builds are considered to be strictly less than the released version // https://github.com/OpenZeppelin/openzeppelin-contracts/blob/release-v3.2.0/contracts/introspection/IERC1820Registry.sol:3:1: ParserError: Source file requires different compiler version (current compiler is 0.7.4+commit.3f05b770.Emscripten.clang) - note that nightly builds are considered to be strictly less than the released version

@ -161,7 +161,7 @@ export enum CompilerRetriggerMode {
} }
export interface CompilerState { export interface CompilerState {
compileJSON: ((input: SourceWithTarget, timeStamp?: number) => void) | null, compileJSON: ((input: SourceWithTarget, timeStamp?: number) => void) | null,
worker: any, worker: any,
currentVersion: string| null| undefined, currentVersion: string| null| undefined,
compilerLicense: string| null compilerLicense: string| null

@ -20,6 +20,6 @@ describe('compiler-input', () => {
expect(getValidLanguage(undefined)).toBe(null) expect(getValidLanguage(undefined)).toBe(null)
expect(getValidLanguage('')).toBe(null) expect(getValidLanguage('')).toBe(null)
expect(getValidLanguage('A')).toBe(null) expect(getValidLanguage('A')).toBe(null)
expect(getValidLanguage('Something')).toBe(null) expect(getValidLanguage('Something')).toBe(null)
}) })
}) })

Loading…
Cancel
Save