Skip to content
This repository has been archived by the owner on Feb 15, 2023. It is now read-only.

Why tslib? #250

Open
janosh opened this issue Jul 13, 2021 · 0 comments
Open

Why tslib? #250

janosh opened this issue Jul 13, 2021 · 0 comments

Comments

@janosh
Copy link

janosh commented Jul 13, 2021

Still learning TypeScript so this may be a dumb question. setupTypeScript.js installs tslib:

"tslib": "^2.0.0",

Reading the docs,

If the importHelpers flag is on, these helper functions are instead imported from the tslib module. You will need to ensure that the tslib module is able to be imported at runtime. This only affects modules; global script files will not attempt to import modules.

it sounds like there's no point in installing tslib unless you also set importHelpers to true in tsconfig.json which @tsconfig/svelte doesn't appear to do.

{
  "$schema": "https://json.schemastore.org/tsconfig",
  "display": "Svelte",
  "_version": "2.0.0",

  "compilerOptions": {
    "moduleResolution": "node",
    "target": "es2017",
    "importsNotUsedAsValues": "error",
    "isolatedModules": true,
    "sourceMap": true,

    "strict": false,
    "esModuleInterop": true,
    "skipLibCheck": true,
    "forceConsistentCasingInFileNames": true
  }
}

I assume I'm missing something?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant