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
Move from JSHint and JSCS to ESLint #655
Conversation
}, | ||
strict: { | ||
options: { | ||
import: 2 | ||
}, | ||
src: ['src/content/**/*.css', | ||
'!src/content/**/*_nolint.css' | ||
'!src/content/**/*_nolint.css' |
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 should be indented
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.
In the commit for this, I've actually moved these onto one line.
Good stuff! Thanks for doing this. |
@@ -68,11 +68,11 @@ function gotStream(stream) { | |||
var filteredStream = webAudio.applyFilter(stream); | |||
|
|||
var servers = null; | |||
|
|||
pc1 = new webkitRTCPeerConnection(servers); // jscs:ignore requireCapitalizedConstructors | |||
/*eslint new-cap: 0*/ |
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'm curious, does this turn it off for the whole file or is it smart and registers the offending Constructor and ignore all of them?
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 played around with this.
The latest comment in the code seems to set the rule for the whole file: adding /*eslint new-cap: 2*/
after the first declaration seems to cause both lines to get a warning. Not ideal...
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.
Hmm, that means you cannot ignore explicitly, indeed not ideal.
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.
Could you try `//eslint-disable-line new-cap: 2 from http://stackoverflow.com/questions/27732209/turning-off-eslint-rule-for-a-specific-line/29592334#29592334 ?
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 one! Changed.
LGTM |
Move from JSHint and JSCS to ESLint
Implements #609 (which gives reasons for doing this).
Most changes to existing files are trivial fixes to validate against the ESLint rules. Also made a couple of other minor updates along the way, and I moved .csslintrc to the top level directory along with .eslintrc.
The rule list in .eslintrc extends the eslint-recommended set, which apparently matches the Google styleguide almost exactly.
Each rule can have:
More information about ESLint rules here. Rules listed as 'recommended' are on by default. I've set these to match our rules, but feel free to add others.
Once we're happy with this for the samples, we should probably use it for the other repos.
@KaptenJansson PTAL
@fippo @juberti FYI