Skip to content

[Bug] Types don't work with verbatimModuleSyntax #148

@paolostyle

Description

@paolostyle

Describe the bug
In projects where verbatimModuleSyntax is enabled typechecking throws an error. This is because your types are not .d.ts files, but a mix of both .ts and .d.ts. Ideally you'd just have a single file with all the necessary types, but considering you're writing them separately from the library code, simply renaming them all to .d.ts should work, too. You could also just change the imports from import { SomeTypeOrInterface } from './file' to import type { SomeTypeOrInterface } from './file'. But generally speaking distributing .ts files (not .d.ts, these are fine of course) on NPM is a bit odd, so just using definition files makes more sense.

I can contribute a PR if you accept them.

Steps to reproduce

  1. Embed the SDK in a TypeScript app
  2. Set verbatimModuleSyntax: true in tsconfig.json
  3. Import monday-sdk-js and use it anywhere
  4. Run tsc
  5. You'll get a bunch of errors

Expected behavior
No errors when running tsc

Context and environment
Any import causes this issue

Additional information
N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions