diff options
author | Rubén Rincón Blanco <ruben@rinconblanco.es> | 2020-08-04 22:39:02 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-04 16:39:02 -0400 |
commit | ccff4b9ee5a37c13f0973b52e8f90a8be8359fea (patch) | |
tree | 0022c9364824c5b4e4f5818c4abbf654aa99f2e8 /lib/compilers/assembly.js | |
parent | 7126b39a6bdeabffc312c8a117ec7af072ef6a1c (diff) | |
download | compiler-explorer-ccff4b9ee5a37c13f0973b52e8f90a8be8359fea.tar.gz compiler-explorer-ccff4b9ee5a37c13f0973b52e8f90a8be8359fea.zip |
Add new eslint rules (#2121)
The largest changes here are:
- enforcing single quotes for strings
- enforcing trailing commas where possible
In addition to those we have enabled several eslint plugins:
- plugin:requirejs/recommended, to enforce some conventions in require statements
- plugin:node/recommended, to enforce correct usage of various node.js APIs
- plugin:unicorn/recommended, which contains a pretty mixed bag of useful rules
This PR attempts to not change code behavior when possible. In cases where fixing
existing code would change semantics, a linting exclusion has been placed in the
code base to silence the error. You can find these by searching for `eslint-disable-next-line`.
Co-authored-by: Austin Morton <austinpmorton@gmail.com>
Diffstat (limited to 'lib/compilers/assembly.js')
-rw-r--r-- | lib/compilers/assembly.js | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/lib/compilers/assembly.js b/lib/compilers/assembly.js index 25156ae22..ef792ca3a 100644 --- a/lib/compilers/assembly.js +++ b/lib/compilers/assembly.js @@ -21,14 +21,14 @@ // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. -"use strict"; +'use strict'; const BaseCompiler = require('../base-compiler'), AsmRaw = require('../asm-raw').AsmParser, utils = require('../utils'), - fs = require("fs"), - path = require("path"), - argumentParsers = require("./argument-parsers"); + fs = require('fs'), + path = require('path'), + argumentParsers = require('./argument-parsers'); class AssemblyCompiler extends BaseCompiler { constructor(info, env) { @@ -76,7 +76,7 @@ class AssemblyCompiler extends BaseCompiler { resolve(path.join(outputFolder, file)); } }); - reject("No output file was generated"); + reject('No output file was generated'); }); }); } @@ -84,14 +84,14 @@ class AssemblyCompiler extends BaseCompiler { async objdump(outputFilename, result, maxSize, intelAsm, demangle) { const realOutputFilename = await this.getGeneratedOutputFilename(outputFilename); const dirPath = path.dirname(realOutputFilename); - let args = ["-d", realOutputFilename, "-l", "--insn-width=16"]; - if (demangle) args = args.concat("-C"); - if (intelAsm) args = args.concat(["-M", "intel"]); + let args = ['-d', realOutputFilename, '-l', '--insn-width=16']; + if (demangle) args = args.concat('-C'); + if (intelAsm) args = args.concat(['-M', 'intel']); const objResult = await this.exec( this.compiler.objdumper, args, {maxOutput: maxSize, customCwd: dirPath}); result.asm = objResult.stdout; if (objResult.code !== 0) { - result.asm = "<No output: objdump returned " + objResult.code + ">"; + result.asm = '<No output: objdump returned ' + objResult.code + '>'; } return result; } |