Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Update babel-eslint to 8.1.1 #2255

Merged
merged 5 commits into from
Oct 29, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions .eslintignore.errorfiles
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,8 @@ src/component-index.js
src/components/structures/BottomLeftMenu.js
src/components/structures/CompatibilityPage.js
src/components/structures/CreateRoom.js
src/components/structures/HomePage.js
src/components/structures/LeftPanel.js
src/components/structures/LoggedInView.js
src/components/structures/login/ForgotPassword.js
src/components/structures/LoginBox.js
src/components/structures/MessagePanel.js
src/components/structures/NotificationPanel.js
src/components/structures/RoomDirectory.js
Expand All @@ -22,22 +19,17 @@ src/components/structures/SearchBox.js
src/components/structures/TimelinePanel.js
src/components/structures/UploadBar.js
src/components/structures/UserSettings.js
src/components/structures/ViewSource.js
src/components/views/avatars/BaseAvatar.js
src/components/views/avatars/MemberAvatar.js
src/components/views/create_room/RoomAlias.js
src/components/views/dialogs/ChangelogDialog.js
src/components/views/dialogs/DeactivateAccountDialog.js
src/components/views/dialogs/SetPasswordDialog.js
src/components/views/dialogs/UnknownDeviceDialog.js
src/components/views/directory/NetworkDropdown.js
src/components/views/elements/AddressSelector.js
src/components/views/elements/DeviceVerifyButtons.js
src/components/views/elements/DirectorySearchBox.js
src/components/views/elements/ImageView.js
src/components/views/elements/InlineSpinner.js
src/components/views/elements/MemberEventListSummary.js
src/components/views/elements/Spinner.js
src/components/views/elements/TintableSvg.js
src/components/views/elements/UserSelector.js
src/components/views/globals/MatrixToolbar.js
Expand Down Expand Up @@ -90,7 +82,6 @@ src/MatrixClientPeg.js
src/Modal.js
src/notifications/ContentRules.js
src/notifications/PushRuleVectorState.js
src/notifications/StandardActions.js
src/notifications/VectorPushRulesDefinitions.js
src/Notifier.js
src/PlatformPeg.js
Expand All @@ -111,7 +102,6 @@ src/utils/MultiInviter.js
src/utils/Receipt.js
src/VectorConferenceHandler.js
src/Velociraptor.js
src/VelocityBounce.js
src/WhoIsTyping.js
src/wrappers/withMatrixClient.js
test/components/structures/login/Registration-test.js
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
"devDependencies": {
"babel-cli": "^6.26.0",
"babel-core": "^6.26.3",
"babel-eslint": "^6.1.2",
"babel-eslint": "^10.0.1",
"babel-loader": "^7.1.5",
"babel-plugin-add-module-exports": "^0.2.1",
"babel-plugin-transform-async-to-bluebird": "^1.1.1",
Expand All @@ -115,9 +115,9 @@
"babel-preset-react": "^6.24.1",
"chokidar": "^1.6.1",
"concurrently": "^4.0.1",
"eslint": "^3.13.1",
"eslint": "^5.8.0",
"eslint-config-google": "^0.7.1",
"eslint-plugin-babel": "^4.1.2",
"eslint-plugin-babel": "^5.2.1",
"eslint-plugin-flowtype": "^2.30.0",
"eslint-plugin-react": "^7.7.0",
"estree-walker": "^0.5.0",
Expand Down
1 change: 0 additions & 1 deletion src/ComposerHistoryManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import _clamp from 'lodash/clamp';
type MessageFormat = 'rich' | 'markdown';

class HistoryItem {

// We store history items in their native format to ensure history is accurate
// and then convert them if our RTE has subsequently changed format.
value: Value;
Expand Down
1 change: 0 additions & 1 deletion src/Entities.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ class MemberEntity extends Entity {
}

class UserEntity extends Entity {

constructor(model, showInviteButton, inviteFn) {
super(model);
this.showInviteButton = Boolean(showInviteButton);
Expand Down
2 changes: 1 addition & 1 deletion src/HtmlUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export function containsEmoji(str) {
* because we want to include emoji shortnames in title text
*/
function unicodeToImage(str) {
let replaceWith, unicode, alt, short, fname;
let replaceWith; let unicode; let alt; let short; let fname;
const mappedUnicode = emojione.mapUnicodeToShort();

str = str.replace(emojione.regUnicode, function(unicodeChar) {
Expand Down
1 change: 0 additions & 1 deletion src/PasswordReset.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import { _t } from './languageHandler';
* API on the homeserver in question with the new password.
*/
class PasswordReset {

/**
* Configure the endpoints for password resetting.
* @param {string} homeserverUrl The URL to the HS which has the account to reset.
Expand Down
1 change: 0 additions & 1 deletion src/Presence.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ const UNAVAILABLE_TIME_MS = 3 * 60 * 1000; // 3 mins
const PRESENCE_STATES = ["online", "offline", "unavailable"];

class Presence {

/**
* Start listening the user activity to evaluate his presence state.
* Any state change will be sent to the Home Server.
Expand Down
3 changes: 1 addition & 2 deletions src/Rooms.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ export function getDisplayAliasForRoom(room) {
* return the other one. Otherwise, return null.
*/
export function getOnlyOtherMember(room, myUserId) {

if (room.currentState.getJoinedMemberCount() === 2) {
return room.getJoinedMembers().filter(function(m) {
return m.userId !== myUserId;
Expand Down Expand Up @@ -103,7 +102,7 @@ export function guessAndSetDMRoom(room, isDirect) {
let newTarget;
if (isDirect) {
const guessedUserId = guessDMRoomTargetId(
room, MatrixClientPeg.get().getUserId()
room, MatrixClientPeg.get().getUserId(),
);
newTarget = guessedUserId;
} else {
Expand Down
1 change: 0 additions & 1 deletion src/ScalarAuthClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ const SdkConfig = require('./SdkConfig');
const MatrixClientPeg = require('./MatrixClientPeg');

class ScalarAuthClient {

constructor() {
this.scalarToken = null;
}
Expand Down
1 change: 0 additions & 1 deletion src/SdkConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ const DEFAULTS = {
};

class SdkConfig {

static get() {
return global.mxReactSdkConfig || {};
}
Expand Down
1 change: 0 additions & 1 deletion src/UserActivity.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ const CURRENTLY_ACTIVE_THRESHOLD_MS = 2000;
* with the app (but at a much lower frequency than mouse move events)
*/
class UserActivity {

/**
* Start listening to user activity
*/
Expand Down
2 changes: 1 addition & 1 deletion src/UserSettingsStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export default {
device_display_name: address,
lang: navigator.language,
data: data,
append: true, // We always append for email pushers since we don't want to stop other accounts notifying to the same email address
append: true, // We always append for email pushers since we don't want to stop other accounts notifying to the same email address
});
},
};
4 changes: 2 additions & 2 deletions src/VelocityBounce.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ const Velocity = require('velocity-vector');
// courtesy of https://github.com/julianshapiro/velocity/issues/283
// We only use easeOutBounce (easeInBounce is just sort of nonsensical)
function bounce( p ) {
let pow2,
bounce = 4;
let pow2;
let bounce = 4;

while ( p < ( ( pow2 = Math.pow( 2, --bounce ) ) - 1 ) / 11 ) {
// just sets pow2
Expand Down
2 changes: 1 addition & 1 deletion src/autocomplete/Autocompleter.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export default class Autocompleter {
provider
.getCompletions(query, selection, force)
.timeout(PROVIDER_COMPLETION_TIMEOUT)
.reflect()
.reflect(),
),
);

Expand Down
2 changes: 1 addition & 1 deletion src/autocomplete/CommunityProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export default class CommunityProvider extends AutocompleteProvider {
if (command) {
const joinedGroups = cli.getGroups().filter(({myMembership}) => myMembership === 'join');

const groups = (await Promise.all(joinedGroups.map(async ({groupId}) => {
const groups = (await Promise.all(joinedGroups.map(async({groupId}) => {
try {
return FlairStore.getGroupProfileCached(cli, groupId);
} catch (e) { // if FlairStore failed, fall back to just groupId
Expand Down
1 change: 0 additions & 1 deletion src/autocomplete/PlainWithPillsSerializer.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import { Block } from 'slate';
*/

class PlainWithPillsSerializer {

/*
* @param {String} options.pillFormat - either 'md', 'plain', 'id'
*/
Expand Down
12 changes: 6 additions & 6 deletions src/components/structures/BottomLeftMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ module.exports = React.createClass({
},

getInitialState: function() {
return({
directoryHover : false,
roomsHover : false,
return ({
directoryHover: false,
roomsHover: false,
homeHover: false,
peopleHover : false,
settingsHover : false,
peopleHover: false,
settingsHover: false,
});
},

Expand Down Expand Up @@ -145,7 +145,7 @@ module.exports = React.createClass({
// Get the label/tooltip to show
getLabel: function(label, show) {
if (show) {
var RoomTooltip = sdk.getComponent("rooms.RoomTooltip");
const RoomTooltip = sdk.getComponent("rooms.RoomTooltip");
return <RoomTooltip className="mx_BottomLeftMenu_tooltip" label={label} />;
}
},
Expand Down
9 changes: 4 additions & 5 deletions src/components/structures/CompatibilityPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,18 @@ limitations under the License.

'use strict';

var React = require('react');
const React = require('react');
import { _t } from '../../languageHandler';

module.exports = React.createClass({
displayName: 'CompatibilityPage',
propTypes: {
onAccept: React.PropTypes.func
onAccept: React.PropTypes.func,
},

getDefaultProps: function() {
return {
onAccept: function() {} // NOP
onAccept: function() {}, // NOP
};
},

Expand All @@ -36,7 +36,6 @@ module.exports = React.createClass({
},

render: function() {

return (
<div className="mx_CompatibilityPage">
<div className="mx_CompatibilityPage_box">
Expand Down Expand Up @@ -69,5 +68,5 @@ module.exports = React.createClass({
</div>
</div>
);
}
},
});
8 changes: 4 additions & 4 deletions src/components/structures/CreateRoom.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ module.exports = React.createClass({
},

phases: {
CONFIG: "CONFIG", // We're waiting for user to configure and hit create.
CREATING: "CREATING", // We're sending the request.
CREATED: "CREATED", // We successfully created the room.
ERROR: "ERROR", // There was an error while trying to create room.
CONFIG: "CONFIG", // We're waiting for user to configure and hit create.
CREATING: "CREATING", // We're sending the request.
CREATED: "CREATED", // We successfully created the room.
ERROR: "ERROR", // There was an error while trying to create room.
},

getDefaultProps: function() {
Expand Down
2 changes: 1 addition & 1 deletion src/components/structures/GroupView.js
Original file line number Diff line number Diff line change
Expand Up @@ -777,7 +777,7 @@ export default React.createClass({
),
button: _t("Leave"),
danger: this.state.isUserPrivileged,
onFinished: async (confirmed) => {
onFinished: async(confirmed) => {
if (!confirmed) return;

this.setState({membershipBusy: true});
Expand Down
14 changes: 6 additions & 8 deletions src/components/structures/HomePage.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,14 @@ class HomePage extends React.Component {

if (this.props.teamToken && this.props.teamServerUrl) {
this.setState({
iframeSrc: `${this.props.teamServerUrl}/static/${this.props.teamToken}/home.html`
iframeSrc: `${this.props.teamServerUrl}/static/${this.props.teamToken}/home.html`,
});
}
else {
} else {
// we use request() to inline the homepage into the react component
// so that it can inherit CSS and theming easily rather than mess around
// with iframes and trying to synchronise document.stylesheets.

let src = this.props.homePageUrl || 'home.html';
const src = this.props.homePageUrl || 'home.html';

request(
{ method: "GET", url: src },
Expand All @@ -77,7 +76,7 @@ class HomePage extends React.Component {

body = body.replace(/_t\(['"]([\s\S]*?)['"]\)/mg, (match, g1)=>this.translate(g1));
this.setState({ page: body });
}
},
);
}
}
Expand All @@ -93,8 +92,7 @@ class HomePage extends React.Component {
<iframe src={ this.state.iframeSrc } />
</div>
);
}
else {
} else {
const GeminiScrollbarWrapper = sdk.getComponent("elements.GeminiScrollbarWrapper");
return (
<GeminiScrollbarWrapper autoshow={true} className="mx_HomePage">
Expand All @@ -106,4 +104,4 @@ class HomePage extends React.Component {
}
}

module.exports = HomePage;
module.exports = HomePage;
6 changes: 3 additions & 3 deletions src/components/structures/LeftPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import VectorConferenceHandler from '../../VectorConferenceHandler';
import SettingsStore from '../../settings/SettingsStore';


var LeftPanel = React.createClass({
const LeftPanel = React.createClass({
displayName: 'LeftPanel',

// NB. If you add props, don't forget to update
Expand Down Expand Up @@ -214,11 +214,11 @@ var LeftPanel = React.createClass({
collapsed={this.props.collapsed}
searchFilter={this.state.searchFilter}
ConferenceHandler={VectorConferenceHandler} />
<BottomLeftMenu collapsed={this.props.collapsed}/>
<BottomLeftMenu collapsed={this.props.collapsed} />
</aside>
</div>
);
}
},
});

module.exports = LeftPanel;
6 changes: 3 additions & 3 deletions src/components/structures/LoggedInView.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,13 +189,13 @@ const LoggedInView = React.createClass({
_updateServerNoticeEvents: async function() {
const roomLists = RoomListStore.getRoomLists();
if (!roomLists['m.server_notice']) return [];

const pinnedEvents = [];
for (const room of roomLists['m.server_notice']) {
const pinStateEvent = room.currentState.getStateEvents("m.room.pinned_events", "");

if (!pinStateEvent || !pinStateEvent.getContent().pinned) continue;

const pinnedEventIds = pinStateEvent.getContent().pinned.slice(0, MAX_PINNED_NOTICES_PER_ROOM);
for (const eventId of pinnedEventIds) {
const timeline = await this._matrixClient.getEventTimeline(room.getUnfilteredTimelineSet(), eventId, 0);
Expand All @@ -207,7 +207,7 @@ const LoggedInView = React.createClass({
serverNoticeEvents: pinnedEvents,
});
},


_onKeyDown: function(ev) {
/*
Expand Down
2 changes: 1 addition & 1 deletion src/components/structures/LoginBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,5 @@ module.exports = React.createClass({
{ loginButton }
</div>
);
}
},
});
Loading