[wp-trac] [WordPress Trac] #61500: Script Modules: Allow scripts to depend on modules
WordPress Trac
noreply at wordpress.org
Tue Feb 10 22:30:09 UTC 2026
#61500: Script Modules: Allow scripts to depend on modules
-------------------------------------+-------------------------------------
Reporter: jonsurrell | Owner: westonruter
Type: enhancement | Status: closed
Priority: normal | Milestone: 7.0
Component: Script Loader | Version: 6.5
Severity: normal | Resolution: fixed
Keywords: has-patch has-unit- | Focuses: javascript,
tests commit needs-dev-note | performance
-------------------------------------+-------------------------------------
Comment (by westonruter):
In [changeset:"61611" 61611]:
{{{
#!CommitTicketReference repository="" revision="61611"
Code Editor: Switch from Esprima to Espree for JavaScript linting in
CodeMirror.
Esprima is no longer maintained, and it does not support the latest
JavaScript features in ES11, as Espree does.
- **New Linter Integration:** Introduces
`src/js/_enqueues/vendor/codemirror/javascript-lint.js` using `espree` for
parsing and error reporting, replacing the dependency on `jshint` and
`esprima` scripts.
- **Script Modules:** Registers `espree` as a script module and leverages
the `module_dependencies` argument in `wp_register_script()` to ensure
`espree` is available as a dynamic import.
- **Editor Settings:** Updates `wp_get_code_editor_settings()` to use ES11
(ECMAScript 2020) defaults and synchronizes JSHint settings from
`.jshintrc` for compatibility.
- **Editable Extensions:** Adds `.mjs` to the list of editable file
extensions for plugins and themes.
- **Deprecations:** Marks `esprima` and `jshint` script handles as
deprecated.
- **Build Tools:** Updates Webpack configuration to bundle `espree` as a
module and use the new local `javascript-lint.js`.
Developed in https://github.com/WordPress/wordpress-develop/pull/10806
Follow-up to [61587], [61544], [61539], [42547].
Props westonruter, jonsurrell.
See #64562, #61500, #48456, #42850.
Fixes #64558.
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/61500#comment:24>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list