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

Add JSHint support and enable strict mode #379

Merged
merged 7 commits into from
Mar 5, 2014
Merged

Add JSHint support and enable strict mode #379

merged 7 commits into from
Mar 5, 2014

Conversation

XhmikosR
Copy link
Member

@XhmikosR XhmikosR commented Mar 3, 2014

Fixes #280. Fixes #285.

TODO:

  • Check the global directives
  • Fix the device image isn't updated with the component used.
  • Agree on the JSHint options
  • Enable bitwise and immed, remove boss

/CC @connor @connors @cvrebert @mdo

@XhmikosR
Copy link
Member Author

XhmikosR commented Mar 3, 2014

On a side note, I face the same issue I describe in #378 in this branch too :/

EDIT: correction, the device navbar shows up and works, the device image isn't updated with the component used.

@XhmikosR XhmikosR added the grunt label Mar 3, 2014
@XhmikosR XhmikosR added this to the 2.0.1 milestone Mar 3, 2014
@XhmikosR XhmikosR self-assigned this Mar 3, 2014
@XhmikosR XhmikosR mentioned this pull request Mar 3, 2014
@XhmikosR
Copy link
Member Author

XhmikosR commented Mar 3, 2014

PR updated. I added a small TODO in the description for the things we need to sort.

src: 'js/*.js'
},
docs: {
src: ['docs/assets/js/docs.js', 'docs/assets/js/fingerblast.js']
Copy link
Contributor

Choose a reason for hiding this comment

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

can/should we do something like: docs/assets/js/*.js?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, but that folder might have more files like docs.min.js (see the uglify PR)

Copy link
Contributor

Choose a reason for hiding this comment

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

Cool

@connor
Copy link
Contributor

connor commented Mar 3, 2014

Let's stay consistent with the bootstrap jshintrc. What do you think about that?

@XhmikosR
Copy link
Member Author

XhmikosR commented Mar 3, 2014

At the moment, it makes more sense to use the options I used. Semicolons are already being used in most of the codebase; the rest are similar to Bootstrap except for eqeqeq which is also being used already.

I'm personally used to those 2 and I find Bootstrap's style a little weird, but it all comes down to one's personal taste. :) So if everyone wants to use the same options as Bootstrap that's ok, we can bring it on par.

PS. There's still a Bootstrap PR twbs/bootstrap#12853, but I'll leave this for when we merge it.

@cvrebert
Copy link
Contributor

cvrebert commented Mar 3, 2014

I'm +1 on not slavishly following Bootstrap's jshintrc, and sticking with a more conventional code style.

{
"boss" : true,
"browser" : true,
"debug" : true,
Copy link
Contributor

Choose a reason for hiding this comment

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

Are debug and devel actually necessary to make the code pass?

Copy link
Member Author

Choose a reason for hiding this comment

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

No, I think they are just remnants. I'll double check later.

Copy link
Member Author

Choose a reason for hiding this comment

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

devel is needed.

Copy link
Contributor

Choose a reason for hiding this comment

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

We might be able to get around it by using window.alert() instead of alert(), etc.

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't mind if you want to do that yourself but I think it should be part of another PR; this one has already grown big.


From: Chris Rebert [email protected]
To: twbs/ratchet [email protected]
Cc: XhmikosR [email protected]
Sent: Monday, March 3, 2014 8:53 PM
Subject: Re: [ratchet] Add JSHint support and enable strict mode (#379)

In js/.jshintrc:

@@ -0,0 +1,17 @@
+{

  • "boss" : true,
  • "browser" : true,
  • "debug" : true,
    We might be able to get around it by using window.alert() instead of alert(), etc.

    Reply to this email directly or view it on GitHub.

Copy link
Contributor

Choose a reason for hiding this comment

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

Fair point.

@cvrebert
Copy link
Contributor

cvrebert commented Mar 3, 2014

So, how would folks feel about "curly": true?
(See also: the recent Apple SSL bug.)

@XhmikosR
Copy link
Member Author

XhmikosR commented Mar 3, 2014

I like using curly braces.

@mdo
Copy link
Member

mdo commented Mar 3, 2014

Don't feel bound to Bootstrap's conventions. The two libraries are separate and don't need 100% parity for the time being. We can work to improve that in future major releases :).

@cvrebert cvrebert mentioned this pull request Mar 3, 2014
@XhmikosR
Copy link
Member Author

XhmikosR commented Mar 4, 2014

This PR is ready, and everything works fine (like before, at least on desktop).

I'll wait for the final comments on the JSHint's options, and then rebase and merge if everyone agrees.

@XhmikosR XhmikosR added the js label Mar 4, 2014
@cvrebert
Copy link
Contributor

cvrebert commented Mar 4, 2014

+1 bitwise, +1 immed, -1 boss, -1 laxbreak, -1 validthis. I'm in full agreement with everything else.
But I ultimately defer to Connor M., and these are but minor quibbles compared to the overall huge win, so I don't think it's worth delaying the PR over them.

@XhmikosR
Copy link
Member Author

XhmikosR commented Mar 4, 2014

I'll wait for the others too and adapt the PR later. I agree with all those you mention but since they yield many warnings I skipped them IIRC. Now, the situation might be better, I'll need to double check.

@XhmikosR
Copy link
Member Author

XhmikosR commented Mar 4, 2014

All done @cvrebert.

Let's stop adding stuff so that we finally merge this 👯

@connors
Copy link
Collaborator

connors commented Mar 4, 2014

@cvrebert and @connor I'll leave the final 👍 to you guys.

@XhmikosR
Copy link
Member Author

XhmikosR commented Mar 5, 2014

So, what should I do with this guys? I'll still need to rebase the branch to squash a few patches if they stay as they are now.

@XhmikosR XhmikosR modified the milestones: 2.0.2, 2.0.1 Mar 5, 2014
@connor
Copy link
Contributor

connor commented Mar 5, 2014

Cool. What you've got is 👍 for me.

@XhmikosR XhmikosR added this to the 2.0.1 milestone Mar 5, 2014
@XhmikosR XhmikosR removed this from the 2.0.2 milestone Mar 5, 2014
zlatanvasovic and others added 5 commits March 5, 2014 09:09
Enabled:

* `immed`
* `newcap`
* `latedef`

Removed:

* `boss`
* `laxbreak`
* `validthis`

Also move `bitwise` to fingerblast.js since that's where it's only needed.
@cvrebert
Copy link
Contributor

cvrebert commented Mar 5, 2014

👍 ❤️

@mdo mdo mentioned this pull request Mar 5, 2014
XhmikosR added a commit that referenced this pull request Mar 5, 2014
Add JSHint support and enable strict mode
@XhmikosR XhmikosR merged commit 9e29f6d into master Mar 5, 2014
@XhmikosR XhmikosR deleted the jshint branch March 5, 2014 07:10
@XhmikosR
Copy link
Member Author

XhmikosR commented Mar 5, 2014

Hopefully, nothing broke :)

@cvrebert
Copy link
Contributor

cvrebert commented Mar 5, 2014

🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

consider using JS strict mode add JSHint and/or JSCS task to Gruntfile?
6 participants