text: "use strict";
  
  Object.defineProperty(exports, "__esModule", {
    value: true
  });
  exports.default = void 0;
  
  var _utilities = require("../utilities");
  
  const schema = [{
    enum: ['always', 'never'],
    type: 'string'
  }];
  const meta = {
    fixable: 'code'
  };
  
  const create = context => {
    var _context$options$;
  
    const never = ((_context$options$ = context === null || context === void 0 ? void 0 : context.options[0]) !== null && _context$options$ !== void 0 ? _context$options$ : 'never') === 'never';
    const sourceCode = context.getSourceCode();
    return {
      ObjectTypeAnnotation(node) {
        const {
          properties
        } = node;
  
        if (properties.length === 0) {
          return;
        }
  
        const [opener, firstInnerToken] = sourceCode.getFirstTokens(node, 2);
        const [lastInnerToken, closer] = sourceCode.getLastTokens(node, 2);
        const spacesBefore = firstInnerToken.range[0] - opener.range[1];
        const spacesAfter = closer.range[0] - lastInnerToken.range[1];
  
        if (never) {
          if (spacesBefore) {
            if (sourceCode.text[opener === null || opener === void 0 ? void 0 : opener.range[1]] !== '\n') {
              context.report({
                data: {
                  token: opener.value
                },
                fix: _utilities.spacingFixers.stripSpacesAfter(opener, spacesBefore),
                message: 'There should be no space after "{{token}}".',
                node
              });
            }
          }
  
          if (spacesAfter) {
            if (sourceCode.text[(closer === null || closer === void 0 ? void 0 : closer.range[0]) - 1] !== '\n') {
              context.report({
                data: {
                  token: closer.value
                },
                fix: _utilities.spacingFixers.stripSpacesBefore(closer, spacesAfter),
                message: 'There should be no space before "{{token}}".',
                node
              });
            }
          }
        } else {
          if (!spacesBefore) {
            context.report({
              data: {
                token: opener.value
              },
              fix: _utilities.spacingFixers.addSpaceAfter(opener),
              message: 'A space is required after "{{token}}".',
              node
            });
          }
  
          if (!spacesAfter) {
            context.report({
              data: {
                token: closer.value
              },
              fix: _utilities.spacingFixers.addSpaceAfter(lastInnerToken),
              message: 'A space is required before "{{token}}".',
              node
            });
          }
        }
      }
  
    };
  };
  
  var _default = {
    create,
    meta,
    schema
  };
  exports.default = _default;
  module.exports = exports.default;