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: fix compatibility with verbatimModuleSyntax TS config option #20

Merged
merged 2 commits into from
Aug 2, 2024

Conversation

achou11
Copy link
Member

@achou11 achou11 commented Jul 31, 2024

Currently trying to build a library that imports types from this module and emits its own declarations. However, running TS on it fails when the verbatimModuleSyntax option is enabled on my project:

node_modules/rpc-reflector/lib/types.ts:1:10 - error TS1484: 'ErrorObject' is a type and must be imported using a type-only import when 'verbatimModuleSyntax' is enabled.

1 import { ErrorObject } from 'serialize-error'
           ~~~~~~~~~~~


Found 1 error in node_modules/rpc-reflector/lib/types.ts:1

There doesn't seem to be any downside to convert the import in question to an explicit type-only import, which I believe is generally recommended when possible anyways when working with TypeScript.

I didn't update the other imports in this file since that first one was the only one that caused the error. Open to fixing the other imports in this PR if it makes sense to.

@achou11 achou11 requested a review from EvanHahn July 31, 2024 22:06
@coveralls
Copy link

coveralls commented Jul 31, 2024

Pull Request Test Coverage Report for Build 10220698815

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 93.405%

Totals Coverage Status
Change from base Build 6233270959: 0.0%
Covered Lines: 328
Relevant Lines: 342

💛 - Coveralls

@coveralls
Copy link

coveralls commented Jul 31, 2024

Pull Request Test Coverage Report for Build 10188337538

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 93.405%

Totals Coverage Status
Change from base Build 6233270959: 0.0%
Covered Lines: 328
Relevant Lines: 342

💛 - Coveralls

Copy link

@EvanHahn EvanHahn left a comment

Choose a reason for hiding this comment

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

Always a fan of using import type when possible.

lib/types.ts Outdated Show resolved Hide resolved
@achou11 achou11 merged commit e7c1bec into main Aug 2, 2024
3 checks passed
@achou11 achou11 deleted the ac/type-only-import branch August 2, 2024 19:02
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