[wp-trac] [WordPress Trac] #25778: jshint should throw no errors

WordPress Trac noreply at wordpress.org
Wed Oct 30 19:58:26 UTC 2013


#25778: jshint should throw no errors
--------------------------+------------------------------
 Reporter:  jorbin        |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  General       |     Version:
 Severity:  normal        |  Resolution:
 Keywords:                |
--------------------------+------------------------------
Changes (by kadamwhite):

 * cc: kadamwhite@… (added)


Comment:

 Some background from the wcbos contributor day: This JSHintRC is based on
 the jQuery project's jshintrc, per #25187.  Of existing styleguides, it
 was the closest to our preferences for whitespace and documentation rigor,
 and "how jQuery does it" has been invoked more than any other style guide
 when JS formatting comes up in trac. You may notice:

 * There's a LOT of errors!
 * Converting == to === (and != to !==) makes up the majority of the
 potentially functionality-impacting changes
 * {} around single-line `if` statements make up the majority of the less-
 likely-to-be-functionality-impacting changes

 gnarf37 & I proposed a file-by-file workthrough of the JS in the system;
 nacin suggested an alternative approach of picking one type of error at a
 time and working on more broad-based changes. My preference for the file-
 by-file option was based on the fact that you can thoroughly exercise that
 file's area of functionality, but I do see Nacin's point (a {} patch would
 be less risky than a threquals ticket, for example). Worth discussing.

--
Ticket URL: <http://core.trac.wordpress.org/ticket/25778#comment:1>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list