oxc-project/oxc · warning · OxcDiagnostic
Unexpected multiple arguments.
Error message
Unexpected multiple arguments.
What it means
The vue/no-multiple-slot-args rule reports scoped-slot functions called with more than one argument. Vue scoped slots (rendered via `this.$slots.default(...)` or slot functions) pass exactly one argument — the slot props object. Extra arguments are silently ignored, so passing several values positionally is always a bug. The diagnostic 'Unexpected multiple arguments.' tells you to pass only one argument to the slot function.
Source
Thrown at crates/oxc_linter/src/rules/vue/no_multiple_slot_args.rs:18
use oxc_ast::{
AstKind,
ast::{
AssignmentTarget, Expression, IdentifierReference, MemberExpression,
VariableDeclarationKind,
},
};
use oxc_diagnostics::OxcDiagnostic;
use oxc_macros::declare_oxc_lint;
use oxc_span::{GetSpan, Span};
use crate::{
AstNode, ast_util::variable_declaration_kind, context::LintContext,
frameworks::FrameworkOptions, rule::Rule,
};
fn multiple_arguments_diagnostic(span: Span) -> OxcDiagnostic {
OxcDiagnostic::warn("Unexpected multiple arguments.")
.with_help("Pass only one argument to the slot function.")
.with_label(span)
}
fn spread_argument_diagnostic(span: Span) -> OxcDiagnostic {
OxcDiagnostic::warn("Unexpected spread argument.")
.with_help("Do not use spread arguments when calling slot functions.")
.with_label(span)
}
#[derive(Debug, Default, Clone)]
pub struct NoMultipleSlotArgs;
declare_oxc_lint!(
/// ### What it does
///
/// Disallow passing multiple arguments to scoped slots.
///View on GitHub (pinned to e1e7af627c)
Solutions
- Collapse all values into a single object argument: `this.$slots.default({ item, index })`.
- Destructure the props object in the template consumer: `<template #default="{ item, index }">`.
- Audit other slot calls in the same render function for the same positional-argument mistake.
- Re-run oxlint to confirm.
Example fix
// before (render function)
h('ul', this.items.map((item, index) =>
this.$slots.default(item, index) // Unexpected multiple arguments.
))
// after
h('ul', this.items.map((item, index) =>
this.$slots.default({ item, index })
)) Defensive patterns
Strategy: validation
Prevention
- Treat scoped-slot functions as single-argument (props object) APIs.
- In templates, always destructure the slot props object rather than expecting positional args.
- Search render functions for `$slots.` / `scopedSlots.` calls with commas between arguments.
When it happens
Trigger: Calling a scoped-slot function with two or more arguments, e.g. `this.$slots.default(item, index)` in a render function, or `slots.default(a, b)` in a functional/TSX component.
Common situations: Porting render-code that assumed slot fns behave like normal callbacks with positional params; trying to pass `item` and `index` from a `v-for` to a slot in a hand-written render function; wrapping slots in higher-order components.
Related errors
- Unexpected spread argument.
- capacity overflow
- Change to `throw new TypeError(...)`
- Could not find the reuseWorker option in ${path}
- `VirtualFree` failed during cleanup: {err}
AI-assisted analysis of oxc-project/oxc@e1e7af627c (2026-08-20).
Data as JSON: /api/errors/6e8d31ed5b3b73de.
Report an issue: GitHub.