Don't extend `MongooseModuleOptions` from `Record<string, any>`
Closed this issue · 4 comments
parzhitsky commented
Is there an existing issue for this?
- I have searched the existing issues
Current behavior
The definition is too broad, property definitions are ignored, IntelliSense is not working, and there are no property suggestions (other than those from Promise
type):
Minimum reproduction code
Steps to reproduce
- Create an arbitrary *.ts file
npm i @nestjs/mongoose
import type { MongooseModuleOptions } from '@nestjs/mongoose/dist/interfaces/mongoose-options.interface'
- Define an object shaped as
MongooseModuleOptions
- Inspect object typings, properties, IntelliSense etc.
Expected behavior
The definition is specific, property definitions are picked up, and IntelliSense is working:
Package version
9.2.2
mongoose version
No response
NestJS version
No response
Node.js version
18.15.0
In which operating systems have you tested?
- macOS
- Windows
- Linux
Other
This is specifically a typings issue. The only fix needed is to remove extends Record<string, any>
from here:
https://github.com/nestjs/mongoose/blob/master/lib/interfaces/mongoose-options.interface.ts#L6
kamilmysliwiec commented
Would you like tor create a PR for this issue?
parzhitsky commented
Sure, on it
parzhitsky commented
PR ready 👆 (#1804), all checks have passed
kamilmysliwiec commented
Let's track this here #1804