eslint-plugin-angular
Advanced tools
Comparing version 1.4.0 to 1.4.1
{ | ||
"name": "eslint-plugin-angular", | ||
"version": "1.4.0", | ||
"version": "1.4.1", | ||
"description": "ESLint rules for AngularJS projects", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -46,2 +46,9 @@ /** | ||
} | ||
var invalidArray = fn.params.filter(function(e, i) { | ||
return e.name !== fn.parent.elements[i].value; | ||
}); | ||
if (invalidArray.length > 0) { | ||
context.report(fn, 'You have an error in your DI configuration. Each items of the array should match exactly one function parameter', {}); | ||
return; | ||
} | ||
} else { | ||
@@ -62,7 +69,5 @@ if (fn.params.length === 0) { | ||
if (syntax === '$inject') { | ||
if (!fn.params || fn.params.length === 0) { | ||
return; | ||
} | ||
if (fn && fn.id && utils.isIdentifierType(fn.id)) { | ||
var $injectArray = $injectProperties[fn.id.name]; | ||
if ($injectArray && utils.isArrayType($injectArray)) { | ||
@@ -73,6 +78,13 @@ if ($injectArray.elements.length !== fn.params.length) { | ||
} | ||
var invalidInjectArray = fn.params.filter(function(e, i) { | ||
return e.name !== $injectArray.elements[i].value; | ||
}); | ||
if (invalidInjectArray.length > 0) { | ||
context.report(fn, 'You have an error in your DI configuration. Each items of the array should match exactly one function parameter', {}); | ||
return; | ||
} | ||
} else { | ||
report(fn); | ||
} | ||
} else { | ||
} else if (fn.params && fn.params.length !== 0) { | ||
report(fn); | ||
@@ -79,0 +91,0 @@ } |
@@ -31,3 +31,4 @@ /** | ||
function checkType(arg) { | ||
return (configType === 'named' && (utils.isIdentifierType(arg) || utils.isNamedInlineFunction(arg))) || | ||
return utils.isCallExpression(arg) || | ||
(configType === 'named' && (utils.isIdentifierType(arg) || utils.isNamedInlineFunction(arg))) || | ||
(configType === 'anonymous' && utils.isFunctionType(arg) && !utils.isNamedInlineFunction(arg)); | ||
@@ -34,0 +35,0 @@ } |
@@ -39,2 +39,3 @@ 'use strict'; | ||
isLiteralType: isLiteralType, | ||
isCallExpression: isCallExpression, | ||
isEmptyFunction: isEmptyFunction, | ||
@@ -41,0 +42,0 @@ isStringRegexp: isStringRegexp, |
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
170048
3859