Reputation: 28940
I have the following index.d.ts
file:
declare module 'mytypes' {
interface Constructor<T> {
new (...args: any[]): T;
}
//etc.
VSCode highlights the interface keyword:
Parsing error: Only declares and type imports are allowed inside declare module
1 | declare module 'someproject' {
> 2 | interface Constructor<T> {
| ^
3 | new (...args: any[]): T;
4 | }
5 |eslint
Looks like an eslint error but I cannot tell which from the error message
Upvotes: 8
Views: 8653
Reputation: 391
You can add .eslintignore
/**/*.d.ts
The eslint rule mistakenly treats d.ts as js
Upvotes: 39