-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
videojs-standard #3459
videojs-standard #3459
Conversation
@@ -114,14 +114,6 @@ module.exports = function(grunt) { | |||
build: ['build/temp/*'], | |||
dist: ['dist/*'] | |||
}, | |||
jshint: { |
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.
This is a temporary step. The final PR in this series will restore automatic linting capabilities, but for now we want them off.
88402d9
to
2da6634
Compare
@@ -3,10 +3,7 @@ | |||
*/ | |||
import ClickableComponent from './clickable-component.js'; | |||
import Component from './component'; | |||
import * as Events from './utils/events.js'; |
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.
There are removals like this scattered around: they were unused modules.
Note: if we're only trying to import the module, we should be doing something like import './utils/events'
.
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.
doesn't import './utils/events.js'
put the exports into local scope? This is an issue for a "bag of functions" module.
import * Events from './utils/events.js'
is more explicit in what we want.
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.
I tend to agree, but the linter doesn't like unused variable names.
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.
if it isn't used then we shouldn't import it, sure.
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.
On the topic of using the import 'foo';
style, I don't think it puts the exports into local scope. I think it simply runs the module code. MDN says:
Import an entire module for side effects only, without importing any bindings.
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.
Same as require('foo.js');
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.
Ah, interesting. I guess that's exactly what we want in player.js
.
LGTM |
@@ -8,13 +8,13 @@ import assign from 'object.assign'; | |||
* | |||
* @param {Number} code The media error code | |||
*/ | |||
let MediaError = function(code){ | |||
let MediaError = function(code) { |
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.
noting it here (but we shouldn't make this change as part of linting) but this potentially can cause a problem on IE8 since on line 22 we do MediaError.defaultMessages
and IE8 is weird.
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.
Good catch. Switching to function MediaError(code) {
would solve that, right?
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.
Yup.
I merged all the disparate |
We are treating this as the "master" branch for standardization efforts. |
deddb6b
to
caf614e
Compare
20867da
to
99724c6
Compare
Landed! |
Description
As discussed in-person on Thursday, we are in a slight lull at the moment and this is a great opportunity to clean up the video.js source code (and tests) to pass videojs-standard linting and abandon jshint.
Specific Changes proposed
src/js/*.js
Requirements Checklist