Skip to content

Commit 1c1e287

Browse files
committed
Add doc explaining how to generate blacklist array
1 parent 9a3ab20 commit 1c1e287

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

guides/rules/no-jquery-methods.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
**TL;DR** The intent of this rule is to identify any blacklisted jQuery methods as deprecated.
44

5-
Provides the ability to blacklist a set of jQuery methods for deprecation.
5+
Provides the ability to blacklist a set of jQuery methods for deprecation.
66
The eventual goal being a complete removal of jQuery.
77

88
# Usage
99

10-
Pass an argument array containing the specific blacklisted jQuery methods your consuming application is flagging for.
10+
Pass an argument array containing the specific blacklisted jQuery methods your consuming application is flagging for.
1111

1212
```js
1313
const BLACKLIST = [
@@ -21,3 +21,9 @@ rules: {
2121
'ember-best-practices/no-jquery-methods': ['error', BLACKLIST]
2222
}
2323
```
24+
To help generate this blacklist array, you can run this snippet in the console of your app:
25+
```js
26+
// In the dev tools console of your app.
27+
let $methods = [...new Set(Object.keys($).concat(Object.keys($.fn)))];
28+
copy(`'${$methods.join('\',\r\n\'')}'`)
29+
```

0 commit comments

Comments
 (0)