[wp-trac] [WordPress Trac] #25947: jshint shouldn't throw errors: wp-admin/js/editor.js
WordPress Trac
noreply at wordpress.org
Thu Nov 14 06:01:16 UTC 2013
#25947: jshint shouldn't throw errors: wp-admin/js/editor.js
--------------------------+------------------------------
Reporter: dougwollison | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Build Tools | Version:
Severity: normal | Resolution:
Keywords: has-patch |
--------------------------+------------------------------
Comment (by nacin):
Hi dougwollison, thanks for the patch.
It looks like some query.php documentation snuck into this one. (Also:
wow, nice work!)
I tested out the patch and the spacing looks great. But it doesn't look
like anything was done to fix JSHint errors. :-)
Here's the ones I found when running it:
{{{
Running "jshint:core" (jshint) task
Linting src/wp-admin/js/editor.js ...ERROR
[L197:C109] W109: Strings must use singlequote.
pee = pee.replace( new RegExp( '<p>\\s*(</?(?:' + blocklist + ')(?:
[^>]*)?>)\\s*</p>', 'gi' ), "$1" );
Linting src/wp-admin/js/editor.js ...ERROR
[L201:C101] W109: Strings must use singlequote.
pee = pee.replace( new RegExp( '<p>\\s*(</?(?:' + blocklist + ')(?:
[^>]*)?>)', 'gi' ), "$1" );
Linting src/wp-admin/js/editor.js ...ERROR
[L202:C102] W109: Strings must use singlequote.
pee = pee.replace( new RegExp( '(</?(?:' + blocklist + ')(?:
[^>]*)?>)\\s*</p>', 'gi' ), "$1" );
Linting src/wp-admin/js/editor.js ...ERROR
[L204:C98] W109: Strings must use singlequote.
pee = pee.replace( new RegExp( '(</?(?:' + blocklist +
')[^>]*>)\\s*<br />', 'gi' ), "$1" );
Linting src/wp-admin/js/editor.js ...ERROR
[L16:C28] W117: 'tinyMCE' is not defined.
var t = this, ed = tinyMCE.get( id ), wrap_id, txtarea_el, dom =
tinymce.DOM;
Linting src/wp-admin/js/editor.js ...ERROR
[L16:C74] W117: 'tinymce' is not defined.
var t = this, ed = tinyMCE.get( id ), wrap_id, txtarea_el, dom =
tinymce.DOM;
Linting src/wp-admin/js/editor.js ...ERROR
[L33:C17] W117: 'QTags' is not defined.
QTags.closeAllTags( id );
Linting src/wp-admin/js/editor.js ...ERROR
[L35:C18] W117: 'tinyMCEPreInit' is not defined.
if ( tinyMCEPreInit.mceInit[ id ] && tinyMCEPreInit.mceInit[ id
].wpautop )
Linting src/wp-admin/js/editor.js ...ERROR
[L35:C50] W117: 'tinyMCEPreInit' is not defined.
if ( tinyMCEPreInit.mceInit[ id ] && tinyMCEPreInit.mceInit[ id
].wpautop )
Linting src/wp-admin/js/editor.js ...ERROR
[L41:C26] W117: 'tinymce' is not defined.
ed = new tinymce.Editor( id, tinyMCEPreInit.mceInit[ id ] );
Linting src/wp-admin/js/editor.js ...ERROR
[L41:C46] W117: 'tinyMCEPreInit' is not defined.
ed = new tinymce.Editor( id, tinyMCEPreInit.mceInit[ id ] );
Linting src/wp-admin/js/editor.js ...ERROR
[L47:C13] W117: 'setUserSetting' is not defined.
setUserSetting( 'editor', 'tinymce' );
Linting src/wp-admin/js/editor.js ...ERROR
[L58:C22] W117: 'tinyMCEPreInit' is not defined.
if ( tinyMCEPreInit.mceInit[ id ] && tinyMCEPreInit.mceInit[ id
].wpautop )
Linting src/wp-admin/js/editor.js ...ERROR
[L58:C54] W117: 'tinyMCEPreInit' is not defined.
if ( tinyMCEPreInit.mceInit[ id ] && tinyMCEPreInit.mceInit[ id
].wpautop )
Linting src/wp-admin/js/editor.js ...ERROR
[L66:C13] W117: 'setUserSetting' is not defined.
setUserSetting( 'editor', 'html' );
Linting src/wp-admin/js/editor.js ...ERROR
[L1:C18] W098: 'switchEditors' is defined but never used.
var switchEditors = {
}}}
"tinyMCE" should be "tinymce", "tinymce" should be declared as a global
(as should tinyMCEPreInit, QTags, setUserSetting, and switchEditors). The
others (single quotes) should be pretty simple.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/25947#comment:4>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list