2.0.0 • Published 9 years ago
eslint-plugin-richlab v2.0.0
eslint-plugin-richlab
An ESLint plugin created by RichLab.
Installation
You'll first need to install ESLint:
$ npm i eslint --save-devNext, install eslint-plugin-richlab:
$ npm install eslint-plugin-richlab --save-devNote: If you installed ESLint globally (using the -g flag) then you must also install eslint-plugin-richlab globally.
Usage
Add richlab to the plugins section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix:
{
"plugins": [
"richlab"
]
}Then configure the rules you want to use under the rules section.
{
"rules": {
"richlab/rule-name": 2
}
}Supported Rules
avoid-ios9-viewport-bug
window.innerWidth and window.innerHeight may have unexpected value in iOS9
Mobile Saferi because the bug.
This rule resticts to use window.innerWidth and window.innerHeight and
recommends to use document.documentElement.clientWidth or document.Element.clientHeight
instead of that properties.
var innerWidth = window.innerWidth; // error
var innerHeight = window.innerHeight; // error
var innerWidth = document.documentElement.clientWidth; // not error
var innerHeight = document.documentElement.clientHeight; // not error