export const getOptions = (options, onLintedCode) => {
  const 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);
        }
      },
      options: {
        ecmaVersion: 6,
      },
    },
  };

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