Restricts the use of browser storage to certain files.
You'll first need to install ESLint:
$ npm i eslint --save-dev
Next, install eslint-plugin-browser-storage
:
$ npm install eslint-plugin-browser-storage --save-dev
Add browser-storage
to the plugins section of your .eslintrc
configuration file. You can omit the eslint-plugin-
prefix:
{
"plugins": [
"browser-storage"
]
}
Then configure the rules you want to use under the rules section.
{
"rules": {
"browser-storage/limit-session-storage": ["error", [["storageManager.js"], "Use StorageManager instead of directly accessing the sessionStorage"]]
}
}