0

Window object properties/ methods throw error in the webview if they are not prefixed with window. and works fine in the browser without the prefix.

So I wanted to enforce this using an eslint rule.

But I didn't find any rule that can help in achieving this behavior.

Expected: Eslint should throw an error on window object properties/ methods if they are not prefixed with window.

Is there a way to achieve this?

I tried the no-implicit-global rule but it doesn't work as expected.

Refer to Eslint Playground here

Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197

0 Answers0