eslint-plugin-unicorn
eslint-plugin-unicorn copied to clipboard
`prefer-global-this` should also reject `self` in service workers
Worker APIs should use
self
I think
self
was chosen because there's nowindow
, butglobalThis
should still be preferred there I think.
- Service workers introduction: 2014
globalThis
introduction: 2019I think using
self
in service workers is more of a historical artifact rather than a necessity.
Originally posted by @fregante in https://github.com/sindresorhus/eslint-plugin-unicorn/pull/2410#discussion_r1779954389