Skip to content
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

refactor: default to noImplicitOverride #42

Merged
merged 1 commit into from
Sep 24, 2024
Merged

refactor: default to noImplicitOverride #42

merged 1 commit into from
Sep 24, 2024

Conversation

GeekyEggo
Copy link
Member

Overriding methods in TypeScript is easy... too easy. This pull request adds the override keyword, and defaults to noImplicitOverride. This protects us from future changes that might go unnoticed, for example:

Before - no override keyword, and noImplicitOverride set to false.

  1. A future change in @elgato/streamdeck renames onWillDisappear to onDisappear.
  2. The plugin builds.
  3. The plugin doesn't receive the onDisappear event as the method is overriding onWillDisappear.
  4. The plugin breaks quietly.

After - override keyword and noImplicitOverride set to true.

  1. A future change in @elgato/streamdeck renames onWillDisappear to onDisappear.
  2. The plugin build fails.
  3. The Maker updates onWillDisappear to be onDisappear as part of the upgrade, and everything works.

@GeekyEggo GeekyEggo merged commit 14cb373 into main Sep 24, 2024
4 checks passed
@GeekyEggo GeekyEggo deleted the override branch September 24, 2024 21:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants