'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});
/* eslint-disable import/prefer-default-export */
var getOptions = exports.getOptions = function getOptions(options, onLintedCode) {
  var onLintErrors = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : function () {};

  var defaults = {
    theme: 'material',
    lineNumbers: true,
    tabSize: 2,
    fixedGutter: true,
    mode: 'javascript',
    matchBrackets: true,
    autoCloseBrackets: true,
    extraKeys: {
      'Cmd-/': 'toggleComment'
    },
    keyMap: 'sublime',
    lineWrapping: true,
    cursorHeight: 0.85,
    gutters: ['CodeMirror-lint-markers'],
    lint: {
      onUpdateLinting: function onUpdateLinting(annotationsNotSorted, annotations, cm) {
        if (!annotationsNotSorted.length) {
          onLintedCode(annotationsNotSorted, annotations, cm);
        } else {
          onLintErrors(annotationsNotSorted);
        }
      },
      options: {
        ecmaVersion: 6
      }
    }
  };

  return Object.assign({}, defaults, options);
};