---
source: crates/oxc_linter/src/tester.rs
expression: no_self_assign
---
  ⚠ eslint(no-self-assign): this expression is assigned to itself
   ╭─[no_self_assign.tsx:1:5]
 1 │ a = a
   ·     ─
   ╰────

  ⚠ eslint(no-self-assign): this expression is assigned to itself
   ╭─[no_self_assign.tsx:1:8]
 1 │ [a] = [a]
   ·        ─
   ╰────

  ⚠ eslint(no-self-assign): this expression is assigned to itself
   ╭─[no_self_assign.tsx:1:11]
 1 │ [a, b] = [a, b]
   ·           ─
   ╰────

  ⚠ eslint(no-self-assign): this expression is assigned to itself
   ╭─[no_self_assign.tsx:1:14]
 1 │ [a, b] = [a, b]
   ·              ─
   ╰────

  ⚠ eslint(no-self-assign): this expression is assigned to itself
   ╭─[no_self_assign.tsx:1:11]
 1 │ [a, b] = [a, c]
   ·           ─
   ╰────

  ⚠ eslint(no-self-assign): this expression is assigned to itself
   ╭─[no_self_assign.tsx:1:13]
 1 │ [a, b] = [, b]
   ·             ─
   ╰────

  ⚠ eslint(no-self-assign): this expression is assigned to itself
   ╭─[no_self_assign.tsx:1:14]
 1 │ [a, ...b] = [a, ...b]
   ·              ─
   ╰────

  ⚠ eslint(no-self-assign): this expression is assigned to itself
   ╭─[no_self_assign.tsx:1:16]
 1 │ [[a], {b}] = [[a], {b}]
   ·                ─
   ╰────

  ⚠ eslint(no-self-assign): this expression is assigned to itself
   ╭─[no_self_assign.tsx:1:21]
 1 │ [[a], {b}] = [[a], {b}]
   ·                     ─
   ╰────

  ⚠ eslint(no-self-assign): this expression is assigned to itself
   ╭─[no_self_assign.tsx:1:9]
 1 │ ({a} = {a})
   ·         ─
   ╰────

  ⚠ eslint(no-self-assign): this expression is assigned to itself
   ╭─[no_self_assign.tsx:1:15]
 1 │ ({a: b} = {a: b})
   ·               ─
   ╰────

  ⚠ eslint(no-self-assign): this expression is assigned to itself
   ╭─[no_self_assign.tsx:1:19]
 1 │ ({'a': b} = {'a': b})
   ·                   ─
   ╰────

  ⚠ eslint(no-self-assign): this expression is assigned to itself
   ╭─[no_self_assign.tsx:1:17]
 1 │ ({a: b} = {'a': b})
   ·                 ─
   ╰────

  ⚠ eslint(no-self-assign): this expression is assigned to itself
   ╭─[no_self_assign.tsx:1:17]
 1 │ ({'a': b} = {a: b})
   ·                 ─
   ╰────

  ⚠ eslint(no-self-assign): this expression is assigned to itself
   ╭─[no_self_assign.tsx:1:15]
 1 │ ({1: b} = {1: b})
   ·               ─
   ╰────

  ⚠ eslint(no-self-assign): this expression is assigned to itself
   ╭─[no_self_assign.tsx:1:17]
 1 │ ({1: b} = {'1': b})
   ·                 ─
   ╰────

  ⚠ eslint(no-self-assign): this expression is assigned to itself
   ╭─[no_self_assign.tsx:1:17]
 1 │ ({'1': b} = {1: b})
   ·                 ─
   ╰────

  ⚠ eslint(no-self-assign): this expression is assigned to itself
   ╭─[no_self_assign.tsx:1:19]
 1 │ ({['a']: b} = {a: b})
   ·                   ─
   ╰────

  ⚠ eslint(no-self-assign): this expression is assigned to itself
   ╭─[no_self_assign.tsx:1:21]
 1 │ ({'a': b} = {[`a`]: b})
   ·                     ─
   ╰────

  ⚠ eslint(no-self-assign): this expression is assigned to itself
   ╭─[no_self_assign.tsx:1:17]
 1 │ ({1: b} = {[1]: b})
   ·                 ─
   ╰────

  ⚠ eslint(no-self-assign): this expression is assigned to itself
   ╭─[no_self_assign.tsx:1:12]
 1 │ ({a, b} = {a, b})
   ·            ─
   ╰────

  ⚠ eslint(no-self-assign): this expression is assigned to itself
   ╭─[no_self_assign.tsx:1:15]
 1 │ ({a, b} = {a, b})
   ·               ─
   ╰────

  ⚠ eslint(no-self-assign): this expression is assigned to itself
   ╭─[no_self_assign.tsx:1:15]
 1 │ ({a, b} = {b, a})
   ·               ─
   ╰────

  ⚠ eslint(no-self-assign): this expression is assigned to itself
   ╭─[no_self_assign.tsx:1:12]
 1 │ ({a, b} = {b, a})
   ·            ─
   ╰────

  ⚠ eslint(no-self-assign): this expression is assigned to itself
   ╭─[no_self_assign.tsx:1:15]
 1 │ ({a, b} = {c, a})
   ·               ─
   ╰────

  ⚠ eslint(no-self-assign): this expression is assigned to itself
   ╭─[no_self_assign.tsx:1:26]
 1 │ ({a: {b}, c: [d]} = {a: {b}, c: [d]})
   ·                          ─
   ╰────

  ⚠ eslint(no-self-assign): this expression is assigned to itself
   ╭─[no_self_assign.tsx:1:34]
 1 │ ({a: {b}, c: [d]} = {a: {b}, c: [d]})
   ·                                  ─
   ╰────

  ⚠ eslint(no-self-assign): this expression is assigned to itself
   ╭─[no_self_assign.tsx:1:21]
 1 │ ({a, b} = {a, ...x, b})
   ·                     ─
   ╰────

  ⚠ eslint(no-self-assign): this expression is assigned to itself
   ╭─[no_self_assign.tsx:1:7]
 1 │ a.b = a.b
   ·       ───
   ╰────

  ⚠ eslint(no-self-assign): this expression is assigned to itself
   ╭─[no_self_assign.tsx:1:9]
 1 │ a.b.c = a.b.c
   ·         ─────
   ╰────

  ⚠ eslint(no-self-assign): this expression is assigned to itself
   ╭─[no_self_assign.tsx:1:8]
 1 │ a[b] = a[b]
   ·        ────
   ╰────

  ⚠ eslint(no-self-assign): this expression is assigned to itself
   ╭─[no_self_assign.tsx:1:10]
 1 │ a['b'] = a['b']
   ·          ──────
   ╰────

  ⚠ eslint(no-self-assign): this expression is assigned to itself
   ╭─[no_self_assign.tsx:3:5]
 2 │         'b'
 3 │ ╭─▶ ] = a[
 4 │ │       'b'
 5 │ ╰─▶ ]
   ╰────

  ⚠ eslint(no-self-assign): this expression is assigned to itself
   ╭─[no_self_assign.tsx:1:7]
 1 │ a.b = a.b
   ·       ───
   ╰────

  ⚠ eslint(no-self-assign): this expression is assigned to itself
   ╭─[no_self_assign.tsx:1:9]
 1 │ a.b.c = a.b.c
   ·         ─────
   ╰────

  ⚠ eslint(no-self-assign): this expression is assigned to itself
   ╭─[no_self_assign.tsx:1:8]
 1 │ a[b] = a[b]
   ·        ────
   ╰────

  ⚠ eslint(no-self-assign): this expression is assigned to itself
   ╭─[no_self_assign.tsx:1:10]
 1 │ a['b'] = a['b']
   ·          ──────
   ╰────

  ⚠ eslint(no-self-assign): this expression is assigned to itself
   ╭─[no_self_assign.tsx:3:5]
 2 │         'b'
 3 │ ╭─▶ ] = a[
 4 │ │       'b'
 5 │ ╰─▶ ]
   ╰────

  ⚠ eslint(no-self-assign): this expression is assigned to itself
   ╭─[no_self_assign.tsx:1:10]
 1 │ this.x = this.x
   ·          ──────
   ╰────

  ⚠ eslint(no-self-assign): this expression is assigned to itself
   ╭─[no_self_assign.tsx:1:12]
 1 │ (a?.b).c = (a?.b).c
   ·            ────────
   ╰────

  ⚠ eslint(no-self-assign): this expression is assigned to itself
   ╭─[no_self_assign.tsx:1:7]
 1 │ a.b = a?.b
   ·       ────
   ╰────

  ⚠ eslint(no-self-assign): this expression is assigned to itself
   ╭─[no_self_assign.tsx:1:41]
 1 │ class C { #field; foo() { this.#field = this.#field; } }
   ·                                         ───────────
   ╰────

  ⚠ eslint(no-self-assign): this expression is assigned to itself
   ╭─[no_self_assign.tsx:1:44]
 1 │ class C { #field; foo() { [this.#field] = [this.#field]; } }
   ·                                            ───────────
   ╰────

  ⚠ eslint(no-self-assign): this expression is assigned to itself
   ╭─[no_self_assign.tsx:1:7]
 1 │ a &&= a
   ·       ─
   ╰────

  ⚠ eslint(no-self-assign): this expression is assigned to itself
   ╭─[no_self_assign.tsx:1:7]
 1 │ a ||= a
   ·       ─
   ╰────

  ⚠ eslint(no-self-assign): this expression is assigned to itself
   ╭─[no_self_assign.tsx:1:7]
 1 │ a ??= a
   ·       ─
   ╰────
