From da210e2ae47093b362ad2554f5433bc16a518b04 Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Wed, 29 Sep 2021 17:19:12 +0100 Subject: [PATCH] Ignore top-level await errs in monaco Fixes #3138 --- .../editor-client/src/js/ui/editors/code-editors/monaco.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/editors/code-editors/monaco.js b/packages/node_modules/@node-red/editor-client/src/js/ui/editors/code-editors/monaco.js index 461d5e8fe..3e04105ed 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/editors/code-editors/monaco.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/editors/code-editors/monaco.js @@ -653,6 +653,8 @@ RED.editor.codeEditor.monaco = (function() { noSyntaxValidation: false, diagnosticCodesToIgnore: [ 1108, //return not inside function + 1375, //'await' expressions are only allowed at the top level of a file when that file is a module + 1378, //Top-level 'await' expressions are only allowed when the 'module' option is set to 'esnext' or 'system', and the 'target' option is set to 'es2017' or higher //2304, //Cannot find name - this one is heavy handed and prevents user seeing stupid errors. Would provide better ACE feature parity (i.e. no need for declaration of vars) but misses lots of errors. Lets be bold & leave it out! 2307, //Cannot find module 'xxx' or its corresponding type declarations 2322, //Type 'unknown' is not assignable to type 'string'