feat(tsconfigs): Enable allowJs in base preset #7274
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes
In our language-server, we force
allowJs
on (this is still the case in 2.0). This is required because otherwise, you wouldn't get intellisense inside inline scripts (which are virtual.js
files). Other frameworks (Vue and Svelte) also suffer from this, Svelte forcesallowJs
on for you, Vue requires you to explicitly set it.This kinda made me forgot how
allowJs
works, so this PR addsallowJs
to our base preset, but still disable it instrictest
. In Astro, Svelte and Vue files, all the native behaviour will work (so forced on for Astro and Svelte, required to change in Vue)This is kinda breaking, in the sense that a project that didn't type check before could type check now when using the
base
orstrict
presets, but in my opinion it was a bug that it wasn't included before. This will overall improve the experience for people not used to TypeScript / who don't know in details how its settings works, as this enable completions and auto imports for.js(x)
files in their project now.(alternatively, we could make it so when you choose No to the
Are you writing TypeScript
question it changes to ajsconfig.json
, which impliesallowJs
, however,jsconfig.json
is non-standard, not always supported and makes it harder to move to a realtsconfig.json
for users, so who knows)Testing
N/A
Docs
N/A