Linting rules for MooTools
You'll first need to install ESLint:
$ npm i eslint --save-dev
Next, install eslint-plugin-mootools
:
$ npm install eslint-plugin-mootools --save-dev
Note: If you installed ESLint globally (using the -g
flag) then you must also install eslint-plugin-mootools
globally.
Add mootools
to the plugins section of your .eslintrc
configuration file. You can omit the eslint-plugin-
prefix:
{
"plugins": [
"mootools"
]
}
You can load specific MooTools environments like so:
{
"env": {
"mootools/core": true,
"mootools/more": true
}
}
Or you can load rules specific to MooTools:
{
"rules": {
"mootools/rule-name": 2
}
}
mootools/core
- defines classes and functions specific to the MooTools-Core library.mootools/more
- defines classes and functions specific to the MooTools-More library.
- This plugin doesn't actually have any custom rules just environments.