--- source: crates/biome_js_analyze/tests/spec_tests.rs expression: invalid.jsonc --- # Input ```cjs var foo = new Symbol('foo'); ``` # Diagnostics ``` invalid.jsonc:1:11 lint/correctness/noNewSymbol FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Symbol cannot be called as a constructor. > 1 │ var foo = new Symbol('foo'); │ ^^^^^^^^^^^^^^^^^ i Unsafe fix: Remove new. 1 │ var·foo·=·new·Symbol('foo'); │ ---- ``` # Input ```cjs var foo = new globalThis.Symbol('foo'); ``` # Diagnostics ``` invalid.jsonc:1:11 lint/correctness/noNewSymbol FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Symbol cannot be called as a constructor. > 1 │ var foo = new globalThis.Symbol('foo'); │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ i Unsafe fix: Remove new. 1 │ var·foo·=·new·globalThis.Symbol('foo'); │ ---- ``` # Input ```cjs var foo = new window.Symbol('foo'); ``` # Diagnostics ``` invalid.jsonc:1:11 lint/correctness/noNewSymbol FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Symbol cannot be called as a constructor. > 1 │ var foo = new window.Symbol('foo'); │ ^^^^^^^^^^^^^^^^^^^^^^^^ i Unsafe fix: Remove new. 1 │ var·foo·=·new·window.Symbol('foo'); │ ---- ``` # Input ```cjs var foo2 = new Symbol(); ``` # Diagnostics ``` invalid.jsonc:1:12 lint/correctness/noNewSymbol FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Symbol cannot be called as a constructor. > 1 │ var foo2 = new Symbol(); │ ^^^^^^^^^^^^ i Unsafe fix: Remove new. 1 │ var·foo2·=·new·Symbol(); │ ---- ``` # Input ```cjs var lorem = new Symbol() // comment ``` # Diagnostics ``` invalid.jsonc:1:13 lint/correctness/noNewSymbol FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Symbol cannot be called as a constructor. > 1 │ var lorem = new Symbol() // comment │ ^^^^^^^^^^^^ i Unsafe fix: Remove new. 1 │ var·lorem·=·new·Symbol()·//·comment │ ---- ``` # Input ```cjs var s = /* prefix_cmt */ new /* suffix_cmt */ Symbol() // comment ``` # Diagnostics ``` invalid.jsonc:1:26 lint/correctness/noNewSymbol FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Symbol cannot be called as a constructor. > 1 │ var s = /* prefix_cmt */ new /* suffix_cmt */ Symbol() // comment │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ i Unsafe fix: Remove new. - var·s·=·/*·prefix_cmt·*/·new·/*·suffix_cmt·*/·Symbol()·//·comment + var·s·=·/*·prefix_cmt·*/··/*·suffix_cmt·*/·Symbol()·//·comment ```