question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Invalid typescript file

See original GitHub issue

Currently I’m using "graphql-binding": "^2.1.1" to generate my own bindings. The file that is being generated contains:


export interface BindingConstructor<T> {
  new(...args): T
}

and the compiler complains: [ts] Rest parameter 'args' implicitly has an 'any[]' type.

I am kind of confused by how these should be typed otherwise I’d have submitted a PR. Or is it the case of explicitly typing it as any[]?

Thanks! 👍

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:5
  • Comments:5

github_iconTop GitHub Comments

1reaction
lucasavila00commented, Jul 17, 2018

On the github docs sample there is the same error: https://github.com/graphql-binding/graphql-binding-github/blob/master/src/generated-binding.ts#L80

Typescript has been adding changes related to rest-spread later, so it may be the case that just now the compiler started complaining.

0reactions
lucasavila00commented, Dec 28, 2018

Fixed 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

Invalid Typescript File · Issue #25 · allenhwkim/ngentest - GitHub
when i run ngentest app.component.ts, i get: Error. invalid typescript file. e.g., Usage $0 [options] my ngentest.config.js file: const fs ...
Read more >
Getting invalid typescript errors in valid TS code - Stack Overflow
I am having a create-react-app (v17.0.2) with typescript (v4.5.5). I am getting typescript errors even in valid TS code.
Read more >
ae-wrong-input-file-type - API Extractor
Unlike some other tools, API Extractor does not process TypeScript source files directly. Instead, it is designed to analyze the .d.ts files that...
Read more >
TypeScript errors and how to fix them
export function logSomething(error: unknown): void;. Alternatively, you can write your function implementation inside a source code file ( *.ts ). TS1192.
Read more >
Documentation - Do's and Don'ts - TypeScript
Recommendations for writing d.ts files. ... WRONG */. function reverse(s: String): String;. ✓ Do use the types number , string , boolean ,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found