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

config: update verbatimModuleSyntax in lenient tsconfig.json #103

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

dv-usama-ansari
Copy link
Contributor

What is verbatimModuleSyntax?

Why do we need it?

  • Without verbatimModuleSyntax:

image

We see no errors when an import which can be used only as a type. This would lead to increased bundle size, since it would also compile the imports within the module.
Also, coming from datavisyn/visyn_core@274fcfb#diff-c767fb22b4d7242d9d2848e5d53d098f77647cf31592ceed92875cbafdce2684, we have run into this problem where the module contained interfaces as well as React imports from a component and the bundler messed up the entire setup which led everything to crash

  • With verbatimModuleSyntax enabled:

image

We see errors right in the editor which suggests to import type instead of the interface name so that it is excluded from bundling.
These lint errors are autofixable (unfortunately not from the CLI)

image

@dv-usama-ansari dv-usama-ansari requested a review from a team as a code owner October 28, 2024 11:59
@dv-usama-ansari dv-usama-ansari changed the title config: update verbatimModuleSyntax in lenient tsconfig.json config: update verbatimModuleSyntax in lenient tsconfig.json Oct 28, 2024
@@ -15,7 +15,8 @@
"esModuleInterop": false,
"resolveJsonModule": true,
"allowSyntheticDefaultImports": true,
"preserveWatchOutput": true
"preserveWatchOutput": true,
"verbatimModuleSyntax": true,
Copy link
Contributor

Choose a reason for hiding this comment

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

@dv-usama-ansari is the lenient config the right place for this? I would put it into the normal one because that's the one loaded by VSCode. Also, it it the one which contains the strict changes, thus not breaking any existing pipelines.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, please put it in the normal one. The intention of this setting is that the developers should see the warning right in the editor and make changes accordingly.

Copy link
Contributor

Choose a reason for hiding this comment

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

Feel free to adjust it and I will review again 👍

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.

2 participants