{"record":{"id":"5ef66f9b30710228","repo":"oxc-project/oxc","slug":"assignment-to-member-of-namespace-namespace-name","errorCode":null,"errorMessage":"Assignment to member of namespace {namespace_name:?}.'","messagePattern":"Assignment to member of namespace (.+?)\\.'","errorType":"validation","errorClass":"OxcDiagnostic","httpStatus":null,"severity":"error","filePath":"crates/oxc_linter/src/rules/import/namespace.rs","lineNumber":47,"sourceCode":"    specifier_name: &str,\n    namespace_name: &str,\n) -> OxcDiagnostic {\n    OxcDiagnostic::warn(format!(\n        \"{specifier_name:?} not found in deeply imported namespace {namespace_name:?}.\"\n    ))\n    .with_label(span)\n}\n\nfn computed_reference(span: Span, namespace_name: &str) -> OxcDiagnostic {\n    OxcDiagnostic::warn(format!(\n        \"Unable to validate computed reference to imported namespace {namespace_name:?}.\"\n    ))\n    .with_help(\"Use a static property access (e.g. `namespace.name`) instead of a computed one.\")\n    .with_label(span)\n}\n\nfn assignment(span: Span, namespace_name: &str) -> OxcDiagnostic {\n    OxcDiagnostic::warn(format!(\"Assignment to member of namespace {namespace_name:?}.'\"))\n        .with_help(\"Imported namespace members are read-only. Assign to a local variable instead.\")\n        .with_label(span)\n}\n\n// <https://github.com/import-js/eslint-plugin-import/blob/v2.29.1/docs/rules/namespace.md>\n#[derive(Debug, Default, Clone, JsonSchema, Deserialize)]\n#[serde(rename_all = \"camelCase\", default, deny_unknown_fields)]\npub struct Namespace {\n    /// Whether to allow computed references to an imported namespace.\n    allow_computed: bool,\n}\n\ndeclare_oxc_lint!(\n    /// ### What it does\n    ///\n    /// Enforces names exist at the time they are dereferenced, when imported as\n    /// a full namespace (i.e. `import * as foo from './foo'; foo.bar();` will\n    /// report if bar is not exported by `./foo.`).  Will report at the import","sourceCodeStart":29,"sourceCodeEnd":65,"githubUrl":"https://github.com/oxc-project/oxc/blob/e1e7af627c8843ab64044ed466b128fcc21a035b/crates/oxc_linter/src/rules/import/namespace.rs#L29-L65","documentation":"Fires from import/namespace when code assigns to a member of an imported namespace object (e.g. ns.foo = 1). ES module namespaces are read-only, so the assignment helper flags the target span with the namespace name.","triggerScenarios":"Thrown at crates/oxc_linter/src/rules/import/namespace.rs:47 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Remove the assignment to the namespace member","Create a local mutable copy of the value if mutation is needed"],"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"}