Skip to content

Commit 0bcce31

Browse files
committed
Enable strict mode on playground
1 parent 63a7708 commit 0bcce31

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/pages/play/monaco.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ import TsWorker from "worker-loader?name=ts.worker.js!./ts.worker";
99

1010
export { monaco };
1111

12+
export function useMonacoTheme() {
13+
const { isDarkTheme } = useThemeContext();
14+
return isDarkTheme ? "vs-dark" : "vs";
15+
}
16+
1217
// TODO: MonacoEnvironment should be a var
1318
(globalThis as { MonacoEnvironment?: typeof MonacoEnvironment }).MonacoEnvironment = {
1419
getWorker(_workerId, label) {
@@ -39,7 +44,7 @@ for (const module of [
3944
monaco.languages.typescript.typescriptDefaults.addExtraLib(module.default);
4045
}
4146

42-
export function useMonacoTheme() {
43-
const { isDarkTheme } = useThemeContext();
44-
return isDarkTheme ? "vs-dark" : "vs";
45-
}
47+
monaco.languages.typescript.typescriptDefaults.setCompilerOptions({
48+
...monaco.languages.typescript.typescriptDefaults.getCompilerOptions(),
49+
strict: true,
50+
});

0 commit comments

Comments
 (0)