Skip to content

Commit 6abd1de

Browse files
committed
eslint --fix on src/
Signed-off-by: Aaron Raimist <aaron@raim.ist>
1 parent ca1dec8 commit 6abd1de

File tree

9 files changed

+31
-42
lines changed

9 files changed

+31
-42
lines changed

.travis.yml

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,11 @@ sudo: required
1111
language: node_js
1212
node_js:
1313
# make sure we work with a range of node versions.
14-
# As of the time of writing:
15-
# - 4.x is still in LTS (until April 2018), but some of our deps (notably
16-
# extract-zip) don't work with it
17-
# - 5.x has been EOLed for nearly a year.
18-
# - 6.x is the active 'LTS' version
19-
# - 7.x is no longer supported
20-
# - 8.x is the current 'current' version (until October 2017)
2114
#
22-
# see: https://github.com/nodejs/LTS/
23-
#
24-
# anything before 6.3 ships with npm 3.9 or earlier, which had problems
25-
# with symlinks in node_modules (see
26-
# https://github.com/npm/npm/releases/tag/v3.10.0 'FIXES AND REFACTORING').
27-
- 6.3
15+
# Current status of node versions: https://github.com/nodejs/LTS/
2816
- 6
29-
- 7
17+
- 8
18+
- 10
3019
addons:
3120
chrome: stable
3221
install:

src/components/views/login/VectorCustomServerDialog.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ See the License for the specific language governing permissions and
1515
limitations under the License.
1616
*/
1717

18-
var React = require("react");
19-
var sanitizeHtml = require("sanitize-html");
18+
const React = require("react");
19+
const sanitizeHtml = require("sanitize-html");
2020
import { _t } from 'matrix-react-sdk/lib/languageHandler';
2121

2222
module.exports = React.createClass({
@@ -47,5 +47,5 @@ module.exports = React.createClass({
4747
</div>
4848
</div>
4949
);
50-
}
50+
},
5151
});

src/components/views/login/VectorLoginFooter.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ limitations under the License.
1616

1717
'use strict';
1818

19-
var React = require('react');
19+
const React = require('react');
2020
import { _t } from 'matrix-react-sdk/lib/languageHandler';
2121
import SettingsStore from 'matrix-react-sdk/lib/settings/SettingsStore';
2222

@@ -29,8 +29,8 @@ module.exports = React.createClass({
2929
render: function() {
3030
// FIXME: replace this with a proper Status skin
3131
// ...except then we wouldn't be able to switch to the Status theme at runtime.
32-
if (SettingsStore.getValue("theme") === 'status') return <div/>;
33-
32+
if (SettingsStore.getValue("theme") === 'status') return <div />;
33+
3434
return (
3535
<div className="mx_Login_links">
3636
<a href="https://medium.com/@RiotChat">blog</a>&nbsp;&nbsp;&middot;&nbsp;&nbsp;
@@ -39,5 +39,5 @@ module.exports = React.createClass({
3939
<a href="https://matrix.org">{ _t('powered by Matrix') }</a>
4040
</div>
4141
);
42-
}
42+
},
4343
});

src/components/views/login/VectorLoginHeader.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ module.exports = React.createClass({
3535
return (
3636
<div className="mx_Login_header">
3737
<div className="mx_Login_logo">
38-
<img src={this.props.icon || DEFAULT_LOGO_URI} alt="Riot"/>
38+
<img src={this.props.icon || DEFAULT_LOGO_URI} alt="Riot" />
3939
</div>
4040
</div>
4141
);
42-
}
42+
},
4343
});

