aboutsummaryrefslogtreecommitdiff
path: root/lib/compilers/rust.js
diff options
context:
space:
mode:
authorRubén Rincón Blanco <ruben@rinconblanco.es>2020-08-04 22:39:02 +0200
committerGitHub <noreply@github.com>2020-08-04 16:39:02 -0400
commitccff4b9ee5a37c13f0973b52e8f90a8be8359fea (patch)
tree0022c9364824c5b4e4f5818c4abbf654aa99f2e8 /lib/compilers/rust.js
parent7126b39a6bdeabffc312c8a117ec7af072ef6a1c (diff)
downloadcompiler-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/rust.js')
-rw-r--r--lib/compilers/rust.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/compilers/rust.js b/lib/compilers/rust.js
index 2b073a918..78a06c7b6 100644
--- a/lib/compilers/rust.js
+++ b/lib/compilers/rust.js
@@ -25,7 +25,7 @@
const BaseCompiler = require('../base-compiler'),
_ = require('underscore'),
path = require('path'),
- argumentParsers = require("./argument-parsers");
+ argumentParsers = require('./argument-parsers');
class RustCompiler extends BaseCompiler {
constructor(info, env) {
@@ -33,7 +33,7 @@ class RustCompiler extends BaseCompiler {
this.compiler.supportsIntel = true;
this.compiler.supportsIrView = true;
this.compiler.irArg = ['--emit', 'llvm-ir'];
- this.linker = this.compilerProps("linker");
+ this.linker = this.compilerProps('linker');
}
getSharedLibraryPathsAsArguments() {
@@ -43,7 +43,7 @@ class RustCompiler extends BaseCompiler {
optionsForFilter(filters, outputFilename, userOptions) {
let options = ['-C', 'debuginfo=1', '-o', this.filename(outputFilename)];
- const userRequestedEmit = _.any(userOptions, opt => opt.indexOf("--emit") > -1);
+ const userRequestedEmit = _.any(userOptions, opt => opt.includes('--emit'));
if (filters.binary) {
options = options.concat(['--crate-type', 'bin']);
if (this.linker) {