ESLint
Docs for radix in ESLintradix
eslint
Suggestion
eslint.config.js
export default [
{
rules: {
"radix": "error",
},
},
];const num = parseInt("071");
const num1 = parseInt(someValue);
const num2 = parseInt("071", "abc");
const num3 = parseInt("071", 37);
const num4 = parseInt();const num = parseInt("071", 10);
const num1 = parseInt("071", 8);
const num2 = parseFloat(someValue);Examples from the ESLint documentation.
radix
eslint
export default [
{
rules: {
"radix": "error",
},
},
];radix
eslint plugin · pedantic
{
"rules": {
"radix": "error"
}
}correctness/useParseIntRadix
correctness · since 2.0.0
{
"linter": {
"rules": {
"correctness": {
"useParseIntRadix": "error"
}
}
}
}Disallow the use of Math.pow in favor of the ** operator
Require template literals instead of string concatenation
Disallow returning value from constructor
Disallow parseInt() and Number.parseInt() in favor of binary, octal, and hexadecimal literals
Disallow variable or function declarations in nested blocks
Disallow unnecessary calls to .call() and .apply()