Skip to content

Improvement: Get rid of ESLint warning in drawers.mustache #1107

@abias

Description

@abias

ESLint started to complain about a change in drawers.mustache:

theme/boost_union/templates/theme_boost/drawers.mustache
    [(#1) ESLint warning [no-multiple-empty-lines]: More than 2 blank lines not allowed. ( }); ), Line: 22 Column: 1](https://git.in.moodle.com/pluginsbot/moodle-plugins-snapshots/blob/83d8efeae73506e4b11a22f4c9c62f4e32128013/theme/boost_union/templates/theme_boost/drawers.mustache#L1)

This seems to be caused by this code:

{{#js}}
M.util.js_pending('theme_boost/loader');
require(['theme_boost/loader', 'theme_boost/drawer'{{#regions.offcanvas.hasblocks}},'theme_boost_union/offcanvas'{{/regions.offcanvas.hasblocks}}{{#includesmartmenu}}, 'theme_boost_union/smartmenu'{{/includesmartmenu}}{{#blockregionsdata.includeblockregionsamd}}, 'theme_boost_union/blockregions'{{/blockregionsdata.includeblockregionsamd}}], function(Loader, Drawer{{#regions.offcanvas.hasblocks}},OffCanvas{{/regions.offcanvas.hasblocks}}{{#includesmartmenu}}, SmartMenu{{/includesmartmenu}}{{#blockregionsdata.includeblockregionsamd}}, BlockRegions{{/blockregionsdata.includeblockregionsamd}}) {
    Drawer.init();
    M.util.js_complete('theme_boost/loader');
{{#regions.offcanvas.hasblocks}}OffCanvas.init();{{/regions.offcanvas.hasblocks}}
{{#includesmartmenu}}SmartMenu.init();{{/includesmartmenu}}
{{#blockregionsdata.outsideregions.verticaloffset}}BlockRegions.OutsideRegionsVerticalAlignment();{{/blockregionsdata.outsideregions.verticaloffset}}
});
{{/js}}

and the fact that, if this template is rendered, there might be 3 empty lines at the end of the Javascript section.

Metadata

Metadata

Assignees

No one assigned

    Labels

    affecting 5.0 onlySomething which only affects Moodle 5.0good first issueSomething which can be addressed by newcomers in reasonable timeimprovementSomething which improves an existing feature in some way (UX, UI, Design, Functionality)

    Projects

    Status

    Ready for DEV

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions