nodegui / svelte-nodegui

Build performant, native and cross-platform desktop applications with native Svelte + powerful CSS-like styling.🚀

Home Page:https://svelte.nodegui.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Update the tsconfig to support async/await by default

shirakaba opened this issue · comments

Found in #40 (comment).

Apparently we should set "noEmitHelpers": false in the tsconfig.json for our app in order for async/await to work correctly. Here's a working config:

{
    "extends": "@tsconfig/svelte/tsconfig.json",

    "compilerOptions": {
        "module": "esnext",
        "declaration": true,
        "removeComments": true,
        "noLib": false,
        "jsxFactory": "svelteNodeGUI.createElement",
        "emitDecoratorMetadata": false,
        "experimentalDecorators": true,
        "pretty": true,
        "allowUnreachableCode": false,
        "allowUnusedLabels": false,
        "noEmitHelpers": false,
        "noEmitOnError": false,
        "noImplicitAny": false,
        "noImplicitReturns": false,
        "noImplicitUseStrict": false,
        "noFallthroughCasesInSwitch": true,
        "allowSyntheticDefaultImports": true,
        "lib": ["es6", "dom", "es2015.iterable", "es2017.string", "es2018.promise"],
        "baseUrl": ".",
        "types": ["node", "svelte"],
        "paths": {
            "~/*": ["src/*"],
            "*": ["./node_modules/*"]
        }
    },
    /**
     * `svelte-nodegui.d.ts` provides the JSX typings needed to support Svelte components using lang="ts".
     * If you'd prefer not to introduce a "files" property into your tsconfig, you can add this
     * triple-slash directive to the top line of `src/app.ts` instead:
     * /// <reference path="../node_modules/@nodegui/svelte-nodegui/svelte-nodegui.d.ts" />
     * Remember to restart the Svelte Language Service after any significant changes to configuration.
    */
    "files": ["./node_modules/@nodegui/svelte-nodegui/svelte-nodegui.d.ts"],
    "include": ["src/**/*"],
    "exclude": ["node_modules/*", "__sapper__/*", "public/*"]
}