Misc linter cleanup

This commit is contained in:
Travis Ralston 2019-02-21 17:53:29 -07:00
parent 1e6594ceba
commit 9795161f40
4 changed files with 10 additions and 15 deletions

View file

@ -31,7 +31,6 @@ src/components/views/globals/UpdateCheckBar.js
src/components/views/messages/MFileBody.js src/components/views/messages/MFileBody.js
src/components/views/messages/RoomAvatarEvent.js src/components/views/messages/RoomAvatarEvent.js
src/components/views/messages/TextualBody.js src/components/views/messages/TextualBody.js
src/components/views/room_settings/AliasSettings.js
src/components/views/room_settings/ColorSettings.js src/components/views/room_settings/ColorSettings.js
src/components/views/rooms/Autocomplete.js src/components/views/rooms/Autocomplete.js
src/components/views/rooms/AuxPanel.js src/components/views/rooms/AuxPanel.js

View file

@ -16,7 +16,6 @@ limitations under the License.
import React from 'react'; import React from 'react';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import sdk from '../../../index';
import {_t} from '../../../languageHandler.js'; import {_t} from '../../../languageHandler.js';
import Field from "./Field"; import Field from "./Field";
import AccessibleButton from "./AccessibleButton"; import AccessibleButton from "./AccessibleButton";
@ -80,14 +79,14 @@ export class EditableItem extends React.Component {
return ( return (
<div className="mx_EditableItem"> <div className="mx_EditableItem">
<img src={require("../../../../res/img/feather-icons/cancel.svg")} width={14} height={14} <img src={require("../../../../res/img/feather-icons/cancel.svg")} width={14} height={14}
onClick={this._onRemove} className="mx_EditableItem_delete" alt={_t("Remove")}/> onClick={this._onRemove} className="mx_EditableItem_delete" alt={_t("Remove")} />
<span className="mx_EditableItem_item">{this.props.value}</span> <span className="mx_EditableItem_item">{this.props.value}</span>
</div> </div>
); );
} }
} }
export default class EditableItemList extends React.Component{ export default class EditableItemList extends React.Component {
static propTypes = { static propTypes = {
items: PropTypes.arrayOf(PropTypes.string).isRequired, items: PropTypes.arrayOf(PropTypes.string).isRequired,
itemsLabel: PropTypes.string, itemsLabel: PropTypes.string,
@ -130,13 +129,13 @@ export default class EditableItemList extends React.Component{
{_t("Add")} {_t("Add")}
</AccessibleButton> </AccessibleButton>
</form> </form>
) );
} }
render() { render() {
const editableItems = this.props.items.map((item, index) => { const editableItems = this.props.items.map((item, index) => {
if (!this.props.canRemove) { if (!this.props.canRemove) {
return <li>{item}</li> return <li>{item}</li>;
} }
return <EditableItem return <EditableItem

View file

@ -15,10 +15,8 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
import Promise from 'bluebird';
const React = require('react'); const React = require('react');
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
const ObjectUtils = require("../../../ObjectUtils");
const MatrixClientPeg = require('../../../MatrixClientPeg'); const MatrixClientPeg = require('../../../MatrixClientPeg');
const sdk = require("../../../index"); const sdk = require("../../../index");
import { _t } from '../../../languageHandler'; import { _t } from '../../../languageHandler';
@ -98,7 +96,7 @@ export default class AliasSettings extends React.Component {
title: _t("Error updating main address"), title: _t("Error updating main address"),
description: _t( description: _t(
"There was an error updating the room's main address. It may not be allowed by the server " + "There was an error updating the room's main address. It may not be allowed by the server " +
"or a temporary failure occurred." "or a temporary failure occurred.",
), ),
}); });
}).finally(() => { }).finally(() => {
@ -136,7 +134,7 @@ export default class AliasSettings extends React.Component {
title: _t("Error creating alias"), title: _t("Error creating alias"),
description: _t( description: _t(
"There was an error creating that alias. It may not be allowed by the server " + "There was an error creating that alias. It may not be allowed by the server " +
"or a temporary failure occurred." "or a temporary failure occurred.",
), ),
}); });
}); });
@ -172,7 +170,7 @@ export default class AliasSettings extends React.Component {
title: _t("Error removing alias"), title: _t("Error removing alias"),
description: _t( description: _t(
"There was an error removing that alias. It may no longer exist or a temporary " + "There was an error removing that alias. It may no longer exist or a temporary " +
"error occurred." "error occurred.",
), ),
}); });
}); });

View file

@ -20,7 +20,6 @@ import {MatrixEvent, MatrixClient} from 'matrix-js-sdk';
import sdk from '../../../index'; import sdk from '../../../index';
import { _t } from '../../../languageHandler'; import { _t } from '../../../languageHandler';
import Modal from '../../../Modal'; import Modal from '../../../Modal';
import isEqual from 'lodash/isEqual';
import ErrorDialog from "../dialogs/ErrorDialog"; import ErrorDialog from "../dialogs/ErrorDialog";
const GROUP_ID_REGEX = /\+\S+:\S+/; const GROUP_ID_REGEX = /\+\S+:\S+/;
@ -58,10 +57,10 @@ export default class RelatedGroupSettings extends React.Component {
title: _t("Error updating flair"), title: _t("Error updating flair"),
description: _t( description: _t(
"There was an error updating the flair for this room. The server may not allow it or " + "There was an error updating the flair for this room. The server may not allow it or " +
"a temporary error occurred." "a temporary error occurred.",
), ),
}); });
}) });
} }
validateGroupId(groupId) { validateGroupId(groupId) {
@ -120,4 +119,4 @@ export default class RelatedGroupSettings extends React.Component {
/> />
</div>; </div>;
} }
}; }