[wp-trac] [WordPress Trac] #50145: Site Health - Defensively handle empty/improperly formed test results

WordPress Trac noreply at wordpress.org
Sat Jul 4 20:20:07 UTC 2020


#50145: Site Health - Defensively handle empty/improperly formed test results
-----------------------------------------------------+---------------------
 Reporter:  dogwithblog                              |       Owner:  (none)
     Type:  defect (bug)                             |      Status:  new
 Priority:  normal                                   |   Milestone:  5.5
Component:  Site Health                              |     Version:
 Severity:  normal                                   |  Resolution:
 Keywords:  has-screenshots has-patch needs-refresh  |     Focuses:
-----------------------------------------------------+---------------------
Changes (by SergeyBiryukov):

 * keywords:  has-screenshots has-patch commit => has-screenshots has-patch
     needs-refresh


Comment:

 [attachment:"50546.diff"] is a refresh of https://github.com/WordPress
 /wordpress-develop/pull/349.diff.

 It seems to work well in my testing, however it also introduces some
 JSHint issues that would result in test failures:
 {{{
 Running "jshint:core" (jshint) task
 src/js/_enqueues/admin/site-health.js
 108 |    Object.entries( minimumExpected ).forEach( ( [ key, value ] ) =>
 {
                                                     ^ 'destructuring
 binding' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions
 (use moz).
 108 |    Object.entries( minimumExpected ).forEach( ( [ key, value ] ) =>
 {
                                                                      ^
 'arrow function syntax (=>)' is only available in ES6 (use 'esversion:
 6').
 110 |            Object.entries( value ).forEach( ( [ subKey, subValue ] )
 => {
                                                   ^ 'destructuring
 binding' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions
 (use moz).
 110 |            Object.entries( value ).forEach( ( [ subKey, subValue ] )
 => {
                                                                          ^
 'arrow function syntax (=>)' is only available in ES6 (use 'esversion:
 6').
 }}}

 Core currently uses the `"esversion": 3` setting (ECMAScript 3) in
 `.jshintrc`.

 Would it be possible to rewrite the patch for compatibility with the
 current core standard?

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/50145#comment:8>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list