I'd like to use ng-annotate to detect something like this:
angular.module('foo')
.factory('XYZ', function () {})
.service('XYZ', function () {});
i.e. detecting if someone has accidentally assigned the same name to two different factories/controllers/services/directives/etc.
The way I was thinking about doing this is to write a plugin that keeps a list of all names that it sees, and throwing an error whenever it comes across a duplicate.
But I'm not sure of all the properties available on a given node passed to the plugin match, so I'm not sure yet what to look for.
Any pointers would be appreciated!
I'd like to use
ng-annotateto detect something like this:i.e. detecting if someone has accidentally assigned the same name to two different factories/controllers/services/directives/etc.
The way I was thinking about doing this is to write a plugin that keeps a list of all names that it sees, and throwing an error whenever it comes across a duplicate.
But I'm not sure of all the properties available on a given
nodepassed to the pluginmatch, so I'm not sure yet what to look for.Any pointers would be appreciated!