= {}): string[] => {
diff --git a/public/app/features/transformers/editors/SortByTransformerEditor.tsx b/public/app/features/transformers/editors/SortByTransformerEditor.tsx
index 899649ca3e0..ff595611e27 100644
--- a/public/app/features/transformers/editors/SortByTransformerEditor.tsx
+++ b/public/app/features/transformers/editors/SortByTransformerEditor.tsx
@@ -23,7 +23,7 @@ export const SortByTransformerEditor = ({ input, options, onChange }: Transforme
[onChange, options]
);
- const sorts = options.sort?.length ? options.sort : [{} as SortByField];
+ const sorts: SortByField[] = options.sort?.length ? options.sort : [{} as SortByField];
return (
diff --git a/public/app/features/transformers/fieldToConfigMapping/fieldToConfigMapping.ts b/public/app/features/transformers/fieldToConfigMapping/fieldToConfigMapping.ts
index 5c81ccc6327..8eca18f14d1 100644
--- a/public/app/features/transformers/fieldToConfigMapping/fieldToConfigMapping.ts
+++ b/public/app/features/transformers/fieldToConfigMapping/fieldToConfigMapping.ts
@@ -135,7 +135,7 @@ export const configMapHandlers: FieldToConfigMapHandler[] = [
{
key: 'displayName',
name: 'Display name',
- processor: (value: any) => value.toString(),
+ processor: (value) => value.toString(),
},
{
key: 'color',
@@ -247,7 +247,7 @@ export function getConfigMapHandlersIndex() {
return configMapHandlersIndex;
}
-function toNumericOrUndefined(value: any) {
+function toNumericOrUndefined(value: unknown) {
const numeric = anyToNumber(value);
if (isNaN(numeric)) {
diff --git a/public/app/features/transformers/lookupGazetteer/FieldLookupTransformerEditor.tsx b/public/app/features/transformers/lookupGazetteer/FieldLookupTransformerEditor.tsx
index 2784d9e17da..810a0d2fb50 100644
--- a/public/app/features/transformers/lookupGazetteer/FieldLookupTransformerEditor.tsx
+++ b/public/app/features/transformers/lookupGazetteer/FieldLookupTransformerEditor.tsx
@@ -28,9 +28,9 @@ const fieldNamePickerSettings: StandardEditorsRegistryItem null,
};
-const fieldLookupSettings: StandardEditorsRegistryItem = {
+const fieldLookupSettings = {
settings: {},
-} as any;
+} as StandardEditorsRegistryItem;
export const FieldLookupTransformerEditor = ({ input, options, onChange }: TransformerUIProps) => {
const onPickLookupField = useCallback(
@@ -60,7 +60,7 @@ export const FieldLookupTransformerEditor = ({ input, options, onChange }: Trans
context={{ data: input }}
value={options?.lookupField ?? ''}
onChange={onPickLookupField}
- item={fieldNamePickerSettings as any}
+ item={fieldNamePickerSettings}
/>
diff --git a/public/app/features/transformers/spatial/SpatialTransformerEditor.tsx b/public/app/features/transformers/spatial/SpatialTransformerEditor.tsx
index 1349f754c93..7834e820a61 100644
--- a/public/app/features/transformers/spatial/SpatialTransformerEditor.tsx
+++ b/public/app/features/transformers/spatial/SpatialTransformerEditor.tsx
@@ -11,7 +11,7 @@ import {
TransformerUIProps,
TransformerCategory,
} from '@grafana/data';
-import { FrameGeometrySource, FrameGeometrySourceMode } from '@grafana/schema';
+import { FrameGeometrySourceMode } from '@grafana/schema';
import { useTheme2 } from '@grafana/ui';
import { addLocationFields } from 'app/features/geo/editor/locationEditor';
@@ -90,10 +90,9 @@ const supplier = (
category: ['Source'],
path: 'source',
build: (b, c) => {
- const loc = (options.source ?? {}) as FrameGeometrySource;
- if (!loc.mode) {
- loc.mode = FrameGeometrySourceMode.Auto;
- }
+ const loc = options.source ?? {
+ mode: FrameGeometrySourceMode.Auto,
+ };
addLocationFields('Point', '', b, loc);
},
});
@@ -102,10 +101,9 @@ const supplier = (
category: ['Target'],
path: 'modify',
build: (b, c) => {
- const loc = (options.modify?.target ?? {}) as FrameGeometrySource;
- if (!loc.mode) {
- loc.mode = FrameGeometrySourceMode.Auto;
- }
+ const loc = options.modify?.target ?? {
+ mode: FrameGeometrySourceMode.Auto,
+ };
addLocationFields('Point', 'target.', b, loc);
},
});
diff --git a/public/app/features/transformers/spatial/optionsHelper.tsx b/public/app/features/transformers/spatial/optionsHelper.tsx
index 8c60d6527bf..49f77cf7927 100644
--- a/public/app/features/transformers/spatial/optionsHelper.tsx
+++ b/public/app/features/transformers/spatial/optionsHelper.tsx
@@ -31,8 +31,8 @@ export function getTransformerOptionPane(
};
const access: NestedValueAccess = {
- getValue: (path: string) => lodashGet(props.options, path),
- onChange: (path: string, value: any) => {
+ getValue: (path) => lodashGet(props.options, path),
+ onChange: (path, value) => {
props.onChange(setOptionImmutably(props.options as any, path, value));
},
};
diff --git a/public/app/features/transformers/spatial/utils.ts b/public/app/features/transformers/spatial/utils.ts
index 60cd7a710e9..2a53307331a 100644
--- a/public/app/features/transformers/spatial/utils.ts
+++ b/public/app/features/transformers/spatial/utils.ts
@@ -41,7 +41,7 @@ export function calculateBearings(values: Array): number[]
export function getCenterPoint(geo: Geometry): number[] {
if (geo instanceof Point) {
- return (geo as Point).getCoordinates();
+ return geo.getCoordinates();
}
return getCenter(geo.getExtent());
}
diff --git a/public/app/features/transformers/utils.ts b/public/app/features/transformers/utils.ts
index adf95a8c19e..33b3f9344dd 100644
--- a/public/app/features/transformers/utils.ts
+++ b/public/app/features/transformers/utils.ts
@@ -9,20 +9,17 @@ export function useAllFieldNamesFromDataFrames(input: DataFrame[]): string[] {
}
return Object.keys(
- input.reduce(
- (names, frame) => {
- if (!frame || !Array.isArray(frame.fields)) {
- return names;
- }
+ input.reduce>((names, frame) => {
+ if (!frame || !Array.isArray(frame.fields)) {
+ return names;
+ }
- return frame.fields.reduce((names, field) => {
- const t = getFieldDisplayName(field, frame, input);
- names[t] = true;
- return names;
- }, names);
- },
- {} as Record
- )
+ return frame.fields.reduce((names, field) => {
+ const t = getFieldDisplayName(field, frame, input);
+ names[t] = true;
+ return names;
+ }, names);
+ }, {})
);
}, [input]);
}
diff --git a/public/app/features/variables/state/sharedReducer.ts b/public/app/features/variables/state/sharedReducer.ts
index fefea202464..ba4d6567a39 100644
--- a/public/app/features/variables/state/sharedReducer.ts
+++ b/public/app/features/variables/state/sharedReducer.ts
@@ -52,7 +52,7 @@ const sharedReducerSlice = createSlice({
instanceState.state = LoadingState.Done;
instanceState.error = null;
},
- variableStateFailed: (state: VariablesState, action: PayloadAction>) => {
+ variableStateFailed: (state: VariablesState, action: PayloadAction>) => {
const instanceState = getInstanceState(state, action.payload.id);
if (!instanceState) {
// we might have cancelled a batch so then this state has been removed
diff --git a/public/app/features/variables/textbox/reducer.ts b/public/app/features/variables/textbox/reducer.ts
index 76fa81274cd..fb884448916 100644
--- a/public/app/features/variables/textbox/reducer.ts
+++ b/public/app/features/variables/textbox/reducer.ts
@@ -2,13 +2,13 @@ import { createSlice, PayloadAction } from '@reduxjs/toolkit';
import { getInstanceState } from '../state/selectors';
import { initialVariablesState, VariablePayload, VariablesState } from '../state/types';
-import { initialVariableModelState, TextBoxVariableModel, VariableOption } from '../types';
+import { initialVariableModelState, TextBoxVariableModel } from '../types';
export const initialTextBoxVariableModelState: TextBoxVariableModel = {
...initialVariableModelState,
type: 'textbox',
query: '',
- current: {} as VariableOption,
+ current: {},
options: [],
originalQuery: null,
};
diff --git a/public/app/features/variables/utils.ts b/public/app/features/variables/utils.ts
index 2c5bbdf29bf..797d6abf22f 100644
--- a/public/app/features/variables/utils.ts
+++ b/public/app/features/variables/utils.ts
@@ -226,7 +226,7 @@ export function findTemplateVarChanges(query: UrlQueryMap, old: UrlQueryMap): Ex
return count ? changes : undefined;
}
-export function ensureStringValues(value: any | any[]): string | string[] {
+export function ensureStringValues(value: unknown | unknown[]): string | string[] {
if (Array.isArray(value)) {
return value.map(String);
}
diff --git a/public/app/polyfills/old-mediaquerylist.ts b/public/app/polyfills/old-mediaquerylist.ts
deleted file mode 100644
index 6fdd31397bf..00000000000
--- a/public/app/polyfills/old-mediaquerylist.ts
+++ /dev/null
@@ -1,22 +0,0 @@
-// Safari < 14 does not have mql.addEventListener(), but uses the old spec mql.addListener()
-
-let oMatchMedia = window.matchMedia;
-
-type MqlListener = (this: MediaQueryList, ev: MediaQueryListEvent) => any;
-
-window.matchMedia = (mediaQueryString) => {
- let mql = oMatchMedia(mediaQueryString);
-
- if (!mql.addEventListener) {
- // @ts-ignore
- mql.addEventListener = (type: string, listener: MqlListener) => {
- mql.addListener(listener);
- };
- // @ts-ignore
- mql.removeEventListener = (type: string, listener: MqlListener) => {
- mql.removeListener(listener);
- };
- }
-
- return mql;
-};