[Bug 9284] New: JavaScript should conform to coding guidelines recommended by JSHint
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9284 Bug ID: 9284 Summary: JavaScript should conform to coding guidelines recommended by JSHint Classification: Unclassified Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Templates Assignee: oleonard@myacpl.org Reporter: oleonard@myacpl.org JSHint can be used to check JavaScript for errors and potential problems. It can be installed on a variety of platforms and integrated into various editors: http://www.jshint.com/platforms/ I propose that we use JSHint with default settings as a set of coding guidelines for JavaScript in Koha, and that patches correcting errors be attached to this omnibus bug. Some typical JSHint errors for example: js/additem.js: line 3, col 52, Missing radix parameter. js/additem.js: line 5, col 41, Use '!==' to compare with '0'. js/additem.js: line 68, col 25, Use '===' to compare with 'undefined'. js/additem.js: line 122, col 58, Missing semicolon. js/additem.js: line 206, col 21, Bad line breaking before '+'. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9284 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9284 --- Comment #1 from Owen Leonard <oleonard@myacpl.org> --- Created attachment 14145 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=14145&action=edit Bug 9284 - JavaScript should follow rules recommended by JSHint Coding style corrections to members.js: - Mixed tab/space indentation converted to spaces. - Converted "!=" and "==" to "!==" and "===" for comparisons with ''. - Adding missing semicolons. To test, create or edit a patron and confirm that validation hasn't been broken by the changes to members.js: Invalid date, empty required fields, guarantor popup, restricted-until field display, etc. http://bugs.koha-community.org/show_bug.cgi?id=9281 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9284 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #14145|0 |1 is obsolete| | --- Comment #2 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 14249 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=14249&action=edit Bug 9284 - JavaScript should follow rules recommended by JSHint Coding style corrections to members.js: - Mixed tab/space indentation converted to spaces. - Converted "!=" and "==" to "!==" and "===" for comparisons with ''. - Adding missing semicolons. To test, create or edit a patron and confirm that validation hasn't been broken by the changes to members.js: Invalid date, empty required fields, guarantor popup, restricted-until field display, etc. http://bugs.koha-community.org/show_bug.cgi?id=9281 Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9284 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off CC| |kyle@bywatersolutions.com -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9284 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA CC| |jonathan.druart@biblibre.co | |m QA Contact| |jonathan.druart@biblibre.co | |m --- Comment #3 from Jonathan Druart <jonathan.druart@biblibre.com> --- QA Comments: This patch only changes 7 lines substituting the js comparison operators (!= with !== and == with ===) in the members.js file. No behaviour changed. Marked as Passed QA. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9284 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #14249|0 |1 is obsolete| | --- Comment #4 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 14260 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=14260&action=edit Bug 9284 - JavaScript should follow rules recommended by JSHint Coding style corrections to members.js: - Mixed tab/space indentation converted to spaces. - Converted "!=" and "==" to "!==" and "===" for comparisons with ''. - Adding missing semicolons. To test, create or edit a patron and confirm that validation hasn't been broken by the changes to members.js: Invalid date, empty required fields, guarantor popup, restricted-until field display, etc. http://bugs.koha-community.org/show_bug.cgi?id=9281 Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9284 Jared Camins-Esakov <jcamins@cpbibliography.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master --- Comment #5 from Jared Camins-Esakov <jcamins@cpbibliography.com> --- This patch has been pushed to master. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9284 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Master |Pushed to Stable CC| |chris@bigballofwax.co.nz Patch complexity|--- |Trivial patch --- Comment #6 from Chris Cormack <chris@bigballofwax.co.nz> --- Pushed to 3.8.x and 3.10.x will be in 3.8.9 and 3.10.2 -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org