Implemented strict linting standards and prettier formatting config. (#248)

* Implemented strict linting standards and prettier formatting config.

* More linter fixes and type updates.

* More linter updates and type fixes

* Remove noisy comments

* Linter and type updates

* Linter, formatting and type updates.

* Linter updates

* Type updates

* Type updates

* fixed all linter errors

* Fixed all linting, formatting and type issues.

* Resolve merge conflicts.
This commit is contained in:
Jas Singh
2024-09-14 16:20:05 -07:00
committed by GitHub
parent ff13e3dd3c
commit 2c72cc66d8
222 changed files with 13141 additions and 8433 deletions

View File

@@ -1,95 +1,91 @@
const network = await Service.import("network");
const bluetooth = await Service.import("bluetooth");
const notifications = await Service.import("notifications");
const audio = await Service.import("audio");
import { BoxWidget } from 'lib/types/widget';
const Controls = () => {
const network = await Service.import('network');
const bluetooth = await Service.import('bluetooth');
const notifications = await Service.import('notifications');
const audio = await Service.import('audio');
const Controls = (): BoxWidget => {
return Widget.Box({
class_name: "dashboard-card controls-container",
hpack: "fill",
vpack: "fill",
class_name: 'dashboard-card controls-container',
hpack: 'fill',
vpack: 'fill',
expand: true,
children: [
Widget.Button({
tooltip_text: "Toggle Wifi",
tooltip_text: 'Toggle Wifi',
expand: true,
setup: (self) => {
self.hook(network, () => {
return (self.class_name = `dashboard-button wifi ${!network.wifi.enabled ? "disabled" : ""}`);
return (self.class_name = `dashboard-button wifi ${!network.wifi.enabled ? 'disabled' : ''}`);
});
},
on_primary_click: () => network.toggleWifi(),
child: Widget.Label({
class_name: "txt-icon",
class_name: 'txt-icon',
setup: (self) => {
self.hook(network, () => {
return (self.label = network.wifi.enabled ? "󰤨" : "󰤭");
return (self.label = network.wifi.enabled ? '󰤨' : '󰤭');
});
},
}),
}),
Widget.Button({
tooltip_text: "Toggle Bluetooth",
tooltip_text: 'Toggle Bluetooth',
expand: true,
class_name: bluetooth
.bind("enabled")
.as(
(btOn) => `dashboard-button bluetooth ${!btOn ? "disabled" : ""}`,
),
.bind('enabled')
.as((btOn) => `dashboard-button bluetooth ${!btOn ? 'disabled' : ''}`),
on_primary_click: () => bluetooth.toggle(),
child: Widget.Label({
class_name: "txt-icon",
label: bluetooth.bind("enabled").as((btOn) => (btOn ? "󰂯" : "󰂲")),
class_name: 'txt-icon',
label: bluetooth.bind('enabled').as((btOn) => (btOn ? '󰂯' : '󰂲')),
}),
}),
Widget.Button({
tooltip_text: "Toggle Notifications",
tooltip_text: 'Toggle Notifications',
expand: true,
class_name: notifications
.bind("dnd")
.as(
(dnd) => `dashboard-button notifications ${dnd ? "disabled" : ""}`,
),
.bind('dnd')
.as((dnd) => `dashboard-button notifications ${dnd ? 'disabled' : ''}`),
on_primary_click: () => (notifications.dnd = !notifications.dnd),
child: Widget.Label({
class_name: "txt-icon",
label: notifications.bind("dnd").as((dnd) => (dnd ? "󰂛" : "󰂚")),
class_name: 'txt-icon',
label: notifications.bind('dnd').as((dnd) => (dnd ? '󰂛' : '󰂚')),
}),
}),
Widget.Button({
tooltip_text: "Toggle Mute (Playback)",
tooltip_text: 'Toggle Mute (Playback)',
expand: true,
on_primary_click: () =>
(audio.speaker.is_muted = !audio.speaker.is_muted),
on_primary_click: () => (audio.speaker.is_muted = !audio.speaker.is_muted),
setup: (self) => {
self.hook(audio, () => {
return (self.class_name = `dashboard-button playback ${audio.speaker.is_muted ? "disabled" : ""}`);
return (self.class_name = `dashboard-button playback ${audio.speaker.is_muted ? 'disabled' : ''}`);
});
},
child: Widget.Label({
class_name: "txt-icon",
class_name: 'txt-icon',
setup: (self) => {
self.hook(audio, () => {
return (self.label = audio.speaker.is_muted ? "󰖁" : "󰕾");
return (self.label = audio.speaker.is_muted ? '󰖁' : '󰕾');
});
},
}),
}),
Widget.Button({
tooltip_text: "Toggle Mute (Microphone)",
tooltip_text: 'Toggle Mute (Microphone)',
expand: true,
on_primary_click: () =>
(audio.microphone.is_muted = !audio.microphone.is_muted),
on_primary_click: () => (audio.microphone.is_muted = !audio.microphone.is_muted),
setup: (self) => {
self.hook(audio, () => {
return (self.class_name = `dashboard-button input ${audio.microphone.is_muted ? "disabled" : ""}`);
return (self.class_name = `dashboard-button input ${audio.microphone.is_muted ? 'disabled' : ''}`);
});
},
child: Widget.Label({
class_name: "txt-icon",
class_name: 'txt-icon',
setup: (self) => {
self.hook(audio, () => {
return (self.label = audio.microphone.is_muted ? "󰍭" : "󰍬");
return (self.label = audio.microphone.is_muted ? '󰍭' : '󰍬');
});
},
}),