inversify / InversifyJS

A powerful and lightweight inversion of control container for JavaScript & Node.js apps powered by TypeScript.
http://inversify.io/
MIT License
11.02k stars 712 forks source link

Fix `@targetName()` signature on TypeScript 5 #1561

Open gustavohenke opened 4 months ago

gustavohenke commented 4 months ago

Description

Title. Basically just makes it accept an undefined value for targetKey, which stops TypeScript from complaining about it.

Related Issue

1556

Motivation and Context

I want to upgrade Typescript to v5 and use @targetName().

See https://devblogs.microsoft.com/typescript/announcing-typescript-5-0/#more-accurate-type-checking-for-parameter-decorators-in-constructors-under-experimentaldecorators

How Has This Been Tested?

Not a functional change, but rather a type change. That said, npm teststill passes. Furthermore, TypeScript v5.x.x no longer shows errors when using @targetName().

Types of changes

Checklist:

gustavohenke commented 3 weeks ago

...is anyone in here?