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(tsconfig): explicit module constraints #672

Merged
merged 2 commits into from
Jun 11, 2023
Merged

Conversation

sambacha
Copy link
Contributor

@sambacha sambacha commented Jun 8, 2023

These options are viral: enabling them in a package requires all downstream consumers to enable them as well.

Consumers can now opt into these semantics, it also does not require them to do so. Consumers can always safely use alternative import syntaxes (including falling back to require() and import()), or can enable these flags and opt into this behavior themselves.


PR-Codex overview

This PR turns off esModuleInterop and allowSyntheticDefaultImports in the tsconfig file.

Detailed summary

  • esModuleInterop and allowSyntheticDefaultImports are set to false in tsconfig.base.json.

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

These options are viral: enabling them in a package requires all downstream consumers to enable them as well.

Consumers can now opt into these semantics, it also does not require them to do so. Consumers can always safely use alternative import syntaxes (including falling back to `require() `and i`mport()`), or can enable these flags and opt into this behavior themselves.
@changeset-bot
Copy link

changeset-bot bot commented Jun 8, 2023

🦋 Changeset detected

Latest commit: 88658f2

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

@vercel
Copy link

vercel bot commented Jun 8, 2023

@sambacha is attempting to deploy a commit to the wagmi Team on Vercel.

A member of the Team first needs to authorize it.

@sambacha
Copy link
Contributor Author

sambacha commented Jun 8, 2023

These options are viral: enabling them in a package requires all downstream consumers to enable them as well.

Consumers can now opt into these semantics, it also does not require them to do so. Consumers can always safely use alternative import syntaxes (including falling back to require() and import()), or can enable these flags and opt into this behavior themselves.

PR-Codex overview

This PR focuses on updating the tsconfig.base.json file by setting esModuleInterop and allowSyntheticDefaultImports to false, and enabling forceConsistentCasingInFileNames and verbatimModuleSyntax.

Detailed summary

  • Set esModuleInterop to false
  • Set allowSyntheticDefaultImports to false
  • Enable forceConsistentCasingInFileNames
  • Enable verbatimModuleSyntax

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

> * Enable `forceConsistentCasingInFileNames`
> * Enable `verbatimModuleSyntax`

This was not enabled, look at the diff.

@pr-codex
Copy link

pr-codex bot commented Jun 8, 2023

{your question}`

> * Enable `forceConsistentCasingInFileNames`
> * Enable `verbatimModuleSyntax`

This was not enabled, look at the diff.

@sambacha My apologies. Here is the question:

What changes were made to the tsconfig.base.json file?

@fubhy
Copy link
Collaborator

fubhy commented Jun 8, 2023

Yeah this is good.

@fubhy
Copy link
Collaborator

fubhy commented Jun 8, 2023

Tried to do that with https://github.com/wagmi-dev/viem/pull/391/files but didn't realize that it's implicitly enabled due to NodeNext. Whoops.

@jxom
Copy link
Member

jxom commented Jun 9, 2023

enabling them in a package requires all downstream consumers to enable them as well.

does this mean this is a breaking change? 😅

@fubhy
Copy link
Collaborator

fubhy commented Jun 9, 2023

enabling them in a package requires all downstream consumers to enable them as well.

does this mean this is a breaking change? sweat_smile

Sam is disabling them here. Currently they are implicitly enabled. So as it stands, consumers are affected by it. Disabling it should not cause any breaking changes but simply be more lenient on consumers. But let's verify that.

@jxom
Copy link
Member

jxom commented Jun 9, 2023

Gotcha! I’m all good with it then!

@codecov
Copy link

codecov bot commented Jun 9, 2023

Codecov Report

Merging #672 (0a4f8ad) into main (4346054) will decrease coverage by 9.92%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##             main     #672      +/-   ##
==========================================
- Coverage   99.86%   89.94%   -9.92%     
==========================================
  Files         260      250      -10     
  Lines       24709    24362     -347     
  Branches     2052     1406     -646     
==========================================
- Hits        24676    21913    -2763     
- Misses         31     2410    +2379     
- Partials        2       39      +37     

see 114 files with indirect coverage changes

@jxom jxom merged commit e033f46 into wevm:main Jun 11, 2023
@github-actions github-actions bot mentioned this pull request Jun 11, 2023
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