eslint-plugin-no-jquery 2.6.0 → 3.0.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 (52) hide show
  1. package/README.md +31 -27
  2. package/README.md.template +5 -2
  3. package/package.json +13 -10
  4. package/src/.eslintrc.js +17 -0
  5. package/src/all-methods.js +2 -1
  6. package/src/index.js +5 -1
  7. package/src/rules/no-ajax-events.js +31 -33
  8. package/src/rules/no-ajax.js +1 -1
  9. package/src/rules/no-and-self.js +1 -3
  10. package/src/rules/no-animate-toggle.js +3 -3
  11. package/src/rules/no-animate.js +28 -30
  12. package/src/rules/no-append-html.js +51 -0
  13. package/src/rules/no-class-state.js +16 -18
  14. package/src/rules/no-class.js +1 -1
  15. package/src/rules/no-constructor-attributes.js +21 -23
  16. package/src/rules/no-data.js +1 -1
  17. package/src/rules/no-deferred.js +2 -2
  18. package/src/rules/no-error.js +1 -3
  19. package/src/rules/no-escape-selector.js +1 -3
  20. package/src/rules/no-event-shorthand.js +7 -7
  21. package/src/rules/no-extend.js +28 -26
  22. package/src/rules/no-fade.js +1 -1
  23. package/src/rules/no-fx-interval.js +13 -15
  24. package/src/rules/no-global-selector.js +39 -41
  25. package/src/rules/no-html.js +2 -1
  26. package/src/rules/no-is-array.js +1 -3
  27. package/src/rules/no-is-function.js +1 -1
  28. package/src/rules/no-jquery-constructor.js +13 -15
  29. package/src/rules/no-load-shorthand.js +17 -19
  30. package/src/rules/no-noop.js +1 -3
  31. package/src/rules/no-now.js +1 -3
  32. package/src/rules/no-on-ready.js +29 -34
  33. package/src/rules/no-other-methods.js +19 -21
  34. package/src/rules/no-other-utils.js +18 -20
  35. package/src/rules/no-parse-html-literal.js +60 -67
  36. package/src/rules/no-parse-json.js +1 -3
  37. package/src/rules/no-parse-xml.js +1 -1
  38. package/src/rules/no-prop.js +1 -1
  39. package/src/rules/no-proxy.js +1 -1
  40. package/src/rules/no-ready-shorthand.js +1 -1
  41. package/src/rules/no-ready.js +9 -11
  42. package/src/rules/no-serialize.js +1 -1
  43. package/src/rules/no-size.js +1 -3
  44. package/src/rules/no-sizzle.js +5 -5
  45. package/src/rules/no-slide.js +1 -1
  46. package/src/rules/no-submit.js +2 -1
  47. package/src/rules/no-unique.js +1 -3
  48. package/src/rules/no-visibility.js +1 -1
  49. package/src/rules/no-wrap.js +1 -1
  50. package/src/rules/variable-pattern.js +6 -5
  51. package/src/utils.js +138 -114
  52. package/Changelog.md +0 -342
