elijahmanor/eslint-plugin-smells

View on GitHub
lib/rules/no-switch.js

Summary

Maintainability
A
0 mins
Test Coverage
/**
 * @fileoverview Rule to flag use of `switch` statement
 * @author Elijah Manor
 * @copyright 2015 Elijah Manor. All rights reserved.
 */

'use strict';

// ------------------------------------------------------------------------------
// Rule Definition
// ------------------------------------------------------------------------------

module.exports = function(context) {
  return {
    SwitchStatement: function(node) {
      context.report(node, 'switch can be harmful.');
    }
  };
};