eslint-plugin-no-jquery 3.1.0 → 3.1.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-no-jquery",
3
- "version": "3.1.0",
3
+ "version": "3.1.1",
4
4
  "description": "Disallow jQuery functions with native equivalents.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -34,14 +34,14 @@
34
34
  },
35
35
  "devDependencies": {
36
36
  "codecov": "^3.8.3",
37
- "eslint-config-wikimedia": "^0.28.2",
37
+ "eslint-config-wikimedia": "^0.29.0",
38
38
  "eslint-docgen": "^0.7.1",
39
39
  "eslint-plugin-eslint-plugin": "^6.1.0",
40
40
  "eslint-plugin-self": "^1.2.1",
41
41
  "jquery": "3.7.1",
42
42
  "jsdom": "^22.1.0",
43
- "mocha": "^10.2.0",
44
- "nyc": "^15.1.0"
43
+ "mocha": "^11.1.0",
44
+ "nyc": "^17.1.0"
45
45
  },
46
46
  "bugs": {
47
47
  "url": "https://github.com/wikimedia/eslint-plugin-no-jquery/issues"
@@ -34,16 +34,23 @@ module.exports = {
34
34
  return;
35
35
  }
36
36
  const allowScroll = context.options[ 0 ] && context.options[ 0 ].allowScroll;
37
- if ( node.callee.property.name === 'animate' && allowScroll ) {
38
- const arg = node.arguments[ 0 ];
39
- // Check properties list has more than just scrollTop/scrollLeft
40
- if ( arg && arg.type === 'ObjectExpression' ) {
41
- if (
42
- arg.properties.every(
43
- ( prop ) => prop.key.name === 'scrollTop' || prop.key.name === 'scrollLeft'
44
- )
45
- ) {
46
- return;
37
+ const name = node.callee.property.name;
38
+ if ( allowScroll ) {
39
+ if ( name === 'stop' || name === 'finish' ) {
40
+ // We can't tell what animation we are stopping, so assume
41
+ // it is an allowed scroll
42
+ return;
43
+ } else if ( name === 'animate' ) {
44
+ const arg = node.arguments[ 0 ];
45
+ // Check properties list has more than just scrollTop/scrollLeft
46
+ if ( arg && arg.type === 'ObjectExpression' ) {
47
+ if (
48
+ arg.properties.every(
49
+ ( prop ) => prop.key.name === 'scrollTop' || prop.key.name === 'scrollLeft'
50
+ )
51
+ ) {
52
+ return;
53
+ }
47
54
  }
48
55
  }
49
56
  }