eslint-plugin-angular
Advanced tools
Comparing version 0.0.4 to 0.0.5
@@ -17,6 +17,6 @@ (function(){ | ||
'ng_module_name': require('./rules/ng_module_name'), | ||
'ng_no_digest': require('./rules/ng_no_ng_no_digest'), | ||
'ng_no_digest': require('./rules/ng_no_digest'), | ||
'ng_no_jquery_angularelement': require('./rules/ng_no_jquery_angularelement'), | ||
'ng_no_private_call': require('./rules/ng_no_private_call'), | ||
'ng_no_services': require('./rules/ng_no-service-ctrl'), | ||
'ng_no_services': require('./rules/ng_no_services'), | ||
'ng_on_watch': require('./rules/ng_on_watch'), | ||
@@ -23,0 +23,0 @@ 'ng_service_name': require('./rules/ng_service_name'), |
{ | ||
"name": "eslint-plugin-angular", | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
"description": "ESLint rules for AngularJS projects", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -12,2 +12,7 @@ module.exports = function(context) { | ||
var prefix = context.options[0]; | ||
if(prefix === undefined) { | ||
return; | ||
} | ||
var callee = node.callee; | ||
@@ -14,0 +19,0 @@ if (callee.type === 'MemberExpression' && callee.property.name === 'controller') { |
@@ -23,3 +23,4 @@ module.exports = function(context) { | ||
if (callee.type === 'MemberExpression' && angularObjectList.indexOf(callee.property.name) >= 0) { | ||
if(syntax === 'function' && !utils.isFunctionType(node.arguments[1])){ | ||
if(syntax === 'function' && (!utils.isFunctionType(node.arguments[1]) && !utils.isIdentifierType(node.arguments[1]))){ | ||
report(node, syntax); | ||
@@ -26,0 +27,0 @@ } |
@@ -12,2 +12,6 @@ module.exports = function(context) { | ||
var prefix = context.options[0]; | ||
if(prefix === undefined) { | ||
return; | ||
} | ||
var callee = node.callee; | ||
@@ -14,0 +18,0 @@ if (callee.type === 'MemberExpression' && callee.property.name === 'directive') { |
@@ -12,2 +12,6 @@ module.exports = function(context) { | ||
var prefix = context.options[0]; | ||
if(prefix === undefined) { | ||
return; | ||
} | ||
var callee = node.callee; | ||
@@ -14,0 +18,0 @@ if (callee.type === 'MemberExpression' && callee.property.name === 'filter') { |
@@ -15,2 +15,6 @@ module.exports = function(context) { | ||
var prefix = context.options[0]; | ||
if(prefix === undefined) { | ||
return; | ||
} | ||
var callee = node.callee; | ||
@@ -17,0 +21,0 @@ if (callee.type === 'MemberExpression' && callee.property.name === 'module' && isArray(node.arguments[1])) { |
@@ -8,3 +8,3 @@ module.exports = function(context) { | ||
'CallExpression': function(node) { | ||
if(node.callee.property.type === 'Identifier' && node.callee.property.name === '$digest'){ | ||
if(node.callee.type === 'MemberExpression' && node.callee.property.type === 'Identifier' && node.callee.property.name === '$digest'){ | ||
context.report(node, 'Instead of using the $destroy method, you should prefer $apply()', {}); | ||
@@ -11,0 +11,0 @@ } |
@@ -12,2 +12,6 @@ module.exports = function(context) { | ||
var prefix = context.options[0]; | ||
if(prefix === undefined) { | ||
return; | ||
} | ||
var callee = node.callee; | ||
@@ -14,0 +18,0 @@ if (callee.type === 'MemberExpression' && |
@@ -12,2 +12,6 @@ (function(){ | ||
isIdentifierType: function(node){ | ||
return node !== undefined && node.type === 'Identifier'; | ||
}, | ||
isEmptyFunction: function(fn){ | ||
@@ -14,0 +18,0 @@ return fn.body.body.length === 0; |
@@ -20,2 +20,5 @@ //------------------------------------------------------------------------------ | ||
args: [1, /^eslint/] | ||
}, { | ||
code: 'angular.controller("eslintController", function(){});', | ||
args: [1, undefined] | ||
}], | ||
@@ -22,0 +25,0 @@ invalid: [ |
@@ -21,2 +21,5 @@ //------------------------------------------------------------------------------ | ||
args: [1, 'array'] | ||
}, { | ||
code: 'angular.' + object + '("name", myFunction);function MyFunction(){}', | ||
args: [1, 'function'] | ||
}); | ||
@@ -23,0 +26,0 @@ |
@@ -20,2 +20,5 @@ //------------------------------------------------------------------------------ | ||
args: [1, /^eslint/] | ||
}, { | ||
code: 'angular.directive("eslintDirective", function(){});', | ||
args: [1, undefined] | ||
}], | ||
@@ -22,0 +25,0 @@ invalid: [ |
@@ -20,2 +20,5 @@ //------------------------------------------------------------------------------ | ||
args: [1, /^eslint/] | ||
}, { | ||
code: 'angular.filter("eslintFilter", function(){});', | ||
args: [1, undefined] | ||
}], | ||
@@ -22,0 +25,0 @@ invalid: [ |
@@ -23,2 +23,5 @@ //------------------------------------------------------------------------------ | ||
args: [1, /^eslint/] | ||
}, { | ||
code: 'angular.module("eslintModule", []);', | ||
args: [1, undefined] | ||
}], | ||
@@ -25,0 +28,0 @@ invalid: [ |
@@ -14,7 +14,10 @@ //------------------------------------------------------------------------------ | ||
valid.push({ | ||
code: 'angular.' + syntax + '("eslintDirective", function(){});', | ||
code: 'angular.' + syntax + '("eslintService", function(){});', | ||
args: [1, 'eslint'] | ||
}, { | ||
code: 'angular.' + syntax + '("eslintDirective", function(){});', | ||
code: 'angular.' + syntax + '("eslintService", function(){});', | ||
args: [1, /^eslint/] | ||
}, { | ||
code: 'angular.' + syntax + '("eslintService", function(){});', | ||
args: [1, undefined] | ||
}); | ||
@@ -21,0 +24,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
80560
63
1495