eslint-plugin-lodash
Advanced tools
Comparing version 1.0.2 to 1.0.3
@@ -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", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
97119
2228