New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@elfinct/eslint-plugin-elfin

Package Overview
Dependencies
Maintainers
2
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@elfinct/eslint-plugin-elfin - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

11

dist/rules/invalid-console.js
"use strict";
var getStaticPropertyName = require('../utils').getStaticPropertyName;
var _a = require('../utils'), getStaticPropertyName = _a.getStaticPropertyName, getVariableByName = _a.getVariableByName;
module.exports = {

@@ -98,4 +98,9 @@ meta: {

var scope = context.getScope();
// 收集所有的console && 输出
scope.through.filter(isConsole).forEach(report);
var consoleVar = getVariableByName(scope, 'console');
var shadowed = consoleVar && consoleVar.defs.length > 0;
var references = consoleVar ? consoleVar.references : scope.through.filter(isConsole);
if (!shadowed) {
// 收集所有的console && 输出
references.filter(isConsole).forEach(report);
}
},

@@ -102,0 +107,0 @@ };

@@ -70,2 +70,21 @@ "use strict";

exports.getStaticPropertyName = getStaticPropertyName;
/**
* Finds the variable by a given name in a given scope and its upper scopes.
*
* @param {eslint-scope.Scope} initScope - A scope to start find.
* @param {string} name - A variable name to find.
* @returns {eslint-scope.Variable|null} A found variable or `null`.
*/
function getVariableByName(initScope, name) {
var scope = initScope;
while (scope) {
var variable = scope.set.get(name);
if (variable) {
return variable;
}
scope = scope.upper;
}
return null;
}
exports.getVariableByName = getVariableByName;
//# sourceMappingURL=ast.js.map
{
"name": "@elfinct/eslint-plugin-elfin",
"version": "0.0.3",
"version": "0.0.4",
"main": "index.js",

@@ -5,0 +5,0 @@ "license": "MIT",

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