Skip to content

package.json types per TypeScript version are not supported #928

Description

@agross

Describe the bug

I just learned that TypeScript's package.json "extensions" support not only the types element, but also types depending on the TypeScript version.

https://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html#version-selection-with-typesversions

rxjs@7 is a package that I want to use. It has this kind of types declaration. ioBroker.javascript is unfortunately totally unaware of this, which causes a lot of red squiggles in the editor and perhaps also most of the compiler errors I currently see with the perfectly fine script.

To Reproduce
Steps to reproduce the behavior:

  1. Install rxjs@7 and add syntax help for rxjs
  2. Create a new TypeScript script with:
    import { Observable } from 'rxjs';
    
    const x = new Observable<number>();
  3. Start script
  4. See error:
    const x = new Observable<number>();
              ^
    ERROR: Untyped function calls may not accept type arguments.
    

Expected behavior

Code compiles.

Versions:

  • Adapter version: 5.2.18
  • JS-Controller version: 3.3.22
  • Node version: 12.22
  • Operating system: docker

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions