Skip to content

Commit

Permalink
Revert "service-name warn only once if there is an oldBehavior=true"
Browse files Browse the repository at this point in the history
  • Loading branch information
EmmanuelDemey committed Mar 5, 2017
1 parent 1e1bedb commit df833e6
Showing 1 changed file with 3 additions and 28 deletions.
31 changes: 3 additions & 28 deletions rules/service-name.js
Expand Up @@ -44,35 +44,7 @@ function getConfig(options) {
return config;
}

/**
* Used only by `ForDeprecatedBehavior()` for making sure it was run only one time
* @type {boolean}
*/
var didWarnForDeprecatedBehavior = false;

/**
* Warn if API is deprecated
* @param {Array.<*>} options
*/
function warnForDeprecatedBehavior(options) {
if (didWarnForDeprecatedBehavior) {
return;
}
didWarnForDeprecatedBehavior = true;

var config = getConfig(options);

/* istanbul ignore if */
if (config.oldBehavior) {
// eslint-disable-next-line
console.warn('The rule `angular/service-name` will be split up to different rules in the next version. Please read the docs for more information');
}
}

module.exports = function(context) {
// Warn if needed for breaking changes in API in new versions
warnForDeprecatedBehavior(context.options);

return {

CallExpression: function(node) {
Expand All @@ -89,6 +61,9 @@ module.exports = function(context) {

if (config.oldBehavior) {
isService = utils.isAngularServiceDeclarationDeprecated(node);
// Warning that the API is deprecated
// eslint-disable-next-line
console.warn('The rule `angular/service-name` will be split up to different rules in the next version. Please read the docs for more information');
} else {
isService = utils.isAngularServiceDeclaration(node);
}
Expand Down

0 comments on commit df833e6

Please sign in to comment.