Skip to content

Commit 1f63d5a

Browse files
committed
Adds strict to the playground defaults and some test tweasks
1 parent 3040857 commit 1f63d5a

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

packages/sandbox/src/compilerOptions.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ type Monaco = typeof import("monaco-editor")
1010
export function getDefaultSandboxCompilerOptions(config: SandboxConfig, monaco: Monaco) {
1111
const useJavaScript = config.filetype === "js"
1212
const settings: CompilerOptions = {
13+
strict: true,
14+
1315
noImplicitAny: true,
1416
strictNullChecks: !useJavaScript,
1517
strictFunctionTypes: true,

packages/sandbox/test/defaultCompilerOptions.test.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,13 @@ describe(getCompilerOptionsFromParams, () => {
2626
})
2727

2828
it("ignores non-compiler flags", () => {
29-
// noImplicitReturns=true is the default, and shouldnt be in the object
3029
const params = new URLSearchParams("?asdasdasdasd=false")
3130
const defaults = getDefaultSandboxCompilerOptions({ filetype: "js" } as any, fauxMonaco)
3231

3332
expect(getCompilerOptionsFromParams(defaults, ts, params)).toMatchInlineSnapshot(`Object {}`)
3433
})
3534

36-
it("hanndles mapped types like target et", () => {
37-
// noImplicitReturns=true is the default, and shouldnt be in the object
35+
it("handles mapped types like target et", () => {
3836
const params = new URLSearchParams("?target=6")
3937
const defaults = getDefaultSandboxCompilerOptions({ filetype: "js" } as any, fauxMonaco)
4038

0 commit comments

Comments
 (0)