src/vector/index.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,12 @@ function checkBrowserFeatures(featureList) {
8787
console.error("Cannot check features - Modernizr global is missing.");
8888
return false;
8989
}
90-
var featureComplete = true;
91-
for (var i = 0; i < featureList.length; i++) {
90+
let featureComplete = true;
91+
for (let i = 0; i < featureList.length; i++) {
9292
if (window.Modernizr[featureList[i]] === undefined) {
9393
console.error(
9494
"Looked for feature '%s' but Modernizr has no results for this. " +
95-
"Has it been configured correctly?", featureList[i]
95+
"Has it been configured correctly?", featureList[i],
9696
);
9797
return false;
9898
}
@@ -113,7 +113,7 @@ function getScreenFromLocation(location) {
113113
return {
114114
screen: fragparts.location.substring(1),
115115
params: fragparts.params,
116-
}
116+
};
117117
}
118118

119119
// Here, we do some crude URL analysis to allow
@@ -138,10 +138,10 @@ function onHashChange(ev) {
138138
// so a web page can update the URL bar appropriately.
139139
function onNewScreen(screen) {
140140
console.log("newscreen "+screen);
141-
var hash = '#/' + screen;
141+
const hash = '#/' + screen;
142142
lastLocationHashSet = hash;
143143
window.location.hash = hash;
144-
};
144+
}
145145

146146
// We use this to work out what URL the SDK should
147147
// pass through when registering to allow the user to
@@ -214,9 +214,9 @@ function onTokenLoginCompleted() {
214214
// if we did a token login, we're now left with the token, hs and is
215215
// url as query params in the url; a little nasty but let's redirect to
216216
// clear them.
217-
var parsedUrl = url.parse(window.location.href);
217+
const parsedUrl = url.parse(window.location.href);
218218
parsedUrl.search = "";
219-
var formatted = url.format(parsedUrl);
219+
const formatted = url.format(parsedUrl);
220220
console.log("Redirecting to " + formatted + " to drop loginToken " +
221221
"from queryparams");
222222
window.location.href = formatted;
@@ -293,7 +293,7 @@ async function loadApp() {
293293
// in case it is the first time loading Riot.
294294
// `InstallTrigger` is a Object which only exists on Firefox
295295
// (it is used for their Plugins) and can be used as a
296-
// feature check.
296+
// feature check.
297297
// Firefox loads css always before js. This is why we dont use
298298
// onload or it's EventListener as thoose will never trigger.
299299
if (typeof InstallTrigger !== 'undefined') {
@@ -345,19 +345,19 @@ async function loadApp() {
345345
initialScreenAfterLogin={getScreenFromLocation(window.location)}
346346
defaultDeviceDisplayName={platform.getDefaultDeviceDisplayName()}
347347
/>,
348-
document.getElementById('matrixchat')
348+
document.getElementById('matrixchat'),
349349
);
350350
} else {
351351
console.error("Browser is missing required features.");
352352
// take to a different landing page to AWOOOOOGA at the user
353-
var CompatibilityPage = sdk.getComponent("structures.CompatibilityPage");
353+
const CompatibilityPage = sdk.getComponent("structures.CompatibilityPage");
354354
window.matrixChat = ReactDOM.render(
355355
<CompatibilityPage onAccept={function() {
356356
if (window.localStorage) window.localStorage.setItem('mx_accepts_unsupported_browser', true);
357357
console.log("User accepts the compatibility risks.");
358358
loadApp();
359359
}} />,
360-
document.getElementById('matrixchat')
360+
document.getElementById('matrixchat'),
361361
);
362362
}
363363
}

src/vector/platform/ElectronPlatform.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import rageshake from 'matrix-react-sdk/lib/rageshake/rageshake';
2727
remote.autoUpdater.on('update-downloaded', onUpdateDownloaded);
2828

2929
// try to flush the rageshake logs to indexeddb before quit.
30-
ipcRenderer.on('before-quit', function () {
30+
ipcRenderer.on('before-quit', function() {
3131
console.log('riot-desktop closing');
3232
rageshake.flush();
3333
});

src/vector/platform/VectorBasePlatform.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ export default class VectorBasePlatform extends BasePlatform {
114114
dis.dispatch({
115115
action: 'check_updates',
116116
value: false,
117-
})
117+
});
118118
}
119119

120120
getUpdateCheckStatusEnum() {

src/vector/platform/WebPlatform.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import Promise from 'bluebird';
2626
import url from 'url';
2727
import UAParser from 'ua-parser-js';
2828

29-
var POKE_RATE_MS = 10 * 60 * 1000; // 10 min
29+
const POKE_RATE_MS = 10 * 60 * 1000; // 10 min
3030

3131
export default class WebPlatform extends VectorBasePlatform {
3232
constructor() {

src/vector/url_utils.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,16 @@ import qs from 'querystring';
2323
export function parseQsFromFragment(location) {
2424
// if we have a fragment, it will start with '#', which we need to drop.
2525
// (if we don't, this will return '').
26-
var fragment = location.hash.substring(1);
26+
const fragment = location.hash.substring(1);
2727

2828
// our fragment may contain a query-param-like section. we need to fish
2929
// this out *before* URI-decoding because the params may contain ? and &
3030
// characters which are only URI-encoded once.
31-
var hashparts = fragment.split('?');
31+
const hashparts = fragment.split('?');
3232

33-
var result = {
33+
const result = {
3434
location: decodeURIComponent(hashparts[0]),
35-
params: {}
35+
params: {},
3636
};
3737

3838
if (hashparts.length > 1) {

0 commit comments

Comments
 (0)