[wp-trac] [WordPress Trac] #64558: CodeMirror: JavaScript linting is incompatible with newer language features
WordPress Trac
noreply at wordpress.org
Tue Jan 27 20:28:11 UTC 2026
#64558: CodeMirror: JavaScript linting is incompatible with newer language features
--------------------------------+-------------------------
Reporter: westonruter | Owner: westonruter
Type: defect (bug) | Status: assigned
Priority: normal | Milestone: 7.0
Component: External Libraries | Version: 4.9.3
Severity: normal | Keywords:
Focuses: javascript |
--------------------------------+-------------------------
In #42850 (r42547), JSHint was replaced with Esprima due to the former
having a GPL-incompatible license. However, the
[https://www.npmjs.com/package/esprima `esprima` package] has not been
updated since July 2018. Because it hasn't been updated in so long, it
does not support "newer" syntax ECMAScript syntax (since 2020) like
dynamic imports, optional chaining, and nullish coalescing:
{{{#!js
async function getMod() {
const mod = await import( 'https://example.com/module.js' );
// ❌ ------------^
return mod;
}
const baz = window?.foo?.bar?.baz;
// ❌ -------------^
const quux = baz ?? 'baz';
// ❌ ------------^
}}}
The [https://www.npmjs.com/package/espree Espree project] (part of ESLint)
is an actively-maintained substitute for Esprima.
As a follow-up to #48456 (r61539) which upgraded CodeMirror to the latest
v5 and Esprima (from 4.0.0 to 4.0.1), we can now do a better upgrade by
using Espree instead of Esprima.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/64558>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list