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.
- package/Changelog.md +87 -11
- package/README.md +114 -98
- package/README.md.template +14 -3
- package/package.json +14 -12
- package/src/all-methods.js +2 -0
- package/src/index.js +174 -53
- package/src/rules/no-ajax-events.js +10 -12
- package/src/rules/no-and-self.js +1 -1
- package/src/rules/no-animate-toggle.js +4 -3
- package/src/rules/no-animate.js +1 -1
- package/src/rules/no-append-html.js +53 -0
- package/src/rules/no-class-state.js +1 -1
- package/src/rules/no-constructor-attributes.js +1 -1
- package/src/rules/no-deferred.js +1 -1
- package/src/rules/no-error.js +7 -1
- package/src/rules/no-escape-selector.js +14 -0
- package/src/rules/no-event-shorthand.js +7 -7
- package/src/rules/no-extend.js +1 -1
- package/src/rules/no-global-selector.js +1 -1
- package/src/rules/no-html.js +2 -1
- package/src/rules/no-is-array.js +1 -1
- package/src/rules/no-is-function.js +1 -1
- package/src/rules/no-jquery-constructor.js +31 -0
- package/src/rules/no-load-shorthand.js +2 -2
- package/src/rules/no-noop.js +1 -1
- package/src/rules/no-now.js +2 -2
- package/src/rules/no-on-ready.js +17 -2
- package/src/rules/no-other-methods.js +121 -0
- package/src/rules/no-other-utils.js +88 -0
- package/src/rules/no-parse-html-literal.js +18 -7
- package/src/rules/no-parse-json.js +1 -1
- package/src/rules/no-parse-xml.js +12 -1
- package/src/rules/no-proxy.js +19 -1
- package/src/rules/no-ready-shorthand.js +9 -1
- package/src/rules/no-ready.js +1 -1
- package/src/rules/no-size.js +2 -2
- package/src/rules/no-sizzle.js +2 -2
- package/src/rules/no-submit.js +2 -1
- package/src/rules/no-unique.js +1 -1
- package/src/rules/variable-pattern.js +4 -3
- 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
|
|
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
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
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
|
|
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
|
|
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
|
|
244
|
-
* Move 'deprecated'
|
|
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
|
-
|
|
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
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
* [`no-jquery/no-
|
|
81
|
-
* [`no-jquery/no-
|
|
82
|
-
* [`no-jquery/no-
|
|
83
|
-
* [`no-jquery/no-
|
|
84
|
-
* [`no-jquery/no-
|
|
85
|
-
* [`no-jquery/no-
|
|
86
|
-
* [`no-jquery/no-
|
|
87
|
-
* [`no-jquery/no-
|
|
88
|
-
* [`no-jquery/no-
|
|
89
|
-
* [`no-jquery/no-
|
|
90
|
-
* [`no-jquery/no-
|
|
91
|
-
* [`no-jquery/no-
|
|
92
|
-
* [`no-jquery/no-
|
|
93
|
-
* [`no-jquery/no-
|
|
94
|
-
* [`no-jquery/no-
|
|
95
|
-
* [`no-jquery/no-
|
|
96
|
-
* [`no-jquery/no-
|
|
97
|
-
* [`no-jquery/no-
|
|
98
|
-
* [`no-jquery/no-
|
|
99
|
-
* [`no-jquery/no-
|
|
100
|
-
* [`no-jquery/no-
|
|
101
|
-
* [`no-jquery/no-
|
|
102
|
-
* [`no-jquery/no-
|
|
103
|
-
* [`no-jquery/no-
|
|
104
|
-
* [`no-jquery/no-
|
|
105
|
-
* [`no-jquery/no-
|
|
106
|
-
* [`no-jquery/no-
|
|
107
|
-
* [`no-jquery/no-
|
|
108
|
-
* [`no-jquery/no-
|
|
109
|
-
* [`no-jquery/no-
|
|
110
|
-
* [`no-jquery/no-
|
|
111
|
-
* [`no-jquery/no-
|
|
112
|
-
* [`no-jquery/no-
|
|
113
|
-
* [`no-jquery/no-
|
|
114
|
-
* [`no-jquery/no-
|
|
115
|
-
* [`no-jquery/no-
|
|
116
|
-
* [`no-jquery/no-
|
|
117
|
-
* [`no-jquery/no-
|
|
118
|
-
* [`no-jquery/no-
|
|
119
|
-
* [`no-jquery/no-
|
|
120
|
-
* [`no-jquery/no-
|
|
121
|
-
* [`no-jquery/no-
|
|
122
|
-
* [`no-jquery/no-
|
|
123
|
-
* [`no-jquery/no-is
|
|
124
|
-
* [`no-jquery/no-is-
|
|
125
|
-
* [`no-jquery/no-
|
|
126
|
-
* [`no-jquery/no-
|
|
127
|
-
* [`no-jquery/no-
|
|
128
|
-
* [`no-jquery/no-
|
|
129
|
-
* [`no-jquery/no-
|
|
130
|
-
* [`no-jquery/no-
|
|
131
|
-
* [`no-jquery/no-
|
|
132
|
-
* [`no-jquery/no-
|
|
133
|
-
* [`no-jquery/no-
|
|
134
|
-
* [`no-jquery/no-
|
|
135
|
-
* [`no-jquery/no-
|
|
136
|
-
* [`no-jquery/no-
|
|
137
|
-
* [`no-jquery/no-
|
|
138
|
-
* [`no-jquery/no-
|
|
139
|
-
* [`no-jquery/no-
|
|
140
|
-
* [`no-jquery/no-
|
|
141
|
-
* [`no-jquery/no-
|
|
142
|
-
* [`no-jquery/no-
|
|
143
|
-
* [`no-jquery/no-
|
|
144
|
-
* [`no-jquery/no-
|
|
145
|
-
* [`no-jquery/no-
|
|
146
|
-
* [`no-jquery/no-
|
|
147
|
-
* [`no-jquery/no-
|
|
148
|
-
* [`no-jquery/no-
|
|
149
|
-
* [`no-jquery/no-
|
|
150
|
-
* [`no-jquery/no-
|
|
151
|
-
* [`no-jquery/no-
|
|
152
|
-
* [`no-jquery/no-
|
|
153
|
-
* [`no-jquery/no-
|
|
154
|
-
* [`no-jquery/no-
|
|
155
|
-
* [`no-jquery/no-
|
|
156
|
-
* [`no-jquery/no-
|
|
157
|
-
* [`no-jquery/no-
|
|
158
|
-
* [`no-jquery/no-
|
|
159
|
-
* [`no-jquery/no-
|
|
160
|
-
* [`no-jquery/no-
|
|
161
|
-
* [`no-jquery/no-
|
|
162
|
-
* [`no-jquery/no-
|
|
163
|
-
* [`no-jquery/no-
|
|
164
|
-
* [`no-jquery/no-
|
|
165
|
-
* [`no-jquery/
|
|
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-
|
|
173
|
-
* [`no-jquery/no-
|
|
174
|
-
* [`no-jquery/no-
|
|
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
|
|
package/README.md.template
CHANGED
|
@@ -33,7 +33,15 @@ Add `no-jquery` to the plugins section of your `.eslintrc` configuration file. Y
|
|
|
33
33
|
}
|
|
34
34
|
```
|
|
35
35
|
|
|
36
|
-
|
|
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
|
-
|
|
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.
|
|
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/**
|
|
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.
|
|
32
|
-
"eslint": "^
|
|
33
|
-
"eslint-
|
|
34
|
-
"eslint-plugin-
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
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
|
}
|