{"record":{"id":"bb3cef07d0d3121c","repo":"oxc-project/oxc","slug":"assignment-to-property-of-function-parameter-nam","errorCode":null,"errorMessage":"Assignment to property of function parameter '{name}'.","messagePattern":"Assignment to property of function parameter '(.+?)'\\.","errorType":"validation","errorClass":"OxcDiagnostic","httpStatus":null,"severity":"error","filePath":"crates/oxc_linter/src/rules/eslint/no_param_reassign.rs","lineNumber":26,"sourceCode":"use oxc_ecmascript::BoundNames;\nuse oxc_macros::declare_oxc_lint;\nuse oxc_semantic::{AstNode, NodeId};\nuse oxc_span::Span;\n\nuse crate::{\n    context::LintContext,\n    rule::{DefaultRuleConfig, Rule},\n    utils::deserialize_regex_vec,\n};\n\nfn assignment_to_param_diagnostic(name: &str, span: Span) -> OxcDiagnostic {\n    OxcDiagnostic::warn(format!(\"Assignment to function parameter '{name}'.\"))\n        .with_help(\"Consider using a different variable to avoid unintended side effects on the parameter.\")\n        .with_label(span)\n}\n\nfn assignment_to_param_property_diagnostic(name: &str, span: Span) -> OxcDiagnostic {\n    OxcDiagnostic::warn(format!(\"Assignment to property of function parameter '{name}'.\"))\n        .with_help(\"Consider using a different variable to avoid unintended side effects on the parameter's properties.\")\n        .with_label(span)\n}\n\n#[derive(Debug, Default, Clone, Deserialize, JsonSchema)]\n#[serde(rename_all = \"camelCase\", default, deny_unknown_fields)]\nstruct NoParamReassignConfig {\n    /// When true, also check for modifications to properties of parameters.\n    props: bool,\n    /// An array of parameter names whose property modifications should be ignored.\n    ignore_property_modifications_for: FxHashSet<String>,\n    /// An array of regex patterns (as strings) for parameter names whose property modifications should be ignored.\n    /// Note that this uses [Rust regex syntax](https://docs.rs/regex/latest/regex/) and so may not have all features\n    /// available to JavaScript regexes.\n    #[serde(default, deserialize_with = \"deserialize_regex_vec\")]\n    #[schemars(with = \"Vec<String>\", default)]\n    ignore_property_modifications_for_regex: Vec<Regex>,\n}","sourceCodeStart":8,"sourceCodeEnd":44,"githubUrl":"https://github.com/oxc-project/oxc/blob/e1e7af627c8843ab64044ed466b128fcc21a035b/crates/oxc_linter/src/rules/eslint/no_param_reassign.rs#L8-L44","documentation":"Lint diagnostic from eslint/no-param-reassign: a property of a function parameter is assigned. This mutates the caller's object (hidden side effect) and couples the function to the argument's internal shape; it fires even when plain parameter reassignment is allowed via props:true.","triggerScenarios":"Thrown at crates/oxc_linter/src/rules/eslint/no_param_reassign.rs:26 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Copy the parameter (e.g. const opts = { ...options }) and modify the copy","Return a new object with the changed property instead of mutating","List the parameter in ignorePropertyModificationsFor if mutation is deliberate (e.g. accumulators)"],"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-14T05:17:10.506Z"}