-
-
Notifications
You must be signed in to change notification settings - Fork 632
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeScript plugins do not build with noImplicitAny: true in 1.6.0 #998
Comments
Digging deeper, this is an issue in hap-nodejs, not in homebridge itself. hap-nodejs defines ambient types for dbus-native already but it doesn’t export those. One possibility could be to submit the ambient types to https://github.com/DefinitelyTyped/DefinitelyTyped/ |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue has been closed as no further activity has occurred. |
This is a bug / regression to be sure. @Supereg - any direction on how you want to deal with this one? Current workaround is to lock plugin builds to Homebridge 1.5.1...works, but not ideal. |
As you found out, we provide an incomplete type declaration file for dbus-native (as it is only used within the project itself). Isn't that enough to package the |
Good point, shipping the ambient declaration should work just fine |
But then the question is, why did the TypeScript compiler complain? Is there anything wrong with our type definition? |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue has been closed as no further activity has occurred. |
This issue has been closed as no further activity has occurred. |
This issue was fixed in the latest beta release and will come live with hap-nodejs 0.11.1 and homebridge 1.6.1. |
Analysis
Plugins that use TypeScript and are configured with
noImplicitAny: true
intsconfig.json
will fail the build with this error:The reason is that
Advertiser.ts
includesInvokeError
from the@homebridge/dbus-native
fork and that lacks type information.A possible workaround is to define an ambient type in the plugin project like so:
See lstrojny/homebridge-prometheus-exporter@ab161aa
It would probably be a good idea to change configure TypeScript in homebridge with
noImplicitAny
as well to catch accidental unsafe types.Expected Behavior
Projects should build
Steps To Reproduce
noImplicitAny
totrue
intsconfig.json
tsc
Logs
Configuration
n.a.
Environment
n.a.
Process Supervisor
not applicable
Additional Context
No response
The text was updated successfully, but these errors were encountered: