-
-
Notifications
You must be signed in to change notification settings - Fork 211
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
Port RecentListens to Typescript #791
Conversation
c699938
to
ff4d969
Compare
ce7d0fc
to
24e0fe5
Compare
@@ -141,7 +141,6 @@ export default class SpotifyPlayer extends React.Component< | |||
} | |||
this.handleWarning("Could not find track on Spotify"); | |||
this.playNextTrack(); | |||
return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extra return statements, removed by the linter. I checked if player was working as expected and the alert bug didn't appear. This should be safe to remove.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, I'm assuming we'll add the snapshot tests in a future pull request?
Description
We're moving over to Typescript for our frontend code. This pull request migrates the profile.jsx file to typescript.
We also do some linting fixes here.
Problem
The LB frontend code is very hard to read or modify because it's complex and javascript provides no guarantee of what is available where etc.
Solution
Use typescript instead, which helps us have types on react components and functions and catch errors at compile time.
The linter has also caught a few actual bugs too.