Skip to content
This repository has been archived by the owner on Oct 25, 2022. It is now read-only.

Commit

Permalink
style: Fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
oliversalzburg committed Jul 17, 2021
1 parent 02d5f6b commit 58bcc67
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 37 deletions.
4 changes: 2 additions & 2 deletions packages/userscript/source/ui/SettingsSectionUi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ export abstract class SettingsSectionUi<TState> {

// How many items to stock.
const stockElement = $("<div/>", {
id: "stock-value-" + name,
id: `stock-value-${name}`,
text: this._host.i18n("resources.stock", [
stock === Infinity ? "∞" : this._host.gamePage.getDisplayValueExt(stock),
]),
Expand Down Expand Up @@ -378,7 +378,7 @@ export abstract class SettingsSectionUi<TState> {

protected setStockValue(name: Resource, value: number, forReset = false): void {
if (value < 0) {
this._host.warning("ignoring non-numeric or invalid stock value " + value);
this._host.warning(`ignoring non-numeric or invalid stock value '${value}'`);
return;
}

Expand Down
10 changes: 5 additions & 5 deletions packages/userscript/source/ui/SpaceSettingsUi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ export class SpaceSettingsUi extends SettingsSectionUi<SpaceSettings> {
const itext = ucfirst(this._host.i18n("ui.space"));

// Our main element is a list item.
const element = $("<li/>", { id: "ks-" + toggleName });
const element = $("<li/>", { id: `ks-${toggleName}` });

const label = $("<label/>", {
text: itext,
});
label.on("click", () => this._itemsButton.trigger("click"));

const input = $("<input/>", {
id: "toggle-" + toggleName,
id: `toggle-${toggleName}`,
type: "checkbox",
});
this._options.$enabled = input;
Expand All @@ -56,7 +56,7 @@ export class SpaceSettingsUi extends SettingsSectionUi<SpaceSettings> {

// Create "trigger" button in the item.
this._triggerButton = $("<div/>", {
id: "trigger-" + toggleName,
id: `trigger-${toggleName}`,
text: this._host.i18n("ui.trigger"),
//title: this._options.trigger,
css: {
Expand Down Expand Up @@ -90,7 +90,7 @@ export class SpaceSettingsUi extends SettingsSectionUi<SpaceSettings> {
element.css("borderBottom", "1px solid rgba(185, 185, 185, 0.7)");

this._itemsButton = $("<div/>", {
id: "toggle-items-" + toggleName,
id: `toggle-items-${toggleName}`,
text: "+",
css: {
cursor: "pointer",
Expand Down Expand Up @@ -273,7 +273,7 @@ export class SpaceSettingsUi extends SettingsSectionUi<SpaceSettings> {
});

const maxButton = $("<div/>", {
id: "set-" + name + "-max",
id: `set-${name}-max`,
text: this._host.i18n("ui.max", [option.max]),
//title: option.max,
css: {
Expand Down
26 changes: 13 additions & 13 deletions packages/userscript/source/ui/TimeControlSettingsUi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export class TimeControlSettingsUi extends SettingsSectionUi<TimeControlSettings
element.css("borderBottom", "1px solid rgba(185, 185, 185, 0.7)");

this._itemsButton = $("<div/>", {
id: "toggle-items-" + toggleName,
id: `toggle-items-${toggleName}`,
text: "+",
css: {
cursor: "pointer",
Expand Down Expand Up @@ -182,7 +182,7 @@ export class TimeControlSettingsUi extends SettingsSectionUi<TimeControlSettings
});

const cyclesButton = $("<div/>", {
id: "toggle-cycle-" + name,
id: `toggle-cycle-${name}`,
text: this._host.i18n("ui.cycles"),
css: {
cursor: "pointer",
Expand All @@ -194,7 +194,7 @@ export class TimeControlSettingsUi extends SettingsSectionUi<TimeControlSettings
});

const cyclesList = $("<ul/>", {
id: "cycles-list-" + name,
id: `cycles-list-${name}`,
css: { display: "none", paddingLeft: "20px" },
});

Expand All @@ -207,7 +207,7 @@ export class TimeControlSettingsUi extends SettingsSectionUi<TimeControlSettings
}

const seasonsButton = $("<div/>", {
id: "toggle-seasons-" + name,
id: `toggle-seasons-${name}`,
text: this._host.i18n("trade.seasons"),
css: {
cursor: "pointer",
Expand All @@ -219,7 +219,7 @@ export class TimeControlSettingsUi extends SettingsSectionUi<TimeControlSettings
});

const seasonsList = $("<ul/>", {
id: "seasons-list-" + name,
id: `seasons-list-${name}`,
css: { display: "none", paddingLeft: "20px" },
});

Expand Down Expand Up @@ -1071,7 +1071,7 @@ export class TimeControlSettingsUi extends SettingsSectionUi<TimeControlSettings
const element = this.getOption(name, option, label);

const triggerButton = $("<div/>", {
id: "set-" + name + "-subTrigger",
id: `set-${name}-subTrigger`,
text: this._host.i18n("ui.trigger"),
//title: option.subTrigger,
css: {
Expand Down Expand Up @@ -1111,12 +1111,12 @@ export class TimeControlSettingsUi extends SettingsSectionUi<TimeControlSettings
const element = $("<li/>");

const label = $("<label/>", {
for: "toggle-timeSkip-" + index,
for: `toggle-timeSkip-${index}`,
text: cycle.title,
});

const input = $("<input/>", {
id: "toggle-timeSkip-" + index,
id: `toggle-timeSkip-${index}`,
type: "checkbox",
}).data("option", option);
option[`$${index}` as const] = input;
Expand Down Expand Up @@ -1148,7 +1148,7 @@ export class TimeControlSettingsUi extends SettingsSectionUi<TimeControlSettings
const elementLabel = i18nName;

const label = $("<label/>", {
for: "toggle-reset-" + type + "-" + name,
for: `toggle-reset-${type}-${name}`,
text: elementLabel,
css: {
display: "inline-block",
Expand All @@ -1158,7 +1158,7 @@ export class TimeControlSettingsUi extends SettingsSectionUi<TimeControlSettings
});

const input = $("<input/>", {
id: "toggle-reset-" + type + "-" + name,
id: `toggle-reset-${type}-${name}`,
type: "checkbox",
}).data("option", option);
option.$checkForReset = input;
Expand All @@ -1174,7 +1174,7 @@ export class TimeControlSettingsUi extends SettingsSectionUi<TimeControlSettings
});

const minButton = $("<div/>", {
id: "set-reset-" + type + "-" + name + "-min",
id: `set-reset-${type}-${name}-min`,
text: this._host.i18n("ui.min", [option.triggerForReset]),
//title: option.triggerForReset,
css: {
Expand Down Expand Up @@ -1213,12 +1213,12 @@ export class TimeControlSettingsUi extends SettingsSectionUi<TimeControlSettings
const element = $("<li/>");

const label = $("<label/>", {
for: "toggle-timeSkip-" + season,
for: `toggle-timeSkip-${season}`,
text: ucfirst(iseason),
});

const input = $("<input/>", {
id: "toggle-timeSkip-" + season,
id: `toggle-timeSkip-${season}`,
type: "checkbox",
}).data("option", option);
option[`$${season}` as const] = input;
Expand Down
8 changes: 4 additions & 4 deletions packages/userscript/source/ui/TimeSettingsUi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ export class TimeSettingsUi extends SettingsSectionUi<TimeSettings> {
const itext = ucfirst(this._host.i18n("ui.time"));

// Our main element is a list item.
const element = $("<li/>", { id: "ks-" + toggleName });
const element = $("<li/>", { id: `ks-${toggleName}` });

const label = $("<label/>", {
text: itext,
});
label.on("click", () => this._itemsButton.trigger("click"));

const input = $("<input/>", {
id: "toggle-" + toggleName,
id: `toggle-${toggleName}`,
type: "checkbox",
});
this._options.$enabled = input;
Expand All @@ -56,7 +56,7 @@ export class TimeSettingsUi extends SettingsSectionUi<TimeSettings> {

// Create "trigger" button in the item.
this._triggerButton = $("<div/>", {
id: "trigger-" + toggleName,
id: `trigger-${toggleName}`,
text: this._host.i18n("ui.trigger"),
//title: this._options.trigger,
css: {
Expand Down Expand Up @@ -90,7 +90,7 @@ export class TimeSettingsUi extends SettingsSectionUi<TimeSettings> {
element.css("borderBottom", "1px solid rgba(185, 185, 185, 0.7)");

this._itemsButton = $("<div/>", {
id: "toggle-items-" + toggleName,
id: `toggle-items-${toggleName}`,
text: "+",
css: {
cursor: "pointer",
Expand Down
20 changes: 10 additions & 10 deletions packages/userscript/source/ui/TradingSettingsUi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ export class TradingSettingsUi extends SettingsSectionUi<TradingSettings> {
const itext = ucfirst(this._host.i18n("ui.trade"));

// Our main element is a list item.
const element = $("<li/>", { id: "ks-" + toggleName });
const element = $("<li/>", { id: `ks-${toggleName}` });

const label = $("<label/>", {
text: itext,
});
label.on("click", () => this._itemsButton.trigger("click"));

const input = $("<input/>", {
id: "toggle-" + toggleName,
id: `toggle-${toggleName}`,
type: "checkbox",
});
this._options.$enabled = input;
Expand All @@ -57,7 +57,7 @@ export class TradingSettingsUi extends SettingsSectionUi<TradingSettings> {

// Create "trigger" button in the item.
this._triggerButton = $("<div/>", {
id: "trigger-" + toggleName,
id: `trigger-${toggleName}`,
text: this._host.i18n("ui.trigger"),
//title: this._options.trigger,
css: {
Expand Down Expand Up @@ -91,7 +91,7 @@ export class TradingSettingsUi extends SettingsSectionUi<TradingSettings> {
element.css("borderBottom", "1px solid rgba(185, 185, 185, 0.7)");

this._itemsButton = $("<div/>", {
id: "toggle-items-" + toggleName,
id: `toggle-items-${toggleName}`,
text: "+",
css: {
cursor: "pointer",
Expand Down Expand Up @@ -176,12 +176,12 @@ export class TradingSettingsUi extends SettingsSectionUi<TradingSettings> {

//Limited Trading
const label = $("<label/>", {
for: "toggle-limited-" + name,
for: `toggle-limited-${name}`,
text: this._host.i18n("ui.limit"),
});

const input = $("<input/>", {
id: "toggle-limited-" + name,
id: `toggle-limited-${name}`,
type: "checkbox",
}).data("option", option);
option.$limited = input;
Expand All @@ -208,7 +208,7 @@ export class TradingSettingsUi extends SettingsSectionUi<TradingSettings> {
//Limited Trading End

const button = $("<div/>", {
id: "toggle-seasons-" + name,
id: `toggle-seasons-${name}`,
text: this._host.i18n("trade.seasons"),
css: {
cursor: "pointer",
Expand All @@ -220,7 +220,7 @@ export class TradingSettingsUi extends SettingsSectionUi<TradingSettings> {
});

const list = $("<ul/>", {
id: "seasons-list-" + name,
id: `seasons-list-${name}`,
css: { display: "none", paddingLeft: "20px" },
});

Expand All @@ -246,12 +246,12 @@ export class TradingSettingsUi extends SettingsSectionUi<TradingSettings> {
const element = $("<li/>");

const label = $("<label/>", {
for: "toggle-" + name + "-" + season,
for: `toggle-${name}-${season}`,
text: ucfirst(iseason),
});

const input = $("<input/>", {
id: "toggle-" + name + "-" + season,
id: `toggle-${name}-${season}`,
type: "checkbox",
}).data("option", option);
option[`$${season}` as const] = input;
Expand Down
6 changes: 3 additions & 3 deletions packages/userscript/source/ui/UnlockingSettingsUi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ export class UnlockingSettingsUi extends SettingsSectionUi<UnlockingSettings> {
const itext = ucfirst(this._host.i18n("ui.upgrade"));

// Our main element is a list item.
const element = $("<li/>", { id: "ks-" + toggleName });
const element = $("<li/>", { id: `ks-${toggleName}` });

const label = $("<label/>", {
text: itext,
});
label.on("click", () => this._itemsButton.trigger("click"));

const input = $("<input/>", {
id: "toggle-" + toggleName,
id: `toggle-${toggleName}`,
type: "checkbox",
});
this._options.$enabled = input;
Expand Down Expand Up @@ -61,7 +61,7 @@ export class UnlockingSettingsUi extends SettingsSectionUi<UnlockingSettings> {
element.css("borderBottom", "1px solid rgba(185, 185, 185, 0.7)");

this._itemsButton = $("<div/>", {
id: "toggle-items-" + toggleName,
id: `toggle-items-${toggleName}`,
text: "+",
css: {
cursor: "pointer",
Expand Down

0 comments on commit 58bcc67

Please sign in to comment.