all files / eslint-plugin-angular/rules/ no-controller.js

100% Statements 6/6
100% Branches 2/2
100% Functions 2/2
100% Lines 6/6
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27                      13×     18×                
/**
 * disallow use of controllers (according to the component first pattern)
 *
 * According to the Component-First pattern, we should avoid the use of AngularJS controller.
 *
 * @version 0.9.0
 * @category bestPractice
 */
'use strict';
 
var utils = require('./utils/utils');
 
module.exports = function(context) {
    return {
 
        CallExpression: function(node) {
            if (utils.isAngularControllerDeclaration(node)) {
                context.report(node, 'Based on the Component-First Pattern, you should avoid the use of controllers', {});
            }
        }
    };
};
 
module.exports.schema = [
    // JSON Schema for rule options goes here
];