-
-
Notifications
You must be signed in to change notification settings - Fork 235
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
Force return types and arrow callbacks on functions #466
Conversation
Codecov Report
@@ Coverage Diff @@
## master #466 +/- ##
======================================
Coverage 0.62% 0.62%
======================================
Files 77 77
Lines 2073 2073
Branches 294 294
======================================
Hits 13 13
Misses 2059 2059
Partials 1 1
Continue to review full report at Codecov.
|
Maybe a simple global mixin to wrap the calls to i18n? |
@ThibaultNocchi Just found this: kazupon/vue-i18n#410 (comment) Making a commit to replace all occurences EDIT: I discovered it has two advantages and one disadvange though: Advantages
Disadvantages
Overall, anyway, I think it's a good change, as it's also a more feature complete version of |
@ferferga In the Vue i18n API, |
@ThibaultNocchi That's what they say but doesn't translate into practice 🤷♂️ |
6e18324
to
7c559ab
Compare
function supportsAc3InHls(videoTestElement: HTMLVideoElement) { | ||
function supportsAc3InHls( | ||
videoTestElement: HTMLVideoElement | ||
): boolean | string { |
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.
): boolean | string { | |
): boolean { |
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.
@camc314 This function also returns the string from the canPlayType
https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/canPlayType
@@ -57,7 +57,7 @@ function hasMp2AudioSupport(): boolean { | |||
* @param {HTMLVideoElement} videoTestElement A HTML video element for testing codecs | |||
* @returns {boolean} Determines if browserr has DTS audio support | |||
*/ | |||
function hasDtsSupport(videoTestElement: HTMLVideoElement) { | |||
function hasDtsSupport(videoTestElement: HTMLVideoElement): boolean | string { |
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.
function hasDtsSupport(videoTestElement: HTMLVideoElement): boolean | string { | |
function hasDtsSupport(videoTestElement: HTMLVideoElement): boolean { |
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.
@camc314 Same as above
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.
LGTM
c409ac9
to
dcb69d8
Compare
Kudos, SonarCloud Quality Gate passed!
|
Added a rule for enforcing return types on all the functions, which should help us with type checking across all the code
We should also investigate how we can get
VueI18n
to return strings instead ofTranslateResult
, so we don't need to invoketoString()
or do any string casting.