rafaelrozon / eslint-plugin-browser-storage

ESLint rule that restricts the use of browser storage to certain files

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

eslint-plugin-browser-storage

Restricts the use of browser storage to certain files.

Installation

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

Usage

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"]]
    }
}

Supported Rules

Limit Session Storage

About

ESLint rule that restricts the use of browser storage to certain files

License:MIT License


Languages

Language:JavaScript 100.0%