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

chore: enable tsconfig's verbatimModuleSyntax #65

Merged
merged 7 commits into from
Feb 17, 2025

Conversation

justlevine
Copy link
Collaborator

What

Enables TSConfig's verbatimModuleSyntax, which requires types to be imported using the type keyword.

Then remediates all violations of type imports.

Why

Not explicitly marking imported types can cause headaches in consuming projects, ides, incorrect codesplitting and compiling etc.

Related Issue(s):

Part of https://github.com/rtCamp/headless/issues/317

How

Testing Instructions

Screenshots

Additional Info

Interestingly, errors are only caught during npm run build, since npm run typecheck uses the --noEmit flag.

Not sure if this is important, but since our CI builds before it typechecks, I'm personally not bothered by it.

Checklist

  • I have read the Contribution Guidelines.
  • My code is tested to the best of my abilities.
  • My code passes all lints (ESLint, tsc, prettier etc.).
  • My code has detailed inline documentation.
  • I have added unit tests to verify the code works as intended.
  • I have updated the project documentation accordingly.

@justlevine
Copy link
Collaborator Author

If someone could pick this up and fix the ts-jest issues 🙇: https://jestjs.io/docs/ecmascript-modules

ayushnirwal
ayushnirwal previously approved these changes Feb 14, 2025
@justlevine
Copy link
Collaborator Author

(Rebased on #64)

@justlevine justlevine mentioned this pull request Feb 14, 2025
6 tasks
@justlevine justlevine force-pushed the chore/tsconfig-verbatim-syntax branch from ef726d2 to a217983 Compare February 14, 2025 14:08
Copy link

changeset-bot bot commented Feb 14, 2025

⚠️ No Changeset found

Latest commit: 3fe8635

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@justlevine
Copy link
Collaborator Author

(Rebased on #66)

@justlevine justlevine changed the title chore: enable tsconfig's verbatimModuleSyntax and fix type imports chore: enable tsconfig's verbatimModuleSyntax Feb 14, 2025
@justlevine justlevine merged commit 3693562 into rtCamp:develop Feb 17, 2025
8 checks passed
@justlevine justlevine deleted the chore/tsconfig-verbatim-syntax branch February 17, 2025 14:11
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.

3 participants