-
Notifications
You must be signed in to change notification settings - Fork 34
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
Please document where to import Typescript types from #142
Comments
While we do our best to support TypeScript, we make no attempt at trying to teach it. That is simply out of scope for the documentation as it is not our area of expertise. But we are happy to consider any concrete improvements to the documentation you might propose. |
Not asking for a teacher, I can program at a beginner's level acceptably enough (for my goals so far), but code diving an unfamiliar code base to find out what's exported where is a bit of a challenge for me. That's more the improvement I'm asking for. A pointer on where your exports are.
I'm not asking for a full typescript tutorial, just a pointer towards the right things to import. Thanks for your time and effort on a community project :-) |
Apparently in my specific example of class App in the tutorial code, |
I am looking at mojo.js and exploring it as I look at a hobby project that needs something different from the content generators like Astro and Hugo that I've used in the past. So I am just starting to explore the tools documentation and capabilities. Right now I have the sample application generated by
pnpm create @mojojs/full-app --ts
:and my eslint configuration is complaining that this has some unsafe defaults.
The second one was trivial to solve, I set my "module" option in tsconfig to "ESNext" and then added an "await" before app.start(). I admittedly do not fully understand all the implications of that change on performance.
The first one though is more of a challenge. The right solution appears to be to explicitly type the
const app
as something. vscodium and IntelJ IDEA. both infer that it is of typeApp
but while vscodium is simply unable to suggest a place to import that definition from, IntelJ suggests'@mojojs/core/lib/app'
except that does not appear to be a valid export.Looking through the documentation I'm at a loss what the correct answer is. I strongly suspect this is a me problem and not a code problem, which is why I am requesting a paragraph or similar be added to the documentation to assist new adopters figure out things like this as they get themselves started.
Thanks!!
The text was updated successfully, but these errors were encountered: