How to fix A required parameter cannot follow an optional parameter in TypeScript | DevErrors