eslint-plugin-no-jquery 2.4.0 → 2.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/Changelog.md +87 -11
  2. package/README.md +114 -98
  3. package/README.md.template +14 -3
  4. package/package.json +14 -12
  5. package/src/all-methods.js +2 -0
  6. package/src/index.js +174 -53
  7. package/src/rules/no-ajax-events.js +10 -12
  8. package/src/rules/no-and-self.js +1 -1
  9. package/src/rules/no-animate-toggle.js +4 -3
  10. package/src/rules/no-animate.js +1 -1
  11. package/src/rules/no-append-html.js +53 -0
  12. package/src/rules/no-class-state.js +1 -1
  13. package/src/rules/no-constructor-attributes.js +1 -1
  14. package/src/rules/no-deferred.js +1 -1
  15. package/src/rules/no-error.js +7 -1
  16. package/src/rules/no-escape-selector.js +14 -0
  17. package/src/rules/no-event-shorthand.js +7 -7
  18. package/src/rules/no-extend.js +1 -1
  19. package/src/rules/no-global-selector.js +1 -1
  20. package/src/rules/no-html.js +2 -1
  21. package/src/rules/no-is-array.js +1 -1
  22. package/src/rules/no-is-function.js +1 -1
  23. package/src/rules/no-jquery-constructor.js +31 -0
  24. package/src/rules/no-load-shorthand.js +2 -2
  25. package/src/rules/no-noop.js +1 -1
  26. package/src/rules/no-now.js +2 -2
  27. package/src/rules/no-on-ready.js +17 -2
  28. package/src/rules/no-other-methods.js +121 -0
  29. package/src/rules/no-other-utils.js +88 -0
  30. package/src/rules/no-parse-html-literal.js +18 -7
  31. package/src/rules/no-parse-json.js +1 -1
  32. package/src/rules/no-parse-xml.js +12 -1
  33. package/src/rules/no-proxy.js +19 -1
  34. package/src/rules/no-ready-shorthand.js +9 -1
  35. package/src/rules/no-ready.js +1 -1
  36. package/src/rules/no-size.js +2 -2
  37. package/src/rules/no-sizzle.js +2 -2
  38. package/src/rules/no-submit.js +2 -1
  39. package/src/rules/no-unique.js +1 -1
  40. package/src/rules/variable-pattern.js +4 -3
  41. package/src/utils.js +59 -25
package/Changelog.md CHANGED
@@ -1,11 +1,88 @@
1
1
  # eslint-plugin-no-jquery release history
2
2
 
