-
Notifications
You must be signed in to change notification settings - Fork 9
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
README mentions adding a tsconfig.json, but doesn't say what to put in it #29
Comments
Good, point we should provide more guidance here. I played around with different configs and this is the minimal I found: {
"include": ["src/**/*", ".marko-run/*"]
"compilerOptions": {
"strict": true,
"target": "es6",
"moduleResolution": "node",
"allowSyntheticDefaultImports": true,
"resolveJsonModule": true
}
} Top-level
Compiler Options
Let me know if these work for you and I will update the examples so they don't use the base tsconfig.json and make them more stand-alone. |
That looks right to me, but maybe put |
@rturnq I can confirm that your suggested minimal tsconfig seems to work fine for me, thank you. 👍 I have other issues that might cause tsconfig.json recommendations to be revisited, but I'll file those separately when I get the brain cycles available. |
If I add a tsconfig.json, I need to put roughly the following in it:
If I omit "lib", I'll get TS errors telling me that Promise isn't defined. (You can use something more aggressive than ES2019 if you're targeting modern browsers, but ES6 happens to be the minimum for Promise.)
If I omit either "esModuleInterop" or "resolveJsonModule", I see type errors in the example project, because the file generated in
.marko-run/routes.d.ts
isn't parsed by typescript, so none of my per-route types seem to be visible in VS Code.I'm going to suggest adding an example tsconfig.json file?
edit: I thought these were needed but they actually aren't:
The text was updated successfully, but these errors were encountered: