EmmanuelDemey / EmmanuelDemey/eslint-plugin-angular
function-type on a string constant
Open
Hacktoberfest
- Dominant language
- JavaScript
- Stars
- 620
- Forks
- 127
- PR merge metrics
- No merged PRs in 30d
Description
```JavaScript
var server = (…) ? 'http://test/' : 'http://production/';
angular.module('myMod', […]).constant('server', server);
```
gives me a `Use anonymous functions instead of named function angular/function-type`.
I tried with:
```JavaScript
angular.module('myMod', […]).constant('server', function () {
return (…) ? 'http://test/' : 'http://production/';
});
```
but that returns the literal function, not the value.
What's the suggested approach here?
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.