Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>no shadowing BOM variable jsNew to Visual Studio Code? Get it now.
no shadowing BOM variable js

no shadowing BOM variable js

calululu

|
30 installs
| (0) | Free
Warns the developer he is shadowing a BOM object
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

no shadowing bom variable js README

Warns the developer he is shadowing a BOM object.

Even though shadowing an object is syntactically right, I made so it's wrong, because there is no way this is allowed:

const document = 5;

This is the error shown:

Do not override a global BOM variable 'document'

It supports all the BOM objects, and works with let or const, here's the list:

  • "window"
  • "document"
  • "navigator"
  • "location"
  • "history"
  • "screen"
  • "frames"
  • "self"
  • "top"
  • "parent"

Requirements

Works for javascript.

Known Issues

Using var, instead of let or const doesn't trigger any error. But who uses var anyway...

1.0.0

Initial release.


Enjoy!

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft