From 310c764f608049fe59578bf72b6f28ded83ce83d Mon Sep 17 00:00:00 2001 From: hadijahkyampeire Date: Fri, 15 Dec 2023 02:21:44 +0300 Subject: [PATCH] fix lint changes --- .../src/implementer-tools.component.tsx | 16 +++++------ packages/framework/esm-globals/src/events.ts | 16 ++++------- packages/framework/esm-globals/src/public.ts | 4 +-- .../framework/esm-styleguide/src/_all.scss | 26 +++++++++--------- .../framework/esm-styleguide/src/index.ts | 18 ++++++------- .../framework/esm-styleguide/src/public.ts | 27 +++++++------------ .../src/toasts/toast.component.tsx | 8 +++--- 7 files changed, 48 insertions(+), 67 deletions(-) diff --git a/packages/apps/esm-implementer-tools-app/src/implementer-tools.component.tsx b/packages/apps/esm-implementer-tools-app/src/implementer-tools.component.tsx index 7c4ba3fb3..7c76e24e8 100644 --- a/packages/apps/esm-implementer-tools-app/src/implementer-tools.component.tsx +++ b/packages/apps/esm-implementer-tools-app/src/implementer-tools.component.tsx @@ -1,10 +1,6 @@ -import React, { useState, useEffect } from "react"; -import { showToast, UserHasAccess, useStore } from "@openmrs/esm-framework"; -import { - implementerToolsStore, - showModuleDiagnostics, - togglePopup, -} from "./store"; +import React, { useState, useEffect } from 'react'; +import { showToast, UserHasAccess, useStore } from '@openmrs/esm-framework'; +import { implementerToolsStore, showModuleDiagnostics, togglePopup } from './store'; import { useBackendDependencies } from './backend-dependencies/useBackendDependencies'; import { hasInvalidDependencies } from './backend-dependencies/openmrs-backend-dependencies'; @@ -30,10 +26,10 @@ function PopupHandler() { if (shouldShowNotification) { showToast({ critical: false, - kind: "error", + kind: 'error', description: t( - "checkImplementerToolsMessage", - "Check the Backend Modules tab in the Implementer Tools for more details" + 'checkImplementerToolsMessage', + 'Check the Backend Modules tab in the Implementer Tools for more details', ), title: t('modulesWithMissingDependenciesWarning', 'Some modules have unresolved backend dependencies'), actionButtonLabel: t('viewModules', 'View modules'), diff --git a/packages/framework/esm-globals/src/events.ts b/packages/framework/esm-globals/src/events.ts index 0aa9c83a2..d2504e682 100644 --- a/packages/framework/esm-globals/src/events.ts +++ b/packages/framework/esm-globals/src/events.ts @@ -67,13 +67,7 @@ export interface ShowToastEvent { /** @category UI */ export interface ShowSnackbarEvent { subtitle?: any; - kind?: - | "error" - | "info" - | "info-square" - | "success" - | "warning" - | "warning-alt"; + kind?: 'error' | 'info' | 'info-square' | 'success' | 'warning' | 'warning-alt'; title: string; actionButtonLabel?: string | any; onActionButtonClick?: () => void; @@ -82,10 +76,10 @@ export interface ShowSnackbarEvent { timeoutInMs?: number; } -const notificationShownName = "openmrs:notification-shown"; -const actionableNotificationShownName = "openmrs:actionable-notification-shown"; -const toastShownName = "openmrs:toast-shown"; -const snackbarShownName = "openmrs:snack-bar-shown"; +const notificationShownName = 'openmrs:notification-shown'; +const actionableNotificationShownName = 'openmrs:actionable-notification-shown'; +const toastShownName = 'openmrs:toast-shown'; +const snackbarShownName = 'openmrs:snack-bar-shown'; export function dispatchNotificationShown(data: ShowNotificationEvent) { window.dispatchEvent(new CustomEvent(notificationShownName, { detail: data })); diff --git a/packages/framework/esm-globals/src/public.ts b/packages/framework/esm-globals/src/public.ts index d1d598c7e..f6d95b61d 100644 --- a/packages/framework/esm-globals/src/public.ts +++ b/packages/framework/esm-globals/src/public.ts @@ -12,5 +12,5 @@ export { subscribeActionableNotificationShown, subscribeToastShown, subscribeSnackbarShown, -} from "./events"; -export * from "./types"; +} from './events'; +export * from './types'; diff --git a/packages/framework/esm-styleguide/src/_all.scss b/packages/framework/esm-styleguide/src/_all.scss index 6294f2e94..0f0ebd26b 100644 --- a/packages/framework/esm-styleguide/src/_all.scss +++ b/packages/framework/esm-styleguide/src/_all.scss @@ -2,18 +2,18 @@ @import '@carbon/charts/styles.css'; @import './vars'; -@import "./components/general"; -@import "./components/canvas"; -@import "./components/colors"; -@import "./components/breadcrumbs"; -@import "./components/main-content"; -@import "./icons/icons"; -@import "./logo/logo"; -@import "./spinner/spinner"; -@import "./notifications/notifications"; -@import "./notifications/actionable-notifications"; -@import "./toasts/toasts"; -@import "./snackbars/snackbars"; -@import "./modals/modals"; +@import './components/general'; +@import './components/canvas'; +@import './components/colors'; +@import './components/breadcrumbs'; +@import './components/main-content'; +@import './icons/icons'; +@import './logo/logo'; +@import './spinner/spinner'; +@import './notifications/notifications'; +@import './notifications/actionable-notifications'; +@import './toasts/toasts'; +@import './snackbars/snackbars'; +@import './modals/modals'; @import './overrides'; diff --git a/packages/framework/esm-styleguide/src/index.ts b/packages/framework/esm-styleguide/src/index.ts index d7296d843..4a39c4afa 100644 --- a/packages/framework/esm-styleguide/src/index.ts +++ b/packages/framework/esm-styleguide/src/index.ts @@ -4,15 +4,15 @@ import { setupBranding } from './brand'; import { defineConfigSchema } from '@openmrs/esm-framework'; import { esmStyleGuideSchema } from './config-schema'; -export * from "./breakpoints"; -export * from "./spinner"; -export * from "./notifications"; -export * from "./toasts"; -export * from "./snackbars"; -export * from "./modals"; -export * from "./left-nav"; -export * from "./error-state"; -export * from "./datepicker"; +export * from './breakpoints'; +export * from './spinner'; +export * from './notifications'; +export * from './toasts'; +export * from './snackbars'; +export * from './modals'; +export * from './left-nav'; +export * from './error-state'; +export * from './datepicker'; defineConfigSchema('@openmrs/esm-styleguide', esmStyleGuideSchema); setupBranding(); diff --git a/packages/framework/esm-styleguide/src/public.ts b/packages/framework/esm-styleguide/src/public.ts index c05d60046..f759b821a 100644 --- a/packages/framework/esm-styleguide/src/public.ts +++ b/packages/framework/esm-styleguide/src/public.ts @@ -3,21 +3,12 @@ export { type NotificationDescriptor, type InlineNotificationType } from './noti export { type ActionableNotificationDescriptor, type ActionableNotificationType, -} from "./notifications/actionable-notification.component"; -export { showToast } from "./toasts"; -export { showModal } from "./modals"; -export { - type ToastDescriptor, - type ToastType, - type ToastNotificationMeta, -} from "./toasts/toast.component"; -export { showSnackbar } from "./snackbars"; -export { - type SnackbarDescriptor, - type SnackbarType, - type SnackbarMeta, -} from "./snackbars/snackbar.component"; - -export * from "./left-nav"; -export * from "./error-state"; -export * from "./datepicker"; +} from './notifications/actionable-notification.component'; +export { showToast } from './toasts'; +export { showModal } from './modals'; +export { type ToastDescriptor, type ToastType, type ToastNotificationMeta } from './toasts/toast.component'; +export { showSnackbar } from './snackbars'; +export { type SnackbarDescriptor, type SnackbarType, type SnackbarMeta } from './snackbars/snackbar.component'; +export * from './left-nav'; +export * from './error-state'; +export * from './datepicker'; diff --git a/packages/framework/esm-styleguide/src/toasts/toast.component.tsx b/packages/framework/esm-styleguide/src/toasts/toast.component.tsx index f06c15914..7c5900f0c 100644 --- a/packages/framework/esm-styleguide/src/toasts/toast.component.tsx +++ b/packages/framework/esm-styleguide/src/toasts/toast.component.tsx @@ -1,6 +1,6 @@ /** @module @category UI */ -import React, { useEffect, useState, useCallback } from "react"; -import { ActionableNotification } from "@carbon/react"; +import React, { useEffect, useCallback } from 'react'; +import { ActionableNotification } from '@carbon/react'; const defaultOptions = { millis: 5000, @@ -53,10 +53,10 @@ export const Toast: React.FC = ({ toast, closeToast }) => { return (