From 6b65640ac7e102a7a4677b7923a3e28dec62309d Mon Sep 17 00:00:00 2001 From: BafS Date: Mon, 12 Feb 2018 21:57:30 +0100 Subject: [PATCH] Radix should be specified Part of the best practices https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseInt and https://eslint.org/docs/rules/radix --- .eslintrc.js | 8 ++------ src/enums.js | 2 +- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index baccf3a6..a13ac8ed 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -277,10 +277,6 @@ module.exports = { "prefer-template": "off", "quote-props": "off", "quotes": "off", - "radix": [ - "error", - "as-needed" - ], "require-await": "error", "require-jsdoc": "off", "rest-spread-spacing": "error", @@ -327,12 +323,12 @@ module.exports = { "never" ], - // Custom silencers: + // Custom silencers: "camelcase": 0, "no-debugger": 0, "require-await": 0, "no-multi-assign": 0, - "no-underscore-dangle": 0, + "no-underscore-dangle": 0, "no-restricted-syntax": 0, "one-var-declaration-per-line": 0, diff --git a/src/enums.js b/src/enums.js index 607b0e53..4ea90c0b 100644 --- a/src/enums.js +++ b/src/enums.js @@ -381,7 +381,7 @@ export default { /** Converts from an integer to string. */ read: function(type, e) { for (var i in type) { - if (type[i] === parseInt(e)) { + if (type[i] === parseInt(e, 10)) { return i; } }