cleanup: Require "dangling" commas

Since ES5, trailing commas in arrays and object literals are valid.
We generally haven't used them so far, but they are actually a good
idea, as they make additions and removals in diffs much cleaner.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/805
This commit is contained in:
Florian Müllner
2019-08-20 23:43:54 +02:00
committed by Georges Basile Stavracas Neto
parent 07cc84f632
commit ebf77748a8
81 changed files with 452 additions and 445 deletions

View File

@ -138,11 +138,11 @@ var BaseAppView = GObject.registerClass({
'use-pagination': GObject.ParamSpec.boolean(
'use-pagination', 'use-pagination', 'use-pagination',
GObject.ParamFlags.READWRITE | GObject.ParamFlags.CONSTRUCT_ONLY,
false)
false),
},
Signals: {
'view-loaded': {},
}
},
}, class BaseAppView extends St.Widget {
_init(params = {}, gridParams) {
super._init(params);
@ -151,7 +151,7 @@ var BaseAppView = GObject.registerClass({
columnLimit: MAX_COLUMNS,
minRows: MIN_ROWS,
minColumns: MIN_COLUMNS,
padWithSpacing: true
padWithSpacing: true,
}, true);
if (this.use_pagination)
@ -271,7 +271,7 @@ var BaseAppView = GObject.registerClass({
let params = {
duration: VIEWS_SWITCH_TIME,
mode: Clutter.AnimationMode.EASE_OUT_QUAD
mode: Clutter.AnimationMode.EASE_OUT_QUAD,
};
if (animationDirection == IconGrid.AnimationDirection.IN) {
this.show();
@ -292,20 +292,22 @@ var BaseAppView = GObject.registerClass({
});
var AllView = GObject.registerClass({
Signals: { 'space-ready': {} }
Signals: { 'space-ready': {} },
}, class AllView extends BaseAppView {
_init() {
super._init({
layout_manager: new Clutter.BinLayout(),
x_expand: true,
y_expand: true,
use_pagination: true
use_pagination: true,
});
this._scrollView = new St.ScrollView({ style_class: 'all-apps',
x_expand: true,
y_expand: true,
reactive: true, });
this._scrollView = new St.ScrollView({
style_class: 'all-apps',
x_expand: true,
y_expand: true,
reactive: true,
});
this.add_actor(this._scrollView);
this._grid._delegate = this;
@ -531,7 +533,7 @@ var AllView = GObject.registerClass({
opacity: 0,
duration: VIEWS_SWITCH_TIME,
mode: Clutter.AnimationMode.EASE_OUT_QUAD,
onComplete: () => (this.opacity = 255)
onComplete: () => (this.opacity = 255),
});
}
@ -587,7 +589,7 @@ var AllView = GObject.registerClass({
this._grid.currentPage = pageNumber;
this._adjustment.ease(this._grid.getPageY(pageNumber), {
mode: Clutter.AnimationMode.EASE_OUT_QUAD,
duration: time
duration: time,
});
this._pageIndicators.setCurrentPage(pageNumber);
@ -714,7 +716,7 @@ var AllView = GObject.registerClass({
this._items[id].ease({
opacity,
duration: INACTIVE_GRID_OPACITY_ANIMATION_TIME,
mode: Clutter.AnimationMode.EASE_OUT_QUAD
mode: Clutter.AnimationMode.EASE_OUT_QUAD,
});
}
}
@ -783,7 +785,7 @@ var AllView = GObject.registerClass({
_onDragBegin() {
this._dragMonitor = {
dragMotion: this._onDragMotion.bind(this)
dragMotion: this._onDragMotion.bind(this),
};
DND.addDragMonitor(this._dragMonitor);
}
@ -865,7 +867,7 @@ var AllView = GObject.registerClass({
let newFolderPath = this._folderSettings.path.concat('folders/', newFolderId, '/');
let newFolderSettings = new Gio.Settings({
schema_id: 'org.gnome.desktop.app-folders.folder',
path: newFolderPath
path: newFolderPath,
});
if (!newFolderSettings) {
log('Error creating new folder');
@ -893,7 +895,7 @@ class FrequentView extends BaseAppView {
style_class: 'frequent-apps',
layout_manager: new Clutter.BinLayout(),
x_expand: true,
y_expand: true
y_expand: true,
}, { fillParent: true });
this._noFrequentAppsLabel = new St.Label({ text: _("Frequently used applications will appear here"),
@ -969,7 +971,7 @@ class FrequentView extends BaseAppView {
var Views = {
FREQUENT: 0,
ALL: 1
ALL: 1,
};
var ControlsBoxLayout = GObject.registerClass(
@ -1016,7 +1018,7 @@ class AppDisplay extends St.BoxLayout {
style_class: 'app-display',
vertical: true,
x_expand: true,
y_expand: true
y_expand: true,
});
this._privacySettings = new Gio.Settings({ schema_id: 'org.gnome.desktop.privacy' });
@ -1128,7 +1130,7 @@ class AppDisplay extends St.BoxLayout {
this._controls.ease({
opacity: finalOpacity,
duration: IconGrid.ANIMATION_TIME_IN,
mode: Clutter.AnimationMode.EASE_IN_OUT_QUAD
mode: Clutter.AnimationMode.EASE_IN_OUT_QUAD,
});
currentView.animate(animationDirection, onComplete);
@ -1256,7 +1258,7 @@ class FolderView extends BaseAppView {
super._init({
layout_manager: new Clutter.BinLayout(),
x_expand: true,
y_expand: true
y_expand: true,
});
// If it not expand, the parent doesn't take into account its preferred_width when allocating
@ -1270,7 +1272,7 @@ class FolderView extends BaseAppView {
this._scrollView = new St.ScrollView({
overlay_scrollbars: true,
x_expand: true,
y_expand: true
y_expand: true,
});
this._scrollView.set_policy(St.PolicyType.NEVER, St.PolicyType.AUTOMATIC);
this.add_actor(this._scrollView);
@ -1460,7 +1462,7 @@ var FolderIcon = GObject.registerClass({
Signals: {
'apps-changed': {},
'name-changed': {},
}
},
}, class FolderIcon extends St.Button {
_init(id, path, parentView) {
super._init({
@ -1481,7 +1483,7 @@ var FolderIcon = GObject.registerClass({
this.icon = new IconGrid.BaseIcon('', {
createIcon: this._createIcon.bind(this),
setSizeManually: true
setSizeManually: true,
});
this.set_child(this.icon);
this.label_actor = this.icon.label;
@ -1880,7 +1882,7 @@ Signals.addSignalMethods(RenameFolderMenu.prototype);
var AppFolderPopup = GObject.registerClass({
Signals: {
'open-state-changed': { param_types: [GObject.TYPE_BOOLEAN] },
}
},
}, class AppFolderPopup extends St.Widget {
_init(source, side) {
super._init({
@ -1895,7 +1897,7 @@ var AppFolderPopup = GObject.registerClass({
x_expand: true,
y_expand: true,
x_align: Clutter.ActorAlign.CENTER,
y_align: Clutter.ActorAlign.START
y_align: Clutter.ActorAlign.START,
});
this._source = source;
this._view = source.view;
@ -1904,9 +1906,10 @@ var AppFolderPopup = GObject.registerClass({
this._isOpen = false;
this.parentOffset = 0;
this._boxPointer = new BoxPointer.BoxPointer(this._arrowSide,
{ style_class: 'app-folder-popup-bin',
x_expand: true, });
this._boxPointer = new BoxPointer.BoxPointer(this._arrowSide, {
style_class: 'app-folder-popup-bin',
x_expand: true,
});
this._boxPointer.style_class = 'app-folder-popup';
this.add_actor(this._boxPointer);
@ -1922,7 +1925,7 @@ var AppFolderPopup = GObject.registerClass({
global.focus_manager.add_group(this);
this._grabHelper = new GrabHelper.GrabHelper(this, {
actionMode: Shell.ActionMode.POPUP
actionMode: Shell.ActionMode.POPUP,
});
this._grabHelper.addActor(Main.layoutManager.overviewGroup);
this.connect('destroy', this._onDestroy.bind(this));
@ -2049,7 +2052,7 @@ var AppIcon = GObject.registerClass({
Signals: {
'menu-state-changed': { param_types: [GObject.TYPE_BOOLEAN] },
'sync-tooltip': {},
}
},
}, class AppIcon extends St.Button {
_init(app, iconParams = {}) {
super._init({
@ -2304,7 +2307,7 @@ var AppIcon = GObject.registerClass({
scale_y: 1,
duration: APP_ICON_SCALE_IN_TIME,
delay: APP_ICON_SCALE_IN_DELAY,
mode: Clutter.AnimationMode.EASE_OUT_QUINT
mode: Clutter.AnimationMode.EASE_OUT_QUINT,
});
}
@ -2337,7 +2340,7 @@ var AppIcon = GObject.registerClass({
this.ease({
scale_x: 0.75,
scale_y: 0.75,
opacity: 128
opacity: 128,
});
}
@ -2346,7 +2349,7 @@ var AppIcon = GObject.registerClass({
this.ease({
scale_x: 1.0,
scale_y: 1.0,
opacity: 255
opacity: 255,
});
}
@ -2354,7 +2357,7 @@ var AppIcon = GObject.registerClass({
this.icon.label.opacity = 0;
this.icon.icon.ease({
scale_x: FOLDER_SUBICON_FRACTION,
scale_y: FOLDER_SUBICON_FRACTION
scale_y: FOLDER_SUBICON_FRACTION,
});
}
@ -2362,7 +2365,7 @@ var AppIcon = GObject.registerClass({
this.icon.label.opacity = 255;
this.icon.icon.ease({
scale_x: 1.0,
scale_y: 1.0
scale_y: 1.0,
});
}