Skip to content

Add import helpers to the playground config #864

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions packages/playground/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -386,8 +386,8 @@ export const setupPlayground = (
} else {
sidebarTabs.style.display = "none"
sidebarContent.style.display = "none"
settingsContent.style.display = "block";
(document.querySelector(".playground-sidebar label") as any).focus()
settingsContent.style.display = "block"
;(document.querySelector(".playground-sidebar label") as any).focus()
}
settingsToggle.parentElement!.classList.toggle("open")
}
Expand Down Expand Up @@ -462,8 +462,8 @@ export const setupPlayground = (
}

// Ensure that the editor is full-width when the screen resizes
window.addEventListener('resize', () => {
sandbox.editor.layout();
window.addEventListener("resize", () => {
sandbox.editor.layout()
})

const ui = createUI()
Expand Down
2 changes: 2 additions & 0 deletions packages/sandbox/src/compilerOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ export function getDefaultSandboxCompilerOptions(config: PlaygroundConfig, monac
allowJs: config.useJavaScript,
declaration: true,

importHelpers: false,

experimentalDecorators: true,
emitDecoratorMetadata: true,
moduleResolution: monaco.languages.typescript.ModuleResolutionKind.NodeJs,
Expand Down
7 changes: 6 additions & 1 deletion packages/sandbox/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,12 @@ export const createTypeScriptSandbox = (
? monaco.languages.typescript.javascriptDefaults
: monaco.languages.typescript.typescriptDefaults

defaults.setDiagnosticsOptions({ ...defaults.getDiagnosticsOptions(), noSemanticValidation: false })
defaults.setDiagnosticsOptions({
...defaults.getDiagnosticsOptions(),
noSemanticValidation: false,
// This is when tslib is not found
diagnosticCodesToIgnore: [2354],
})

// In the future it'd be good to add support for an 'add many files'
const addLibraryToRuntime = (code: string, path: string) => {
Expand Down
1 change: 0 additions & 1 deletion packages/tsconfig-reference/scripts/tsconfigRules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ export const defaultsForOptions = {
inlineSourceMap: "false",
inlineSources: "false",
isolatedModules: "false",
jsx: '`"react"`',
jsxFactory: "`React.createElement`",
keyofStringsOnly: "false",
listEmittedFiles: "false",
Expand Down
1 change: 1 addition & 0 deletions packages/typescriptlang-org/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"strict": true,
"esModuleInterop": true,
"noEmit": true,
"jsx": "react",
"skipLibCheck": true,
"noImplicitAny": false,
"resolveJsonModule": true
Expand Down