eslint-plugin-compat icon indicating copy to clipboard operation
eslint-plugin-compat copied to clipboard

Plugin doesn't work on window.location.hostname

Open v-tank opened this issue 5 years ago • 4 comments

Environment: VSCode Plugin version: 3.7.0 Browserslist default: "> 0.5%, last 2 versions, Firefox ESR, not dead" Issue: I am using some properties that are a part of window.location (such as hostname) but the plugin did not catch that it's incompatible with Opera 67; it only catches 'location.hostname' and not 'window.location.hostname'. Is this expected behavior? How can I make sure that explicit properties from the window object are not being missed by the linter? Thank you.

v-tank avatar Jul 02 '20 20:07 v-tank

Same here. No support for Opera 23+ but shows supported on MDN.

mnicpt avatar Aug 12 '20 13:08 mnicpt

I'm using v3.8.0 and it does highlight the incompatibility of window.location.hostname with Opera 68: image My config is the pretty standard one: ">0.2%", "not dead", "not ie <= 11", "not op_mini all" However MDN does report that window.location.hostname is compatible with Opera, so don't know what to think.

gabriele-cannizzaro avatar Aug 23 '20 13:08 gabriele-cannizzaro

Same here

the current line code export const currentRootDomain = getRootDomain(window.location.hostname);

failed during tests with this elsint error :

37:48 error location.hostname() is not supported in Opera 69 compat/compat

This error is surprising because this property exists for a long time. I didn't manage to find a documentation about hostname property on Opera 69, but I downloaded Opera 69 (from here http://get.opera.com/ftp/pub/opera/desktop/ ) and tested the result :

Capture d’écran 2020-09-25 à 20 15 40

As you can see, Opera 69 supports hostname property

wulfy avatar Oct 05 '20 07:10 wulfy

Any news about this issue or how to workaround it? Thank you!

afdev82 avatar Nov 19 '20 11:11 afdev82