From 620c5484e30e91ddf29e09e239d5f8818aa0bbce Mon Sep 17 00:00:00 2001 From: Jesse Hallam Date: Wed, 21 Feb 2018 14:20:33 -0500 Subject: [PATCH] invoke `yarn fix:js` to adopt the updated eslint rules. No other changes are included. --- scripts/check_build_config.js | 2 +- scripts/extract_dict.js | 2 +- src/browser/components/AutoSaveIndicator.jsx | 4 +- .../components/DestructiveConfirmModal.jsx | 2 +- src/browser/components/ErrorView.jsx | 2 +- src/browser/components/HoveringURL.jsx | 2 +- src/browser/components/LoginModal.jsx | 2 +- src/browser/components/MainPage.jsx | 26 +++--- src/browser/components/MattermostView.jsx | 20 ++--- src/browser/components/NewTeamModal.jsx | 14 ++-- .../components/PermissionRequestDialog.jsx | 18 ++-- src/browser/components/RemoveServerModal.jsx | 2 +- src/browser/components/SettingsPage.jsx | 66 +++++++-------- src/browser/components/TabBar.jsx | 4 +- src/browser/components/TeamList.jsx | 26 +++--- src/browser/components/TeamListItem.jsx | 2 +- src/browser/config/AppConfig.js | 2 +- src/browser/index.jsx | 6 +- src/browser/js/badge.js | 2 +- src/browser/js/contextMenu.js | 14 ++-- src/browser/js/notification.js | 2 +- src/browser/webview/mattermost.js | 2 +- src/common/config/buildConfig.js | 2 +- src/common/config/defaultPreferences.js | 4 +- src/common/config/pastDefaultPreferences.js | 4 +- src/common/config/upgradePreferences.js | 2 +- src/common/osVersion.js | 2 +- src/common/settings.js | 4 +- src/main.js | 26 +++--- src/main/CriticalErrorHandler.js | 4 +- src/main/SpellChecker.js | 2 +- src/main/allowProtocolDialog.js | 8 +- src/main/certificateStore.js | 4 +- src/main/downloadURL.js | 2 +- src/main/mainWindow.js | 2 +- src/main/menus/app.js | 84 +++++++++---------- src/main/menus/tray.js | 16 ++-- src/main/permissionRequestHandler.js | 2 +- src/main/squirrelStartup.js | 2 +- test/modules/environment.js | 4 +- test/specs/app_test.js | 4 +- test/specs/browser/index_test.js | 30 +++---- test/specs/browser/settings_test.js | 8 +- test/specs/permisson_test.js | 12 +-- test/specs/security_test.js | 10 +-- test/specs/settings_test.js | 10 +-- webpack.config.base.js | 2 +- webpack.config.main.js | 6 +- webpack.config.renderer.js | 24 +++--- 49 files changed, 251 insertions(+), 251 deletions(-) diff --git a/scripts/check_build_config.js b/scripts/check_build_config.js index 4f18b543..84bff2eb 100644 --- a/scripts/check_build_config.js +++ b/scripts/check_build_config.js @@ -4,7 +4,7 @@ function validateBuildConfig(config) { if (config.enableServerManagement === false && config.defaultTeams && config.defaultTeams.length === 0) { return { result: false, - message: `Specify at least one server for "defaultTeams" in buildConfig.js when "enableServerManagement is set to false.\n${JSON.stringify(config, null, 2)}` + message: `Specify at least one server for "defaultTeams" in buildConfig.js when "enableServerManagement is set to false.\n${JSON.stringify(config, null, 2)}`, }; } return {result: true}; diff --git a/scripts/extract_dict.js b/scripts/extract_dict.js index 4f163434..8c8cae54 100644 --- a/scripts/extract_dict.js +++ b/scripts/extract_dict.js @@ -7,7 +7,7 @@ const cwd = process.argv[2]; spawn(path7za, ['e', '-y', '*.zip'], { cwd, - stdio: 'inherit' + stdio: 'inherit', }).on('error', (err) => { console.error(err); process.exit(1); diff --git a/src/browser/components/AutoSaveIndicator.jsx b/src/browser/components/AutoSaveIndicator.jsx index ad082e1b..99b93175 100644 --- a/src/browser/components/AutoSaveIndicator.jsx +++ b/src/browser/components/AutoSaveIndicator.jsx @@ -41,14 +41,14 @@ function AutoSaveIndicator(props) { AutoSaveIndicator.propTypes = { savingState: PropTypes.string.isRequired, - errorMessage: PropTypes.string + errorMessage: PropTypes.string, }; Object.assign(AutoSaveIndicator, { SAVING_STATE_SAVING, SAVING_STATE_SAVED, SAVING_STATE_ERROR, - SAVING_STATE_DONE + SAVING_STATE_DONE, }); module.exports = AutoSaveIndicator; diff --git a/src/browser/components/DestructiveConfirmModal.jsx b/src/browser/components/DestructiveConfirmModal.jsx index 172e8cb6..c33ed46f 100644 --- a/src/browser/components/DestructiveConfirmModal.jsx +++ b/src/browser/components/DestructiveConfirmModal.jsx @@ -37,7 +37,7 @@ DestructiveConfirmationModal.propTypes = { acceptLabel: PropTypes.string.isRequired, cancelLabel: PropTypes.string.isRequired, onAccept: PropTypes.func.isRequired, - onCancel: PropTypes.func.isRequired + onCancel: PropTypes.func.isRequired, }; module.exports = DestructiveConfirmationModal; diff --git a/src/browser/components/ErrorView.jsx b/src/browser/components/ErrorView.jsx index a8b21519..9d1c3a4f 100644 --- a/src/browser/components/ErrorView.jsx +++ b/src/browser/components/ErrorView.jsx @@ -80,7 +80,7 @@ ErrorView.propTypes = { errorInfo: PropTypes.object, id: PropTypes.number, active: PropTypes.bool, - withTab: PropTypes.bool + withTab: PropTypes.bool, }; module.exports = ErrorView; diff --git a/src/browser/components/HoveringURL.jsx b/src/browser/components/HoveringURL.jsx index c0dd7df4..f6c3526b 100644 --- a/src/browser/components/HoveringURL.jsx +++ b/src/browser/components/HoveringURL.jsx @@ -10,7 +10,7 @@ function HoveringURL(props) { } HoveringURL.propTypes = { - targetURL: PropTypes.string + targetURL: PropTypes.string, }; module.exports = HoveringURL; diff --git a/src/browser/components/LoginModal.jsx b/src/browser/components/LoginModal.jsx index 26440c03..a00fdf96 100644 --- a/src/browser/components/LoginModal.jsx +++ b/src/browser/components/LoginModal.jsx @@ -92,7 +92,7 @@ LoginModal.propTypes = { onCancel: PropTypes.func, onLogin: PropTypes.func, request: PropTypes.object, - show: PropTypes.bool + show: PropTypes.bool, }; module.exports = LoginModal; diff --git a/src/browser/components/MainPage.jsx b/src/browser/components/MainPage.jsx index db882292..bccd6161 100644 --- a/src/browser/components/MainPage.jsx +++ b/src/browser/components/MainPage.jsx @@ -28,7 +28,7 @@ const MainPage = createReactClass({ deeplinkingUrl: PropTypes.string, showAddServerButton: PropTypes.bool.isRequired, requestingPermission: TabBar.propTypes.requestingPermission, - onClickPermissionDialog: PropTypes.func + onClickPermissionDialog: PropTypes.func, }, getInitialState() { @@ -48,22 +48,22 @@ const MainPage = createReactClass({ unreadAtActive: new Array(this.props.teams.length), mentionAtActiveCounts: new Array(this.props.teams.length), loginQueue: [], - targetURL: '' + targetURL: '', }; }, componentDidMount() { var self = this; ipcRenderer.on('login-request', (event, request, authInfo) => { self.setState({ - loginRequired: true + loginRequired: true, }); const loginQueue = self.state.loginQueue; loginQueue.push({ request, - authInfo + authInfo, }); self.setState({ - loginQueue + loginQueue, }); }); @@ -146,13 +146,13 @@ const MainPage = createReactClass({ handleSelect(key) { const newKey = (this.props.teams.length + key) % this.props.teams.length; this.setState({ - key: newKey + key: newKey, }); this.handleOnTeamFocused(newKey); var webview = document.getElementById('mattermostView' + newKey); ipcRenderer.send('update-title', { - title: webview.getTitle() + title: webview.getTitle(), }); }, handleUnreadCountChange(index, unreadCount, mentionCount, isUnread, isMentioned) { @@ -174,7 +174,7 @@ const MainPage = createReactClass({ unreadCounts, mentionCounts, unreadAtActive, - mentionAtActiveCounts + mentionAtActiveCounts, }); this.handleUnreadCountTotalChange(); }, @@ -185,7 +185,7 @@ const MainPage = createReactClass({ mentionAtActiveCounts[index] = 0; this.setState({ unreadAtActive, - mentionAtActiveCounts + mentionAtActiveCounts, }); this.handleUnreadCountTotalChange(); }, @@ -237,7 +237,7 @@ const MainPage = createReactClass({ }, addServer() { this.setState({ - showNewTeamModal: true + showNewTeamModal: true, }); }, @@ -321,14 +321,14 @@ const MainPage = createReactClass({ show={this.state.showNewTeamModal} onClose={() => { this.setState({ - showNewTeamModal: false + showNewTeamModal: false, }); }} onSave={(newTeam) => { this.props.teams.push(newTeam); this.setState({ showNewTeamModal: false, - key: this.props.teams.length - 1 + key: this.props.teams.length - 1, }); this.render(); this.props.onTeamConfigChange(this.props.teams); @@ -379,7 +379,7 @@ const MainPage = createReactClass({ ); - } + }, }); module.exports = MainPage; diff --git a/src/browser/components/MattermostView.jsx b/src/browser/components/MattermostView.jsx index 8393d3c7..c01ca9ac 100644 --- a/src/browser/components/MattermostView.jsx +++ b/src/browser/components/MattermostView.jsx @@ -25,7 +25,7 @@ const MattermostView = createReactClass({ active: PropTypes.bool, withTab: PropTypes.bool, useSpellChecker: PropTypes.bool, - onSelectSpellCheckerLocale: PropTypes.func + onSelectSpellCheckerLocale: PropTypes.func, }, getInitialState() { @@ -33,7 +33,7 @@ const MattermostView = createReactClass({ errorInfo: null, isContextMenuAdded: false, reloadTimeoutID: null, - isLoaded: false + isLoaded: false, }; }, @@ -55,7 +55,7 @@ const MattermostView = createReactClass({ self.setState({ errorInfo: e, - isLoaded: true + isLoaded: true, }); function reload() { window.removeEventListener('online', reload); @@ -63,7 +63,7 @@ const MattermostView = createReactClass({ } if (navigator.onLine) { self.setState({ - reloadTimeoutID: setTimeout(reload, 30000) + reloadTimeoutID: setTimeout(reload, 30000), }); } else { window.addEventListener('online', reload); @@ -105,7 +105,7 @@ const MattermostView = createReactClass({ this.props.onSelectSpellCheckerLocale(locale); } webview.send('set-spellcheker'); - } + }, }); this.setState({isContextMenuAdded: true}); } @@ -121,7 +121,7 @@ const MattermostView = createReactClass({ switch (event.channel) { case 'onGuestInitialized': self.setState({ - isLoaded: true + isLoaded: true, }); break; case 'onUnreadCountChange': @@ -142,7 +142,7 @@ const MattermostView = createReactClass({ webview.addEventListener('page-title-updated', (event) => { if (self.props.active) { ipcRenderer.send('update-title', { - title: event.title + title: event.title, }); } }); @@ -171,7 +171,7 @@ const MattermostView = createReactClass({ this.setState({ errorInfo: null, reloadTimeoutID: null, - isLoaded: false + isLoaded: false, }); var webview = findDOMNode(this.refs.webview); webview.reload(); @@ -179,7 +179,7 @@ const MattermostView = createReactClass({ clearCacheAndReload() { this.setState({ - errorInfo: null + errorInfo: null, }); var webContents = findDOMNode(this.refs.webview).getWebContents(); webContents.session.clearCache(() => { @@ -271,7 +271,7 @@ const MattermostView = createReactClass({ /> { loadingImage } ); - } + }, }); module.exports = MattermostView; diff --git a/src/browser/components/NewTeamModal.jsx b/src/browser/components/NewTeamModal.jsx index 82ee74e8..42c12c64 100644 --- a/src/browser/components/NewTeamModal.jsx +++ b/src/browser/components/NewTeamModal.jsx @@ -10,7 +10,7 @@ class NewTeamModal extends React.Component { this.state = { teamName: '', teamUrl: '', - saveStarted: false + saveStarted: false, }; } @@ -23,7 +23,7 @@ class NewTeamModal extends React.Component { teamName: this.props.team ? this.props.team.name : '', teamUrl: this.props.team ? this.props.team.url : '', teamIndex: this.props.team ? this.props.team.index : false, - saveStarted: false + saveStarted: false, }); } @@ -40,7 +40,7 @@ class NewTeamModal extends React.Component { handleTeamNameChange(e) { this.setState({ - teamName: e.target.value + teamName: e.target.value, }); } @@ -63,7 +63,7 @@ class NewTeamModal extends React.Component { handleTeamUrlChange(e) { this.setState({ - teamUrl: e.target.value + teamUrl: e.target.value, }); } @@ -78,13 +78,13 @@ class NewTeamModal extends React.Component { save() { this.setState({ - saveStarted: true + saveStarted: true, }, () => { if (this.validateForm()) { this.props.onSave({ url: this.state.teamUrl, name: this.state.teamName, - index: this.state.teamIndex + index: this.state.teamIndex, }); } }); @@ -199,7 +199,7 @@ NewTeamModal.propTypes = { onSave: PropTypes.func, team: PropTypes.object, editMode: PropTypes.bool, - show: PropTypes.bool + show: PropTypes.bool, }; module.exports = NewTeamModal; diff --git a/src/browser/components/PermissionRequestDialog.jsx b/src/browser/components/PermissionRequestDialog.jsx index 798afeb6..7d9b4528 100644 --- a/src/browser/components/PermissionRequestDialog.jsx +++ b/src/browser/components/PermissionRequestDialog.jsx @@ -5,32 +5,32 @@ const {Button, Glyphicon, Popover} = require('react-bootstrap'); const PERMISSIONS = { media: { description: 'Use your camera and microphone', - glyph: 'facetime-video' + glyph: 'facetime-video', }, geolocation: { description: 'Know your location', - glyph: 'map-marker' + glyph: 'map-marker', }, notifications: { description: 'Show notifications', - glyph: 'bell' + glyph: 'bell', }, midiSysex: { description: 'Use your MIDI devices', - glyph: 'music' + glyph: 'music', }, pointerLock: { description: 'Lock your mouse cursor', - glyph: 'hand-up' + glyph: 'hand-up', }, fullscreen: { description: 'Enter full screen', - glyph: 'resize-full' + glyph: 'resize-full', }, openExternal: { description: 'Open external', - glyph: 'new-window' - } + glyph: 'new-window', + }, }; function glyph(permission) { @@ -83,7 +83,7 @@ PermissionRequestDialog.propTypes = { permission: PropTypes.oneOf(['media', 'geolocation', 'notifications', 'midiSysex', 'pointerLock', 'fullscreen', 'openExternal']), onClickAllow: PropTypes.func, onClickBlock: PropTypes.func, - onClickClose: PropTypes.func + onClickClose: PropTypes.func, }; module.exports = PermissionRequestDialog; diff --git a/src/browser/components/RemoveServerModal.jsx b/src/browser/components/RemoveServerModal.jsx index 8955cab0..49c8fb04 100644 --- a/src/browser/components/RemoveServerModal.jsx +++ b/src/browser/components/RemoveServerModal.jsx @@ -27,7 +27,7 @@ function RemoveServerModal(props) { } RemoveServerModal.propTypes = { - serverName: PropTypes.string.isRequired + serverName: PropTypes.string.isRequired, }; module.exports = RemoveServerModal; diff --git a/src/browser/components/SettingsPage.jsx b/src/browser/components/SettingsPage.jsx index 2a08b2f5..d0ee94d5 100644 --- a/src/browser/components/SettingsPage.jsx +++ b/src/browser/components/SettingsPage.jsx @@ -16,7 +16,7 @@ const AutoSaveIndicator = require('./AutoSaveIndicator.jsx'); const appLauncher = new AutoLaunch({ name: remote.app.getName(), - isHidden: true + isHidden: true, }); function backToIndex(index) { @@ -31,7 +31,7 @@ const CONFIG_TYPE_APP_OPTIONS = 'appOptions'; const SettingsPage = createReactClass({ propTypes: { configFile: PropTypes.string, - enableServerManagement: PropTypes.bool + enableServerManagement: PropTypes.bool, }, getInitialState() { @@ -49,7 +49,7 @@ const SettingsPage = createReactClass({ } initialState.savingState = { appOptions: AutoSaveIndicator.SAVING_STATE_DONE, - servers: AutoSaveIndicator.SAVING_STATE_DONE + servers: AutoSaveIndicator.SAVING_STATE_DONE, }; return initialState; @@ -59,13 +59,13 @@ const SettingsPage = createReactClass({ var self = this; appLauncher.isEnabled().then((enabled) => { self.setState({ - autostart: enabled + autostart: enabled, }); }); } ipcRenderer.on('add-server', () => { this.setState({ - showAddTeamForm: true + showAddTeamForm: true, }); }); ipcRenderer.on('switch-tab', (event, key) => { @@ -113,7 +113,7 @@ const SettingsPage = createReactClass({ handleTeamsChange(teams) { this.setState({ showAddTeamForm: false, - teams + teams, }); if (teams.length === 0) { this.setState({showAddTeamForm: true}); @@ -131,11 +131,11 @@ const SettingsPage = createReactClass({ notifications: { flashWindow: this.state.notifications.flashWindow, bounceIcon: this.state.notifications.bounceIcon, - bounceIconType: this.state.notifications.bounceIconType + bounceIconType: this.state.notifications.bounceIconType, }, showUnreadBadge: this.state.showUnreadBadge, useSpellChecker: this.state.useSpellChecker, - spellCheckerLocale: this.state.spellCheckerLocale + spellCheckerLocale: this.state.spellCheckerLocale, }; settings.writeFile(this.props.configFile, config, (err) => { @@ -176,12 +176,12 @@ const SettingsPage = createReactClass({ handleChangeShowTrayIcon() { var shouldShowTrayIcon = !this.refs.showTrayIcon.props.checked; this.setState({ - showTrayIcon: shouldShowTrayIcon + showTrayIcon: shouldShowTrayIcon, }); if (process.platform === 'darwin' && !shouldShowTrayIcon) { this.setState({ - minimizeToTray: false + minimizeToTray: false, }); } @@ -189,13 +189,13 @@ const SettingsPage = createReactClass({ }, handleChangeTrayIconTheme() { this.setState({ - trayIconTheme: ReactDOM.findDOMNode(this.refs.trayIconTheme).value + trayIconTheme: ReactDOM.findDOMNode(this.refs.trayIconTheme).value, }); setImmediate(this.startSaveConfig, CONFIG_TYPE_APP_OPTIONS); }, handleChangeAutoStart() { this.setState({ - autostart: !this.refs.autostart.props.checked + autostart: !this.refs.autostart.props.checked, }); setImmediate(this.startSaveConfig, CONFIG_TYPE_APP_OPTIONS); }, @@ -203,27 +203,27 @@ const SettingsPage = createReactClass({ const shouldMinimizeToTray = this.state.showTrayIcon && !this.refs.minimizeToTray.props.checked; this.setState({ - minimizeToTray: shouldMinimizeToTray + minimizeToTray: shouldMinimizeToTray, }); setImmediate(this.startSaveConfig, CONFIG_TYPE_APP_OPTIONS); }, toggleShowTeamForm() { this.setState({ - showAddTeamForm: !this.state.showAddTeamForm + showAddTeamForm: !this.state.showAddTeamForm, }); document.activeElement.blur(); }, setShowTeamFormVisibility(val) { this.setState({ - showAddTeamForm: val + showAddTeamForm: val, }); }, handleFlashWindow() { this.setState({ notifications: { ...this.state.notifications, - flashWindow: this.refs.flashWindow.props.checked ? 0 : 2 - } + flashWindow: this.refs.flashWindow.props.checked ? 0 : 2, + }, }); setImmediate(this.startSaveConfig, CONFIG_TYPE_APP_OPTIONS); }, @@ -231,8 +231,8 @@ const SettingsPage = createReactClass({ this.setState({ notifications: { ...this.state.notifications, - bounceIcon: !this.refs.bounceIcon.props.checked - } + bounceIcon: !this.refs.bounceIcon.props.checked, + }, }); setImmediate(this.startSaveConfig, CONFIG_TYPE_APP_OPTIONS); }, @@ -240,21 +240,21 @@ const SettingsPage = createReactClass({ this.setState({ notifications: { ...this.state.notifications, - bounceIconType: event.target.value - } + bounceIconType: event.target.value, + }, }); setImmediate(this.startSaveConfig, CONFIG_TYPE_APP_OPTIONS); }, handleShowUnreadBadge() { this.setState({ - showUnreadBadge: !this.refs.showUnreadBadge.props.checked + showUnreadBadge: !this.refs.showUnreadBadge.props.checked, }); setImmediate(this.startSaveConfig, CONFIG_TYPE_APP_OPTIONS); }, handleChangeUseSpellChecker() { this.setState({ - useSpellChecker: !this.refs.useSpellChecker.props.checked + useSpellChecker: !this.refs.useSpellChecker.props.checked, }); setImmediate(this.startSaveConfig, CONFIG_TYPE_APP_OPTIONS); }, @@ -263,7 +263,7 @@ const SettingsPage = createReactClass({ var teams = this.state.teams; teams[index] = newData; this.setState({ - teams + teams, }); setImmediate(this.startSaveConfig, CONFIG_TYPE_SERVERS); }, @@ -272,7 +272,7 @@ const SettingsPage = createReactClass({ var teams = this.state.teams; teams.push(team); this.setState({ - teams + teams, }); setImmediate(this.startSaveConfig, CONFIG_TYPE_SERVERS); }, @@ -280,7 +280,7 @@ const SettingsPage = createReactClass({ render() { const settingsPage = { navbar: { - backgroundColor: '#fff' + backgroundColor: '#fff', }, close: { textDecoration: 'none', @@ -289,28 +289,28 @@ const SettingsPage = createReactClass({ top: '5px', fontSize: '35px', fontWeight: 'normal', - color: '#bbb' + color: '#bbb', }, heading: { textAlign: 'center', fontSize: '24px', margin: '0', - padding: '1em 0' + padding: '1em 0', }, sectionHeading: { fontSize: '20px', margin: '0', padding: '1em 0', - float: 'left' + float: 'left', }, sectionHeadingLink: { marginTop: '24px', display: 'inline-block', - fontSize: '15px' + fontSize: '15px', }, footer: { - padding: '0.4em 0' - } + padding: '0.4em 0', + }, }; var teamsRow = ( @@ -598,7 +598,7 @@ const SettingsPage = createReactClass({ ); - } + }, }); module.exports = SettingsPage; diff --git a/src/browser/components/TabBar.jsx b/src/browser/components/TabBar.jsx index 839bf6cd..d2f4ee07 100644 --- a/src/browser/components/TabBar.jsx +++ b/src/browser/components/TabBar.jsx @@ -108,10 +108,10 @@ TabBar.propTypes = { showAddServerButton: PropTypes.bool, requestingPermission: PropTypes.arrayOf(PropTypes.shape({ origin: PropTypes.string, - permission: PropTypes.string + permission: PropTypes.string, })), onAddServer: PropTypes.func, - onClickPermissionDialog: PropTypes.func + onClickPermissionDialog: PropTypes.func, }; module.exports = TabBar; diff --git a/src/browser/components/TeamList.jsx b/src/browser/components/TeamList.jsx index 946a673e..43dbbd36 100644 --- a/src/browser/components/TeamList.jsx +++ b/src/browser/components/TeamList.jsx @@ -15,7 +15,7 @@ const TeamList = createReactClass({ updateTeam: PropTypes.func, toggleAddTeamForm: PropTypes.func, setAddTeamFormVisibility: PropTypes.func, - onTeamClick: PropTypes.func + onTeamClick: PropTypes.func, }, getInitialState() { @@ -25,8 +25,8 @@ const TeamList = createReactClass({ team: { url: '', name: '', - index: false - } + index: false, + }, }; }, handleTeamRemove(index) { @@ -51,8 +51,8 @@ const TeamList = createReactClass({ team: { url: '', name: '', - index: false - } + index: false, + }, }); this.props.onTeamsChange(teams); @@ -63,8 +63,8 @@ const TeamList = createReactClass({ team: { url: teamUrl, name: teamName, - index: teamIndex - } + index: teamIndex, + }, }); }, @@ -116,15 +116,15 @@ const TeamList = createReactClass({ team: { name: '', url: '', - index: false - } + index: false, + }, }); this.props.setAddTeamFormVisibility(false); }} onSave={(newTeam) => { var teamData = { name: newTeam.name, - url: newTeam.url + url: newTeam.url, }; if (this.props.showAddTeamForm) { this.props.addServer(teamData); @@ -137,8 +137,8 @@ const TeamList = createReactClass({ team: { name: '', url: '', - index: false - } + index: false, + }, }); this.render(); this.props.setAddTeamFormVisibility(false); @@ -167,7 +167,7 @@ const TeamList = createReactClass({ { removeServerModal} ); - } + }, }); module.exports = TeamList; diff --git a/src/browser/components/TeamListItem.jsx b/src/browser/components/TeamListItem.jsx index 2ea72a7a..980cb287 100644 --- a/src/browser/components/TeamListItem.jsx +++ b/src/browser/components/TeamListItem.jsx @@ -47,7 +47,7 @@ TeamListItem.propTypes = { onTeamEditing: PropTypes.func, onTeamRemove: PropTypes.func, onTeamClick: PropTypes.func, - url: PropTypes.string + url: PropTypes.string, }; module.exports = TeamListItem; diff --git a/src/browser/config/AppConfig.js b/src/browser/config/AppConfig.js index c235db5c..1531fec3 100644 --- a/src/browser/config/AppConfig.js +++ b/src/browser/config/AppConfig.js @@ -8,7 +8,7 @@ class AppConfig { this.data = settings.readFileSync(file); } catch (e) { this.data = { - teams: [] + teams: [], }; } } diff --git a/src/browser/index.jsx b/src/browser/index.jsx index df1ac2a8..68a898b0 100644 --- a/src/browser/index.jsx +++ b/src/browser/index.jsx @@ -35,7 +35,7 @@ function showUnreadBadgeWindows(unreadCount, mentionCount) { overlayDataURL: dataURL, description, unreadCount, - mentionCount + mentionCount, }); } @@ -61,7 +61,7 @@ function showUnreadBadgeOSX(unreadCount, mentionCount) { ipcRenderer.send('update-unread', { unreadCount, - mentionCount + mentionCount, }); } @@ -72,7 +72,7 @@ function showUnreadBadgeLinux(unreadCount, mentionCount) { ipcRenderer.send('update-unread', { unreadCount, - mentionCount + mentionCount, }); } diff --git a/src/browser/js/badge.js b/src/browser/js/badge.js index 36444630..575984ff 100644 --- a/src/browser/js/badge.js +++ b/src/browser/js/badge.js @@ -25,5 +25,5 @@ function createDataURL(text) { } module.exports = { - createDataURL + createDataURL, }; diff --git a/src/browser/js/contextMenu.js b/src/browser/js/contextMenu.js index bbdf78ac..380f74d8 100644 --- a/src/browser/js/contextMenu.js +++ b/src/browser/js/contextMenu.js @@ -5,14 +5,14 @@ function getSuggestionsMenus(win, suggestions) { if (suggestions.length === 0) { return [{ label: 'No Suggestions', - enabled: false + enabled: false, }]; } return suggestions.map((s) => ({ label: s, click() { (win.webContents || win.getWebContents()).replaceMisspelling(s); - } + }, })); } @@ -23,7 +23,7 @@ function getSpellCheckerLocaleMenus(onSelectSpellCheckerLocale) { {language: 'French', locale: 'fr-FR'}, {language: 'German', locale: 'de-DE'}, {language: 'Spanish', locale: 'es-ES'}, - {language: 'Dutch', locale: 'nl-NL'} + {language: 'Dutch', locale: 'nl-NL'}, ]; return locales.map((l) => ({ label: l.language, @@ -33,7 +33,7 @@ function getSpellCheckerLocaleMenus(onSelectSpellCheckerLocale) { if (onSelectSpellCheckerLocale) { onSelectSpellCheckerLocale(l.locale); } - } + }, })); } @@ -41,7 +41,7 @@ module.exports = { setup(win, options) { const defaultOptions = { useSpellChecker: false, - onSelectSpellCheckerLocale: null + onSelectSpellCheckerLocale: null, }; const actualOptions = Object.assign({}, defaultOptions, options); electronContextMenu({ @@ -61,7 +61,7 @@ module.exports = { return prependMenuItems; } return []; - } + }, }); - } + }, }; diff --git a/src/browser/js/notification.js b/src/browser/js/notification.js index 30ff5097..75241346 100644 --- a/src/browser/js/notification.js +++ b/src/browser/js/notification.js @@ -27,7 +27,7 @@ class EnhancedNotification extends OriginalNotification { ipcRenderer.send('notified', { title, - options + options, }); if (process.platform === 'win32' && osVersion.isLowerThanOrEqualWindows8_1()) { diff --git a/src/browser/webview/mattermost.js b/src/browser/webview/mattermost.js index c6b5052c..528838ec 100644 --- a/src/browser/webview/mattermost.js +++ b/src/browser/webview/mattermost.js @@ -178,7 +178,7 @@ function setSpellChecker() { spellCheck(text) { const res = ipc.sendSync('checkspell', text); return res === null ? true : res; - } + }, }); resetMisspelledState(); } diff --git a/src/common/config/buildConfig.js b/src/common/config/buildConfig.js index d1817c7a..4a007c31 100644 --- a/src/common/config/buildConfig.js +++ b/src/common/config/buildConfig.js @@ -17,7 +17,7 @@ const buildConfig = { }*/ ], helpLink: 'https://about.mattermost.com/default-desktop-app-documentation/', - enableServerManagement: true + enableServerManagement: true, }; module.exports = buildConfig; diff --git a/src/common/config/defaultPreferences.js b/src/common/config/defaultPreferences.js index bb2538a8..51c16a89 100644 --- a/src/common/config/defaultPreferences.js +++ b/src/common/config/defaultPreferences.js @@ -11,11 +11,11 @@ const defaultPreferences = { notifications: { flashWindow: 0, bounceIcon: false, - bounceIconType: 'informational' + bounceIconType: 'informational', }, showUnreadBadge: true, useSpellChecker: true, - spellCheckerLocale: 'en-US' + spellCheckerLocale: 'en-US', }; module.exports = defaultPreferences; diff --git a/src/common/config/pastDefaultPreferences.js b/src/common/config/pastDefaultPreferences.js index 5572c70d..45d48fc2 100644 --- a/src/common/config/pastDefaultPreferences.js +++ b/src/common/config/pastDefaultPreferences.js @@ -2,8 +2,8 @@ const defaultPreferences = require('./defaultPreferences'); const pastDefaultPreferences = { 0: { - url: '' - } + url: '', + }, }; pastDefaultPreferences[`${defaultPreferences.version}`] = defaultPreferences; diff --git a/src/common/config/upgradePreferences.js b/src/common/config/upgradePreferences.js index 3e8485a3..2fea75c5 100644 --- a/src/common/config/upgradePreferences.js +++ b/src/common/config/upgradePreferences.js @@ -11,7 +11,7 @@ function upgradeV0toV1(configV0) { } config.teams.push({ name: 'Primary team', - url: configV0.url + url: configV0.url, }); return config; } diff --git a/src/common/osVersion.js b/src/common/osVersion.js index 63efc741..352d9121 100644 --- a/src/common/osVersion.js +++ b/src/common/osVersion.js @@ -13,5 +13,5 @@ module.exports = { // consider Windows 7 and later. return (this.major <= 6 && this.minor <= 3); - } + }, }; diff --git a/src/common/settings.js b/src/common/settings.js index 51fae547..8c30edd0 100644 --- a/src/common/settings.js +++ b/src/common/settings.js @@ -14,7 +14,7 @@ const upgradePreferences = require('./config/upgradePreferences'); function loadDefault(spellCheckerLocale) { const config = JSON.parse(JSON.stringify(defaultPreferences)); return Object.assign({}, config, { - spellCheckerLocale: spellCheckerLocale || defaultPreferences.spellCheckerLocale || 'en-US' + spellCheckerLocale: spellCheckerLocale || defaultPreferences.spellCheckerLocale || 'en-US', }); } @@ -73,5 +73,5 @@ module.exports = { newTeams.push(...JSON.parse(JSON.stringify(teams))); } return newTeams; - } + }, }; diff --git a/src/main.js b/src/main.js index 944d5d41..250c5fef 100644 --- a/src/main.js +++ b/src/main.js @@ -8,7 +8,7 @@ const { nativeImage, dialog, systemPreferences, - session + session, } = require('electron'); const os = require('os'); const path = require('path'); @@ -114,7 +114,7 @@ const trayImages = (() => { return { normal: nativeImage.createFromPath(path.resolve(assetsDir, 'windows/tray.ico')), unread: nativeImage.createFromPath(path.resolve(assetsDir, 'windows/tray_unread.ico')), - mention: nativeImage.createFromPath(path.resolve(assetsDir, 'windows/tray_mention.ico')) + mention: nativeImage.createFromPath(path.resolve(assetsDir, 'windows/tray_mention.ico')), }; case 'darwin': { @@ -122,13 +122,13 @@ const trayImages = (() => { light: { normal: nativeImage.createFromPath(path.resolve(assetsDir, 'osx/MenuIcon.png')), unread: nativeImage.createFromPath(path.resolve(assetsDir, 'osx/MenuIconUnread.png')), - mention: nativeImage.createFromPath(path.resolve(assetsDir, 'osx/MenuIconMention.png')) + mention: nativeImage.createFromPath(path.resolve(assetsDir, 'osx/MenuIconMention.png')), }, clicked: { normal: nativeImage.createFromPath(path.resolve(assetsDir, 'osx/ClickedMenuIcon.png')), unread: nativeImage.createFromPath(path.resolve(assetsDir, 'osx/ClickedMenuIconUnread.png')), - mention: nativeImage.createFromPath(path.resolve(assetsDir, 'osx/ClickedMenuIconMention.png')) - } + mention: nativeImage.createFromPath(path.resolve(assetsDir, 'osx/ClickedMenuIconMention.png')), + }, }; switchMenuIconImages(icons, systemPreferences.isDarkMode()); return icons; @@ -140,14 +140,14 @@ const trayImages = (() => { return { normal: nativeImage.createFromPath(path.resolve(assetsDir, 'linux', theme, 'MenuIconTemplate.png')), unread: nativeImage.createFromPath(path.resolve(assetsDir, 'linux', theme, 'MenuIconUnreadTemplate.png')), - mention: nativeImage.createFromPath(path.resolve(assetsDir, 'linux', theme, 'MenuIconMentionTemplate.png')) + mention: nativeImage.createFromPath(path.resolve(assetsDir, 'linux', theme, 'MenuIconMentionTemplate.png')), }; } catch (e) { //Fallback for invalid theme setting return { normal: nativeImage.createFromPath(path.resolve(assetsDir, 'linux', 'light', 'MenuIconTemplate.png')), unread: nativeImage.createFromPath(path.resolve(assetsDir, 'linux', 'light', 'MenuIconUnreadTemplate.png')), - mention: nativeImage.createFromPath(path.resolve(assetsDir, 'linux', 'light', 'MenuIconMentionTemplate.png')) + mention: nativeImage.createFromPath(path.resolve(assetsDir, 'linux', 'light', 'MenuIconMentionTemplate.png')), }; } } @@ -250,7 +250,7 @@ function handleScreenResize(screen, browserWindow) { x: position[0], y: position[1], width: size[0], - height: size[1] + height: size[1], }, screen); browserWindow.setPosition(validPosition.x || 0, validPosition.y || 0); } @@ -295,9 +295,9 @@ app.on('certificate-error', (event, webContents, url, error, certificate, callba type: 'warning', buttons: [ 'Yes', - 'No' + 'No', ], - cancelId: 1 + cancelId: 1, }, (response) => { if (response === 0) { certificateStore.add(url, certificate); @@ -335,7 +335,7 @@ ipcMain.on('download-url', (event, URL) => { if (err) { dialog.showMessageBox(mainWindow, { type: 'error', - message: err.toString() + message: err.toString(), }); console.log(err); } @@ -411,7 +411,7 @@ app.on('ready', () => { mainWindow = createMainWindow(config, { hideOnStartup, linuxAppIcon: path.join(assetsDir, 'appicon.png'), - deeplinkingUrl + deeplinkingUrl, }); mainWindow.on('closed', () => { @@ -528,7 +528,7 @@ app.on('ready', () => { var filename = item.getFilename(); var savePath = dialog.showSaveDialog({ title: filename, - defaultPath: os.homedir() + '/Downloads/' + filename + defaultPath: os.homedir() + '/Downloads/' + filename, }); if (savePath) { diff --git a/src/main/CriticalErrorHandler.js b/src/main/CriticalErrorHandler.js index a3ff8fe2..1dd666be 100644 --- a/src/main/CriticalErrorHandler.js +++ b/src/main/CriticalErrorHandler.js @@ -50,7 +50,7 @@ class CriticalErrorHandler { title: app.getName(), message: 'The window is no longer responsive.\nDo you wait until the window becomes responsive again?', buttons: ['No', 'Yes'], - defaultId: 0 + defaultId: 0, }); if (result === 0) { throw new Error('BrowserWindow \'unresponsive\' event has been emitted'); @@ -74,7 +74,7 @@ class CriticalErrorHandler { message: `The ${app.getName()} app quit unexpectedly. Click "Show Details" to learn more or "Reopen" to open the application again.\n\nInternal error: ${err.message}`, buttons, defaultId: buttons.indexOf(BUTTON_REOPEN), - noLink: true + noLink: true, }); switch (result) { case buttons.indexOf(BUTTON_SHOW_DETAILS): diff --git a/src/main/SpellChecker.js b/src/main/SpellChecker.js index a35451f4..d77da744 100644 --- a/src/main/SpellChecker.js +++ b/src/main/SpellChecker.js @@ -17,7 +17,7 @@ const contractions = [ "there're", "there's", "they'd", "they'd've", "they'll", "they're", "they've", "wasn't", "we'd", "we'd've", "we'll", "we're", "we've", "weren't", "what'll", "what're", "what's", "what've", "when's", "where'd", "where's", "where've", "who'd", "who'll", "who're", "who's", "who've", "why'll", "why're", "why's", "won't", - "would've", "wouldn't", "wouldn't've", "y'all", "y'all'd've", "you'd", "you'd've", "you'll", "you're", "you've" + "would've", "wouldn't", "wouldn't've", "y'all", "y'all'd've", "you'd", "you'd've", "you'll", "you're", "you've", ]; const contractionMap = contractions.reduce((acc, word) => { diff --git a/src/main/allowProtocolDialog.js b/src/main/allowProtocolDialog.js index f7a36cc9..9a97e22e 100644 --- a/src/main/allowProtocolDialog.js +++ b/src/main/allowProtocolDialog.js @@ -4,7 +4,7 @@ const { app, dialog, ipcMain, - shell + shell, } = require('electron'); const path = require('path'); const fs = require('fs'); @@ -35,10 +35,10 @@ function initDialogEvent(mainWindow) { buttons: [ 'Yes', `Yes (Save ${protocol} as allowed)`, - 'No' + 'No', ], cancelId: 2, - noLink: true + noLink: true, }, (response) => { switch (response) { case 1: { @@ -63,5 +63,5 @@ function initDialogEvent(mainWindow) { } module.exports = { - init + init, }; diff --git a/src/main/certificateStore.js b/src/main/certificateStore.js index 4fbf878f..e0bf7db2 100644 --- a/src/main/certificateStore.js +++ b/src/main/certificateStore.js @@ -6,7 +6,7 @@ const url = require('url'); function comparableCertificate(certificate) { return { data: certificate.data.toString(), - issuerName: certificate.issuerName + issuerName: certificate.issuerName, }; } @@ -63,5 +63,5 @@ CertificateStore.prototype.isTrusted = function isTrusted(targetURL, certificate module.exports = { load(storeFile) { return new CertificateStore(storeFile); - } + }, }; diff --git a/src/main/downloadURL.js b/src/main/downloadURL.js index 0d1187f2..a4da4a07 100644 --- a/src/main/downloadURL.js +++ b/src/main/downloadURL.js @@ -11,7 +11,7 @@ function downloadURL(browserWindow, URL, callback) { request.on('response', (response) => { const file = getAttachmentName(response.headers); const dialogOptions = { - defaultPath: path.join(app.getPath('downloads'), file) + defaultPath: path.join(app.getPath('downloads'), file), }; dialog.showSaveDialog(browserWindow, dialogOptions, (filename) => { if (filename) { diff --git a/src/main/mainWindow.js b/src/main/mainWindow.js index e5c62b2a..1d8bcebc 100644 --- a/src/main/mainWindow.js +++ b/src/main/mainWindow.js @@ -38,7 +38,7 @@ function createMainWindow(config, options) { fullscreenable: true, show: false, minWidth: minimumWindowWidth, - minHeight: minimumWindowHeight + minHeight: minimumWindowHeight, }); const mainWindow = new BrowserWindow(windowOptions); diff --git a/src/main/menus/app.js b/src/main/menus/app.js index 9538b06c..be8ef768 100644 --- a/src/main/menus/app.js +++ b/src/main/menus/app.js @@ -10,7 +10,7 @@ function createTemplate(mainWindow, config, isDev) { const settingsURL = isDev ? 'http://localhost:8080/browser/settings.html' : `file://${electron.app.getAppPath()}/browser/settings.html`; const separatorItem = { - type: 'separator' + type: 'separator', }; var appName = electron.app.getName(); @@ -23,21 +23,21 @@ function createTemplate(mainWindow, config, isDev) { click() { electron.dialog.showMessageBox(mainWindow, { buttons: ['OK'], - message: `${appName} Desktop ${electron.app.getVersion()}` + message: `${appName} Desktop ${electron.app.getVersion()}`, }); - } + }, }, separatorItem, { label: 'Preferences...', accelerator: 'CmdOrCtrl+,', click() { mainWindow.loadURL(settingsURL); - } + }, }] : [{ label: 'Settings...', accelerator: 'CmdOrCtrl+,', click() { mainWindow.loadURL(settingsURL); - } + }, }]; if (buildConfig.enableServerManagement === true) { @@ -45,49 +45,49 @@ function createTemplate(mainWindow, config, isDev) { label: 'Sign in to Another Server', click() { mainWindow.webContents.send('add-server'); - } + }, }); } platformAppMenu = platformAppMenu.concat(process.platform === 'darwin' ? [ separatorItem, { - role: 'hide' + role: 'hide', }, { - role: 'hideothers' + role: 'hideothers', }, { - role: 'unhide' + role: 'unhide', }, separatorItem, { - role: 'quit' + role: 'quit', }] : [separatorItem, { role: 'quit', accelerator: 'CmdOrCtrl+Q', click() { electron.app.quit(); - } + }, }] ); template.push({ label: '&' + firstMenuName, submenu: [ - ...platformAppMenu - ] + ...platformAppMenu, + ], }); template.push({ label: '&Edit', submenu: [{ - role: 'undo' + role: 'undo', }, { - role: 'redo' + role: 'redo', }, separatorItem, { - role: 'cut' + role: 'cut', }, { - role: 'copy' + role: 'copy', }, { - role: 'paste' + role: 'paste', }, { - role: 'selectall' - }] + role: 'selectall', + }], }); template.push({ label: '&View', @@ -102,7 +102,7 @@ function createTemplate(mainWindow, config, isDev) { focusedWindow.reload(); } } - } + }, }, { label: 'Clear Cache and Reload', accelerator: 'Shift+CmdOrCtrl+R', @@ -116,25 +116,25 @@ function createTemplate(mainWindow, config, isDev) { }); } } - } + }, }, { - role: 'togglefullscreen' + role: 'togglefullscreen', }, separatorItem, { - role: 'resetzoom' + role: 'resetzoom', }, { - role: 'zoomin' + role: 'zoomin', }, { label: 'Zoom In (hidden)', accelerator: 'CmdOrCtrl+=', visible: false, - role: 'zoomin' + role: 'zoomin', }, { - role: 'zoomout' + role: 'zoomout', }, { label: 'Zoom Out (hidden)', accelerator: 'CmdOrCtrl+Shift+-', visible: false, - role: 'zoomout' + role: 'zoomout', }, separatorItem, { label: 'Toggle Developer Tools', accelerator: (() => { @@ -147,8 +147,8 @@ function createTemplate(mainWindow, config, isDev) { if (focusedWindow) { focusedWindow.toggleDevTools(); } - } - }] + }, + }], }); template.push({ label: '&History', @@ -161,7 +161,7 @@ function createTemplate(mainWindow, config, isDev) { } else if (focusedWindow.webContents.canGoBack()) { focusedWindow.goBack(); } - } + }, }, { label: 'Forward', accelerator: process.platform === 'darwin' ? 'Cmd+]' : 'Alt+Right', @@ -171,17 +171,17 @@ function createTemplate(mainWindow, config, isDev) { } else if (focusedWindow.webContents.canGoForward()) { focusedWindow.goForward(); } - } - }] + }, + }], }); const teams = settings.mergeDefaultTeams(config.teams); const windowMenu = { label: '&Window', submenu: [{ - role: 'minimize' + role: 'minimize', }, { - role: 'close' + role: 'close', }, separatorItem, ...teams.slice(0, 9).map((team, i) => { return { label: team.name, @@ -189,7 +189,7 @@ function createTemplate(mainWindow, config, isDev) { click() { mainWindow.show(); // for OS X mainWindow.webContents.send('switch-tab', i); - } + }, }; }), separatorItem, { label: 'Select Next Server', @@ -197,15 +197,15 @@ function createTemplate(mainWindow, config, isDev) { click() { mainWindow.webContents.send('select-next-tab'); }, - enabled: (teams.length > 1) + enabled: (teams.length > 1), }, { label: 'Select Previous Server', accelerator: 'Ctrl+Shift+Tab', click() { mainWindow.webContents.send('select-previous-tab'); }, - enabled: (teams.length > 1) - }] + enabled: (teams.length > 1), + }], }; template.push(windowMenu); var submenu = []; @@ -214,13 +214,13 @@ function createTemplate(mainWindow, config, isDev) { label: 'Learn More...', click() { electron.shell.openExternal(buildConfig.helpLink); - } + }, }); submenu.push(separatorItem); } submenu.push({ label: `Version ${electron.app.getVersion()}`, - enabled: false + enabled: false, }); template.push({label: '&Help', submenu}); return template; @@ -231,5 +231,5 @@ function createMenu(mainWindow, config, isDev) { } module.exports = { - createMenu + createMenu, }; diff --git a/src/main/menus/tray.js b/src/main/menus/tray.js index 8db5587e..bbca766d 100644 --- a/src/main/menus/tray.js +++ b/src/main/menus/tray.js @@ -2,7 +2,7 @@ const { app, - Menu + Menu, } = require('electron'); const settings = require('../../common/settings'); @@ -21,10 +21,10 @@ function createTemplate(mainWindow, config, isDev) { app.dock.show(); mainWindow.focus(); } - } + }, }; }), { - type: 'separator' + type: 'separator', }, { label: process.platform === 'darwin' ? 'Preferences...' : 'Settings', click: () => { @@ -35,12 +35,12 @@ function createTemplate(mainWindow, config, isDev) { app.dock.show(); mainWindow.focus(); } - } + }, }, { - type: 'separator' + type: 'separator', }, { - role: 'quit' - } + role: 'quit', + }, ]; return template; } @@ -58,5 +58,5 @@ function showOrRestore(window) { } module.exports = { - createMenu + createMenu, }; diff --git a/src/main/permissionRequestHandler.js b/src/main/permissionRequestHandler.js index 6edeffd9..ea783402 100644 --- a/src/main/permissionRequestHandler.js +++ b/src/main/permissionRequestHandler.js @@ -49,7 +49,7 @@ function permissionRequestHandler(mainWindow, permissionManager) { requestQueue.push({ origin: targetURL.origin, permission, - callback + callback, }); mainWindow.webContents.send('request-permission', targetURL.origin, permission); }; diff --git a/src/main/squirrelStartup.js b/src/main/squirrelStartup.js index 1e1d56a4..8c980283 100644 --- a/src/main/squirrelStartup.js +++ b/src/main/squirrelStartup.js @@ -11,7 +11,7 @@ function shouldQuitApp(cmd) { async function setupAutoLaunch(cmd) { const appLauncher = new AutoLaunch({ name: app.getName(), - isHidden: true + isHidden: true, }); if (cmd === '--squirrel-uninstall') { // If we're uninstalling, make sure we also delete our auto launch registry key diff --git a/test/modules/environment.js b/test/modules/environment.js index 244a2315..32cb4b4f 100644 --- a/test/modules/environment.js +++ b/test/modules/environment.js @@ -48,7 +48,7 @@ module.exports = { getSpectronApp() { return new Application({ path: electronBinaryPath, - args: [`${path.join(sourceRootDir, 'src')}`, `--data-dir=${userDataDir}`, '--disable-dev-mode'] + args: [`${path.join(sourceRootDir, 'src')}`, `--data-dir=${userDataDir}`, '--disable-dev-mode'], }); }, @@ -78,5 +78,5 @@ module.exports = { }, isOneOf(platforms) { return (platforms.indexOf(process.platform) !== -1); - } + }, }; diff --git a/test/specs/app_test.js b/test/specs/app_test.js index b4d348c6..f874d04f 100644 --- a/test/specs/app_test.js +++ b/test/specs/app_test.js @@ -80,7 +80,7 @@ describe('application', function desc() { it('should show index.html when there is config file', () => { fs.writeFileSync(env.configFilePath, JSON.stringify({ - url: env.mattermostURL + url: env.mattermostURL, })); return this.app.restart().then(() => { return this.app.client.waitUntilWindowLoaded().getUrl(); @@ -92,7 +92,7 @@ describe('application', function desc() { it('should upgrade v0 config file', () => { const settings = require('../../src/common/settings'); fs.writeFileSync(env.configFilePath, JSON.stringify({ - url: env.mattermostURL + url: env.mattermostURL, })); return this.app.restart().then(() => { return this.app.client.waitUntilWindowLoaded().getUrl(); diff --git a/test/specs/browser/index_test.js b/test/specs/browser/index_test.js index e130d565..dace9384 100644 --- a/test/specs/browser/index_test.js +++ b/test/specs/browser/index_test.js @@ -13,11 +13,11 @@ describe('browser/index.html', function desc() { version: 1, teams: [{ name: 'example', - url: env.mattermostURL + url: env.mattermostURL, }, { name: 'github', - url: 'https://github.com/' - }] + url: 'https://github.com/', + }], }; const serverPort = 8181; @@ -25,7 +25,7 @@ describe('browser/index.html', function desc() { before(() => { function serverCallback(req, res) { res.writeHead(200, { - 'Content-Type': 'text/html' + 'Content-Type': 'text/html', }); res.end(fs.readFileSync(path.resolve(env.sourceRootDir, 'test/modules/test.html'), 'utf-8')); } @@ -51,7 +51,7 @@ describe('browser/index.html', function desc() { it('should NOT show tabs when there is one team', () => { fs.writeFileSync(env.configFilePath, JSON.stringify({ - url: env.mattermostURL + url: env.mattermostURL, })); return this.app.restart().then(() => { return this.app.client.waitUntilWindowLoaded(). @@ -99,8 +99,8 @@ describe('browser/index.html', function desc() { version: 1, teams: [{ name: 'error_1', - url: 'http://false' - }] + url: 'http://false', + }], })); return this.app.restart().then(() => { return this.app.client.waitUntilWindowLoaded(). @@ -113,8 +113,8 @@ describe('browser/index.html', function desc() { version: 1, teams: [{ name: 'title_test', - url: `http://localhost:${serverPort}` - }] + url: `http://localhost:${serverPort}`, + }], })); return this.app.restart().then(() => { return this.app.client.waitUntilWindowLoaded().pause(2000); @@ -131,11 +131,11 @@ describe('browser/index.html', function desc() { version: 1, teams: [{ name: 'title_test_0', - url: `http://localhost:${serverPort}` + url: `http://localhost:${serverPort}`, }, { name: 'title_test_1', - url: `http://localhost:${serverPort}` - }] + url: `http://localhost:${serverPort}`, + }], })); return this.app.restart().then(() => { return this.app.client.waitUntilWindowLoaded().pause(500); @@ -170,11 +170,11 @@ describe('browser/index.html', function desc() { version: 1, teams: [{ name: 'title_test_0', - url: `http://localhost:${serverPort}` + url: `http://localhost:${serverPort}`, }, { name: 'title_test_1', - url: `http://localhost:${serverPort}` - }] + url: `http://localhost:${serverPort}`, + }], })); return this.app.restart().then(() => { // Note: Indices of webview are correct. diff --git a/test/specs/browser/settings_test.js b/test/specs/browser/settings_test.js index 1ae7971f..9decc9d7 100644 --- a/test/specs/browser/settings_test.js +++ b/test/specs/browser/settings_test.js @@ -11,11 +11,11 @@ describe('browser/settings.html', function desc() { version: 1, teams: [{ name: 'example', - url: env.mattermostURL + url: env.mattermostURL, }, { name: 'github', - url: 'https://github.com/' - }] + url: 'https://github.com/', + }], }; beforeEach(() => { @@ -473,7 +473,7 @@ describe('browser/settings.html', function desc() { const savedConfig = JSON.parse(fs.readFileSync(env.configFilePath, 'utf8')); savedConfig.teams.should.deep.contain({ name: 'TestTeam', - url: 'http://example.org' + url: 'http://example.org', }); done(); }).catch((err) => { diff --git a/test/specs/permisson_test.js b/test/specs/permisson_test.js index cf6f3dd2..0c81f802 100644 --- a/test/specs/permisson_test.js +++ b/test/specs/permisson_test.js @@ -54,22 +54,22 @@ describe('PermissionManager', function() { manager.grant(ORIGIN + '_another', PERMISSION + '_another'); JSON.parse(fs.readFileSync(permissionFile)).should.deep.equal({ origin: { - permission: 'denied' + permission: 'denied', }, origin_another: { - permission_another: 'granted' - } + permission_another: 'granted', + }, }); }); it('should restore permissions from the file', function() { fs.writeFileSync(permissionFile, JSON.stringify({ origin: { - permission: 'denied' + permission: 'denied', }, origin_another: { - permission_another: 'granted' - } + permission_another: 'granted', + }, })); const manager = new PermissionManager(permissionFile); manager.isDenied('origin', 'permission').should.be.true; diff --git a/test/specs/security_test.js b/test/specs/security_test.js index b8e70233..80a29583 100644 --- a/test/specs/security_test.js +++ b/test/specs/security_test.js @@ -16,17 +16,17 @@ describe('application', function desc() { version: 1, teams: [{ name: 'example_1', - url: testURL + url: testURL, }, { name: 'example_2', - url: testURL - }] + url: testURL, + }], }; before(() => { this.server = http.createServer((req, res) => { res.writeHead(200, { - 'Content-Type': 'text/html' + 'Content-Type': 'text/html', }); res.end(fs.readFileSync(path.resolve(env.sourceRootDir, 'test/modules/test.html'), 'utf-8')); }).listen(serverPort, '127.0.0.1'); @@ -114,7 +114,7 @@ describe('application', function desc() { }; return Promise.all([ tryEval(0), - tryEvalInSettingsPage() + tryEvalInSettingsPage(), ]); }); }); diff --git a/test/specs/settings_test.js b/test/specs/settings_test.js index 0b2b6fee..43a84096 100644 --- a/test/specs/settings_test.js +++ b/test/specs/settings_test.js @@ -6,7 +6,7 @@ const pastDefaultPreferences = require('../../src/common/config/pastDefaultPrefe describe('common/settings.js', () => { it('should upgrade v0 config file', () => { const v0Config = { - url: 'https://example.com/team' + url: 'https://example.com/team', }; const config = settings.upgrade(v0Config); config.teams.length.should.equal(1); @@ -18,17 +18,17 @@ describe('common/settings.js', () => { const teams = [ { name: 'test', - url: 'https://example.com' - } + url: 'https://example.com', + }, ]; const mergedTeams = settings.mergeDefaultTeams(teams); mergedTeams.should.deep.equal([ { name: 'test', - url: 'https://example.com' + url: 'https://example.com', }, - ...buildConfig.defaultTeams + ...buildConfig.defaultTeams, ]); }); }); diff --git a/webpack.config.base.js b/webpack.config.base.js index 4f8cd192..efe3dd12 100644 --- a/webpack.config.base.js +++ b/webpack.config.base.js @@ -3,5 +3,5 @@ const isProduction = process.env.NODE_ENV === 'production'; module.exports = { - devtool: isProduction ? false : '#inline-source-map' + devtool: isProduction ? false : '#inline-source-map', }; diff --git a/webpack.config.main.js b/webpack.config.main.js index dceed770..e4a70f5e 100644 --- a/webpack.config.main.js +++ b/webpack.config.main.js @@ -6,11 +6,11 @@ const base = require('./webpack.config.base'); module.exports = merge(base, { entry: './src/main.js', output: { - filename: './src/[name]_bundle.js' + filename: './src/[name]_bundle.js', }, node: { __filename: true, - __dirname: true + __dirname: true, }, - target: 'electron-main' + target: 'electron-main', }); diff --git a/webpack.config.renderer.js b/webpack.config.renderer.js index ab7ba2c8..7e3d8f78 100644 --- a/webpack.config.renderer.js +++ b/webpack.config.renderer.js @@ -8,40 +8,40 @@ module.exports = merge(base, { entry: { index: './src/browser/index.jsx', settings: './src/browser/settings.jsx', - 'webview/mattermost': './src/browser/webview/mattermost.js' + 'webview/mattermost': './src/browser/webview/mattermost.js', }, output: { path: path.join(__dirname, 'src/browser'), publicPath: 'browser', - filename: '[name]_bundle.js' + filename: '[name]_bundle.js', }, module: { rules: [{ test: /\.jsx$/, use: { - loader: 'babel-loader' - } + loader: 'babel-loader', + }, }, { test: /\.css$/, use: [ {loader: 'style-loader'}, - {loader: 'css-loader'} - ] + {loader: 'css-loader'}, + ], }, { test: /\.mp3$/, use: { - loader: 'url-loader' - } - }] + loader: 'url-loader', + }, + }], }, node: { __filename: true, - __dirname: true + __dirname: true, }, target: 'electron-renderer', devServer: { contentBase: path.join(__dirname, 'src'), inline: true, - publicPath: '/browser/' - } + publicPath: '/browser/', + }, });