no-document-cookie
is enabled by default.
The docs tell you to use the Cookie Store API, however this is a poor recommendation as it does not yet have wide browser support.
The docs' other suggestion is to use a cookie library which is a fine suggestion, however I am already using a cookie library. The rule seems to hard ban assigning to document.cookie
and the library I'm using is used in the form of:
document.cookie = setCookie(MyCookie, { foo: "baz" })
This is completely safe and is the intended usage but still trips the rule anyway.
If you would prefer to keep no-document-cookie
enabled by default, my other suggestion would be to instead make the rule smarter and allow assignments from a called imported function.
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too