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,35 +1,37 @@
import { Notification, Notifications } from "types/service/notifications";
import { Attribute, Child } from 'lib/types/widget';
import { Notification, Notifications } from 'types/service/notifications';
import Box from 'types/widgets/box';
const Action = (notif: Notification, notifs: Notifications) => {
const Action = (notif: Notification, notifs: Notifications): Box<Child, Attribute> => {
if (notif.actions !== undefined && notif.actions.length > 0) {
return Widget.Box({
class_name: "notification-card-actions",
class_name: 'notification-card-actions',
hexpand: true,
vpack: "end",
vpack: 'end',
children: notif.actions.map((action) => {
return Widget.Button({
hexpand: true,
class_name: "notification-action-buttons",
class_name: 'notification-action-buttons',
on_primary_click: () => {
if (action.id.includes("scriptAction:-")) {
Utils.execAsync(
`${action.id.replace("scriptAction:-", "")}`,
).catch((err) => console.error(err));
if (action.id.includes('scriptAction:-')) {
Utils.execAsync(`${action.id.replace('scriptAction:-', '')}`).catch((err) =>
console.error(err),
);
notifs.CloseNotification(notif.id);
} else {
notif.invoke(action.id);
}
},
child: Widget.Box({
hpack: "center",
hpack: 'center',
hexpand: true,
children: [
Widget.Label({
class_name: "notification-action-buttons-label",
class_name: 'notification-action-buttons-label',
hexpand: true,
label: action.label,
max_width_chars: 15,
truncate: "end",
truncate: 'end',
wrap: true,
}),
],