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"
}
}
}
}Require using arrow functions for callbacks
Disallow unnecessary constructors
Disallow the use of variables before they are defined
Disallow ternary operators when simpler alternatives exist
Disallow use of the RegExp constructor in favor of regular expression literals