Skip to content

function-type rule does not recognize inline named functions properly #229

@jeffcharles

Description

@jeffcharles

I have some code that looks like this:

.factory('myHttpInterceptor', function myHttpInterceptor($localStorage, configuredToken) {

and I'm getting an error on the module indicating that I should use a named function instead of an anonymous function. I wasn't expecting that error because the function is named.

The code for the rule looks like it has an error https://github.com/Gillespie59/eslint-plugin-angular/blob/044621cd4f1a93f4f4087b2472efca034e431012/rules/function-type.js#L24. The second argument could be a named function or an identifier and be in compliance. Furthermore, the use of an identifier doesn't necessarily mean the function is named since it's possible to assign an anonymous function to a variable.

Metadata

Metadata

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions