oxc-project/oxc · error · OxcDiagnostic

`$delete` and `$set` are deprecated.

Error message

`$delete` and `$set` are deprecated.

What it means

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.

Source

Thrown at crates/oxc_linter/src/rules/vue/no_deprecated_delete_set.rs:17

use oxc_ast::{
    AstKind,
    ast::{Expression, IdentifierReference, MemberExpression, StaticMemberExpression},
};
use oxc_diagnostics::OxcDiagnostic;
use oxc_macros::declare_oxc_lint;
use oxc_span::Span;

use crate::{
    AstNode,
    context::LintContext,
    rule::Rule,
    utils::{is_import_symbol, is_this_object},
};

fn no_deprecated_delete_set_diagnostic(span: Span) -> OxcDiagnostic {
    OxcDiagnostic::warn("`$delete` and `$set` are deprecated.").with_label(span)
}

#[derive(Debug, Default, Clone)]
pub struct NoDeprecatedDeleteSet;

declare_oxc_lint!(
    /// ### What it does
    ///
    /// Disallow using deprecated `$set` / `$delete` (in Vue.js 3.0.0+).
    ///
    /// ### Why is this bad?
    ///
    /// In Vue 3, the instance methods `$set` / `$delete` and the global
    /// `Vue.set` / `Vue.delete` were removed. Reactivity is now backed by
    /// Proxies, so plain assignment and the `delete` operator work as
    /// expected and these helpers are no longer needed.
    ///
    /// ### Examples

View on GitHub (pinned to e1e7af627c)

Solutions

  1. Replace this.$set(this.obj, key, val) with this.obj[key] = val
  2. Replace this.$set(this.arr, i, val) with this.arr[i] = val (Vue 3 tracks index writes)
  3. Replace this.$delete(this.obj, key) with delete this.obj[key]

Example fix

// before
this.$set(this.user, 'email', value)
this.$delete(this.user, 'email')
// after
this.user.email = value
delete this.user.email
Defensive patterns

Strategy: validation

Validate before calling

# find removed $set/$delete and Vue.set/Vue.delete calls
grep -rnE "this\.\$(set|delete)\(|\bVue\.(set|delete)\(" --include='*.vue' --include='*.js' src

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of oxc-project/oxc@e1e7af627c (2026-08-20). Data as JSON: /api/errors/ad85111fb2e9c772. Report an issue: GitHub.