{"record":{"id":"b13065ce69899d1e","repo":"oxc-project/oxc","slug":"assignment-to-function-parameter-name","errorCode":null,"errorMessage":"Assignment to function parameter '{name}'.","messagePattern":"Assignment to function parameter '(.+?)'\\.","errorType":"validation","errorClass":"OxcDiagnostic","httpStatus":null,"severity":"error","filePath":"crates/oxc_linter/src/rules/eslint/no_param_reassign.rs","lineNumber":20,"sourceCode":"use rustc_hash::FxHashSet;\nuse schemars::JsonSchema;\nuse serde::Deserialize;\n\nuse oxc_ast::AstKind;\nuse oxc_diagnostics::OxcDiagnostic;\nuse 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.","sourceCodeStart":2,"sourceCodeEnd":38,"githubUrl":"https://github.com/oxc-project/oxc/blob/e1e7af627c8843ab64044ed466b128fcc21a035b/crates/oxc_linter/src/rules/eslint/no_param_reassign.rs#L2-L38","documentation":"Lint diagnostic from eslint/no-param-reassign: a value is assigned directly to a function parameter. Reassignment obscures the original argument, breaks reliance on arguments, and can unintentionally mutate caller-visible state for object semantics in some engines/toolchains.","triggerScenarios":"Thrown at crates/oxc_linter/src/rules/eslint/no_param_reassign.rs:20 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Copy the parameter into a local variable and mutate that","Use a propsObject/option-preserving pattern for options objects","Configure props/ignorePropertyModificationsFor if parameter mutation is intentional"],"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"}