oxc-project/oxc · error · OxcDiagnostic

The '__proto__' property is deprecated

Error message

The '__proto__' property is deprecated

What it means

Lint diagnostic from eslint/no-proto: the deprecated __proto__ property was accessed (via dot access or computed '__proto__'). It is a legacy Annex-B feature whose behavior varies across environments; the static Object helpers are the standard replacements named in the help text.

Solutions

  1. Use Object.getPrototypeOf(obj) to read the prototype
  2. Use Object.setPrototypeOf(obj, proto) or Object.create(proto) to set it
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/oxc_linter/src/rules/eslint/no_proto.rs:8 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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

Appendix: source

Thrown at crates/oxc_linter/src/rules/eslint/no_proto.rs:8

use oxc_diagnostics::OxcDiagnostic;
use oxc_macros::declare_oxc_lint;
use oxc_span::{GetSpan, Span};

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

fn no_proto_diagnostic(span: Span) -> OxcDiagnostic {
    OxcDiagnostic::warn("The '__proto__' property is deprecated")
        .with_help("use `Object.getPrototypeOf` and `Object.setPrototypeOf` instead.")
        .with_label(span)
}

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

declare_oxc_lint!(
    /// ### What it does
    ///
    /// Disallow the use of the `__proto__` property.
    ///
    /// ### Why is this bad?
    ///
    /// The `__proto__` property has been deprecated as of ECMAScript 3.1 and
    /// shouldn’t be used in new code. Use `Object.getPrototypeOf` and
    /// `Object.setPrototypeOf` instead.
    ///

View on GitHub (pinned to e1e7af627c)