From 6bb912b3e2b518806c28a00082df0a60c062c1bb Mon Sep 17 00:00:00 2001 From: Marijn Haverbeke Date: Thu, 18 Jun 2020 15:13:27 +0200 Subject: [PATCH] [runmode addon] Fix lint issues --- rollup.config.js | 14 +++++++------- src/addon/runmode/codemirror-standalone.js | 6 ++++-- src/addon/runmode/codemirror.node.js | 4 ++-- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/rollup.config.js b/rollup.config.js index 88c94411f..f50f62fae 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -5,14 +5,14 @@ export default [ input: "src/codemirror.js", output: { banner: `// CodeMirror, copyright (c) by Marijn Haverbeke and others - // Distributed under an MIT license: https://codemirror.net/LICENSE +// Distributed under an MIT license: https://codemirror.net/LICENSE - // This is CodeMirror (https://codemirror.net), a code editor - // implemented in JavaScript on top of the browser's DOM. - // - // You can find some technical background for some of the code below - // at http://marijnhaverbeke.nl/blog/#cm-internals . - `, +// This is CodeMirror (https://codemirror.net), a code editor +// implemented in JavaScript on top of the browser's DOM. +// +// You can find some technical background for some of the code below +// at http://marijnhaverbeke.nl/blog/#cm-internals . +`, format: "umd", file: "lib/codemirror.js", name: "CodeMirror" diff --git a/src/addon/runmode/codemirror-standalone.js b/src/addon/runmode/codemirror-standalone.js index bb246c9b9..b463a5cf5 100644 --- a/src/addon/runmode/codemirror-standalone.js +++ b/src/addon/runmode/codemirror-standalone.js @@ -1,6 +1,8 @@ import StringStream from "../../util/StringStream.js" import * as modeMethods from "../../modes.js" +// declare global: globalThis, CodeMirror + // Create a minimal CodeMirror needed to use runMode, and assign to root. var root = typeof globalThis !== 'undefined' ? globalThis : window root.CodeMirror = {} @@ -14,7 +16,7 @@ CodeMirror.defineMode("null", () => ({token: stream => stream.skipToEnd()})) CodeMirror.defineMIME("text/plain", "null") CodeMirror.registerHelper = CodeMirror.registerGlobalHelper = Math.min -CodeMirror.splitLines = function(string) { return string.split(/\r?\n|\r/); } +CodeMirror.splitLines = function(string) { return string.split(/\r?\n|\r/) } CodeMirror.defaults = { indentUnit: 2 } -export default CodeMirror; \ No newline at end of file +export default CodeMirror diff --git a/src/addon/runmode/codemirror.node.js b/src/addon/runmode/codemirror.node.js index f3b5fa6e0..58efc5286 100644 --- a/src/addon/runmode/codemirror.node.js +++ b/src/addon/runmode/codemirror.node.js @@ -7,7 +7,7 @@ exports.StringStream = StringStream exports.countColumn = countColumn for (var exported in modeMethods) exports[exported] = modeMethods[exported] -// Shim library CodeMirror with the minimal CodeMirror defined above. +// Shim library CodeMirror with the minimal CodeMirror defined above. require.cache[require.resolve("../../lib/codemirror")] = require.cache[require.resolve("./runmode.node")] require.cache[require.resolve("../../addon/runmode/runmode")] = require.cache[require.resolve("./runmode.node")] @@ -16,6 +16,6 @@ exports.defineMode("null", () => ({token: stream => stream.skipToEnd()})) exports.defineMIME("text/plain", "null") exports.registerHelper = exports.registerGlobalHelper = Math.min -exports.splitLines = function(string) { return string.split(/\r?\n|\r/); } +exports.splitLines = function(string) { return string.split(/\r?\n|\r/) } exports.defaults = { indentUnit: 2 }