fix: add override keyword to Lit component lifecycle methods#535
Open
abalmush wants to merge 1 commit intogoogle:mainfrom
Open
fix: add override keyword to Lit component lifecycle methods#535abalmush wants to merge 1 commit intogoogle:mainfrom
abalmush wants to merge 1 commit intogoogle:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request correctly adds the override keyword to Lit component lifecycle methods across multiple files, which is a great improvement for code clarity and to satisfy compiler requirements. My review focuses on a related improvement: adding explicit return types to these same lifecycle methods. Many methods like render, firstUpdated, and willUpdate are missing explicit return types, and adding them would further enhance type safety and maintainability. I've added several suggestions for render and firstUpdated methods. The same principle applies to the multi-line willUpdate signatures, which should also be updated to include a : void return type.
5c77210 to
aaf97df
Compare
Add the TypeScript `override` keyword to all Lit component methods that override parent class methods. This is required for Google's internal repository compilation. Methods updated: - render() - connectedCallback() - disconnectedCallback() - firstUpdated() - willUpdate() Fixes google#463
aaf97df to
7f67fe5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add the TypeScript
overridekeyword to all Lit component methods that override parent class methods. This is required for Google's internal repository compilation.Methods updated:
Fixes #463