Update eslint plugin & fix silly indenting

As per https://github.com/matrix-org/eslint-plugin-matrix-org/pull/15
this caused a bunch of silly indenting to creep in, so this fixes it
back to the previous style.
This commit is contained in:
David Baker 2021-08-03 17:07:37 +01:00
parent b51fb0cb94
commit 28f5dc483b
14 changed files with 49 additions and 49 deletions

View file

@ -153,7 +153,7 @@
"enzyme": "^3.11.0", "enzyme": "^3.11.0",
"eslint": "7.18.0", "eslint": "7.18.0",
"eslint-config-google": "^0.14.0", "eslint-config-google": "^0.14.0",
"eslint-plugin-matrix-org": "github:matrix-org/eslint-plugin-matrix-org#main", "eslint-plugin-matrix-org": "github:matrix-org/eslint-plugin-matrix-org#2306b3d4da4eba908b256014b979f1d3d43d2945",
"eslint-plugin-react": "^7.22.0", "eslint-plugin-react": "^7.22.0",
"eslint-plugin-react-hooks": "^4.2.0", "eslint-plugin-react-hooks": "^4.2.0",
"glob": "^7.1.6", "glob": "^7.1.6",

View file

@ -146,23 +146,23 @@ export default class IdentityAuthClient {
const QuestionDialog = sdk.getComponent("dialogs.QuestionDialog"); const QuestionDialog = sdk.getComponent("dialogs.QuestionDialog");
const { finished } = Modal.createTrackedDialog('Default identity server terms warning', '', const { finished } = Modal.createTrackedDialog('Default identity server terms warning', '',
QuestionDialog, { QuestionDialog, {
title: _t("Identity server has no terms of service"), title: _t("Identity server has no terms of service"),
description: ( description: (
<div> <div>
<p>{ _t( <p>{ _t(
"This action requires accessing the default identity server " + "This action requires accessing the default identity server " +
"<server /> to validate an email address or phone number, " + "<server /> to validate an email address or phone number, " +
"but the server does not have any terms of service.", {}, "but the server does not have any terms of service.", {},
{ {
server: () => <b>{ abbreviateUrl(identityServerUrl) }</b>, server: () => <b>{ abbreviateUrl(identityServerUrl) }</b>,
}, },
) }</p> ) }</p>
<p>{ _t( <p>{ _t(
"Only continue if you trust the owner of the server.", "Only continue if you trust the owner of the server.",
) }</p> ) }</p>
</div> </div>
), ),
button: _t("Trust"), button: _t("Trust"),
}); });
const [confirmed] = await finished; const [confirmed] = await finished;
if (confirmed) { if (confirmed) {

View file

@ -163,7 +163,7 @@ const shortcuts: Record<Categories, IShortcut[]> = {
modifiers: [Modifiers.SHIFT], modifiers: [Modifiers.SHIFT],
key: Key.PAGE_UP, key: Key.PAGE_UP,
}], }],
description: _td("Jump to oldest unread message"), description: _td("Jump to oldest unread message"),
}, { }, {
keybinds: [{ keybinds: [{
modifiers: [CMD_OR_CTRL, Modifiers.SHIFT], modifiers: [CMD_OR_CTRL, Modifiers.SHIFT],

View file

@ -490,9 +490,9 @@ class RoomStateExplorer extends React.PureComponent<IExplorerProps, IRoomStateEx
forceStateEvent={true} forceStateEvent={true}
onBack={this.onBack} onBack={this.onBack}
inputs={{ inputs={{
eventType: this.state.event.getType(), eventType: this.state.event.getType(),
evContent: JSON.stringify(this.state.event.getContent(), null, '\t'), evContent: JSON.stringify(this.state.event.getContent(), null, '\t'),
stateKey: this.state.event.getStateKey(), stateKey: this.state.event.getStateKey(),
}} }}
/>; />;
} }

View file

@ -20,10 +20,10 @@ import { _t } from '../../../languageHandler';
import SdkConfig from '../../../SdkConfig'; import SdkConfig from '../../../SdkConfig';
export default function KeySignatureUploadFailedDialog({ export default function KeySignatureUploadFailedDialog({
failures, failures,
source, source,
continuation, continuation,
onFinished, onFinished,
}) { }) {
const RETRIES = 2; const RETRIES = 2;
const BaseDialog = sdk.getComponent('dialogs.BaseDialog'); const BaseDialog = sdk.getComponent('dialogs.BaseDialog');

View file

@ -152,7 +152,7 @@ const PinnedMessagesCard = ({ room, onClose }: IProps) => {
<h2>{ _t("Nothing pinned, yet") }</h2> <h2>{ _t("Nothing pinned, yet") }</h2>
{ _t("If you have permissions, open the menu on any message and select " + { _t("If you have permissions, open the menu on any message and select " +
"<b>Pin</b> to stick them here.", {}, { "<b>Pin</b> to stick them here.", {}, {
b: sub => <b>{ sub }</b>, b: sub => <b>{ sub }</b>,
}) } }) }
</div> </div>
</div>; </div>;

View file

@ -1381,8 +1381,8 @@ const BasicUserInfo: React.FC<{
className="mx_UserInfo_field" className="mx_UserInfo_field"
onClick={() => { onClick={() => {
dis.dispatch({ dis.dispatch({
action: Action.ViewUserSettings, action: Action.ViewUserSettings,
initialTabId: UserTab.Security, initialTabId: UserTab.Security,
}); });
}} }}
> >

View file

@ -64,9 +64,9 @@ const NewRoomIntro = () => {
height={AVATAR_SIZE} height={AVATAR_SIZE}
onClick={() => { onClick={() => {
defaultDispatcher.dispatch<ViewUserPayload>({ defaultDispatcher.dispatch<ViewUserPayload>({
action: Action.ViewUser, action: Action.ViewUser,
// XXX: We should be using a real member object and not assuming what the receiver wants. // XXX: We should be using a real member object and not assuming what the receiver wants.
member: member || { userId: dmPartner } as User, member: member || { userId: dmPartner } as User,
}); });
}} }}
/> />

View file

@ -145,7 +145,7 @@ export default class ReadReceiptMarker extends React.PureComponent {
if (oldInfo && oldInfo.left) { if (oldInfo && oldInfo.left) {
// start at the old height and in the old h pos // start at the old height and in the old h pos
startStyles.push({ top: startTopOffset+"px", startStyles.push({ top: startTopOffset+"px",
left: toPx(oldInfo.left) }); left: toPx(oldInfo.left) });
} }
startStyles.push({ top: startTopOffset+'px', left: '0' }); startStyles.push({ top: startTopOffset+'px', left: '0' });
@ -174,14 +174,14 @@ export default class ReadReceiptMarker extends React.PureComponent {
title = _t( title = _t(
"Seen by %(userName)s at %(dateTime)s", "Seen by %(userName)s at %(dateTime)s",
{ userName: this.props.fallbackUserId, { userName: this.props.fallbackUserId,
dateTime: dateString }, dateTime: dateString },
); );
} else { } else {
title = _t( title = _t(
"Seen by %(displayName)s (%(userName)s) at %(dateTime)s", "Seen by %(displayName)s (%(userName)s) at %(dateTime)s",
{ displayName: this.props.member.rawDisplayName, { displayName: this.props.member.rawDisplayName,
userName: this.props.fallbackUserId, userName: this.props.fallbackUserId,
dateTime: dateString }, dateTime: dateString },
); );
} }
} }

View file

@ -106,7 +106,7 @@ describe('MemberEventListSummary', function() {
const result = wrapper.props.children; const result = wrapper.props.children;
expect(result.props.children).toEqual([ expect(result.props.children).toEqual([
<div className="event_tile" key="event0">Expanded membership</div>, <div className="event_tile" key="event0">Expanded membership</div>,
]); ]);
}); });
@ -129,8 +129,8 @@ describe('MemberEventListSummary', function() {
const result = wrapper.props.children; const result = wrapper.props.children;
expect(result.props.children).toEqual([ expect(result.props.children).toEqual([
<div className="event_tile" key="event0">Expanded membership</div>, <div className="event_tile" key="event0">Expanded membership</div>,
<div className="event_tile" key="event1">Expanded membership</div>, <div className="event_tile" key="event1">Expanded membership</div>,
]); ]);
}); });

View file

@ -56,7 +56,7 @@ describe("ContentRules", function() {
describe("parseContentRules", function() { describe("parseContentRules", function() {
it("should handle there being no keyword rules", function() { it("should handle there being no keyword rules", function() {
const rules = { 'global': { 'content': [ const rules = { 'global': { 'content': [
USERNAME_RULE, USERNAME_RULE,
] } }; ] } };
const parsed = ContentRules.parseContentRules(rules); const parsed = ContentRules.parseContentRules(rules);
expect(parsed.rules).toEqual([]); expect(parsed.rules).toEqual([]);

View file

@ -129,8 +129,8 @@ export function mkEvent(opts) {
if (opts.skey) { if (opts.skey) {
event.state_key = opts.skey; event.state_key = opts.skey;
} else if (["m.room.name", "m.room.topic", "m.room.create", "m.room.join_rules", } else if (["m.room.name", "m.room.topic", "m.room.create", "m.room.join_rules",
"m.room.power_levels", "m.room.topic", "m.room.history_visibility", "m.room.encryption", "m.room.power_levels", "m.room.topic", "m.room.history_visibility", "m.room.encryption",
"com.example.state"].indexOf(opts.type) !== -1) { "com.example.state"].indexOf(opts.type) !== -1) {
event.state_key = ""; event.state_key = "";
} }
return opts.event ? new MatrixEvent(event) : event; return opts.event ? new MatrixEvent(event) : event;

View file

@ -49,7 +49,7 @@ describe("shieldStatusForMembership self-trust behaviour", function() {
it.each( it.each(
[[true, true], [true, false], [[true, true], [true, false],
[false, true], [false, false]], [false, true], [false, false]],
)("2 unverified: returns 'normal', self-trust = %s, DM = %s", async (trusted, dm) => { )("2 unverified: returns 'normal', self-trust = %s, DM = %s", async (trusted, dm) => {
const client = mkClient(trusted); const client = mkClient(trusted);
const room = { const room = {
@ -62,7 +62,7 @@ describe("shieldStatusForMembership self-trust behaviour", function() {
it.each( it.each(
[["verified", true, true], ["verified", true, false], [["verified", true, true], ["verified", true, false],
["verified", false, true], ["warning", false, false]], ["verified", false, true], ["warning", false, false]],
)("2 verified: returns '%s', self-trust = %s, DM = %s", async (result, trusted, dm) => { )("2 verified: returns '%s', self-trust = %s, DM = %s", async (result, trusted, dm) => {
const client = mkClient(trusted); const client = mkClient(trusted);
const room = { const room = {
@ -75,7 +75,7 @@ describe("shieldStatusForMembership self-trust behaviour", function() {
it.each( it.each(
[["normal", true, true], ["normal", true, false], [["normal", true, true], ["normal", true, false],
["normal", false, true], ["warning", false, false]], ["normal", false, true], ["warning", false, false]],
)("2 mixed: returns '%s', self-trust = %s, DM = %s", async (result, trusted, dm) => { )("2 mixed: returns '%s', self-trust = %s, DM = %s", async (result, trusted, dm) => {
const client = mkClient(trusted); const client = mkClient(trusted);
const room = { const room = {
@ -88,7 +88,7 @@ describe("shieldStatusForMembership self-trust behaviour", function() {
it.each( it.each(
[["verified", true, true], ["verified", true, false], [["verified", true, true], ["verified", true, false],
["warning", false, true], ["warning", false, false]], ["warning", false, true], ["warning", false, false]],
)("0 others: returns '%s', self-trust = %s, DM = %s", async (result, trusted, dm) => { )("0 others: returns '%s', self-trust = %s, DM = %s", async (result, trusted, dm) => {
const client = mkClient(trusted); const client = mkClient(trusted);
const room = { const room = {
@ -101,7 +101,7 @@ describe("shieldStatusForMembership self-trust behaviour", function() {
it.each( it.each(
[["verified", true, true], ["verified", true, false], [["verified", true, true], ["verified", true, false],
["verified", false, true], ["verified", false, false]], ["verified", false, true], ["verified", false, false]],
)("1 verified: returns '%s', self-trust = %s, DM = %s", async (result, trusted, dm) => { )("1 verified: returns '%s', self-trust = %s, DM = %s", async (result, trusted, dm) => {
const client = mkClient(trusted); const client = mkClient(trusted);
const room = { const room = {
@ -114,7 +114,7 @@ describe("shieldStatusForMembership self-trust behaviour", function() {
it.each( it.each(
[["normal", true, true], ["normal", true, false], [["normal", true, true], ["normal", true, false],
["normal", false, true], ["normal", false, false]], ["normal", false, true], ["normal", false, false]],
)("1 unverified: returns '%s', self-trust = %s, DM = %s", async (result, trusted, dm) => { )("1 unverified: returns '%s', self-trust = %s, DM = %s", async (result, trusted, dm) => {
const client = mkClient(trusted); const client = mkClient(trusted);
const room = { const room = {

View file

@ -3233,9 +3233,9 @@ eslint-config-google@^0.14.0:
resolved "https://registry.yarnpkg.com/eslint-config-google/-/eslint-config-google-0.14.0.tgz#4f5f8759ba6e11b424294a219dbfa18c508bcc1a" resolved "https://registry.yarnpkg.com/eslint-config-google/-/eslint-config-google-0.14.0.tgz#4f5f8759ba6e11b424294a219dbfa18c508bcc1a"
integrity sha512-WsbX4WbjuMvTdeVL6+J3rK1RGhCTqjsFjX7UMSMgZiyxxaNLkoJENbrGExzERFeoTpGw3F3FypTiWAP9ZXzkEw== integrity sha512-WsbX4WbjuMvTdeVL6+J3rK1RGhCTqjsFjX7UMSMgZiyxxaNLkoJENbrGExzERFeoTpGw3F3FypTiWAP9ZXzkEw==
"eslint-plugin-matrix-org@github:matrix-org/eslint-plugin-matrix-org#main": "eslint-plugin-matrix-org@github:matrix-org/eslint-plugin-matrix-org#2306b3d4da4eba908b256014b979f1d3d43d2945":
version "0.3.4" version "0.3.5"
resolved "https://codeload.github.com/matrix-org/eslint-plugin-matrix-org/tar.gz/45f6937539192e3820edcafc4d6d4d4187e85a6a" resolved "https://codeload.github.com/matrix-org/eslint-plugin-matrix-org/tar.gz/2306b3d4da4eba908b256014b979f1d3d43d2945"
eslint-plugin-react-hooks@^4.2.0: eslint-plugin-react-hooks@^4.2.0:
version "4.2.0" version "4.2.0"