Ver código fonte

Chore: Fixes some strict errors (#18381)

Hugo Häggmark 6 anos atrás
pai
commit
c8b195147e

+ 1 - 1
public/app/app.ts

@@ -46,7 +46,7 @@ extensionsIndex.keys().forEach((key: any) => {
 export class GrafanaApp {
   registerFunctions: any;
   ngModuleDependencies: any[];
-  preBootModules: any[];
+  preBootModules: any[] | null;
 
   constructor() {
     addClassIfNoOverlayScrollbar('no-overlay-scrollbar');

+ 1 - 1
public/app/core/components/AlertBox/AlertBox.tsx

@@ -18,7 +18,7 @@ function getIconFromSeverity(severity: AppNotificationSeverity): string {
       return 'fa fa-check';
     }
     default:
-      return null;
+      return '';
   }
 }
 

+ 1 - 1
public/app/core/components/CopyToClipboard/CopyToClipboard.tsx

@@ -11,7 +11,7 @@ interface Props {
 }
 
 export class CopyToClipboard extends PureComponent<Props> {
-  clipboardjs: ClipboardJS;
+  clipboardjs?: ClipboardJS;
   myRef: any;
 
   constructor(props: Props) {

+ 3 - 1
public/app/core/components/EmptyListCTA/EmptyListCTA.tsx

@@ -28,7 +28,9 @@ const EmptyListCTA: React.FunctionComponent<Props> = props => {
         {proTipLinkTitle}
       </a>
     </span>
-  ) : null;
+  ) : (
+    ''
+  );
 
   const ctaElementClassName = !footer
     ? css`

+ 3 - 3
public/app/core/copy/appNotification.ts

@@ -1,7 +1,7 @@
 import { AppNotification, AppNotificationSeverity, AppNotificationTimeout } from 'app/types';
 import { getMessageFromError } from 'app/core/utils/errors';
 
-const defaultSuccessNotification: AppNotification = {
+const defaultSuccessNotification = {
   title: '',
   text: '',
   severity: AppNotificationSeverity.Success,
@@ -9,7 +9,7 @@ const defaultSuccessNotification: AppNotification = {
   timeout: AppNotificationTimeout.Success,
 };
 
-const defaultWarningNotification: AppNotification = {
+const defaultWarningNotification = {
   title: '',
   text: '',
   severity: AppNotificationSeverity.Warning,
@@ -17,7 +17,7 @@ const defaultWarningNotification: AppNotification = {
   timeout: AppNotificationTimeout.Warning,
 };
 
-const defaultErrorNotification: AppNotification = {
+const defaultErrorNotification = {
   title: '',
   text: '',
   severity: AppNotificationSeverity.Error,

+ 1 - 1
public/app/types/appNotifications.ts

@@ -1,5 +1,5 @@
 export interface AppNotification {
-  id?: number;
+  id: number;
   severity: AppNotificationSeverity;
   icon: string;
   title: string;