Git Product home page Git Product logo

eslint-plugin-jquery's Introduction

eslint-plugin-jquery

Disallow jQuery functions with native equivalents.

Installation

You'll first need to install ESLint:

$ npm install eslint --save-dev

Next, install eslint-plugin-jquery:

$ npm install eslint-plugin-jquery --save-dev

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

Usage

Add jquery to the plugins section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix.

You can either enable individual rules as follows:

{
  "plugins": [
    "jquery"
  ],
  "rules": {
    "jquery/no-ajax": 2,
    "jquery/no-ajax-events": 2,
    "jquery/no-animate": 2,
    "jquery/no-attr": 2,
    "jquery/no-bind": 2,
    "jquery/no-class": 2,
    "jquery/no-clone": 2,
    "jquery/no-closest": 2,
    "jquery/no-css": 2,
    "jquery/no-data": 2,
    "jquery/no-deferred": 2,
    "jquery/no-delegate": 2,
    "jquery/no-each": 2,
    "jquery/no-extend": 2,
    "jquery/no-fade": 2,
    "jquery/no-filter": 2,
    "jquery/no-find": 2,
    "jquery/no-global-eval": 2,
    "jquery/no-grep": 2,
    "jquery/no-has": 2,
    "jquery/no-hide": 2,
    "jquery/no-html": 2,
    "jquery/no-in-array": 2,
    "jquery/no-is-array": 2,
    "jquery/no-is-function": 2,
    "jquery/no-is": 2,
    "jquery/no-load": 2,
    "jquery/no-map": 2,
    "jquery/no-merge": 2,
    "jquery/no-param": 2,
    "jquery/no-parent": 2,
    "jquery/no-parents": 2,
    "jquery/no-parse-html": 2,
    "jquery/no-prop": 2,
    "jquery/no-proxy": 2,
    "jquery/no-ready": 2,
    "jquery/no-serialize": 2,
    "jquery/no-show": 2,
    "jquery/no-size": 2,
    "jquery/no-sizzle": 2,
    "jquery/no-slide": 2,
    "jquery/no-submit": 2,
    "jquery/no-text": 2,
    "jquery/no-toggle": 2,
    "jquery/no-trigger": 2,
    "jquery/no-trim": 2,
    "jquery/no-val": 2,
    "jquery/no-when": 2,
    "jquery/no-wrap": 2
  }
}

Or you can use the full set of rules:

{
  "plugins": [
    "jquery"
  ],
  "extends": [
    "plugin:jquery/deprecated"
  ]
}

Or a subset:

{
  "plugins": [
    "jquery"
  ],
  "extends": [
    "plugin:jquery/slim"
  ]
}

The slim set uses the following rules: jquery/no-ajax, jquery/no-animate, jquery/no-fade, jquery/no-hide, jquery/no-load, jquery/no-param, jquery/no-serialize, jquery/no-show, jquery/no-slide, jquery/no-toggle.

Development

npm install
npm test

License

Distributed under the MIT license. See LICENSE for details.

eslint-plugin-jquery's People

Contributors

alunny avatar berkmann18 avatar brendo avatar dependabot[bot] avatar dgraham avatar edg2s avatar jeffdolle-sge avatar josh avatar longtian avatar macklinu avatar mislav avatar sharkykh avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.