Commit 07c7a406 authored by Jérome Perrin's avatar Jérome Perrin

monaco_editor: lint javascript with typescript compiler

Because typescript is a subset of javascript, running typescript
compiler on javascript files can already report several issues.

https://www.typescriptlang.org/docs/handbook/type-checking-javascript-files.html
parent 19b61a09
......@@ -112,6 +112,20 @@
}
);
// Annotations for javascript
monaco.languages.typescript.javascriptDefaults.setDiagnosticsOptions({
noSemanticValidation: false,
noSyntaxValidation: false
});
monaco.languages.typescript.javascriptDefaults.setCompilerOptions({
target: monaco.languages.typescript.ScriptTarget.ES6,
allowNonTsExtensions: true,
checkJs: true,
allowJs: true,
module: monaco.languages.typescript.ModuleKind.UMD
});
// Type mapping for Nexedi libraries
function addExtraLibrary(script_name, lib_name) {
return fetch(script_name)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment