Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(website): pass user defined compilerOptions to linter (#5080)
- Loading branch information
Showing
3 changed files
with
20 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import type Monaco from 'monaco-editor'; | ||
|
||
export function createCompilerOptions( | ||
jsx = false, | ||
tsConfig: Record<string, unknown> = {}, | ||
): Monaco.languages.typescript.CompilerOptions { | ||
return { | ||
noResolve: true, | ||
lib: ['es2021', 'esnext'], | ||
// ts and monaco has different type as monaco types are not changing base on ts version | ||
target: window.ts.ScriptTarget.ESNext as number, | ||
module: window.ts.ModuleKind.ESNext as number, | ||
...tsConfig, | ||
jsx: jsx ? window.ts.JsxEmit.Preserve : window.ts.JsxEmit.None, | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters