Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By nod_ on
Change record status:
Published (View all published change records)
Project:
Introduced in branch:
8.x
Issue links:
Description:
In Drupal 7, none of the JavaScript files were indented within the file-level closure. Starting with Drupal 8, The "indent" option of JSHint was added to the default configuration to allow for code indentation validation. It means that all the code within the file-level closure needs to be indented. This change will allow for automated formating tools to be run on Drupal JavaScript.
Drupal 7
(function ($, Drupal) {
"use strict";
Drupal.behavior.something = {};
})(jQuery, Drupal);
Drupal 8
(function ($, Drupal) {
"use strict";
Drupal.behavior.something = {};
})(jQuery, Drupal);
Impacts:
Site builders, administrators, editors
Module developers
Themers