eslint-plugin-angular
Advanced tools
Comparing version 2.4.2 to 2.5.0
{ | ||
"name": "eslint-plugin-angular", | ||
"version": "2.4.2", | ||
"version": "2.5.0", | ||
"description": "ESLint rules for AngularJS projects", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -30,2 +30,5 @@ /** | ||
type: 'boolean' | ||
}, | ||
stripUnderscores: { | ||
type: 'boolean' | ||
} | ||
@@ -40,2 +43,3 @@ } | ||
var matchNames = extra.matchNames !== false; | ||
var stripUnderscores = extra.stripUnderscores === true; | ||
@@ -58,2 +62,8 @@ function report(node) { | ||
function normalizeParameter(param) { | ||
return param.replace(/^_(.+)_$/, function(match, p1) { | ||
return p1; | ||
}); | ||
} | ||
function checkDi(callee, fn) { | ||
@@ -73,3 +83,9 @@ if (!fn) { | ||
var invalidArray = fn.params.filter(function(e, i) { | ||
return e.name !== fn.parent.elements[i].value; | ||
var name = e.name; | ||
if (stripUnderscores) { | ||
name = normalizeParameter(name); | ||
} | ||
return name !== fn.parent.elements[i].value; | ||
}); | ||
@@ -107,3 +123,9 @@ if (invalidArray.length > 0) { | ||
var invalidInjectArray = fn.params.filter(function(e, i) { | ||
return e.name !== $injectArray.elements[i].value; | ||
var name = e.name; | ||
if (stripUnderscores) { | ||
name = normalizeParameter(name); | ||
} | ||
return name !== $injectArray.elements[i].value; | ||
}); | ||
@@ -110,0 +132,0 @@ if (invalidInjectArray.length > 0) { |
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
284975
4633