[runmode addon] Fix lint issues
This commit is contained in:
parent
f87e1181c0
commit
6bb912b3e2
|
@ -5,14 +5,14 @@ export default [
|
||||||
input: "src/codemirror.js",
|
input: "src/codemirror.js",
|
||||||
output: {
|
output: {
|
||||||
banner: `// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
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
|
// This is CodeMirror (https://codemirror.net), a code editor
|
||||||
// implemented in JavaScript on top of the browser's DOM.
|
// implemented in JavaScript on top of the browser's DOM.
|
||||||
//
|
//
|
||||||
// You can find some technical background for some of the code below
|
// You can find some technical background for some of the code below
|
||||||
// at http://marijnhaverbeke.nl/blog/#cm-internals .
|
// at http://marijnhaverbeke.nl/blog/#cm-internals .
|
||||||
`,
|
`,
|
||||||
format: "umd",
|
format: "umd",
|
||||||
file: "lib/codemirror.js",
|
file: "lib/codemirror.js",
|
||||||
name: "CodeMirror"
|
name: "CodeMirror"
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
import StringStream from "../../util/StringStream.js"
|
import StringStream from "../../util/StringStream.js"
|
||||||
import * as modeMethods from "../../modes.js"
|
import * as modeMethods from "../../modes.js"
|
||||||
|
|
||||||
|
// declare global: globalThis, CodeMirror
|
||||||
|
|
||||||
// Create a minimal CodeMirror needed to use runMode, and assign to root.
|
// Create a minimal CodeMirror needed to use runMode, and assign to root.
|
||||||
var root = typeof globalThis !== 'undefined' ? globalThis : window
|
var root = typeof globalThis !== 'undefined' ? globalThis : window
|
||||||
root.CodeMirror = {}
|
root.CodeMirror = {}
|
||||||
|
@ -14,7 +16,7 @@ CodeMirror.defineMode("null", () => ({token: stream => stream.skipToEnd()}))
|
||||||
CodeMirror.defineMIME("text/plain", "null")
|
CodeMirror.defineMIME("text/plain", "null")
|
||||||
|
|
||||||
CodeMirror.registerHelper = CodeMirror.registerGlobalHelper = Math.min
|
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 }
|
CodeMirror.defaults = { indentUnit: 2 }
|
||||||
export default CodeMirror;
|
export default CodeMirror
|
||||||
|
|
|
@ -7,7 +7,7 @@ exports.StringStream = StringStream
|
||||||
exports.countColumn = countColumn
|
exports.countColumn = countColumn
|
||||||
for (var exported in modeMethods) exports[exported] = modeMethods[exported]
|
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("../../lib/codemirror")] = require.cache[require.resolve("./runmode.node")]
|
||||||
require.cache[require.resolve("../../addon/runmode/runmode")] = 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.defineMIME("text/plain", "null")
|
||||||
|
|
||||||
exports.registerHelper = exports.registerGlobalHelper = Math.min
|
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 }
|
exports.defaults = { indentUnit: 2 }
|
||||||
|
|
Loading…
Reference in New Issue