eslint-plugin-storage

1.0.1 • Public • Published

eslint-plugin-storage

An eslint plugin to disallow using document.cookie and/or localStorage directly. Useful if you want to create wrappers around them that enforce GDPR compliance, for example.

Installation

npm install --save-dev eslint-plugin-storage

Rules

no-document-cookie

Disallows any references or assignments to document.cookie or window.document.cookie.

{
  "plugins": ["storage"],
  "rules": {
    "storage/no-document-cookie": "error"
  }
}

no-localstorage

Disallows any references to localStorage and methods on the localStorage object.

{
  "plugins": ["storage"],
  "rules": {
    "storage/no-localstorage": "error"
  }
}

Package Sidebar

Install

npm i eslint-plugin-storage

Weekly Downloads

2

Version

1.0.1

License

MIT

Unpacked Size

6.47 kB

Total Files

6

Last publish

Collaborators

  • matjones