{"record":{"id":"ad85111fb2e9c772","repo":"oxc-project/oxc","slug":"delete-and-set-are-deprecated","errorCode":null,"errorMessage":"`$delete` and `$set` are deprecated.","messagePattern":"`\\$delete` and `\\$set` are deprecated\\.","errorType":"validation","errorClass":"OxcDiagnostic","httpStatus":null,"severity":"error","filePath":"crates/oxc_linter/src/rules/vue/no_deprecated_delete_set.rs","lineNumber":17,"sourceCode":"use oxc_ast::{\n    AstKind,\n    ast::{Expression, IdentifierReference, MemberExpression, StaticMemberExpression},\n};\nuse oxc_diagnostics::OxcDiagnostic;\nuse oxc_macros::declare_oxc_lint;\nuse oxc_span::Span;\n\nuse crate::{\n    AstNode,\n    context::LintContext,\n    rule::Rule,\n    utils::{is_import_symbol, is_this_object},\n};\n\nfn no_deprecated_delete_set_diagnostic(span: Span) -> OxcDiagnostic {\n    OxcDiagnostic::warn(\"`$delete` and `$set` are deprecated.\").with_label(span)\n}\n\n#[derive(Debug, Default, Clone)]\npub struct NoDeprecatedDeleteSet;\n\ndeclare_oxc_lint!(\n    /// ### What it does\n    ///\n    /// Disallow using deprecated `$set` / `$delete` (in Vue.js 3.0.0+).\n    ///\n    /// ### Why is this bad?\n    ///\n    /// In Vue 3, the instance methods `$set` / `$delete` and the global\n    /// `Vue.set` / `Vue.delete` were removed. Reactivity is now backed by\n    /// Proxies, so plain assignment and the `delete` operator work as\n    /// expected and these helpers are no longer needed.\n    ///\n    /// ### Examples","sourceCodeStart":1,"sourceCodeEnd":35,"githubUrl":"https://github.com/oxc-project/oxc/blob/e1e7af627c8843ab64044ed466b128fcc21a035b/crates/oxc_linter/src/rules/vue/no_deprecated_delete_set.rs#L1-L35","documentation":"Diagnostic from oxlint's vue/no-deprecated-delete-set rule (since oxlint 1.62.0). It fires on this.$set()/this.$delete() and on imported Vue.set()/Vue.delete() (detected via is_import_symbol). These methods existed to patch Vue 2's non-reactive property addition; Vue 3's Proxy-based reactivity makes them unnecessary, and they were removed — calling them in Vue 3 throws a TypeError.","triggerScenarios":"Inside a component instance method (is_this_object receiver), a member call `$set` or `$delete`; or a call to an imported binding named set/delete that resolves to Vue.set/Vue.delete.","commonSituations":"Ported Vue 2 code that used $set/$delete for array index and new-property assignment; CI stays green in lint but production throws 'this.$set is not a function' under Vue 3.","solutions":["Replace this.$set(this.obj, key, val) with this.obj[key] = val","Replace this.$set(this.arr, i, val) with this.arr[i] = val (Vue 3 tracks index writes)","Replace this.$delete(this.obj, key) with delete this.obj[key]"],"exampleFix":"// before\nthis.$set(this.user, 'email', value)\nthis.$delete(this.user, 'email')\n// after\nthis.user.email = value\ndelete this.user.email","handlingStrategy":"validation","validationCode":"# find removed $set/$delete and Vue.set/Vue.delete calls\ngrep -rnE \"this\\.\\$(set|delete)\\(|\\bVue\\.(set|delete)\\(\" --include='*.vue' --include='*.js' src","typeGuard":null,"tryCatchPattern":null,"preventionTips":["In Vue 3 code, add/deleted properties and array index writes are natively reactive — never reach for $set/$delete","Run the vue3 deprecation rules as a CI gate during and after migration"],"tags":["vue","oxlint","lint","vue3","migration","reactivity","removed-api"],"backgroundTag":"vue-2-to-3-migration","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"}