ioBroker.javascript icon indicating copy to clipboard operation
ioBroker.javascript copied to clipboard

package.json types per TypeScript version are not supported

Open agross opened this issue 4 years ago • 0 comments

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

agross avatar Dec 20 '21 22:12 agross