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

fix(NOJIRA-123): Allow JS+TS files #168

Closed
wants to merge 3 commits into from

Conversation

georgegillams
Copy link
Contributor

@georgegillams georgegillams commented Nov 13, 2023

Some files can't be renamed to have a .ts or .tsx extension. For example, next.config.js and any files that it requires.
https://nextjs.org/docs/pages/building-your-application/configuring/typescript#type-checking-nextconfigjs

However, we can still benefit from Typescript in these files by adding // @ts-check at the top of the file. eg https://github.com/Typeform/public-main-site/pull/4089

This change changes the typescript check to allow JS files with such an annotation. This will avoid false-negatives when Typescript is used this way, and will encourage Typeformers to adopt JS in these places to make adoption % look better 🙌

In this PR, I'm testing the change in the PR and it passes (because the JS file I've edited is type-checked)
https://github.com/Typeform/public-main-site/pull/4091

And in this PR, I edit a regular JS file and so it complains
https://github.com/Typeform/public-main-site/pull/4095

@georgegillams georgegillams force-pushed the NOJIRA-123/allow-JS+TS-files-in-TS-check branch from 621c646 to eaf4d01 Compare November 13, 2023 13:54
@georgegillams georgegillams force-pushed the NOJIRA-123/allow-JS+TS-files-in-TS-check branch from eaf4d01 to d6d82dd Compare November 13, 2023 13:55
@georgegillams georgegillams force-pushed the NOJIRA-123/allow-JS+TS-files-in-TS-check branch 20 times, most recently from c3ea64a to 04fddec Compare November 13, 2023 19:01
@georgegillams georgegillams force-pushed the NOJIRA-123/allow-JS+TS-files-in-TS-check branch from 04fddec to b10f1e2 Compare November 13, 2023 19:01
@georgegillams georgegillams deleted the NOJIRA-123/allow-JS+TS-files-in-TS-check branch November 13, 2023 19:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant