JavaScript

JavaScript

Made by DeepSource

Require and specify a prefix for all value names JS-0543

Anti-pattern
Minor
angularjs

All your values should have a name starting with the parameter you can define in your config object. The second parameter can be a Regexp wrapped in quotes. You can not prefix your values by "$" (reserved keyword for AngularJS services)

Rule based on Angular 1.x

Bad Practice

// invalid
angular.module('myModule').value('otherValue', function () {
    // ...
}); // error: The otherValue value should follow this pattern: /^xyz/

Recommended

// valid
angular.module('myModule').value('prefixValue', function () {
    // ...
});