1.0.1 • Published 3 years ago

eslint-config-greasemonkey v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

eslint-config-greasemonkey

This package provides an eslint shared config which defines all additional variables supported by Geasemonkey/Tampermonkey/Violentmonkey 's API in its globals property. It's very useful when you use eslint to lint your xxxmonkey scripts that use these variable without having to define the used variables yourself in your eslint configuration.

Installation

npm i -D eslint-config-greasemonkey

Usage

Add greasemonkey to the extends property in your eslint configuration. Example of a configuration file in JSON format:

// .eslintrc.json
{
    "extends": [
        "greasemonkey"
    ],
    "globals": {
        "GM_info": "off" // you can disable the unneeded variables
    }
}

The default shared config provided by this package shares variables in readonly mode so that you can not overwrite these variables. You can extend another config greasemonkey/writable which allow the variables to be overwritten.

// .eslintrc.json
{
    "extends": [
        "greasemonkey/writable"
    ]
}

License

MIT License