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
You can add .eslintignore
/**/*.d.ts
The eslint rule mistakenly treats d.ts as js
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With