Skip to content

Latest commit

 

History

History
40 lines (24 loc) · 1.12 KB

module-getter.md

File metadata and controls

40 lines (24 loc) · 1.12 KB

module-getter - enforce to reference modules with the getter syntax

When using a module, avoid using a variable and instead use chaining with the getter syntax

Rule based on Angular 1.x

Styleguide Reference

Examples

The following patterns are considered problems;

/*eslint angular/module-getter: 2*/

// invalid
app.controller('MyController', function () {
    // ...
}); // error: Avoid using a variable and instead use chaining with the getter syntax.

The following patterns are not considered problems;

/*eslint angular/module-getter: 2*/

// valid
angular.module('myModule').controller('MyController', function () {
    // ...
});

Version

This rule was introduced in eslint-plugin-angular 0.1.0

Links