Skip to content
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

feat(tsconfigs): Enable allowJs in base preset #7274

Merged
merged 1 commit into from
Jun 5, 2023
Merged

Conversation

Princesseuh
Copy link
Member

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 forces allowJs on for you, Vue requires you to explicitly set it.

This kinda made me forgot how allowJs works, so this PR adds allowJs to our base preset, but still disable it in strictest. 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 or strict 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 a jsconfig.json, which implies allowJs, however, jsconfig.json is non-standard, not always supported and makes it harder to move to a real tsconfig.json for users, so who knows)

Testing

N/A

Docs

N/A

@changeset-bot
Copy link

changeset-bot bot commented Jun 2, 2023

🦋 Changeset detected

Latest commit: a46707e

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added pkg: astro Related to the core `astro` package (scope) semver: minor Change triggers a `minor` release labels Jun 2, 2023
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is blocked because it contains a minor changeset. A reviewer will merge this at the next release if approved.

@Princesseuh Princesseuh merged commit b521365 into main Jun 5, 2023
@Princesseuh Princesseuh deleted the feat/allowJs branch June 5, 2023 15:31
@astrobot-houston astrobot-houston mentioned this pull request Jun 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: astro Related to the core `astro` package (scope) semver: minor Change triggers a `minor` release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants