Fix lint issues

And disable eslint when building in prod mode

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2020-11-30 10:24:11 +01:00
parent da42522073
commit 2d541f2e32
161 changed files with 3869 additions and 1236 deletions

View File

@@ -52,7 +52,9 @@ export class Actor implements IActor {
}
public displayName(): string {
return this.name != null && this.name !== "" ? this.name : this.usernameWithDomain();
return this.name != null && this.name !== ""
? this.name
: this.usernameWithDomain();
}
}

View File

@@ -60,7 +60,8 @@ export class Address implements IAddress {
let alternativeName = "";
let poiIcon: IPOIIcon = poiIcons.default;
// Google Maps doesn't have a type
if (this.type == null && this.description === this.street) this.type = "house";
if (this.type == null && this.description === this.street)
this.type = "house";
switch (this.type) {
case "house":
@@ -81,8 +82,12 @@ export class Address implements IAddress {
case "zone":
case "city":
case "administrative":
name = this.postalCode ? `${this.description} (${this.postalCode})` : this.description;
alternativeName = [this.region, this.country].filter((zone) => zone).join(", ");
name = this.postalCode
? `${this.description} (${this.postalCode})`
: this.description;
alternativeName = [this.region, this.country]
.filter((zone) => zone)
.join(", ");
poiIcon = poiIcons.defaultAdministrative;
break;
default:

View File

@@ -41,7 +41,9 @@ export class Discussion implements IDiscussion {
this.title = hash.title;
this.comments = {
total: hash.comments.total,
elements: hash.comments.elements.map((comment: IComment) => new CommentModel(comment)),
elements: hash.comments.elements.map(
(comment: IComment) => new CommentModel(comment)
),
};
this.slug = hash.slug;
this.creator = hash.creator;

View File

@@ -184,7 +184,9 @@ export class EventModel implements IEvent {
this.onlineAddress = hash.onlineAddress;
this.phoneAddress = hash.phoneAddress;
this.physicalAddress = hash.physicalAddress ? new Address(hash.physicalAddress) : undefined;
this.physicalAddress = hash.physicalAddress
? new Address(hash.physicalAddress)
: undefined;
this.participantStats = hash.participantStats;
this.contacts = hash.contacts;
@@ -209,7 +211,8 @@ export class EventModel implements IEvent {
phoneAddress: this.phoneAddress,
physicalAddress: this.physicalAddress,
options: this.options,
attributedToId: this.attributedTo && this.attributedTo.id ? this.attributedTo.id : null,
attributedToId:
this.attributedTo && this.attributedTo.id ? this.attributedTo.id : null,
contacts: this.contacts.map(({ id }) => ({
id,
})),