Active
Project:
Coding Standards
Component:
Documentation
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
20 Jun 2026 at 03:01 UTC
Updated:
20 Jun 2026 at 03:01 UTC
Jump to comment: Most recent
Since Drupal core adopted Prettier formatting for JavaScript - see Use Prettier for formatting core JavaScript all the way back in Drupal 8.7 - the Stroustrup style brace rule have been replaced 1TBS (One True Brace Style) one.
Stroustrup style brace
if (condition1 || condition2) {
action1();
}
else if (condition3 && condition4) {
action2();
}
else {
defaultAction();
}
1TBS
if (condition1 || condition2) {
action1();
} else if (condition3 && condition4) {
action2();
} else {
defaultAction();
}
The JavaScript coding standard documentation page still shows the Stroustrup style braces.
Drupal core has already adopted this change, as seen in the issue - Use Prettier for formatting core JavaScript.
Make the default brace-style rule examples on the documentation site to align with core's 1TBS.
Particularly on the JavaScript coding standards page examples related to if/else and try/catch blocks.
Comments