eslint-plugin-total-functions
eslint-plugin-total-functions copied to clipboard
Add rule for Web Storage API (localStorage, sessionStorage)
- Accessing
localStorageorsessionStorageobjects can throwSecurityError DOMException - "Set" operations can throw
QuotaExceededError DOMException localStorageandsessionStoragecan benull(not sure if this is per spec, but Safari, Mobile Safari, and Chrome Mobile WebView definitely do this)
Reference: https://html.spec.whatwg.org/multipage/webstorage.html