package/src/utils.js CHANGED
@@ -113,7 +113,7 @@ function traverse( context, node, variableTest, constructorTest ) {
113
113
 
114
114
  break;
115
115
  case 'MemberExpression':
116
- if ( node.property && node.parent.type !== 'CallExpression' ) {
116
+ if ( node.property && !( node.parent.type === 'CallExpression' && node.parent.callee === node ) ) {
117
117
  if ( node.property.type === 'Identifier' ) {
118
118
  if ( node.computed ) {
119
119
  // e.g. foo[bar] can't be determined, returns false
@@ -132,7 +132,7 @@ function traverse( context, node, variableTest, constructorTest ) {
132
132
  node = node.object;
133
133
  break;
134
134
  case 'Identifier':
135
- if ( node.parent && node.parent.type === 'CallExpression' ) {
135
+ if ( node.parent && node.parent.type === 'CallExpression' && node.parent.callee === node ) {
136
136
  return constructorTest( node );
137
137
  } else {
138
138
  return variableTest( node ) || constructorTest( node );
@@ -141,6 +141,8 @@ function traverse( context, node, variableTest, constructorTest ) {
141
141
  return false;
142
142
  }
143
143
  }
144
+ /* istanbul ignore next */
145
+ throw new Error( 'Invalid node' );
144
146
  }
145
147
 
146
148
  function isjQueryConstructor( context, name ) {
@@ -193,21 +195,22 @@ function isjQuery( context, node ) {
193
195
  * @param {string} [fixable] Fixable mode, e.g. 'code'
194
196
  * @param {string[]|boolean} [deprecated] Rule is deprecated.
195
197
  * If a string list, the replacedBy rules.
198
+ * @param {Array} schema Schema
196
199
  * @return {Object} Rule
197
200
  */
198
- function createRule( create, description, fixable, deprecated ) {
201
+ function createRule( create, description, fixable, deprecated, schema ) {
199
202
  return {
200
203
  meta: {
201
204
  type: 'suggestion',
202
205
  docs: {
203
- description: description,
206
+ description,
204
207
  deprecated: !!deprecated,
205
208
  replacedBy: Array.isArray( deprecated ) ? deprecated : undefined
206
209
  },
207
- fixable: fixable,
208
- schema: []
210
+ fixable,
211
+ schema: schema || []
209
212
  },
210
- create: create
213
+ create
211
214
  };
212
215
  }
213
216
 
@@ -296,6 +299,8 @@ function jQueryGlobalLink( name ) {
296
299
  * @param {Function} [options.fix] Fixing function. First argument is `node`.
297
300
  * @param {string[]|boolean} [options.deprecated] Rule is deprecated.
298
301
  * If a string list, the replacedBy rules.
302
+ * @param {boolean} [options.getAndSetOptions] Create options to enabled getting and setting
303
+ * separately.
299
304
  * @return {Object} Rule
300
305
  */
301
306
  function createCollectionMethodRule( methods, message, options ) {
@@ -310,30 +315,57 @@ function createCollectionMethodRule( methods, message, options ) {
310
315
 
311
316
  description += messageSuffix( message );
312
317
 
313
- return createRule( function ( context ) {
314
- return {
315
- 'CallExpression:exit': function ( node ) {
316
- if ( node.callee.type !== 'MemberExpression' ) {
317
- return;
318
- }
319
- const name = node.callee.property.name;
320
- if (
321
- !methods.includes( name ) ||
318
+ let schema = [];
319
+ if ( options.getAndSetOptions ) {
320
+ schema = [
321
+ {
322
+ type: 'object',
323
+ properties: {
324
+ allowGetOrSet: {
325
+ enum: [ 'none', 'get', 'set' ]
326
+ }
327
+ },
328
+ additionalProperties: false
329
+ }
330
+ ];
331
+
332
+ // TODO: nonCollectionReturningValueAccessors have 1 argument in getter mode
333
+ description += '\n\nUsing this method only as a getter or a setter can be allowed using the `allowGetOrSet` option:\n' +
334
+ '* `"none"` (default) the method can\'t be used at all\n' +
335
+ '* `"get"` the method can only be used as a getter i.e. with no arguments\n' +
336
+ '* `"set"` the method can only be used as a setter i.e. with arguments';
337
+ }
338
+
339
+ return createRule( ( context ) => ( {
340
+ 'CallExpression:exit': ( node ) => {
341
+ if ( node.callee.type !== 'MemberExpression' ) {
342
+ return;
343
+ }
344
+ const name = node.callee.property.name;
345
+ if (
346
+ !methods.includes( name ) ||
322
347
  isjQueryConstructor( context, node.callee.object.name )
323
- ) {
324
- return;
325
- }
348
+ ) {
349
+ return;
350
+ }
351
+ const allowGetOrSet = ( context.options[ 0 ] && context.options[ 0 ].allowGetOrSet ) || 'none';
352
+ // TODO: nonCollectionReturningValueAccessors have 1 argument in getter mode
353
+ if (
354
+ ( allowGetOrSet === 'get' && !node.arguments.length ) ||
355
+ ( allowGetOrSet === 'set' && node.arguments.length )
356
+ ) {
357
+ return;
358
+ }
326
359
 
327
- if ( isjQuery( context, node.callee ) ) {
328
- context.report( {
329
- node: node,
330
- message: messageToPlainString( message, node, name, options ),
331
- fix: options.fix && options.fix.bind( this, node, context )
332
- } );
333
- }
360
+ if ( isjQuery( context, node.callee ) ) {
361
+ context.report( {
362
+ node,
363
+ message: messageToPlainString( message, node, name, options ),
364
+ fix: options.fix && options.fix.bind( this, node, context )
365
+ } );
334
366
  }
335
- };
336
- }, description, options.fixable, options.deprecated );
367
+ }
368
+ } ), description, options.fixable, options.deprecated, schema );
337
369
  }
338
370
 
339
371
  /**
@@ -353,26 +385,24 @@ function createCollectionPropertyRule( property, message, options ) {
353
385
 
354
386
  description += messageSuffix( message );
355
387
 
356
- return createRule( function ( context ) {
357
- return {
358
- 'MemberExpression:exit': function ( node ) {
359
- const name = node.property.name;
360
- if (
361
- name !== property ||
388
+ return createRule( ( context ) => ( {
389
+ 'MemberExpression:exit': ( node ) => {
390
+ const name = node.property.name;
391
+ if (
392
+ name !== property ||
362
393
  node.parent.callee === node
363
- ) {
364
- return;
365
- }
366
- if ( isjQuery( context, node.object ) ) {
367
- context.report( {
368
- node: node,
369
- message: messageToPlainString( message, node, name, options ),
370
- fix: options.fix && options.fix.bind( this, node, context )
371
- } );
372
- }
394
+ ) {
395
+ return;
396
+ }
397
+ if ( isjQuery( context, node.object ) ) {
398
+ context.report( {
399
+ node,
400
+ message: messageToPlainString( message, node, name, options ),
401
+ fix: options.fix && options.fix.bind( this, node, context )
402
+ } );
373
403
  }
374
- };
375
- }, description, options.fixable, options.deprecated );
404
+ }
405
+ } ), description, options.fixable, options.deprecated );
376
406
  }
377
407
 
378
408
  /**
@@ -395,28 +425,26 @@ function createUtilMethodRule( methods, message, options ) {
395
425
 
396
426
  description += messageSuffix( message );
397
427
 
398
- return createRule( function ( context ) {
399
- return {
400
- 'CallExpression:exit': function ( node ) {
401
- if ( node.callee.type !== 'MemberExpression' ) {
402
- return;
403
- }
404
- const name = node.callee.property.name;
405
- if (
406
- !methods.includes( name ) ||
428
+ return createRule( ( context ) => ( {
429
+ 'CallExpression:exit': ( node ) => {
430
+ if ( node.callee.type !== 'MemberExpression' ) {
431
+ return;
432
+ }
433
+ const name = node.callee.property.name;
434
+ if (
435
+ !methods.includes( name ) ||
407
436
  !isjQueryConstructor( context, node.callee.object.name )
408
- ) {
409
- return;
410
- }
411
-
412
- context.report( {
413
- node: node,
414
- message: messageToPlainString( message, node, name, options ),
415
- fix: options.fix && options.fix.bind( this, node, context )
416
- } );
437
+ ) {
438
+ return;
417
439
  }
418
- };
419
- }, description, options.fixable, options.deprecated );
440
+
441
+ context.report( {
442
+ node,
443
+ message: messageToPlainString( message, node, name, options ),
444
+ fix: options.fix && options.fix.bind( this, node, context )
445
+ } );
446
+ }
447
+ } ), description, options.fixable, options.deprecated );
420
448
  }
421
449
 
422
450
  /**
@@ -436,25 +464,23 @@ function createUtilPropertyRule( property, message, options ) {
436
464
 
437
465
  description += messageSuffix( message );
438
466
 
439
- return createRule( function ( context ) {
440
- return {
441
- 'MemberExpression:exit': function ( node ) {
442
- if ( !isjQueryConstructor( context, node.object.name ) ) {
443
- return;
444
- }
445
- const name = node.property.name;
446
- if ( name !== property ) {
447
- return;
448
- }
449
-
450
- context.report( {
451
- node: node,
452
- message: messageToPlainString( message, node, name, options ),
453
- fix: options.fix && options.fix.bind( this, node, context )
454
- } );
467
+ return createRule( ( context ) => ( {
468
+ 'MemberExpression:exit': ( node ) => {
469
+ if ( !isjQueryConstructor( context, node.object.name ) ) {
470
+ return;
455
471
  }
456
- };
457
- }, description, options.fixable, options.deprecated );
472
+ const name = node.property.name;
473
+ if ( name !== property ) {
474
+ return;
475
+ }
476
+
477
+ context.report( {
478
+ node,
479
+ message: messageToPlainString( message, node, name, options ),
480
+ fix: options.fix && options.fix.bind( this, node, context )
481
+ } );
482
+ }
483
+ } ), description, options.fixable, options.deprecated );
458
484
  }
459
485
 
460
486
  /**
@@ -480,26 +506,24 @@ function createCollectionOrUtilMethodRule( methods, message, options ) {
480
506
 
481
507
  description += messageSuffix( message );
482
508
 
483
- return createRule( function ( context ) {
484
- return {
485
- 'CallExpression:exit': function ( node ) {
486
- if ( node.callee.type !== 'MemberExpression' ) {
487
- return;
488
- }
489
- const name = node.callee.property.name;
490
- if ( !methods.includes( name ) ) {
491
- return;
492
- }
493
- if ( isjQuery( context, node.callee ) ) {
494
- context.report( {
495
- node: node,
496
- message: messageToPlainString( message, node, name, options ),
497
- fix: options.fix && options.fix.bind( this, node, context )
498
- } );
499
- }
509
+ return createRule( ( context ) => ( {
510
+ 'CallExpression:exit': ( node ) => {
511
+ if ( node.callee.type !== 'MemberExpression' ) {
512
+ return;
513
+ }
514
+ const name = node.callee.property.name;
515
+ if ( !methods.includes( name ) ) {
516
+ return;
500
517
  }
501
- };
502
- }, description, options.fixable, options.deprecated );
518
+ if ( isjQuery( context, node.callee ) ) {
519
+ context.report( {
520
+ node,
521
+ message: messageToPlainString( message, node, name, options ),
522
+ fix: options.fix && options.fix.bind( this, node, context )
523
+ } );
524
+ }
525
+ }
526
+ } ), description, options.fixable, options.deprecated );
503
527
  }
504
528
 
505
529
  function eventShorthandFixer( node, context, fixer ) {
@@ -518,15 +542,15 @@ function eventShorthandFixer( node, context, fixer ) {
518
542
  }
519
543
 
520
544
  module.exports = {
521
- isjQuery: isjQuery,
522
- isjQueryConstructor: isjQueryConstructor,
523
- isFunction: isFunction,
524
- createCollectionMethodRule: createCollectionMethodRule,
525
- createCollectionPropertyRule: createCollectionPropertyRule,
526
- createUtilMethodRule: createUtilMethodRule,
527
- createUtilPropertyRule: createUtilPropertyRule,
528
- createCollectionOrUtilMethodRule: createCollectionOrUtilMethodRule,
529
- eventShorthandFixer: eventShorthandFixer,
530
- jQueryCollectionLink: jQueryCollectionLink,
531
- jQueryGlobalLink: jQueryGlobalLink
545
+ isjQuery,
546
+ isjQueryConstructor,
547
+ isFunction,
548
+ createCollectionMethodRule,
549
+ createCollectionPropertyRule,
550
+ createUtilMethodRule,
551
+ createUtilPropertyRule,
552
+ createCollectionOrUtilMethodRule,
553
+ eventShorthandFixer,
554
+ jQueryCollectionLink,
555
+ jQueryGlobalLink
532
556
  };
package/Changelog.md DELETED
@@ -1,342 +0,0 @@
1
- # eslint-plugin-no-jquery release history
2
-
3
- ## v2.6.0
4
- * New rule: `no-escape-selector` for `$.escapeSelector` util (Ed Sanders)
5
- * New config: `deprecated-3.6` for new jQuery release (Ed Sanders)
6
-
7
-
8
- * Rule fix: Add fixer for `no-on-ready` (Ed Sanders)
9
- * Rule fix: Add fixer for `no-ready-shorthand` (Ed Sanders)
10
- * Rule fix: Add fixer for `no-error` (Ed Sanders)
11
- * Rule fix: Add fixer for `no-parse-xml` (Ed Sanders)
12
- * Rule fix: Add fixer for `no-parse-html-literal` tag style (Ed Sanders)
13
- * Rule fix: `no-now`; recommend `Date.now` rather than `(new Date).getTime()` (Ed Sanders)
14
-
15
-
16
- * Code: Add real arguments to `no-parse-html` tests (Ed Sanders)
17
- * Code: codecov.yaml: Remove extra linebreak (Ed Sanders)
18
- * Release: Update devDependencies (#266) (Ed Sanders)
19
-
20
-
21
- ## v2.5.0
22
-
23
- * New config: `recommended` just includes `variable-pattern` rule (Ed Sanders)
24
- * New config: `all` covers all usages of jQuery methods and utils (Ed Sanders)
25
- * New config: Create a `deprecated-X.X` config for every minor release (Ed Sanders)
26
- * Configs: Use 'warn' instead of 'error' in `deprecated-X` and `all` configs (Ed Sanders)
27
- * New rule: `no-jquery-constructor` (Ed Sanders)
28
-
29
-
30
- * Code: Add `reporthtml` coverage script (Ed Sanders)
31
- * Code: Remove unnecessary constants (Ed Sanders)
32
- * Code: Replace `Array#indexOf` with `Array#includes` (Ed Sanders)
33
- * Code: Only assert error message strings (Ed Sanders)
34
- * Code: Introduce eslint-plugin-eslint-plugin (Ed Sanders)
35
- * Code: Add ESLint 7.0.0 support (Ed Sanders)
36
- * Code: Prefer `$("div")` in test cases (Ed Sanders)
37
- * Code: Fix ESLint 2.3.0 support (Ed Sanders)
38
-
39
-
40
- * Docs: Document and test the `slim` config (Ed Sanders)
41
- * Docs: Move docs to docs/rules (Ed Sanders)
42
- * Docs: Suppress more examples with noDoc (no-parse-html-literal) (Ed Sanders)
43
- * Docs: Update to eslint-docgen 0.3.1 (Ed Sanders)
44
- * Docs: Suppress some examples with noDoc in long documentation files (Ed Sanders)
45
- * Docs: Use eslint-docgen (Ed Sanders)
46
- * Docs: Remove noDoc arg from RuleTesterAndDocs, just use RuleTester (Ed Sanders)
47
- * Docs: Fetch 'main' path from package.json (Ed Sanders)
48
- * Docs: Remove extra linebreak from no-parse-html-literal.md (Ed Sanders)
49
- * Docs: Add missing linebreak before rule source section (Ed Sanders)
50
- * Docs: Improvements to doc builder (Ed Sanders)
51
-
52
-
53
- * Release: Update devDependencies (Ed Sanders)
54
-
55
- ## v2.4.1
56
-
57
- * Config fix: Fix override of `no-event-shorthand` in `deprecated-3.5` (Ed Sanders)
58
-
59
-
60
- * Code: Add real test coverage for index.js (Ed Sanders)
61
- * Code: gitignore coverage.lcov (Ed Sanders)
62
-
63
- ## v2.4.0
64
-
65
- * New feature: Add specification of plugin return types to settings (Ed Sanders)
66
-
67
-
68
- * New config: Add new `deprecated-3.5` config (Ed Sanders)
69
-
70
-
71
- * New rule: `no-find-collection`, split out of `no-find` (Ed Sanders)
72
- * New rule: `no-find-util`, split out of `no-find` (Ed Sanders)
73
-
74
-
75
- * Rule fix: Set all rules to type: `suggestion` (Ed Sanders)
76
- * Rule fix: `no-global-selector`; add `allowIds` option to allow global selector by ID (Adam Roses Wight)
77
- * Rule fix: `no-event-shorthand`; add `allowAjaxEvents` option and use in `deprecated-3.3` (Ed Sanders)
78
-
79
-
80
- * Docs: Avoid duplicating name in "Prefer..." sentence (Ed Sanders)
81
- * Docs: Build lists in README.md automatically (Ed Sanders)
82
- * Docs: Consistently use `.methodOrProp` with collections, not `$.methodOrProp` (Ed Sanders)
83
- * Docs: Link to jQuery documentation for each method/util/property (Ed Sanders)
84
- * Docs: Show ruleset information in README (Ed Sanders)
85
-
86
-
87
- * Release: State "MIT license" in LICENSE header (Ed Sanders)
88
- * Release: Update devDependencies (Ed Sanders)
89
-
90
-
91
- * Code: Add `#odd` and `#even` to all methods lists, new in jQuery 3.5 (Ed Sanders)
92
- * Code: Add code coverage checks using Istanbul (Ed Sanders)
93
- * Code: Move index.js to src/ (Ed Sanders)
94
- * Code: Restructure files and folders (Ed Sanders)
95
- * Code: Setup codecov GitHub Action integration (Ed Sanders)
96
-
97
-
98
- ## v2.3.2
99
-
100
- * Rule fix: Add fixer for `no-is-function` (Ed Sanders)
101
- * Rule fix: Follow-up #186: Actually merge `no-undelegate` into `no-delegate` (Ed Sanders)
102
-
103
-
104
- * Docs: Soften and make clearer the language for `no-class-state` (James D. Forrester)
105
- * Docs: Explain `no-global-selector` restriction more clearly (James D. Forrester)
106
-
107
-
108
- * Release: Update devDependencies (Ed Sanders)
109
-
110
-
111
- * Code: Remove non-existent $.fn.parse from tests (Ed Sanders)
112
-
113
-
114
- ## v2.3.1
115
- * New feature: Show deprecation message in linting errors (Ed Sanders)
116
-
117
-
118
- * Deprecated rule: `no-die`; use `no-live` (Ed Sanders)
119
- * Deprecated rule: `no-unbind`; use `no-bind` (Ed Sanders)
120
- * Deprecated rule: `no-undelegate`; use `no-delegate` (Ed Sanders)
121
-
122
-
123
- * Rule fix: Remove `load` from `no-event-shorthand` (Ed Sanders)
124
-
125
-
126
- * Docs: Build generic "Prefer" messages for docs when node===true (Ed Sanders)
127
- * Docs: Escape all code snippets (Ed Sanders)
128
- * Docs: Monospace rule names (Ed Sanders)
129
-
130
-
131
- * Release: Add icons to readme section headings (Ed Sanders)
132
- * Release: Fix Changelog markdown list spacing (Ed Sanders)
133
- * Release: Use a limited ruleset for lint-fixing documentation snippets (Ed Sanders)
134
-
135
-
136
- * Code: Add `triggerHandler` to `nonCollectionReturningMethods` (Ed Sanders)
137
- * Code: Check documentation in CI (Ed Sanders)
138
- * Code: Check rules are listed in README.md & index.js (Ed Sanders)
139
- * Code: Migrate from Travis to GitHub Actions (James D. Forrester)
140
- * Code: Remove incorrect TODO comment (Ed Sanders)
141
-
142
-
143
- ## v2.3.0
144
- * New rule: `variable-pattern` (Ed Sanders)
145
- * New rule: `no-parse-xml` (Ed Sanders)
146
- * New rule: `no-visibility` as a group alias for `no-show`, `no-hide`, & `no-toggle` (Ed Sanders)
147
-
148
-
149
- * New config: `slim` as a config for users of the jQuery slim build (Ed Sanders)
150
-
151
-
152
- * Deprecated rule: `no-show` (Ed Sanders)
153
- * Deprecated rule: `no-hide` (Ed Sanders)
154
- * Deprecated rule: `no-toggle` (Ed Sanders)
155
-
156
-
157
- * Rule fix: Add `allowDeep` options to `no-extend` (Ed Sanders)
158
- * Rule fix: Add `hasData` method to `no-data` rule (Ed Sanders)
159
- * Rule fix: Enforce single tag style in `no-parse-html-literal` (Ed Sanders)
160
-
161
-
162
- * New fixer: Add fixer for `no-event-shorthand` and similar (Ed Sanders)
163
- * New fixer: Add fixer for `no-noop` (Ed Sanders)
164
- * New fixer: Add fixer for `no-now` (Ed Sanders)
165
- * New fixer: Add fixer for `no-size` (Ed Sanders)
166
-
167
-
168
- * Docs: Link to each rule's definition (Ed Sanders)
169
- * Docs: Switch `constructorAliases`/`variablePattern` in README (Ed Sanders)
170
- * Docs: Pad fixer examples so they align (Ed Sanders)
171
- * Docs: Output example fixes in documentation (Ed Sanders)
172
-
173
-
174
- * Release: Update LICENSE authors (Ed Sanders)
175
-
176
-
177
- * Code: Add `npm run testpath` for running a single test (Ed Sanders)
178
- * Code: Add a test that automatically captures all rules (Ed Sanders)
179
- * Code: Avoid `key in object` lookup (Ed Sanders)
180
- * Code: Improvements to collection return detection (Ed Sanders)
181
- * Code: More fixes to jQuery method return types (Ed Sanders)
182
- * Code: Rename .eslintrc to .eslintrc.json (Ed Sanders)
183
- * Code: Update eslint-config-wikimedia (Ed Sanders)
184
-
185
-
186
- ## v2.2.1
187
- * Release: Update index.js and README with missing rules (Ed Sanders)
188
-
189
-
190
- ## v2.2.0
191
- * New rule: `no-camel-case` (Christophe Coevoet)
192
- * New rule: `no-constructor-attributes` (Ed Sanders)
193
- * New rule: `no-contains` (Christophe Coevoet)
194
- * New rule: `no-error` (Ed Sanders)
195
- * New rule: `no-is-empty-object` (Ed Sanders)
196
- * New rule: `no-is-plain-object` (Ed Sanders)
197
- * New rule: `no-node-name` (Ed Sanders)
198
-
199
-
200
- * Rule fix: Add `removeAttr` to `no-attr` rule (Ed Sanders)
201
- * Rule fix: Add `removeProp` to `no-remove-prop` rule (Ed Sanders)
202
- * Rule fix: Add ajax method shorthands to `no-ajax-events` and `no-event-shorthand` (Ed Sanders)
203
- * Rule fix: Detect concatenated selectors in `no-sizzle` (Ed Sanders)
204
- * Rule fix: Handle concatenated strings and other methods in `no-parse-html-literal` (Ed Sanders)
205
- * Rule fix: Include the `$.clone` utility in the `no-clone` rule (Ed Sanders)
206
- * Rule fix: Include the `$.css` utility in the `no-css` rule (Ed Sanders)
207
- * Rule fix: Make error message in `no-parse-html-literal` less specific (Ed Sanders)
208
- * Rule fix: Separate out positional sizzle selectors and add to `deprecated-3.4` (Ed Sanders)
209
-
210
-
211
- * New fixer: Add fixer for `no-and-self` (Ed Sanders)
212
- * New fixer: Add fixer for `no-is-array` (Ed Sanders)
213
- * New fixer: Add fixer for `no-parse-json` (Ed Sanders)
214
- * New fixer: Add fixer for `no-unique` (Ed Sanders)
215
-
216
-
217
- * Docs: Build documentation from tests (Ed Sanders)
218
- * Docs: Comment in documentation when rules are fixable (Ed Sanders)
219
- * Docs: Document `npm run doc` (Ed Sanders)
220
- * Docs: Document when rules are included in a deprecation set (Ed Sanders)
221
-
222
-
223
- * Bug: Fix the detection of jQuery collection calls for non-fluent APIs (e.g. `.toArray()`) (Christophe Coevoet)
224
- * Bug: Support arrow functions (Ed Sanders)
225
-
226
-
227
- * Code: Add an EditorConfig config file (Christophe Coevoet)
228
- * Code: Introduce and use createCollectionOrUtilMethodRule (Ed Sanders)
229
- * Code: Update development dependencies (Ed Sanders)
230
-
231
-
232
- * Release: Add `files` list to package.json (Ed Sanders)
233
- * Release: Add global settings for configuring jQuery constructor/variable names (Ed Sanders)
234
- * Release: Update deprecation rulesets (Ed Sanders)
235
-
236
-
237
- * Improve messages' references to methods vs. static methods (Christophe Coevoet)
238
-
239
-
240
- ## v2.1.0
241
- * New rule: `no-class-state` (Ed Sanders)
242
-
243
-
244
- * Docs: Fix plugin name (Maurício Meneghini Fauth)
245
-
246
-
247
- * Code: Upgrade eslint-config-wikimedia to 0.12.0 (James D. Forrester)
248
-
249
-
250
- ## v2.0.0
251
- * New rule options: `[{allowScroll:true}]` in `no-animate` (Ed Sanders)
252
-
253
-
254
- * Renamed repository, rules and documentation to eslint-plugin-no-jquery (Ed Sanders)
255
- * Update eslint dev dependency to 5.14.0 (Ed Sanders)
256
-
257
- # Release history as wikimedia/eslint-plugin-jquery
258
-
259
-
260
- ## v1.3.2-wmf.6
261
- * New rule: `no-box-model` (Ed Sanders)
262
- * New rule: `no-browser` (Ed Sanders)
263
- * New rule: `no-context-prop` (Ed Sanders)
264
- * New rule: `no-error-shorthand` (Ed Sanders)
265
- * New rule: `no-fx-interval` (Ed Sanders)
266
- * New rule: `no-hold-ready` (Ed Sanders)
267
- * New rule: `no-is-numeric` (Ed Sanders)
268
- * New rule: `no-load-shorthand` (Ed Sanders)
269
- * New rule: `no-now` (Ed Sanders)
270
- * New rule: `no-on-ready` (Ed Sanders)
271
- * New rule: `no-ready-shorthand` (Ed Sanders)
272
- * New rule: `no-selector-prop` (Ed Sanders)
273
- * New rule: `no-sub` (Ed Sanders)
274
- * New rule: `no-support` (Ed Sanders)
275
- * New rule: `no-unload-shorthand` (Ed Sanders)
276
-
277
-
278
- * Bug: Fix `isjQuery` util to match `$`-prefixed properties (Ed Sanders)
279
- * Bug: Fix `isjQuery` to not match methods of jQuery properties (Ed Sanders)
280
- * Bug: Only catch `toggle(arg)` if `arg` is definitely not a boolean (Ed Sanders)
281
-
282
-
283
- * Code: De-deduplicate rule generation (Ed Sanders)
284
- * Code: Remove useless export of traverse method (Ed Sanders)
285
-
286
-
287
- ## v1.3.2-wmf.5
288
- * New rule: `no-animate-toggle` (Ed Sanders)
289
- * Add "Prefer CSS transitions" to animation rule messages (Ed Sanders)
290
- * Add " or $.trigger" to `no-event-shorthand` warning (Ed Sanders)
291
-
292
-
293
- ## v1.3.2-wmf.4
294
- * Fix typo in config listing (Ed Sanders)
295
-
296
-
297
- ## v1.3.2-wmf.3
298
- * Revert package name, breaking npm package references to instead fix git references (Ed Sanders)
299
-
300
-
301
- ## v1.3.2-wmf.2
302
- * Provide version-specific deprecation configs (James D. Forrester)
303
- * Move 'deprecated' config as a pointer to latest, remove old 'slim' config (Ed Sanders)
304
-
305
-
306
- * New rule: `no-and-self` (Ed Sanders)
307
- * New rule: `no-die` and `no-live` (Ed Sanders)
308
- * New rule: `no-event-shorthand` (Ed Sanders)
309
- * New rule: `no-global-selector` (Ed Sanders)
310
- * New rule: `no-is-window` (Ed Sanders)
311
- * New rule: `no-noop` (Ed Sanders)
312
- * New rule: `no-parse-html-literal` (Ed Sanders)
313
- * New rule: `no-parse-json` (Ed Sanders)
314
- * New rule: `no-type` (Ed Sanders)
315
- * New rule: `no-unbind` (Ed Sanders)
316
- * New rule: `no-undelegate` (Ed Sanders)
317
- * New rule: `no-unique` (Ed Sanders)
318
-
319
-
320
- * Miscellaneous release-related clean-up (James D. Forrester)
321
-
322
-
323
- ## v1.3.2-wmf.1
324
- * New rule: `no-is-array` (Mackie Underdown)
325
- * New rule: `no-is-function` (Brendan Abbott; renamed by Ed Sanders pre-release)
326
- * New rule: `no-extend` (Brendan Abbott)
327
- * New rule: `no-grep` (Ed Sanders)
328
- * New rule: `no-each-collection` (Ed Sanders)
329
- * New rule: `no-each-util` (Ed Sanders)
330
- * New rule: `no-map-collection` (Ed Sanders)
331
- * New rule: `no-map-util` (Ed Sanders)
332
-
333
-
334
- * Deprecated rule: `no-each` (Ed Sanders)
335
- * Deprecated rule: `no-map` (Ed Sanders)
336
-
337
-
338
- * Code: Update development dependencies (David Graham)
339
- * Code: Refactor to use new rule format (Ed Sanders)
340
-
341
-
342
- * README: Note that this is a fork (James D. Forrester)