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

eslint-plugin-lodash

Package Overview
Dependencies
Maintainers
3
Versions
100
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-lodash - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

7

lib/rules/matches-shorthand.js

@@ -13,3 +13,4 @@ /**

var astUtil = require('../util/astUtil');
var settings = require('../util/settingsUtil').getSettings(context);
var settingsUtil = require('../util/settingsUtil');
var settings = settingsUtil.getSettings(context);
var SUPPORT_MATCHES_STYLE_CB = ['find', 'detect', 'filter', 'select', 'reject', 'findIndex', 'findLastIndex', 'some', 'every'];

@@ -23,3 +24,3 @@ var DEFAULT_MAX_PROPERTY_PATH_LENGTH = 3;

function canBeObjectLiteralWithShorthandProperty(node, paramName) {
return context.ecmaFeatures.objectLiteralShorthandProperties && astUtil.isEqEqEq(node) &&
return settingsUtil.isEcmaFeatureOn(context, 'objectLiteralShorthandProperties') && astUtil.isEqEqEq(node) &&
(astUtil.isMemberExpOf(node.left, paramName, 1) && node.left.property.type === 'Identifier' && node.right.type === 'Identifier' && node.left.property.name === node.right.name ||

@@ -30,3 +31,3 @@ astUtil.isMemberExpOf(node.right, paramName, 1) && node.right.property.type === 'Identifier' && node.left.type === 'Identifier' && node.right.property.name === node.left.name);

function isConjunctionOfEqEqEqToMemberOf(exp, paramName, maxPropertyPathLength) {
var allowComputed = context.options[2] && context.ecmaFeatures.objectLiteralComputedProperties;
var allowComputed = context.options[2] && settingsUtil.isEcmaFeatureOn(context, 'objectLiteralComputedProperties');
if (isConjunction(exp) || canBeObjectLiteralWithShorthandProperty(exp, paramName)) {

@@ -33,0 +34,0 @@ var checkStack = [exp];

@@ -17,2 +17,11 @@ 'use strict';

.value();
},
/**
* Gets whether the ecmaFeature specified is on for the context
* @param context
* @param {string} featureName
*/
isEcmaFeatureOn: function (context, featureName) {
return _.get(context, ['ecmaFeatures', featureName]) || (_.get(context, ['parserOptions', 'ecmaVersion'], 0) > 5);
}

@@ -19,0 +28,0 @@ };

{
"name": "eslint-plugin-lodash",
"version": "1.0.2",
"version": "1.0.3",
"author": "Omer Ganim <ganimomer@gmail.com>",

@@ -5,0 +5,0 @@ "description": "Lodash specific linting rules for ESLint",

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