Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/wp-admin/includes/file.php
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ function wp_get_plugin_file_editable_extensions( $plugin ) {
'inc',
'include',
'js',
'mjs',
'json',
'jsx',
'less',
Expand Down Expand Up @@ -261,6 +262,7 @@ function wp_get_theme_file_editable_extensions( $theme ) {
'inc',
'include',
'js',
'mjs',
'json',
'jsx',
'less',
Expand Down
2 changes: 2 additions & 0 deletions src/wp-includes/general-template.php
Original file line number Diff line number Diff line change
Expand Up @@ -4152,6 +4152,7 @@ function wp_get_code_editor_settings( $args ) {
),
'jshint' => array(
'esversion' => 11,
'module' => str_ends_with( $args['file'] ?? '', '.mjs' ),

// The following JSHint *linting rule* options are copied from
// <https://github.com/WordPress/wordpress-develop/blob/6.9.0/.jshintrc>.
Expand Down Expand Up @@ -4239,6 +4240,7 @@ function wp_get_code_editor_settings( $args ) {
$type = 'message/http';
break;
case 'js':
case 'mjs':
$type = 'text/javascript';
break;
case 'json':
Expand Down