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

There are Type Errors in theia.d.ts and we don't notice it #13099

Open
tsmaeder opened this issue Nov 24, 2023 · 0 comments
Open

There are Type Errors in theia.d.ts and we don't notice it #13099

tsmaeder opened this issue Nov 24, 2023 · 0 comments

Comments

@tsmaeder
Copy link
Contributor

Bug Description:

I tried to make a theia plugin for #13085, and I noticed I was geting compile errors:

node_modules/@theia/plugin/src/theia-extra.d.ts:22:1 - error TS2668: 'export' modifier cannot be applied to ambient modules and module augmentations since they are always visible.

22 export module '@theia/plugin' {
   ~~~~~~

node_modules/@theia/plugin/src/theia.d.ts:49:1 - error TS2668: 'export' modifier cannot be applied to ambient modules and module augmentations since they are always visible.

49 export module '@theia/plugin' {
   ~~~~~~

node_modules/@theia/plugin/src/theia.d.ts:3738:9 - error TS2300: Duplicate identifier 'Production'.

3738         Production = 1,
             ~~~~~~~~~~

We never notice this in the compilation of the plugin package because *.d.ts files are not compiled and we have "skipLibCheck": true set in our compiler config.
The errors fall into two categories:

  1. We use export module where in VS Code they use declare module. That makes sense, since we don't actually define any types in the theia.d.ts files, we are just describing the types to the compiler
  2. We have duplicated types in some files

I'm not sure how we can detect these problems in the build process. Maybe we need to compile a sample plugin in our build process.

Steps to Reproduce:

Build anything against the package @theia/plugin with skipLibCheck: false.

Additional Information

  • Operating System:
  • Theia Version:
@tsmaeder tsmaeder changed the title There is Garbage in theia.d.ts and we don't notice it There are Type Errors in theia.d.ts and we don't notice it Nov 24, 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

No branches or pull requests

1 participant