text: /**
   * @fileoverview Enforce that elements that do not support ARIA roles, states and properties do not have those attributes.
   * @author Ethan Cohen
   */
  'use strict';
  
  // ----------------------------------------------------------------------------
  // Rule Definition
  // ----------------------------------------------------------------------------
  
  var _DOM = require('../util/attributes/DOM');
  
  var _DOM2 = _interopRequireDefault(_DOM);
  
  var _ARIA = require('../util/attributes/ARIA');
  
  var _ARIA2 = _interopRequireDefault(_ARIA);
  
  var _getAttribute = require('../util/getAttribute');
  
  var _getAttribute2 = _interopRequireDefault(_getAttribute);
  
  var _getNodeType = require('../util/getNodeType');
  
  var _getNodeType2 = _interopRequireDefault(_getNodeType);
  
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  
  function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
  
  var errorMessage = 'This element does not support ARIA roles, states and properties.';
  
  module.exports = function (context) {
    return {
      JSXOpeningElement: function JSXOpeningElement(node) {
        var nodeType = (0, _getNodeType2.default)(node);
        var nodeAttrs = _DOM2.default[nodeType];
        var isReservedNodeType = nodeAttrs && nodeAttrs.reserved || false;
  
        // If it's not reserved, then it can have ARIA-* roles, states, and properties
        if (isReservedNodeType === false) {
          return;
        }
  
        var invalidAttributes = Object.keys(_ARIA2.default).concat('ROLE');
        var hasInvalidAttribute = _getAttribute2.default.apply(undefined, [node.attributes].concat(_toConsumableArray(invalidAttributes))) !== undefined;
  
        if (hasInvalidAttribute) {
          context.report({
            node: node,
            message: errorMessage
          });
        }
      }
    };
  };
  
  module.exports.schema = [{ type: 'object' }];