{"record":{"id":"6e8d31ed5b3b73de","repo":"oxc-project/oxc","slug":"unexpected-multiple-arguments","errorCode":null,"errorMessage":"Unexpected multiple arguments.","messagePattern":"Unexpected multiple arguments\\.","errorType":"validation","errorClass":"OxcDiagnostic","httpStatus":null,"severity":"warning","filePath":"crates/oxc_linter/src/rules/vue/no_multiple_slot_args.rs","lineNumber":18,"sourceCode":"use oxc_ast::{\n    AstKind,\n    ast::{\n        AssignmentTarget, Expression, IdentifierReference, MemberExpression,\n        VariableDeclarationKind,\n    },\n};\nuse oxc_diagnostics::OxcDiagnostic;\nuse oxc_macros::declare_oxc_lint;\nuse oxc_span::{GetSpan, Span};\n\nuse crate::{\n    AstNode, ast_util::variable_declaration_kind, context::LintContext,\n    frameworks::FrameworkOptions, rule::Rule,\n};\n\nfn multiple_arguments_diagnostic(span: Span) -> OxcDiagnostic {\n    OxcDiagnostic::warn(\"Unexpected multiple arguments.\")\n        .with_help(\"Pass only one argument to the slot function.\")\n        .with_label(span)\n}\n\nfn spread_argument_diagnostic(span: Span) -> OxcDiagnostic {\n    OxcDiagnostic::warn(\"Unexpected spread argument.\")\n        .with_help(\"Do not use spread arguments when calling slot functions.\")\n        .with_label(span)\n}\n\n#[derive(Debug, Default, Clone)]\npub struct NoMultipleSlotArgs;\n\ndeclare_oxc_lint!(\n    /// ### What it does\n    ///\n    /// Disallow passing multiple arguments to scoped slots.\n    ///","sourceCodeStart":1,"sourceCodeEnd":36,"githubUrl":"https://github.com/oxc-project/oxc/blob/e1e7af627c8843ab64044ed466b128fcc21a035b/crates/oxc_linter/src/rules/vue/no_multiple_slot_args.rs#L1-L36","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"// before (render function)\nh('ul', this.items.map((item, index) =>\n  this.$slots.default(item, index) // Unexpected multiple arguments.\n))\n\n// after\nh('ul', this.items.map((item, index) =>\n  this.$slots.default({ item, index })\n))","handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["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."],"tags":["vue","slots","lint","render-function"],"backgroundTag":"wrong-argument-count","analyzedSha":"e1e7af627c8843ab64044ed466b128fcc21a035b","analyzedAt":"2026-08-20T07:01:07.079Z","contentChangedAt":"2026-08-20T07:01:07.079Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}