- Linting: max-len, exponentiation operator

This commit is contained in:
Brett Zamir
2020-07-27 11:55:15 +08:00
parent ec32f5bc68
commit be5d353bc4
16 changed files with 188 additions and 57 deletions

View File

@@ -44,7 +44,10 @@ const menuItemIsValid = function (menuItem) {
export const add = function (menuItem) {
// menuItem: {id, label, shortcut, action}
if (!menuItemIsValid(menuItem)) {
throw new TypeError('Menu items must be defined and have at least properties: id, label, action, where action must be a function');
throw new TypeError(
'Menu items must be defined and have at least properties: ' +
'id, label, action, where action must be a function'
);
}
if (menuItem.id in contextMenuExtensions) {
throw new Error('Cannot add extension "' + menuItem.id + '", an extension by that name already exists"');