{"record":{"id":"76266f9518b71830","repo":"oxc-project/oxc","slug":"these-overloads-can-be-combined-into-one-signature","errorCode":null,"errorMessage":"These overloads can be combined into one signature taking `{type1} | {type2}`.","messagePattern":"These overloads can be combined into one signature taking `(.+?) \\| (.+?)`\\.","errorType":"validation","errorClass":"OxcDiagnostic","httpStatus":null,"severity":"error","filePath":"crates/oxc_linter/src/rules/typescript/unified_signatures.rs","lineNumber":30,"sourceCode":"};\nuse oxc_diagnostics::{LabeledSpan, OxcDiagnostic};\nuse oxc_macros::declare_oxc_lint;\nuse oxc_span::{GetSpan, Span};\nuse rustc_hash::{FxHashMap, FxHashSet};\nuse schemars::JsonSchema;\nuse serde::{Deserialize, Serialize};\n\nuse crate::{\n    AstNode,\n    context::{ContextHost, LintContext},\n    rule::{DefaultRuleConfig, Rule},\n};\n\nfn unified_signatures_diagnostic<L: Into<LabeledSpan>, T: IntoIterator<Item = L>>(\n    message: String,\n    labels: T,\n) -> OxcDiagnostic {\n    OxcDiagnostic::warn(message).with_labels(labels)\n}\n\n#[derive(Debug, Default, Clone, Deserialize, Serialize, JsonSchema)]\n#[serde(default, rename_all = \"camelCase\", deny_unknown_fields)]\npub struct UnifiedSignaturesOptions {\n    /// Whether to ignore parameter name differences when comparing signatures. If `false`, signatures\n    /// will not be considered unifiable if they have parameters in the same position with different\n    /// names, even if the parameter types are the same.\n    ignore_differently_named_parameters: bool,\n    /// Whether to ignore JSDoc differences when comparing signatures. If `false`, signatures will not\n    /// be considered unifiable if the closest leading block comments for the signatures are different,\n    /// even if the signatures themselves are identical.\n    #[serde(rename = \"ignoreOverloadsWithDifferentJSDoc\")]\n    ignore_overloads_with_different_jsdoc: bool,\n}\n\n#[derive(Debug, Default, Clone, Deserialize, Serialize)]\npub struct UnifiedSignatures(UnifiedSignaturesOptions);","sourceCodeStart":12,"sourceCodeEnd":48,"githubUrl":"https://github.com/oxc-project/oxc/blob/e1e7af627c8843ab64044ed466b128fcc21a035b/crates/oxc_linter/src/rules/typescript/unified_signatures.rs#L12-L48","documentation":"Raised by typescript/unified-signatures when multiple overloads differ only in one parameter's type across several signatures (plural case). They can be collapsed into a single signature using a union type.","triggerScenarios":"Thrown at crates/oxc_linter/src/rules/typescript/unified_signatures.rs:30 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Merge the overloads into one signature with a union parameter type, e.g. (a: string | number)."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}