🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more →

eslint-plugin-no-jquery

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-no-jquery - npm Package Compare versions

Comparing version

to
3.1.1

{
"name": "eslint-plugin-no-jquery",
"version": "3.1.0",
"version": "3.1.1",
"description": "Disallow jQuery functions with native equivalents.",

@@ -37,3 +37,3 @@ "repository": {

"codecov": "^3.8.3",
"eslint-config-wikimedia": "^0.28.2",
"eslint-config-wikimedia": "^0.29.0",
"eslint-docgen": "^0.7.1",

@@ -44,4 +44,4 @@ "eslint-plugin-eslint-plugin": "^6.1.0",

"jsdom": "^22.1.0",
"mocha": "^10.2.0",
"nyc": "^15.1.0"
"mocha": "^11.1.0",
"nyc": "^17.1.0"
},

@@ -48,0 +48,0 @@ "bugs": {

@@ -37,12 +37,19 @@ 'use strict';

const allowScroll = context.options[ 0 ] && context.options[ 0 ].allowScroll;
if ( node.callee.property.name === 'animate' && allowScroll ) {
const arg = node.arguments[ 0 ];
// Check properties list has more than just scrollTop/scrollLeft
if ( arg && arg.type === 'ObjectExpression' ) {
if (
arg.properties.every(
( prop ) => prop.key.name === 'scrollTop' || prop.key.name === 'scrollLeft'
)
) {
return;
const name = node.callee.property.name;
if ( allowScroll ) {
if ( name === 'stop' || name === 'finish' ) {
// We can't tell what animation we are stopping, so assume
// it is an allowed scroll
return;
} else if ( name === 'animate' ) {
const arg = node.arguments[ 0 ];
// Check properties list has more than just scrollTop/scrollLeft
if ( arg && arg.type === 'ObjectExpression' ) {
if (
arg.properties.every(
( prop ) => prop.key.name === 'scrollTop' || prop.key.name === 'scrollLeft'
)
) {
return;
}
}

@@ -49,0 +56,0 @@ }