UNPKG

2.02 kBMarkdownView Raw
1# eslint-plugin-jquery
2
3Disallow jQuery functions with native equivalents.
4
5## Installation
6
7You'll first need to install [ESLint](http://eslint.org):
8
9```
10$ npm install eslint --save-dev
11```
12
13Next, install `eslint-plugin-jquery`:
14
15```
16$ npm install eslint-plugin-jquery --save-dev
17```
18
19**Note:** If you installed ESLint globally (using the `-g` flag) then you must also install `eslint-plugin-jquery` globally.
20
21## Usage
22
23Add `jquery` to the plugins section of your `.eslintrc` configuration file. You can omit the `eslint-plugin-` prefix:
24
25```json
26{
27 "plugins": [
28 "jquery"
29 ],
30 "rules": {
31 "jquery/no-ajax": 2,
32 "jquery/no-ajax-events": 2,
33 "jquery/no-animate": 2,
34 "jquery/no-attr": 2,
35 "jquery/no-bind": 2,
36 "jquery/no-class": 2,
37 "jquery/no-clone": 2,
38 "jquery/no-closest": 2,
39 "jquery/no-css": 2,
40 "jquery/no-data": 2,
41 "jquery/no-deferred": 2,
42 "jquery/no-delegate": 2,
43 "jquery/no-each": 2,
44 "jquery/no-extend": 2,
45 "jquery/no-fade": 2,
46 "jquery/no-filter": 2,
47 "jquery/no-find": 2,
48 "jquery/no-global-eval": 2,
49 "jquery/no-grep": 2,
50 "jquery/no-has": 2,
51 "jquery/no-hide": 2,
52 "jquery/no-html": 2,
53 "jquery/no-in-array": 2,
54 "jquery/no-is-array": 2,
55 "jquery/no-is-function": 2,
56 "jquery/no-is": 2,
57 "jquery/no-load": 2,
58 "jquery/no-map": 2,
59 "jquery/no-merge": 2,
60 "jquery/no-param": 2,
61 "jquery/no-parent": 2,
62 "jquery/no-parents": 2,
63 "jquery/no-parse-html": 2,
64 "jquery/no-prop": 2,
65 "jquery/no-proxy": 2,
66 "jquery/no-ready": 2,
67 "jquery/no-serialize": 2,
68 "jquery/no-show": 2,
69 "jquery/no-size": 2,
70 "jquery/no-sizzle": 2,
71 "jquery/no-slide": 2,
72 "jquery/no-submit": 2,
73 "jquery/no-text": 2,
74 "jquery/no-toggle": 2,
75 "jquery/no-trigger": 2,
76 "jquery/no-trim": 2,
77 "jquery/no-val": 2,
78 "jquery/no-when": 2,
79 "jquery/no-wrap": 2
80 }
81}
82```
83
84## Development
85
86```
87npm install
88npm test
89```
90
91## License
92
93Distributed under the MIT license. See LICENSE for details.