From 19308bbfbda8939d8bca27d1e51c0c9ef2220751 Mon Sep 17 00:00:00 2001 From: azivner Date: Fri, 23 Feb 2018 20:10:29 -0500 Subject: [PATCH] small changes to linting and protected session --- src/public/javascripts/protected_session.js | 4 +++- src/public/libraries/codemirror/addon/lint/eslint.js | 9 +++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/public/javascripts/protected_session.js b/src/public/javascripts/protected_session.js index 77269388a..6eb1cf511 100644 --- a/src/public/javascripts/protected_session.js +++ b/src/public/javascripts/protected_session.js @@ -25,7 +25,9 @@ const protected_session = (function() { if (requireProtectedSession && !isProtectedSessionAvailable()) { protectedSessionDeferred = dfd; - $noteDetailWrapper.hide(); + if (noteTree.getCurrentNode().data.isProtected) { + $noteDetailWrapper.hide(); + } $dialog.dialog({ modal: modal, diff --git a/src/public/libraries/codemirror/addon/lint/eslint.js b/src/public/libraries/codemirror/addon/lint/eslint.js index a1520134b..dce86d9fb 100644 --- a/src/public/libraries/codemirror/addon/lint/eslint.js +++ b/src/public/libraries/codemirror/addon/lint/eslint.js @@ -11,9 +11,15 @@ })(function(CodeMirror) { "use strict"; - async function validator(text, options) {console.log("Validating..."); + async function validator(text, options) { await requireLibrary(ESLINT); + if (text.length > 20000) { + console.log("Skipping linting because of large size: ", text.length); + + return []; + } + var errors = new eslint().verify(text, { root: true, parserOptions: { @@ -29,7 +35,6 @@ 'import/no-extraneous-dependencies': 'off', 'func-names': 'off', 'no-multi-spaces': 'off', - 'spaced-comment': ["error", "always", { "markers": ["/"] }], 'comma-dangle': ['error'], 'padded-blocks': 'off', 'linebreak-style': 'off',