UNPKG

1.22 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-class": 2,
33 "jquery/no-closest": 2,
34 "jquery/no-data": 2,
35 "jquery/no-deferred": 2,
36 "jquery/no-each": 2,
37 "jquery/no-find": 2,
38 "jquery/no-html": 2,
39 "jquery/no-inarray": 2,
40 "jquery/no-map": 2,
41 "jquery/no-param": 2,
42 "jquery/no-parent": 2,
43 "jquery/no-parents": 2,
44 "jquery/no-serialize": 2,
45 "jquery/no-text": 2,
46 "jquery/no-trigger": 2,
47 "jquery/no-trim": 2,
48 "jquery/no-val": 2,
49 "jquery/no-wrap": 2
50 }
51}
52```
53
54## Development
55
56```
57npm install
58npm test
59```
60
61## License
62
63Distributed under the MIT license. See LICENSE for details.