oxc-project/oxc · warning · OxcDiagnostic
Missing parameters.
Error message
Missing parameters.
What it means
oxlint `eslint/radix`: `parseInt` was called with no arguments at all, which returns `NaN` and is almost certainly a bug. Emitted by `missing_parameters` (radix.rs:14) with help text 'Add parameters for parsing numbers, e.g., `parseInt(\'10\', 10)`'. The rule's purpose is to force an explicit radix so string-to-number parsing is deterministic across environments.
Source
Thrown at crates/oxc_linter/src/rules/eslint/radix.rs:14
use oxc_ast::{
AstKind,
ast::{Argument, CallExpression, Expression, IdentifierReference},
};
use oxc_diagnostics::OxcDiagnostic;
use oxc_macros::declare_oxc_lint;
use oxc_span::{GetSpan, Span};
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
use crate::{AstNode, context::LintContext, rule::Rule};
fn missing_parameters(span: Span) -> OxcDiagnostic {
OxcDiagnostic::warn("Missing parameters.")
.with_help("Add parameters for parsing numbers, e.g., `parseInt('10', 10)`.")
.with_label(span)
}
fn missing_radix(span: Span) -> OxcDiagnostic {
OxcDiagnostic::warn("Missing radix parameter.")
.with_help("Add radix parameter `10` for parsing decimal numbers, or specify the appropriate radix for other number formats.")
.with_label(span)
}
fn invalid_radix(span: Span) -> OxcDiagnostic {
OxcDiagnostic::warn("Invalid radix parameter, must be an integer between 2 and 36.")
.with_help("The radix parameter should be an integer between 2 and 36, or a variable that is not `undefined`.")
.with_label(span)
}
// `RadixType` has no effect, it is only here for backward compatibility.
// Without it, the linter will report unknown rule configuration error.View on GitHub (pinned to e1e7af627c)
Solutions
- Pass the string and an explicit radix: `parseInt("10", 10)`.
- Review surrounding code — a zero-argument parseInt usually means an argument was accidentally removed.
- If the value is not a string, consider `Number(value)` instead.
Example fix
// before
const n = parseInt();
// after
const n = parseInt("10", 10); Defensive patterns
Strategy: validation
Validate before calling
# zero-argument parseInt calls rg -n --pcre2 '(Number\.)?parseInt\(\s*\)' src/
Prevention
- Treat a zero-argument `parseInt()` as a compile-time bug: it always returns NaN.
- Keep the `radix` rule enabled (suggestion category) so empty and radix-less calls are caught on save.
- Use TypeScript — a zero-argument call is also a type error there.
When it happens
Trigger: A call expression whose callee resolves to the global `parseInt` (or `Number.parseInt`) with an empty argument list: `parseInt()`.
Common situations: Half-finished edits where the argument was deleted; bad find-and-replace; template-generated code with an unfilled placeholder.
Related errors
- Missing radix parameter.
- Invalid radix parameter, must be an integer between 2 and 36
- Empty array binding pattern
- Empty object binding pattern
- Checking inequality with NaN will always return true
AI-assisted analysis of oxc-project/oxc@e1e7af627c (2026-08-20).
Data as JSON: /api/errors/da06a4250aa24892.
Report an issue: GitHub.