diff options
author | Philip Chimento <philip.chimento@gmail.com> | 2019-08-03 20:37:01 -0700 |
---|---|---|
committer | Philip Chimento <philip.chimento@gmail.com> | 2019-08-13 22:17:34 -0700 |
commit | adf9a22adcda7e00ecb30f30d24d7318c72e841d (patch) | |
tree | 2b070d951ef71433fc772c7e0a8aa0219e605d95 /examples | |
parent | 9d5d41998dee7730708c77dc8920f4fc41154bba (diff) | |
download | gjs-adf9a22adcda7e00ecb30f30d24d7318c72e841d.tar.gz |
CI: Add eqeqeq to eslint rules
Using == for comparisons is a well-known gotcha that we should avoid.
However, we ignore the rule in tweener.js to reduce the risk of
regressions in the unmaintained code.
Diffstat (limited to 'examples')
-rw-r--r-- | examples/calc.js | 4 | ||||
-rw-r--r-- | examples/gio-cat.js | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/examples/calc.js b/examples/calc.js index 0b45732e..860c17ff 100644 --- a/examples/calc.js +++ b/examples/calc.js @@ -30,7 +30,7 @@ function pressedEquals() { calcVal = calcVal.replace('tan', 'Math.tan'); calcVal = eval(calcVal); // Avoid ridiculous amounts of precision from toString. - if (calcVal == Math.floor(calcVal)) + if (calcVal === Math.floor(calcVal)) calcVal = Math.floor(calcVal); else // bizarrely gjs loses str.toFixed() somehow?! calcVal = Math.floor(calcVal * 10000) / 10000; @@ -48,7 +48,7 @@ function pressedNumber(button) { } function swapSign() { - calcVal = ((calcVal[0] == '-') ? + calcVal = ((calcVal[0] === '-') ? calcVal.substring(1) : `-${calcVal}`); updateDisplay(); } diff --git a/examples/gio-cat.js b/examples/gio-cat.js index 92d05347..640df637 100644 --- a/examples/gio-cat.js +++ b/examples/gio-cat.js @@ -23,7 +23,7 @@ function cat(filename) { loop.run(); } -if (ARGV.length != 1) +if (ARGV.length !== 1) printerr('Usage: gio-cat.js filename'); else cat(ARGV[0]); |