fix: remove editor red squiggly lines

by dynamically loading project's tsconfig file and adding nice defaults

# Conflicts:
#	frontend/components/editor/index.tsx
#	frontend/lib/utils.ts
This commit is contained in:
Hamzat Victor 2024-09-24 13:00:49 +01:00 committed by James Murdza
parent 224d190468
commit 8b890fdffe

View File

@ -1228,4 +1228,17 @@ export default function CodeEditor({
)
}
/**
* Configure the typescript compiler to detect JSX and load type definitions
*/
const defaultCompilerOptions: monaco.languages.typescript.CompilerOptions = {
allowJs: true,
allowSyntheticDefaultImports: true,
allowNonTsExtensions: true,
resolveJsonModule: true,
jsx: monaco.languages.typescript.JsxEmit.ReactJSX,
module: monaco.languages.typescript.ModuleKind.ESNext,
moduleResolution: monaco.languages.typescript.ModuleResolutionKind.NodeJs,
target: monaco.languages.typescript.ScriptTarget.ESNext,
}