-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
create astro --no
=> typescript == strict, instead of "no"
#11609
Comments
I think supporting astro/packages/create-astro/src/actions/context.ts Lines 78 to 83 in 19adfaa
|
Astro always uses TypeScript. No matter what you chose your code will be processed using a TS compiler. Answering "no" to the "Do you plan to write TypeScript?" question doesn't mean "disable TypeScript". It causes the generated project to not use the strictest TS config, which outright forbids plain JS files. It will still run TS but allow untyped JS files in the project. Now, if you plan to write TypeScript and want it to be more forgiving than the default settings, you can choose the relaxed TS config preset. If you are only writing JS files, those two (strict and relaxed) do the same thing, so the current behavior is just fine. If you are also writing TS files and want them relaxed, then the answer to "Do you plan to write TypeScript?" is not "no" is it? You see the option to set TS to relaxed only if you intend to use TS in the first place. |
Thanks @Fryuni. That explains why there's still a tsconfig.json with "base" 😁 While on that topic. If Astro uses TS anyway, if we use relaxed, what's the best practice for the files we create? Always use .ts? Or does it make sense to use .js and .mjs? |
I think it's .astro files interpreted as typescript. There will be errors for js-styled .astro files if type check enabled. |
Astro Info
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
As there is a flag for everything except "no typescript" 🙄, I tried that command with
--no
expecting it would answer "no" to the only remaining question "Do you plan to write TypeScript?"… but it's not the case, instead it uses--typescript strict
.What's the expected result?
Like the doc says
--no (-n) Skip all prompts by declining defaults.
There's a question "Do you plan to write TypeScript? Y/n", so declining the default should result in "no".
PS: But I would expect
create-astro
to have a flag--no-typescript
(like for the other similar flags).Link to Minimal Reproducible Example
https://example.com/not-applicable
Participation
The text was updated successfully, but these errors were encountered: