From b910e2e39ee9b170a29c1c8609bb829f1e5b4e75 Mon Sep 17 00:00:00 2001 From: Jack Westbrook Date: Mon, 1 Dec 2025 14:58:45 +0100 Subject: [PATCH] chore(tsgo): clean up some more types, disable js typechecks --- eslint.config.js | 3 ++- .../src/grafana/notificationPolicies/utils.ts | 3 +-- .../grafana-sql/src/components/query-editor-raw/RawEditor.tsx | 4 ++-- .../app/plugins/datasource/loki/components/LokiContextUi.tsx | 4 ++-- scripts/webpack/env-util.js | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/eslint.config.js b/eslint.config.js index 2af812e1fe3..d3436a75ac6 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -1,4 +1,5 @@ -// @ts-check +// TODO: Migrate to Typescript. +// @ts-nocheck const emotionPlugin = require('@emotion/eslint-plugin'); const restrictedGlobals = require('confusing-browser-globals'); const importPlugin = require('eslint-plugin-import'); diff --git a/packages/grafana-alerting/src/grafana/notificationPolicies/utils.ts b/packages/grafana-alerting/src/grafana/notificationPolicies/utils.ts index 1fc7608a76f..a5b4ca3d7d8 100644 --- a/packages/grafana-alerting/src/grafana/notificationPolicies/utils.ts +++ b/packages/grafana-alerting/src/grafana/notificationPolicies/utils.ts @@ -110,10 +110,9 @@ export function getInheritedProperties( ...propertiesParentInherited, } as const; - // @ts-expect-error we're using "keyof" for the property so the type checker can help us out but this makes the - // reduce function signature unhappy const inherited = reduce( inheritableProperties, + // @ts-expect-error we're using "keyof" for the property so the type checker can help us out but this makes the (inheritedProperties: InheritableProperties, parentValue, property: keyof InheritableProperties) => { const parentHasValue = parentValue != null; diff --git a/packages/grafana-sql/src/components/query-editor-raw/RawEditor.tsx b/packages/grafana-sql/src/components/query-editor-raw/RawEditor.tsx index 14f32bd3cbe..2b0adc78e3c 100644 --- a/packages/grafana-sql/src/components/query-editor-raw/RawEditor.tsx +++ b/packages/grafana-sql/src/components/query-editor-raw/RawEditor.tsx @@ -1,7 +1,7 @@ import { css } from '@emotion/css'; import { useMemo, useState } from 'react'; import { useMeasure } from 'react-use'; -import AutoSizer from 'react-virtualized-auto-sizer'; +import AutoSizer, { type Size } from 'react-virtualized-auto-sizer'; import { GrafanaTheme2 } from '@grafana/data'; import { Trans, t } from '@grafana/i18n'; @@ -61,7 +61,7 @@ export function RawEditor({ db, query, onChange, onRunQuery, onValidate, queryTo const renderEditor = (standalone = false) => { return standalone ? ( - {({ width, height }) => { + {({ width, height }: Size) => { return renderQueryEditor(width, height); }} diff --git a/public/app/plugins/datasource/loki/components/LokiContextUi.tsx b/public/app/plugins/datasource/loki/components/LokiContextUi.tsx index 13cc4f9f023..513c328b858 100644 --- a/public/app/plugins/datasource/loki/components/LokiContextUi.tsx +++ b/public/app/plugins/datasource/loki/components/LokiContextUi.tsx @@ -331,7 +331,7 @@ export function LokiContextUi(props: LokiContextUiProps) { > Widen the search - isLoading={loading} options={realLabels.map(contextFilterToSelectFilter)} value={realLabelsEnabled.map(contextFilterToSelectFilter)} @@ -372,7 +372,7 @@ export function LokiContextUi(props: LokiContextUiProps) { > Refine the search - isLoading={loading} options={parsedLabels.map(contextFilterToSelectFilter)} value={parsedLabelsEnabled.map(contextFilterToSelectFilter)} diff --git a/scripts/webpack/env-util.js b/scripts/webpack/env-util.js index c963f476fee..eea9bbe5331 100644 --- a/scripts/webpack/env-util.js +++ b/scripts/webpack/env-util.js @@ -1,4 +1,4 @@ -// @ts-check +// @ts-nocheck const { parse } = require('ini'); const { readFileSync, existsSync } = require('node:fs'); const path = require('path');