I wanna change the express namespace in my typescript file and add another option to it, but eslint get some errors,
declare global {
namespace Express {
interface Request {
currentUser?: User;
}
}
}
Error is: ES2015 module syntax is preferred over namespaces.
how can i fix this error except change ts rules
You can do it like this:
declare module 'express' {
export interface Request {
currentUser?: User;
}
}
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