Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

eslint-plugin-mocha

Package Overview
Dependencies
Maintainers
4
Versions
63
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-mocha - npm Package Compare versions

Comparing version 10.4.1 to 10.4.2

2

lib/rules/handle-done-callback.js

@@ -52,3 +52,3 @@ 'use strict';

function checkAsyncMochaFunction(functionExpression) {
const scope = context.getScope();
const scope = context.sourceCode.getScope(functionExpression);
const callback = functionExpression.params[0];

@@ -55,0 +55,0 @@ const callbackName = callback.name;

@@ -51,3 +51,3 @@ 'use strict';

if (astUtils.isDescribe(node)) {
const scope = context.getScope();
const scope = context.sourceCode.getScope(node);

@@ -54,0 +54,0 @@ if (isTopLevelScope(scope)) {

@@ -83,3 +83,6 @@ 'use strict';

const text = getStringIfConstant(description, context.getScope());
const text = getStringIfConstant(
description,
context.sourceCode.getScope(mochaCallExpression)
);

@@ -86,0 +89,0 @@ if (!isStaticallyAnalyzableDescription(description, text)) {

@@ -24,3 +24,3 @@ 'use strict';

const callee = node.callee;
const scope = context.getScope();
const scope = context.sourceCode.getScope(node);

@@ -27,0 +27,0 @@ if (astUtils.isTestCase(node) && isGlobalScope(scope)) {

@@ -289,3 +289,3 @@ 'use strict';

// Skip recursive functions.
const nameVar = context.getDeclaredVariables(node)[0];
const nameVar = context.sourceCode.getDeclaredVariables(node)[0];

@@ -297,3 +297,3 @@ if (isFunctionName(nameVar) && nameVar.references.length > 0) {

// Skip if it's using arguments.
const variable = getVariableOfArguments(context.getScope());
const variable = getVariableOfArguments(context.sourceCode.getScope(node));

@@ -300,0 +300,0 @@ if (variable && variable.references.length > 0) {

@@ -86,3 +86,6 @@ 'use strict';

const descriptionArgument = args[0];
const description = getStringIfConstant(descriptionArgument, context.getScope());
const description = getStringIfConstant(
descriptionArgument,
context.sourceCode.getScope(mochaCallExpression)
);

@@ -89,0 +92,0 @@ if (description) {

@@ -85,3 +85,6 @@ 'use strict';

const testDescriptionArgument = args[0];
const description = getStringIfConstant(testDescriptionArgument, context.getScope());
const description = getStringIfConstant(
testDescriptionArgument,
context.sourceCode.getScope(mochaCallExpression)
);

@@ -88,0 +91,0 @@ if (description) {

@@ -137,3 +137,3 @@ 'use strict';

if (isMochaFunctionCall(node)) {
const scope = context.getScope();
const scope = context.sourceCode.getScope(node);

@@ -140,0 +140,0 @@ if (!isCallToShadowedReference(node, scope)) {

{
"name": "eslint-plugin-mocha",
"version": "10.4.1",
"version": "10.4.2",
"description": "Eslint rules for mocha.",

@@ -5,0 +5,0 @@ "engines": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc