Skip to content

Commit

Permalink
Issue #454 Change angular: into angular?
Browse files Browse the repository at this point in the history
  • Loading branch information
EmmanuelDemey committed Mar 18, 2017
1 parent b93b658 commit 91c8530
Show file tree
Hide file tree
Showing 9 changed files with 57 additions and 57 deletions.
20 changes: 10 additions & 10 deletions rules/component-limit.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,16 @@ module.exports = {
}

return {
'angular:animation': checkLimit,
'angular:config': checkLimit,
'angular:controller': checkLimit,
'angular:directive': checkLimit,
'angular:factory': checkLimit,
'angular:filter': checkLimit,
'angular:provider': checkLimit,
'angular:run': checkLimit,
'angular:service': checkLimit,
'angular:component': checkLimit
'angular?animation': checkLimit,
'angular?config': checkLimit,
'angular?controller': checkLimit,
'angular?directive': checkLimit,
'angular?factory': checkLimit,
'angular?filter': checkLimit,
'angular?provider': checkLimit,
'angular?run': checkLimit,
'angular?service': checkLimit,
'angular?component': checkLimit
};
})
};
20 changes: 10 additions & 10 deletions rules/di-order.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,16 @@ module.exports = {
}

return {
'angular:animation': checkOrder,
'angular:config': checkOrder,
'angular:controller': checkOrder,
'angular:directive': checkOrder,
'angular:factory': checkOrder,
'angular:filter': checkOrder,
'angular:inject': checkOrder,
'angular:run': checkOrder,
'angular:service': checkOrder,
'angular:provider': function(callee, providerFn, $get) {
'angular?animation': checkOrder,
'angular?config': checkOrder,
'angular?controller': checkOrder,
'angular?directive': checkOrder,
'angular?factory': checkOrder,
'angular?filter': checkOrder,
'angular?inject': checkOrder,
'angular?run': checkOrder,
'angular?service': checkOrder,
'angular?provider': function(callee, providerFn, $get) {
checkOrder(null, providerFn);
checkOrder(null, $get);
}
Expand Down
20 changes: 10 additions & 10 deletions rules/di-unused.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,16 @@ module.exports = {
}

return {
'angular:animation': reportUnusedVariables,
'angular:config': reportUnusedVariables,
'angular:controller': reportUnusedVariables,
'angular:directive': reportUnusedVariables,
'angular:factory': reportUnusedVariables,
'angular:filter': reportUnusedVariables,
'angular:inject': reportUnusedVariables,
'angular:run': reportUnusedVariables,
'angular:service': reportUnusedVariables,
'angular:provider': function(callee, providerFn, $get) {
'angular?animation': reportUnusedVariables,
'angular?config': reportUnusedVariables,
'angular?controller': reportUnusedVariables,
'angular?directive': reportUnusedVariables,
'angular?factory': reportUnusedVariables,
'angular?filter': reportUnusedVariables,
'angular?inject': reportUnusedVariables,
'angular?run': reportUnusedVariables,
'angular?service': reportUnusedVariables,
'angular?provider': function(callee, providerFn, $get) {
reportUnusedVariables(null, providerFn);
reportUnusedVariables(null, $get);
},
Expand Down
20 changes: 10 additions & 10 deletions rules/di.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,16 +117,16 @@ module.exports = {
}

return {
'angular:animation': checkDi,
'angular:config': checkDi,
'angular:controller': checkDi,
'angular:directive': checkDi,
'angular:factory': checkDi,
'angular:filter': checkDi,
'angular:inject': checkDi,
'angular:run': checkDi,
'angular:service': checkDi,
'angular:provider': function(callee, providerFn, $get) {
'angular?animation': checkDi,
'angular?config': checkDi,
'angular?controller': checkDi,
'angular?directive': checkDi,
'angular?factory': checkDi,
'angular?filter': checkDi,
'angular?inject': checkDi,
'angular?run': checkDi,
'angular?service': checkDi,
'angular?provider': function(callee, providerFn, $get) {
checkDi(null, providerFn);
checkDi(null, $get);
},
Expand Down
2 changes: 1 addition & 1 deletion rules/dumb-inject.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ module.exports = {
}

return {
'angular:inject': function(callExpression, fn) {
'angular?inject': function(callExpression, fn) {
if (!fn) {
return;
}
Expand Down
2 changes: 1 addition & 1 deletion rules/no-directive-replace.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ module.exports = {
}

return {
'angular:directive': function(callExpressionNode, fnNode) {
'angular?directive': function(callExpressionNode, fnNode) {
if (!fnNode || !fnNode.body) {
return;
}
Expand Down
2 changes: 1 addition & 1 deletion rules/no-run-logic.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ module.exports = {
}

return {
'angular:run': function(callExpression, fn) {
'angular?run': function(callExpression, fn) {
if (!fn) {
return;
}
Expand Down
2 changes: 1 addition & 1 deletion rules/prefer-component.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ module.exports = {
}

return {
'angular:directive': function(callExpressionNode, fnNode) {
'angular?directive': function(callExpressionNode, fnNode) {
if (!fnNode || !fnNode.body) {
return;
}
Expand Down
26 changes: 13 additions & 13 deletions rules/utils/angular-rule.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,17 @@ var angularChainableNames = [
* ```js
* module.exports = angularRule(function(context) {
* return {
* 'angular:animation': function(configCallee, configFn) {},
* 'angular:component': function(componentCallee, componentObj) {},
* 'angular:config': function(configCallee, configFn) {},
* 'angular:controller': function(controllerCallee, controllerFn) {},
* 'angular:directive': function(directiveCallee, directiveFn) {},
* 'angular:factory': function(factoryCallee, factoryFn) {},
* 'angular:filter': function(filterCallee, filterFn) {},
* 'angular:inject': function(injectCallee, injectFn) {}, // inject() calls from angular-mocks
* 'angular:run': function(runCallee, runFn) {},
* 'angular:service': function(serviceCallee, serviceFn) {},
* 'angular:provider': function(providerCallee, providerFn, provider$getFn) {}
* 'angular?animation': function(configCallee, configFn) {},
* 'angular?component': function(componentCallee, componentObj) {},
* 'angular?config': function(configCallee, configFn) {},
* 'angular?controller': function(controllerCallee, controllerFn) {},
* 'angular?directive': function(directiveCallee, directiveFn) {},
* 'angular?factory': function(factoryCallee, factoryFn) {},
* 'angular?filter': function(filterCallee, filterFn) {},
* 'angular?inject': function(injectCallee, injectFn) {}, // inject() calls from angular-mocks
* 'angular?run': function(runCallee, runFn) {},
* 'angular?service': function(serviceCallee, serviceFn) {},
* 'angular?provider': function(providerCallee, providerFn, provider$getFn) {}
* };
* })
* ```
Expand Down Expand Up @@ -227,13 +227,13 @@ function angularRule(ruleDefinition) {
function callAngularRules(ruleObject, context) {
angularComponents.forEach(function(component) {
var name = component.callExpression.callee.property.name;
var fn = ruleObject['angular:' + name];
var fn = ruleObject['angular?' + name];
if (!fn) {
return;
}
fn.apply(ruleObject, assembleArguments(component, context));
});
var injectRule = ruleObject['angular:inject'];
var injectRule = ruleObject['angular?inject'];
if (injectRule) {
injectCalls.forEach(function(node) {
injectRule.call(ruleObject, node.CallExpression, node.fn);
Expand Down

0 comments on commit 91c8530

Please sign in to comment.