[wp-trac] [WordPress Trac] #41870: Code Editor: Add grunt task for building new CodeMirror bundles from external dependencies

WordPress Trac noreply at wordpress.org
Tue Oct 17 05:17:39 UTC 2017


#41870: Code Editor: Add grunt task for building new CodeMirror bundles from
external dependencies
------------------------------+------------------------------
 Reporter:  westonruter       |       Owner:  adamsilverstein
     Type:  task (blessed)    |      Status:  assigned
 Priority:  high              |   Milestone:  4.9
Component:  Build/Test Tools  |     Version:
 Severity:  normal            |  Resolution:
 Keywords:  has-patch         |     Focuses:  javascript
------------------------------+------------------------------

Comment (by westonruter):

 @adamsilverstein It looks great!

 The only thing I see that needs to be changed is the HTMLHint dependency
 needs to refer to the [https://github.com/xwp/HTMLHint xwp/HTMLHint] fork
 on GitHub (as seen in the plugin's [https://github.com/WordPress/better-
 code-
 editing/blob/a31eb400a1e75c38ac7364affe5be5337a7d8b10/package.json#L49
 package.json]). The reason is that there is a bug in HTMLHint for which
 I've opened a [https://github.com/yaniswang/HTMLHint/pull/216 PR] but it
 has not been merged. Without this, the `globals` defined in the JSHint
 configuration are not properly passed, resulting in linting errors on each
 line when editing an HTML file that contains (yes, these will result in
 runtime errors too 😁):

 {{{
 <script>
 wp();
 Backbone();
 _();
 </script>
 }}}

 While if you edit a JS file these will not cause “not defined” warnings
 because they are declared in the [https://github.com/WordPress/wordpress-
 develop/blob/ee678ee1f5b8d81f6c64e4bce56550ca3610fb93/src/wp-includes
 /general-template.php#L3189-L3193 config]. But HTMLHint is failing to pass
 along these `globals`.

 Unfortunately HTMLHint hasn't been updated since February so I'm not sure
 when we'd be able to switch the dependency back to the origin.

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


More information about the wp-trac mailing list