3
+ ## v2.7.0
4
+ * New rule: `no-append-html` (#284) (Ed Sanders)
5
+ * New config: Allow rules to disable get/set separately, starting with no-html (Ed Sanders)
6
+ * Deprecated rule: `no-submit`; use `no-event-shorthand` (Ed Sanders)
7
+
8
+
9
+ * Code: Sort ajax events consistently and alphabetically. (Ed Sanders)
10
+ * Code: utils.isjQuery: Improve `Identifier` detection (#283) (Ed Sanders)
11
+
12
+
13
+ * Docs: Update eslint-docgen to 0.5.1 (#290) (Ed Sanders)
14
+ * Docs: Show which rules have options, and which are fixable in README (#289) (Ed Sanders)
15
+ * Docs: Fix test links (#280) (Ed Sanders)
16
+
17
+
18
+ * Release: Update devDependencies (#278) (Ed Sanders)
19
+
20
+ ## v2.6.0
21
+ * New rule: `no-escape-selector` for `$.escapeSelector` util (Ed Sanders)
22
+ * New config: `deprecated-3.6` for new jQuery release (Ed Sanders)
23
+
24
+
25
+ * Rule fix: Add fixer for `no-on-ready` (Ed Sanders)
26
+ * Rule fix: Add fixer for `no-ready-shorthand` (Ed Sanders)
27
+ * Rule fix: Add fixer for `no-error` (Ed Sanders)
28
+ * Rule fix: Add fixer for `no-parse-xml` (Ed Sanders)
29
+ * Rule fix: Add fixer for `no-parse-html-literal` tag style (Ed Sanders)
30
+ * Rule fix: `no-now`; recommend `Date.now` rather than `(new Date).getTime()` (Ed Sanders)
31
+
32
+
33
+ * Code: Add real arguments to `no-parse-html` tests (Ed Sanders)
34
+ * Code: codecov.yaml: Remove extra linebreak (Ed Sanders)
35
+ * Release: Update devDependencies (#266) (Ed Sanders)
36
+
37
+
38
+ ## v2.5.0
39
+
40
+ * New config: `recommended` just includes `variable-pattern` rule (Ed Sanders)
41
+ * New config: `all` covers all usages of jQuery methods and utils (Ed Sanders)
42
+ * New config: Create a `deprecated-X.X` config for every minor release (Ed Sanders)
43
+ * Configs: Use 'warn' instead of 'error' in `deprecated-X` and `all` configs (Ed Sanders)
44
+ * New rule: `no-jquery-constructor` (Ed Sanders)
45
+
46
+
47
+ * Code: Add `reporthtml` coverage script (Ed Sanders)
48
+ * Code: Remove unnecessary constants (Ed Sanders)
49
+ * Code: Replace `Array#indexOf` with `Array#includes` (Ed Sanders)
50
+ * Code: Only assert error message strings (Ed Sanders)
51
+ * Code: Introduce eslint-plugin-eslint-plugin (Ed Sanders)
52
+ * Code: Add ESLint 7.0.0 support (Ed Sanders)
53
+ * Code: Prefer `$("div")` in test cases (Ed Sanders)
54
+ * Code: Fix ESLint 2.3.0 support (Ed Sanders)
55
+
56
+
57
+ * Docs: Document and test the `slim` config (Ed Sanders)
58
+ * Docs: Move docs to docs/rules (Ed Sanders)
59
+ * Docs: Suppress more examples with noDoc (no-parse-html-literal) (Ed Sanders)
60
+ * Docs: Update to eslint-docgen 0.3.1 (Ed Sanders)
61
+ * Docs: Suppress some examples with noDoc in long documentation files (Ed Sanders)
62
+ * Docs: Use eslint-docgen (Ed Sanders)
63
+ * Docs: Remove noDoc arg from RuleTesterAndDocs, just use RuleTester (Ed Sanders)
64
+ * Docs: Fetch 'main' path from package.json (Ed Sanders)
65
+ * Docs: Remove extra linebreak from no-parse-html-literal.md (Ed Sanders)
66
+ * Docs: Add missing linebreak before rule source section (Ed Sanders)
67
+ * Docs: Improvements to doc builder (Ed Sanders)
68
+
69
+
70
+ * Release: Update devDependencies (Ed Sanders)
71
+
72
+ ## v2.4.1
73
+
74
+ * Config fix: Fix override of `no-event-shorthand` in `deprecated-3.5` (Ed Sanders)
75
+
76
+
77
+ * Code: Add real test coverage for index.js (Ed Sanders)
78
+ * Code: gitignore coverage.lcov (Ed Sanders)
79
+
3
80
  ## v2.4.0
4
81
 
5
82
  * New feature: Add specification of plugin return types to settings (Ed Sanders)
6
83
 
7
84
 
8
- * New profile: Add new `deprecated-3.5` config (Ed Sanders)
85
+ * New config: Add new `deprecated-3.5` config (Ed Sanders)
9
86
 
10
87
 
11
88
  * New rule: `no-find-collection`, split out of `no-find` (Ed Sanders)
@@ -16,7 +93,6 @@
16
93
  * Rule fix: `no-global-selector`; add `allowIds` option to allow global selector by ID (Adam Roses Wight)
17
94
  * Rule fix: `no-event-shorthand`; add `allowAjaxEvents` option and use in `deprecated-3.3` (Ed Sanders)
18
95
 
19
-
20
96
 
21
97
  * Docs: Avoid duplicating name in "Prefer..." sentence (Ed Sanders)
22
98
  * Docs: Build lists in README.md automatically (Ed Sanders)
@@ -29,11 +105,11 @@
29
105
  * Release: Update devDependencies (Ed Sanders)
30
106
 
31
107
 
32
- * code: Add `#odd` and `#even` to all methods lists, new in jQuery 3.5 (Ed Sanders)
33
- * code: Add code coverage checks using Istanbul (Ed Sanders)
34
- * code: Move index.js to src/ (Ed Sanders)
35
- * code: Restructure files and folders (Ed Sanders)
36
- * code: Setup codecov GitHub Action integration (Ed Sanders)
108
+ * Code: Add `#odd` and `#even` to all methods lists, new in jQuery 3.5 (Ed Sanders)
109
+ * Code: Add code coverage checks using Istanbul (Ed Sanders)
110
+ * Code: Move index.js to src/ (Ed Sanders)
111
+ * Code: Restructure files and folders (Ed Sanders)
112
+ * Code: Setup codecov GitHub Action integration (Ed Sanders)
37
113
 
38
114
 
39
115
  ## v2.3.2
@@ -87,7 +163,7 @@
87
163
  * New rule: `no-visibility` as a group alias for `no-show`, `no-hide`, & `no-toggle` (Ed Sanders)
88
164
 
89
165
 
90
- * New config: `slim` as a profile for users of the jQuery slim build (Ed Sanders)
166
+ * New config: `slim` as a config for users of the jQuery slim build (Ed Sanders)
91
167
 
92
168
 
93
169
  * Deprecated rule: `no-show` (Ed Sanders)
@@ -232,7 +308,7 @@
232
308
 
233
309
 
234
310
  ## v1.3.2-wmf.4
235
- * Fix typo in profile listing (Ed Sanders)
311
+ * Fix typo in config listing (Ed Sanders)
236
312
 
237
313
 
238
314
  ## v1.3.2-wmf.3
@@ -240,8 +316,8 @@
240
316
 
241
317
 
242
318
  ## v1.3.2-wmf.2
243
- * Provide version-specific deprecation profiles (James D. Forrester)
244
- * Move 'deprecated' profile as a pointer to latest, remove old 'slim' profile (Ed Sanders)
319
+ * Provide version-specific deprecation configs (James D. Forrester)
320
+ * Move 'deprecated' config as a pointer to latest, remove old 'slim' config (Ed Sanders)
245
321
 
246
322
 
247
323
  * New rule: `no-and-self` (Ed Sanders)
package/README.md CHANGED
@@ -34,7 +34,15 @@ Add `no-jquery` to the plugins section of your `.eslintrc` configuration file. Y
34
34
  }
35
35
  ```
36
36
 
37
- The pre-set profile `plugin:no-jquery/deprecated` includes all known deprecated and removed code, and is updated as new releases of jQuery come out. You can instead use profiles targetting specific versions of jQuery if you know the environment in which your code will operate. There is a profile for jQuery 3.5.x+ environments (`deprecated-3.5`), and profiles for other minor releases that include deprecations (`deprecated-3.4`, `deprecated-1.10` etc.). Deprecation profiles are cumulative, so they include all the rules for jQuery versions below them.
37
+ ## 📋 Configs
38
+
39
+ The config **`plugin:no-jquery/recommended`** includes the recommended rule [`no-jquery/variable-pattern`](docs/rules/variable-pattern.md) which is required for method rules to work correctly.
40
+
41
+ The config **`plugin:no-jquery/deprecated`** includes all known deprecated and removed code, and is updated as new releases of jQuery come out. You can instead use configs targeting specific versions of jQuery if you know the environment in which your code will operate. There is a config for all minor versions from 1.0 to 3.6 (`deprecated-1.0`, ..., `deprecated-3.6`). Deprecation configs are cumulative, so they include all the rules for jQuery versions below them.
42
+
43
+ The config **`plugin:no-jquery/slim`** includes all features excluded from the official "slim" build of jQuery, specifically the [ajax](https://api.jquery.com/category/ajax/) and [effects](https://api.jquery.com/category/effects/) modules.
44
+
45
+ The config **`plugin:no-jquery/all`** includes all methods and utilies and should be used when you are aiming to remove all jQuery usage from your code.
38
46
 
39
47
  Alternatively, you can pick out rules individually (see below).
40
48
 
@@ -43,7 +51,7 @@ Alternatively, you can pick out rules individually (see below).
43
51
  The following global settings can be used under the `no-jquery` property to configure the linter:
44
52
 
45
53
  * `constructorAliases` - An array of aliases for the jQuery constructor. Defaults to `[ "$", "jQuery" ]`.
46
- * `variablePattern` - Regular expression pattern for matching jQuery variables. Defaults to `"^\\$."`. This pattern can be enforced with the [`no-jquery/variable-pattern`](docs/variable-pattern.md) rule.
54
+ * `variablePattern` - Regular expression pattern for matching jQuery variables. Defaults to `"^\\$."`. This pattern can be enforced with the [`no-jquery/variable-pattern`](docs/rules/variable-pattern.md) rule.
47
55
  * `collectionReturningPlugins` - An object describing the return types of jQuery plugins. Keys are plugin method names, and values can be one of:
48
56
  * `'always'` a plugin which always returns a jQuery collection.
49
57
  * e.g. `$bar = $foo.stop()`
@@ -73,105 +81,113 @@ The following global settings can be used under the `no-jquery` property to conf
73
81
 
74
82
  ## 📖 Rules
75
83
 
76
- Where rules are included in the pre-set profiles `slim` or `deprecated-X.X` it is indicated below. Where rules are included with options this is indicated with a `†`.
77
- * [`no-jquery/no-ajax`](docs/no-ajax.md) `slim`
78
- * [`no-jquery/no-ajax-events`](docs/no-ajax-events.md) `slim`
79
- * [`no-jquery/no-and-self`](docs/no-and-self.md) `1.8`
80
- * [`no-jquery/no-animate`](docs/no-animate.md) `slim`
81
- * [`no-jquery/no-animate-toggle`](docs/no-animate-toggle.md) `slim`
82
- * [`no-jquery/no-attr`](docs/no-attr.md)
83
- * [`no-jquery/no-bind`](docs/no-bind.md) `3.0`
84
- * [`no-jquery/no-box-model`](docs/no-box-model.md) `1.3`
85
- * [`no-jquery/no-browser`](docs/no-browser.md) `1.3`
86
- * [`no-jquery/no-camel-case`](docs/no-camel-case.md) `3.3`
87
- * [`no-jquery/no-class`](docs/no-class.md)
88
- * [`no-jquery/no-class-state`](docs/no-class-state.md)
89
- * [`no-jquery/no-clone`](docs/no-clone.md)
90
- * [`no-jquery/no-closest`](docs/no-closest.md)
91
- * [`no-jquery/no-constructor-attributes`](docs/no-constructor-attributes.md)
92
- * [`no-jquery/no-contains`](docs/no-contains.md)
93
- * [`no-jquery/no-context-prop`](docs/no-context-prop.md) `1.10`
94
- * [`no-jquery/no-css`](docs/no-css.md)
95
- * [`no-jquery/no-data`](docs/no-data.md)
96
- * [`no-jquery/no-deferred`](docs/no-deferred.md)
97
- * [`no-jquery/no-delegate`](docs/no-delegate.md) `3.0`
98
- * [`no-jquery/no-each`](docs/no-each.md)
99
- * [`no-jquery/no-each-collection`](docs/no-each-collection.md)
100
- * [`no-jquery/no-each-util`](docs/no-each-util.md)
101
- * [`no-jquery/no-error`](docs/no-error.md)
102
- * [`no-jquery/no-error-shorthand`](docs/no-error-shorthand.md) `1.8`
103
- * [`no-jquery/no-event-shorthand`](docs/no-event-shorthand.md) `3.5`, `3.3†`
104
- * [`no-jquery/no-extend`](docs/no-extend.md)
105
- * [`no-jquery/no-fade`](docs/no-fade.md) `slim`
106
- * [`no-jquery/no-filter`](docs/no-filter.md)
107
- * [`no-jquery/no-find`](docs/no-find.md)
108
- * [`no-jquery/no-find-collection`](docs/no-find-collection.md)
109
- * [`no-jquery/no-find-util`](docs/no-find-util.md)
110
- * [`no-jquery/no-fx-interval`](docs/no-fx-interval.md) `3.0`
111
- * [`no-jquery/no-global-eval`](docs/no-global-eval.md)
112
- * [`no-jquery/no-global-selector`](docs/no-global-selector.md)
113
- * [`no-jquery/no-grep`](docs/no-grep.md)
114
- * [`no-jquery/no-has`](docs/no-has.md)
115
- * [`no-jquery/no-hold-ready`](docs/no-hold-ready.md) `3.2`
116
- * [`no-jquery/no-html`](docs/no-html.md)
117
- * [`no-jquery/no-in-array`](docs/no-in-array.md)
118
- * [`no-jquery/no-is`](docs/no-is.md)
119
- * [`no-jquery/no-is-array`](docs/no-is-array.md) `3.2`
120
- * [`no-jquery/no-is-empty-object`](docs/no-is-empty-object.md)
121
- * [`no-jquery/no-is-function`](docs/no-is-function.md) `3.3`
122
- * [`no-jquery/no-is-numeric`](docs/no-is-numeric.md) `3.3`
123
- * [`no-jquery/no-is-plain-object`](docs/no-is-plain-object.md)
124
- * [`no-jquery/no-is-window`](docs/no-is-window.md) `3.3`
125
- * [`no-jquery/no-live`](docs/no-live.md) `1.7`
126
- * [`no-jquery/no-load`](docs/no-load.md) `slim`
127
- * [`no-jquery/no-load-shorthand`](docs/no-load-shorthand.md) `1.8`
128
- * [`no-jquery/no-map`](docs/no-map.md)
129
- * [`no-jquery/no-map-collection`](docs/no-map-collection.md)
130
- * [`no-jquery/no-map-util`](docs/no-map-util.md)
131
- * [`no-jquery/no-merge`](docs/no-merge.md)
132
- * [`no-jquery/no-node-name`](docs/no-node-name.md) `3.2`
133
- * [`no-jquery/no-noop`](docs/no-noop.md)
134
- * [`no-jquery/no-now`](docs/no-now.md) `3.3`
135
- * [`no-jquery/no-on-ready`](docs/no-on-ready.md) `1.8`
136
- * [`no-jquery/no-param`](docs/no-param.md)
137
- * [`no-jquery/no-parent`](docs/no-parent.md)
138
- * [`no-jquery/no-parents`](docs/no-parents.md)
139
- * [`no-jquery/no-parse-html`](docs/no-parse-html.md)
140
- * [`no-jquery/no-parse-html-literal`](docs/no-parse-html-literal.md)
141
- * [`no-jquery/no-parse-json`](docs/no-parse-json.md) `3.0`
142
- * [`no-jquery/no-parse-xml`](docs/no-parse-xml.md) `slim`
143
- * [`no-jquery/no-prop`](docs/no-prop.md)
144
- * [`no-jquery/no-proxy`](docs/no-proxy.md) `3.3`
145
- * [`no-jquery/no-ready`](docs/no-ready.md)
146
- * [`no-jquery/no-ready-shorthand`](docs/no-ready-shorthand.md) `3.0`
147
- * [`no-jquery/no-selector-prop`](docs/no-selector-prop.md) `1.7`
148
- * [`no-jquery/no-serialize`](docs/no-serialize.md)
149
- * [`no-jquery/no-size`](docs/no-size.md) `1.8`
150
- * [`no-jquery/no-sizzle`](docs/no-sizzle.md) `3.4†`
151
- * [`no-jquery/no-slide`](docs/no-slide.md) `slim`
152
- * [`no-jquery/no-sub`](docs/no-sub.md) `1.7`
153
- * [`no-jquery/no-submit`](docs/no-submit.md)
154
- * [`no-jquery/no-support`](docs/no-support.md) `1.9`
155
- * [`no-jquery/no-text`](docs/no-text.md)
156
- * [`no-jquery/no-trigger`](docs/no-trigger.md)
157
- * [`no-jquery/no-trim`](docs/no-trim.md) `3.5`
158
- * [`no-jquery/no-type`](docs/no-type.md) `3.3`
159
- * [`no-jquery/no-unique`](docs/no-unique.md) `3.0`
160
- * [`no-jquery/no-unload-shorthand`](docs/no-unload-shorthand.md) `1.8`
161
- * [`no-jquery/no-val`](docs/no-val.md)
162
- * [`no-jquery/no-visibility`](docs/no-visibility.md)
163
- * [`no-jquery/no-when`](docs/no-when.md)
164
- * [`no-jquery/no-wrap`](docs/no-wrap.md)
165
- * [`no-jquery/variable-pattern`](docs/variable-pattern.md)
84
+ Rules with options are indicated with ⚙️. Rules which are fixable are indicated with 🔧.
85
+
86
+ Where rules are included in the configs `recommended`, `slim`, `all` or `deprecated-X.X` it is indicated below. Where rules are included in a config with non-default options this is indicated with a `†`.
87
+
88
+ * [`no-jquery/no-ajax`](docs/rules/no-ajax.md) `slim`, `all`
89
+ * [`no-jquery/no-ajax-events`](docs/rules/no-ajax-events.md) `slim`
90
+ * [`no-jquery/no-and-self`](docs/rules/no-and-self.md) 🔧 `1.8`
91
+ * [`no-jquery/no-animate`](docs/rules/no-animate.md) ⚙️ `slim`, `all`
92
+ * [`no-jquery/no-animate-toggle`](docs/rules/no-animate-toggle.md) `slim`
93
+ * [`no-jquery/no-append-html`](docs/rules/no-append-html.md)
94
+ * [`no-jquery/no-attr`](docs/rules/no-attr.md) `all`
95
+ * [`no-jquery/no-bind`](docs/rules/no-bind.md) `3.0`, `all`
96
+ * [`no-jquery/no-box-model`](docs/rules/no-box-model.md) `1.3`
97
+ * [`no-jquery/no-browser`](docs/rules/no-browser.md) `1.3`
98
+ * [`no-jquery/no-camel-case`](docs/rules/no-camel-case.md) `3.3`, `all`
99
+ * [`no-jquery/no-class`](docs/rules/no-class.md) `all`
100
+ * [`no-jquery/no-class-state`](docs/rules/no-class-state.md)
101
+ * [`no-jquery/no-clone`](docs/rules/no-clone.md) `all`
102
+ * [`no-jquery/no-closest`](docs/rules/no-closest.md) `all`
103
+ * [`no-jquery/no-constructor-attributes`](docs/rules/no-constructor-attributes.md)
104
+ * [`no-jquery/no-contains`](docs/rules/no-contains.md) `all`
105
+ * [`no-jquery/no-context-prop`](docs/rules/no-context-prop.md) `1.10`
106
+ * [`no-jquery/no-css`](docs/rules/no-css.md) `all`
107
+ * [`no-jquery/no-data`](docs/rules/no-data.md) `all`
108
+ * [`no-jquery/no-deferred`](docs/rules/no-deferred.md) `all`
109
+ * [`no-jquery/no-delegate`](docs/rules/no-delegate.md) `3.0`, `all`
110
+ * [`no-jquery/no-each`](docs/rules/no-each.md)
111
+ * [`no-jquery/no-each-collection`](docs/rules/no-each-collection.md) `all`
112
+ * [`no-jquery/no-each-util`](docs/rules/no-each-util.md) `all`
113
+ * [`no-jquery/no-error`](docs/rules/no-error.md) 🔧 `all`
114
+ * [`no-jquery/no-error-shorthand`](docs/rules/no-error-shorthand.md) 🔧 `1.8`
115
+ * [`no-jquery/no-escape-selector`](docs/rules/no-escape-selector.md) 🔧 `all`
116
+ * [`no-jquery/no-event-shorthand`](docs/rules/no-event-shorthand.md) ⚙️ 🔧 `3.5`, `3.3†`, `all`
117
+ * [`no-jquery/no-extend`](docs/rules/no-extend.md) ⚙️ `all`
118
+ * [`no-jquery/no-fade`](docs/rules/no-fade.md) `slim`, `all`
119
+ * [`no-jquery/no-filter`](docs/rules/no-filter.md) `all`
120
+ * [`no-jquery/no-find`](docs/rules/no-find.md)
121
+ * [`no-jquery/no-find-collection`](docs/rules/no-find-collection.md) `all`
122
+ * [`no-jquery/no-find-util`](docs/rules/no-find-util.md) `all`
123
+ * [`no-jquery/no-fx-interval`](docs/rules/no-fx-interval.md) `3.0`
124
+ * [`no-jquery/no-global-eval`](docs/rules/no-global-eval.md) `all`
125
+ * [`no-jquery/no-global-selector`](docs/rules/no-global-selector.md) ⚙️
126
+ * [`no-jquery/no-grep`](docs/rules/no-grep.md) `all`
127
+ * [`no-jquery/no-has`](docs/rules/no-has.md) `all`
128
+ * [`no-jquery/no-hold-ready`](docs/rules/no-hold-ready.md) `3.2`, `all`
129
+ * [`no-jquery/no-html`](docs/rules/no-html.md) ⚙️ `all`
130
+ * [`no-jquery/no-in-array`](docs/rules/no-in-array.md) `all`
131
+ * [`no-jquery/no-is`](docs/rules/no-is.md) `all`
132
+ * [`no-jquery/no-is-array`](docs/rules/no-is-array.md) 🔧 `3.2`, `all`
133
+ * [`no-jquery/no-is-empty-object`](docs/rules/no-is-empty-object.md) `all`
134
+ * [`no-jquery/no-is-function`](docs/rules/no-is-function.md) 🔧 `3.3`, `all`
135
+ * [`no-jquery/no-is-numeric`](docs/rules/no-is-numeric.md) `3.3`, `all`
136
+ * [`no-jquery/no-is-plain-object`](docs/rules/no-is-plain-object.md) `all`
137
+ * [`no-jquery/no-is-window`](docs/rules/no-is-window.md) `3.3`, `all`
138
+ * [`no-jquery/no-jquery-constructor`](docs/rules/no-jquery-constructor.md) `all`
139
+ * [`no-jquery/no-live`](docs/rules/no-live.md) `1.7`, `all`
140
+ * [`no-jquery/no-load`](docs/rules/no-load.md) `slim`, `all`
141
+ * [`no-jquery/no-load-shorthand`](docs/rules/no-load-shorthand.md) 🔧 `1.8`
142
+ * [`no-jquery/no-map`](docs/rules/no-map.md)
143
+ * [`no-jquery/no-map-collection`](docs/rules/no-map-collection.md) `all`
144
+ * [`no-jquery/no-map-util`](docs/rules/no-map-util.md) `all`
145
+ * [`no-jquery/no-merge`](docs/rules/no-merge.md) `all`
146
+ * [`no-jquery/no-node-name`](docs/rules/no-node-name.md) `3.2`, `all`
147
+ * [`no-jquery/no-noop`](docs/rules/no-noop.md) 🔧 `all`
148
+ * [`no-jquery/no-now`](docs/rules/no-now.md) 🔧 `3.3`, `all`
149
+ * [`no-jquery/no-on-ready`](docs/rules/no-on-ready.md) 🔧 `1.8`
150
+ * [`no-jquery/no-other-methods`](docs/rules/no-other-methods.md) `all`
151
+ * [`no-jquery/no-other-utils`](docs/rules/no-other-utils.md) `all`
152
+ * [`no-jquery/no-param`](docs/rules/no-param.md) `all`
153
+ * [`no-jquery/no-parent`](docs/rules/no-parent.md) `all`
154
+ * [`no-jquery/no-parents`](docs/rules/no-parents.md) `all`
155
+ * [`no-jquery/no-parse-html`](docs/rules/no-parse-html.md) `all`
156
+ * [`no-jquery/no-parse-html-literal`](docs/rules/no-parse-html-literal.md) ⚙️ 🔧
157
+ * [`no-jquery/no-parse-json`](docs/rules/no-parse-json.md) 🔧 `3.0`, `all`
158
+ * [`no-jquery/no-parse-xml`](docs/rules/no-parse-xml.md) 🔧 `slim`, `all`
159
+ * [`no-jquery/no-prop`](docs/rules/no-prop.md) `all`
160
+ * [`no-jquery/no-proxy`](docs/rules/no-proxy.md) 🔧 `3.3`, `all`
161
+ * [`no-jquery/no-ready`](docs/rules/no-ready.md)
162
+ * [`no-jquery/no-ready-shorthand`](docs/rules/no-ready-shorthand.md) 🔧 `3.0`, `all`
163
+ * [`no-jquery/no-selector-prop`](docs/rules/no-selector-prop.md) `1.7`
164
+ * [`no-jquery/no-serialize`](docs/rules/no-serialize.md) `all`
165
+ * [`no-jquery/no-size`](docs/rules/no-size.md) 🔧 `1.8`, `all`
166
+ * [`no-jquery/no-sizzle`](docs/rules/no-sizzle.md) ⚙️ `3.4†`
167
+ * [`no-jquery/no-slide`](docs/rules/no-slide.md) `slim`, `all`
168
+ * [`no-jquery/no-sub`](docs/rules/no-sub.md) `1.7`, `all`
169
+ * [`no-jquery/no-support`](docs/rules/no-support.md) `1.9`
170
+ * [`no-jquery/no-text`](docs/rules/no-text.md) `all`
171
+ * [`no-jquery/no-trigger`](docs/rules/no-trigger.md) `all`
172
+ * [`no-jquery/no-trim`](docs/rules/no-trim.md) `3.5`, `all`
173
+ * [`no-jquery/no-type`](docs/rules/no-type.md) `3.3`, `all`
174
+ * [`no-jquery/no-unique`](docs/rules/no-unique.md) 🔧 `3.0`, `all`
175
+ * [`no-jquery/no-unload-shorthand`](docs/rules/no-unload-shorthand.md) 🔧 `1.8`
176
+ * [`no-jquery/no-val`](docs/rules/no-val.md) `all`
177
+ * [`no-jquery/no-visibility`](docs/rules/no-visibility.md) `all`
178
+ * [`no-jquery/no-when`](docs/rules/no-when.md) `all`
179
+ * [`no-jquery/no-wrap`](docs/rules/no-wrap.md) `all`
180
+ * [`no-jquery/variable-pattern`](docs/rules/variable-pattern.md) `recommended`
166
181
 
167
182
  ### ⚠️ Deprecated
168
183
 
169
- * [`no-jquery/no-die`](docs/no-die.md) (use [`no-jquery/no-live`](docs/no-live.md))
170
- * [`no-jquery/no-hide`](docs/no-hide.md) (use [`no-jquery/no-visibility`](docs/no-visibility.md))
171
- * [`no-jquery/no-show`](docs/no-show.md) (use [`no-jquery/no-visibility`](docs/no-visibility.md))
172
- * [`no-jquery/no-toggle`](docs/no-toggle.md) (use [`no-jquery/no-visibility`](docs/no-visibility.md))
173
- * [`no-jquery/no-unbind`](docs/no-unbind.md) (use [`no-jquery/no-bind`](docs/no-bind.md))
174
- * [`no-jquery/no-undelegate`](docs/no-undelegate.md) (use [`no-jquery/no-delegate`](docs/no-delegate.md))
184
+ * [`no-jquery/no-die`](docs/rules/no-die.md) (use [`no-jquery/no-live`](docs/rules/no-live.md))
185
+ * [`no-jquery/no-hide`](docs/rules/no-hide.md) (use [`no-jquery/no-visibility`](docs/rules/no-visibility.md))
186
+ * [`no-jquery/no-show`](docs/rules/no-show.md) (use [`no-jquery/no-visibility`](docs/rules/no-visibility.md))
187
+ * [`no-jquery/no-submit`](docs/rules/no-submit.md) (use [`no-jquery/no-event-shorthand`](docs/rules/no-event-shorthand.md))
188
+ * [`no-jquery/no-toggle`](docs/rules/no-toggle.md) (use [`no-jquery/no-visibility`](docs/rules/no-visibility.md))
189
+ * [`no-jquery/no-unbind`](docs/rules/no-unbind.md) (use [`no-jquery/no-bind`](docs/rules/no-bind.md))
190
+ * [`no-jquery/no-undelegate`](docs/rules/no-undelegate.md) (use [`no-jquery/no-delegate`](docs/rules/no-delegate.md))
175
191
 
176
192
  ## 🤖 Development
177
193
 
@@ -33,7 +33,15 @@ Add `no-jquery` to the plugins section of your `.eslintrc` configuration file. Y
33
33
  }
34
34
  ```
35
35
 
36
- The pre-set profile `plugin:no-jquery/deprecated` includes all known deprecated and removed code, and is updated as new releases of jQuery come out. You can instead use profiles targetting specific versions of jQuery if you know the environment in which your code will operate. There is a profile for jQuery 3.5.x+ environments (`deprecated-3.5`), and profiles for other minor releases that include deprecations (`deprecated-3.4`, `deprecated-1.10` etc.). Deprecation profiles are cumulative, so they include all the rules for jQuery versions below them.
36
+ ## 📋 Configs
37
+
38
+ The config **`plugin:no-jquery/recommended`** includes the recommended rule [`no-jquery/variable-pattern`](docs/rules/variable-pattern.md) which is required for method rules to work correctly.
39
+
40
+ The config **`plugin:no-jquery/deprecated`** includes all known deprecated and removed code, and is updated as new releases of jQuery come out. You can instead use configs targeting specific versions of jQuery if you know the environment in which your code will operate. There is a config for all minor versions from 1.0 to 3.6 (`deprecated-1.0`, ..., `deprecated-3.6`). Deprecation configs are cumulative, so they include all the rules for jQuery versions below them.
41
+
42
+ The config **`plugin:no-jquery/slim`** includes all features excluded from the official "slim" build of jQuery, specifically the [ajax](https://api.jquery.com/category/ajax/) and [effects](https://api.jquery.com/category/effects/) modules.
43
+
44
+ The config **`plugin:no-jquery/all`** includes all methods and utilies and should be used when you are aiming to remove all jQuery usage from your code.
37
45
 
38
46
  Alternatively, you can pick out rules individually (see below).
39
47
 
@@ -42,7 +50,7 @@ Alternatively, you can pick out rules individually (see below).
42
50
  The following global settings can be used under the `no-jquery` property to configure the linter:
43
51
 
44
52
  * `constructorAliases` - An array of aliases for the jQuery constructor. Defaults to `[ "$", "jQuery" ]`.
45
- * `variablePattern` - Regular expression pattern for matching jQuery variables. Defaults to `"^\\$."`. This pattern can be enforced with the [`no-jquery/variable-pattern`](docs/variable-pattern.md) rule.
53
+ * `variablePattern` - Regular expression pattern for matching jQuery variables. Defaults to `"^\\$."`. This pattern can be enforced with the [`no-jquery/variable-pattern`](docs/rules/variable-pattern.md) rule.
46
54
  * `collectionReturningPlugins` - An object describing the return types of jQuery plugins. Keys are plugin method names, and values can be one of:
47
55
  * `'always'` a plugin which always returns a jQuery collection.
48
56
  * e.g. `$bar = $foo.stop()`
@@ -72,7 +80,10 @@ The following global settings can be used under the `no-jquery` property to conf
72
80
 
73
81
  ## 📖 Rules
74
82
 
75
- Where rules are included in the pre-set profiles `slim` or `deprecated-X.X` it is indicated below. Where rules are included with options this is indicated with a `†`.
83
+ Rules with options are indicated with ⚙️. Rules which are fixable are indicated with 🔧.
84
+
85
+ Where rules are included in the configs `recommended`, `slim`, `all` or `deprecated-X.X` it is indicated below. Where rules are included in a config with non-default options this is indicated with a `†`.
86
+
76
87
  <!-- rules -->
77
88
 
78
89
  ### ⚠️ Deprecated
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-no-jquery",
3
- "version": "2.4.0",
3
+ "version": "2.7.0",
4
4
  "description": "Disallow jQuery functions with native equivalents.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -16,9 +16,11 @@
16
16
  "scripts": {
17
17
  "pretest": "eslint --report-unused-disable-directives .",
18
18
  "test": "nyc mocha --reporter dot tests/** && git diff --exit-code docs/ src/ README.md",
19
+ "onlytest": "mocha --reporter dot tests/** --nofix",
19
20
  "report": "nyc report --reporter=text-lcov > coverage.lcov",
21
+ "reporthtml": "nyc report --reporter=html",
20
22
  "testpath": "mocha",
21
- "doc": "rm -f docs/* && mocha --reporter dot tests/** --doc && node tools/build-readme.js",
23
+ "doc": "rm -f docs/rules/* && env DOCGEN=1 mocha --reporter dot tests/** && node tools/build-readme.js",
22
24
  "build": "npm run doc && node tools/build-all-methods.js"
23
25
  },
24
26
  "files": [
@@ -28,14 +30,15 @@
28
30
  "eslint": ">=2.3.0"
29
31
  },
30
32
  "devDependencies": {
31
- "codecov": "^3.6.5",
32
- "eslint": "^6.4.0",
33
- "eslint-config-wikimedia": "^0.15.1",
34
- "eslint-plugin-rulesdir": "^0.1.0",
35
- "jquery": "3.5.0",
36
- "jsdom": "^16.2.2",
37
- "mocha": "^7.1.1",
38
- "nyc": "^15.0.1"
33
+ "codecov": "^3.8.3",
34
+ "eslint-config-wikimedia": "^0.20.0",
35
+ "eslint-docgen": "^0.5.1",
36
+ "eslint-plugin-eslint-plugin": "^3.6.1",
37
+ "eslint-plugin-self": "^1.2.1",
38
+ "jquery": "3.6.0",
39
+ "jsdom": "^16.7.0",
40
+ "mocha": "^8.4.0",
41
+ "nyc": "^15.1.0"
39
42
  },
40
43
  "bugs": {
41
44
  "url": "https://github.com/wikimedia/eslint-plugin-no-jquery/issues"
@@ -43,6 +46,5 @@
43
46
  "homepage": "https://github.com/wikimedia/eslint-plugin-no-jquery#readme",
44
47
  "directories": {
45
48
  "test": "tests"
46
- },
47
- "dependencies": {}
49
+ }
48
50
  }
@@ -1,3 +1,5 @@
1
+ 'use strict';
2
+
1
3
  <!-- This file is built by build-all-methods.js; do not edit it directly. -->
2
4
  module.exports = [
3
5
  'add',