initial support for eslint backed JS linting

This commit is contained in:
azivner
2018-02-20 23:24:55 -05:00
parent 2582b016f9
commit d5605aa64d
6 changed files with 101761 additions and 1 deletions

View File

@@ -142,6 +142,7 @@ const noteEditor = (function() {
else if (currentNote.detail.type === 'code') {
if (!codeEditor) {
await requireLibrary(CODE_MIRROR);
await requireLibrary(JS_LINT);
CodeMirror.keyMap.default["Shift-Tab"] = "indentLess";
CodeMirror.keyMap.default["Tab"] = "indentMore";
@@ -154,7 +155,10 @@ const noteEditor = (function() {
indentUnit: 4,
matchBrackets: true,
matchTags: { bothTags: true },
highlightSelectionMatches: { showToken: /\w/, annotateScrollbar: false }
highlightSelectionMatches: { showToken: /\w/, annotateScrollbar: false },
lint: true,
gutters: ["CodeMirror-lint-markers"],
lineNumbers: true
});
codeEditor.on('change', noteChanged);