npm.io
0.0.1 • Published 9 years ago

eslint-plugin-turbolinks-event-handling

Licence
ISC
Version
0.0.1
Deps
1
Vulns
0
Weekly
0
DeprecatedThis package is deprecated

ESLint plugin to avoid registering vanilla or jquery event listeners multiple times when using turbolinks

Installation

You'll first need to install ESLint:

$ npm i eslint --save-dev

Next, install eslint-plugin-turbolinks-event-handling:

$ npm install eslint-plugin-turbolinks-event-handling --save-dev

Note: If you installed ESLint globally (using the -g flag) then you must also install eslint-plugin-turbolinks-event-handling globally.

Usage

Add turbolinks-event-handling to the plugins section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix:

{
  "plugins": [
    "turbolinks-event-handling"
  ]
}

Then configure the rules you want to use under the rules section.

{
  "rules": {
    "turbolinks-event-handling/jquery-off-before-on": 2,
    "turbolinks-event-handling/jquery-use-event-namespaces": 2,
    "turbolinks-event-handling/vanilla-addeventlistener-needs-function-reference": 2
  }
}

Keywords