Skip to content
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

Merged
merged 6 commits into from Oct 6, 2015
Merged

Conversation

samdutton
Copy link
Contributor

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:

  • A single value (0, 1 or 2) representing severity: the rule is off, a warning, or an error.
  • An array with a severity value followed by other parameters.

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

},
strict: {
options: {
import: 2
},
src: ['src/content/**/*.css',
'!src/content/**/*_nolint.css'
'!src/content/**/*_nolint.css'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be indented

Copy link
Contributor Author

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.

@KaptenJansson
Copy link
Contributor

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*/
Copy link
Contributor

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?

Copy link
Contributor Author

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...

Copy link
Contributor

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good one! Changed.

@KaptenJansson
Copy link
Contributor

LGTM

KaptenJansson added a commit that referenced this pull request Oct 6, 2015
Move from JSHint and JSCS to ESLint
@KaptenJansson KaptenJansson merged commit 5e78d1b into webrtc:gh-pages Oct 6, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants