diff --git a/.betterer.results b/.betterer.results index 7eabbff1a7e..116b3c7b307 100644 --- a/.betterer.results +++ b/.betterer.results @@ -7567,24 +7567,13 @@ exports[`better eslint`] = { [0, 0, 0, "Do not use any type assertions.", "0"], [0, 0, 0, "Do not use any type assertions.", "1"] ], - "public/app/plugins/panel/nodeGraph/useCategorizeFrames.ts:5381": [ - [0, 0, 0, "Do not use any type assertions.", "0"] - ], "public/app/plugins/panel/nodeGraph/usePanning.ts:5381": [ [0, 0, 0, "Do not use any type assertions.", "0"], [0, 0, 0, "Unexpected any. Specify a different type.", "1"], [0, 0, 0, "Do not use any type assertions.", "2"], [0, 0, 0, "Do not use any type assertions.", "3"] ], - "public/app/plugins/panel/nodeGraph/useZoom.ts:5381": [ - [0, 0, 0, "Do not use any type assertions.", "0"] - ], "public/app/plugins/panel/nodeGraph/utils.ts:5381": [ - [0, 0, 0, "Do not use any type assertions.", "0"], - [0, 0, 0, "Unexpected any. Specify a different type.", "1"], - [0, 0, 0, "Unexpected any. Specify a different type.", "2"] - ], - "public/app/plugins/panel/piechart/PieChart.tsx:5381": [ [0, 0, 0, "Unexpected any. Specify a different type.", "0"], [0, 0, 0, "Unexpected any. Specify a different type.", "1"] ], @@ -7597,25 +7586,16 @@ exports[`better eslint`] = { [0, 0, 0, "Unexpected any. Specify a different type.", "1"] ], "public/app/plugins/panel/stat/StatMigrations.test.ts:5381": [ - [0, 0, 0, "Unexpected any. Specify a different type.", "0"], - [0, 0, 0, "Unexpected any. Specify a different type.", "1"], - [0, 0, 0, "Unexpected any. Specify a different type.", "2"], - [0, 0, 0, "Unexpected any. Specify a different type.", "3"], - [0, 0, 0, "Unexpected any. Specify a different type.", "4"] + [0, 0, 0, "Unexpected any. Specify a different type.", "0"] ], "public/app/plugins/panel/stat/StatMigrations.ts:5381": [ [0, 0, 0, "Unexpected any. Specify a different type.", "0"], [0, 0, 0, "Unexpected any. Specify a different type.", "1"], [0, 0, 0, "Do not use any type assertions.", "2"] ], - "public/app/plugins/panel/stat/common.ts:5381": [ - [0, 0, 0, "Do not use any type assertions.", "0"], - [0, 0, 0, "Unexpected any. Specify a different type.", "1"] - ], "public/app/plugins/panel/state-timeline/TimelineChart.tsx:5381": [ [0, 0, 0, "Do not use any type assertions.", "0"], - [0, 0, 0, "Unexpected any. Specify a different type.", "1"], - [0, 0, 0, "Do not use any type assertions.", "2"] + [0, 0, 0, "Unexpected any. Specify a different type.", "1"] ], "public/app/plugins/panel/state-timeline/migrations.ts:5381": [ [0, 0, 0, "Unexpected any. Specify a different type.", "0"], @@ -7638,23 +7618,10 @@ exports[`better eslint`] = { [0, 0, 0, "Unexpected any. Specify a different type.", "0"] ], "public/app/plugins/panel/state-timeline/utils.test.ts:5381": [ - [0, 0, 0, "Unexpected any. Specify a different type.", "0"], - [0, 0, 0, "Unexpected any. Specify a different type.", "1"], - [0, 0, 0, "Unexpected any. Specify a different type.", "2"], - [0, 0, 0, "Unexpected any. Specify a different type.", "3"], - [0, 0, 0, "Unexpected any. Specify a different type.", "4"], - [0, 0, 0, "Unexpected any. Specify a different type.", "5"], - [0, 0, 0, "Unexpected any. Specify a different type.", "6"], - [0, 0, 0, "Unexpected any. Specify a different type.", "7"] + [0, 0, 0, "Unexpected any. Specify a different type.", "0"] ], "public/app/plugins/panel/state-timeline/utils.ts:5381": [ - [0, 0, 0, "Unexpected any. Specify a different type.", "0"], - [0, 0, 0, "Do not use any type assertions.", "1"], - [0, 0, 0, "Do not use any type assertions.", "2"], - [0, 0, 0, "Unexpected any. Specify a different type.", "3"], - [0, 0, 0, "Unexpected any. Specify a different type.", "4"], - [0, 0, 0, "Unexpected any. Specify a different type.", "5"], - [0, 0, 0, "Unexpected any. Specify a different type.", "6"] + [0, 0, 0, "Unexpected any. Specify a different type.", "0"] ], "public/app/plugins/panel/table-old/column_options.ts:5381": [ [0, 0, 0, "Unexpected any. Specify a different type.", "0"], @@ -8020,16 +7987,10 @@ exports[`better eslint`] = { "public/test/core/redux/reduxTester.ts:5381": [ [0, 0, 0, "Unexpected any. Specify a different type.", "0"], [0, 0, 0, "Unexpected any. Specify a different type.", "1"], - [0, 0, 0, "Do not use any type assertions.", "2"], - [0, 0, 0, "Do not use any type assertions.", "3"], - [0, 0, 0, "Do not use any type assertions.", "4"], - [0, 0, 0, "Unexpected any. Specify a different type.", "5"], - [0, 0, 0, "Do not use any type assertions.", "6"], - [0, 0, 0, "Do not use any type assertions.", "7"], - [0, 0, 0, "Do not use any type assertions.", "8"], - [0, 0, 0, "Unexpected any. Specify a different type.", "9"], - [0, 0, 0, "Unexpected any. Specify a different type.", "10"], - [0, 0, 0, "Unexpected any. Specify a different type.", "11"] + [0, 0, 0, "Unexpected any. Specify a different type.", "2"], + [0, 0, 0, "Unexpected any. Specify a different type.", "3"], + [0, 0, 0, "Unexpected any. Specify a different type.", "4"], + [0, 0, 0, "Unexpected any. Specify a different type.", "5"] ], "public/test/core/thunk/thunkTester.ts:5381": [ [0, 0, 0, "Unexpected any. Specify a different type.", "0"], @@ -8043,43 +8004,32 @@ exports[`better eslint`] = { [0, 0, 0, "Unexpected any. Specify a different type.", "8"] ], "public/test/global-jquery-shim.ts:5381": [ - [0, 0, 0, "Do not use any type assertions.", "0"], - [0, 0, 0, "Unexpected any. Specify a different type.", "1"] + [0, 0, 0, "Unexpected any. Specify a different type.", "0"] ], "public/test/helpers/convertToStoreState.ts:5381": [ - [0, 0, 0, "Unexpected any. Specify a different type.", "0"], - [0, 0, 0, "Do not use any type assertions.", "1"] - ], - "public/test/helpers/createFetchResponse.ts:5381": [ - [0, 0, 0, "Do not use any type assertions.", "0"], - [0, 0, 0, "Do not use any type assertions.", "1"] + [0, 0, 0, "Unexpected any. Specify a different type.", "0"] ], "public/test/helpers/getDashboardModel.ts:5381": [ - [0, 0, 0, "Unexpected any. Specify a different type.", "0"], - [0, 0, 0, "Unexpected any. Specify a different type.", "1"] + [0, 0, 0, "Unexpected any. Specify a different type.", "0"] ], "public/test/helpers/initTemplateSrv.ts:5381": [ [0, 0, 0, "Unexpected any. Specify a different type.", "0"] ], "public/test/jest-setup.ts:5381": [ - [0, 0, 0, "Do not use any type assertions.", "0"], + [0, 0, 0, "Unexpected any. Specify a different type.", "0"], [0, 0, 0, "Unexpected any. Specify a different type.", "1"], - [0, 0, 0, "Unexpected any. Specify a different type.", "2"], - [0, 0, 0, "Unexpected any. Specify a different type.", "3"] + [0, 0, 0, "Unexpected any. Specify a different type.", "2"] ], "public/test/jest-shim.ts:5381": [ - [0, 0, 0, "Do not use any type assertions.", "0"], + [0, 0, 0, "Unexpected any. Specify a different type.", "0"], [0, 0, 0, "Unexpected any. Specify a different type.", "1"], [0, 0, 0, "Unexpected any. Specify a different type.", "2"], - [0, 0, 0, "Do not use any type assertions.", "3"], + [0, 0, 0, "Unexpected any. Specify a different type.", "3"], [0, 0, 0, "Unexpected any. Specify a different type.", "4"], - [0, 0, 0, "Unexpected any. Specify a different type.", "5"], - [0, 0, 0, "Unexpected any. Specify a different type.", "6"], - [0, 0, 0, "Unexpected any. Specify a different type.", "7"] + [0, 0, 0, "Unexpected any. Specify a different type.", "5"] ], "public/test/lib/common.ts:5381": [ - [0, 0, 0, "Do not use any type assertions.", "0"], - [0, 0, 0, "Unexpected any. Specify a different type.", "1"] + [0, 0, 0, "Unexpected any. Specify a different type.", "0"] ], "public/test/matchers/index.ts:5381": [ [0, 0, 0, "Unexpected any. Specify a different type.", "0"] @@ -8103,10 +8053,7 @@ exports[`better eslint`] = { [0, 0, 0, "Unexpected any. Specify a different type.", "4"] ], "public/test/matchers/utils.ts:5381": [ - [0, 0, 0, "Unexpected any. Specify a different type.", "0"], - [0, 0, 0, "Unexpected any. Specify a different type.", "1"], - [0, 0, 0, "Unexpected any. Specify a different type.", "2"], - [0, 0, 0, "Unexpected any. Specify a different type.", "3"] + [0, 0, 0, "Unexpected any. Specify a different type.", "0"] ], "public/test/mocks/angular.ts:5381": [ [0, 0, 0, "Unexpected any. Specify a different type.", "0"], @@ -8123,16 +8070,11 @@ exports[`better eslint`] = { ], "public/test/mocks/datasource_srv.ts:5381": [ [0, 0, 0, "Unexpected any. Specify a different type.", "0"], - [0, 0, 0, "Do not use any type assertions.", "1"], - [0, 0, 0, "Do not use any type assertions.", "2"], - [0, 0, 0, "Unexpected any. Specify a different type.", "3"], - [0, 0, 0, "Do not use any type assertions.", "4"], - [0, 0, 0, "Do not use any type assertions.", "5"] + [0, 0, 0, "Unexpected any. Specify a different type.", "1"] ], "public/test/mocks/workers.ts:5381": [ [0, 0, 0, "Unexpected any. Specify a different type.", "0"], - [0, 0, 0, "Do not use any type assertions.", "1"], - [0, 0, 0, "Unexpected any. Specify a different type.", "2"] + [0, 0, 0, "Unexpected any. Specify a different type.", "1"] ], "public/test/specs/helpers.ts:5381": [ [0, 0, 0, "Unexpected any. Specify a different type.", "0"], @@ -8144,14 +8086,13 @@ exports[`better eslint`] = { [0, 0, 0, "Unexpected any. Specify a different type.", "6"], [0, 0, 0, "Unexpected any. Specify a different type.", "7"], [0, 0, 0, "Unexpected any. Specify a different type.", "8"], - [0, 0, 0, "Do not use any type assertions.", "9"], + [0, 0, 0, "Unexpected any. Specify a different type.", "9"], [0, 0, 0, "Unexpected any. Specify a different type.", "10"], [0, 0, 0, "Unexpected any. Specify a different type.", "11"], [0, 0, 0, "Unexpected any. Specify a different type.", "12"], [0, 0, 0, "Unexpected any. Specify a different type.", "13"], [0, 0, 0, "Unexpected any. Specify a different type.", "14"], - [0, 0, 0, "Unexpected any. Specify a different type.", "15"], - [0, 0, 0, "Unexpected any. Specify a different type.", "16"] + [0, 0, 0, "Unexpected any. Specify a different type.", "15"] ] }` }; diff --git a/.betterer.ts b/.betterer.ts index dc3789d46ad..6d40d7a9179 100644 --- a/.betterer.ts +++ b/.betterer.ts @@ -36,7 +36,10 @@ function countEslintErrors() { }; const isTestFile = - filePath.endsWith('.test.tsx') || filePath.endsWith('.test.ts') || filePath.includes('__mocks__'); + filePath.endsWith('.test.tsx') || + filePath.endsWith('.test.ts') || + filePath.includes('__mocks__') || + filePath.includes('public/test/'); if (!isTestFile) { rules['@typescript-eslint/consistent-type-assertions'] = [ diff --git a/public/app/plugins/panel/nodeGraph/useCategorizeFrames.ts b/public/app/plugins/panel/nodeGraph/useCategorizeFrames.ts index 28cf65ca32e..a23162c313a 100644 --- a/public/app/plugins/panel/nodeGraph/useCategorizeFrames.ts +++ b/public/app/plugins/panel/nodeGraph/useCategorizeFrames.ts @@ -9,7 +9,10 @@ import { DataFrame } from '@grafana/data'; */ export function useCategorizeFrames(series: DataFrame[]) { return useMemo(() => { - return series.reduce( + return series.reduce<{ + nodes: DataFrame[]; + edges: DataFrame[]; + }>( (acc, frame) => { const sourceField = frame.fields.filter((f) => f.name === 'source'); if (sourceField.length) { @@ -19,7 +22,7 @@ export function useCategorizeFrames(series: DataFrame[]) { } return acc; }, - { edges: [], nodes: [] } as { nodes: DataFrame[]; edges: DataFrame[] } + { edges: [], nodes: [] } ); }, [series]); } diff --git a/public/app/plugins/panel/nodeGraph/useZoom.ts b/public/app/plugins/panel/nodeGraph/useZoom.ts index 19dbd5632c5..34cc4954b90 100644 --- a/public/app/plugins/panel/nodeGraph/useZoom.ts +++ b/public/app/plugins/panel/nodeGraph/useZoom.ts @@ -44,14 +44,13 @@ export function useZoom({ stepUp, stepDown, min, max } = defaultOptions) { }, [scale, stepDown, min]); const onWheel = useCallback( - function (event: Event) { + function (wheelEvent: WheelEvent) { // Seems like typing for the addEventListener is lacking a bit - const wheelEvent = event as WheelEvent; // Only do this with special key pressed similar to how google maps work. // TODO: I would guess this won't work very well with touch right now if (wheelEvent.ctrlKey || wheelEvent.metaKey) { - event.preventDefault(); + wheelEvent.preventDefault(); setScale(Math.min(Math.max(min ?? -Infinity, scale + Math.min(wheelEvent.deltaY, 2) * -0.01), max ?? Infinity)); diff --git a/public/app/plugins/panel/nodeGraph/utils.ts b/public/app/plugins/panel/nodeGraph/utils.ts index c88a1bedb6c..bb931502a27 100644 --- a/public/app/plugins/panel/nodeGraph/utils.ts +++ b/public/app/plugins/panel/nodeGraph/utils.ts @@ -213,7 +213,7 @@ function processEdges(edges: DataFrame, edgeFields: EdgeFields): EdgeDatum[] { secondaryStat: edgeFields.secondaryStat ? statToString(edgeFields.secondaryStat.config, edgeFields.secondaryStat.values.get(index)) : '', - } as EdgeDatum; + }; }); } diff --git a/public/app/plugins/panel/piechart/PieChart.tsx b/public/app/plugins/panel/piechart/PieChart.tsx index 7cec1b32f2f..c550ebbc73b 100644 --- a/public/app/plugins/panel/piechart/PieChart.tsx +++ b/public/app/plugins/panel/piechart/PieChart.tsx @@ -199,7 +199,7 @@ function PieSlice({ arc, pie, highlightState, openMenu, fill, tooltip, tooltipOp const { eventBus } = usePanelContext(); const onMouseOut = useCallback( - (event: any) => { + (event: React.MouseEvent) => { eventBus?.publish({ type: DataHoverClearEvent.type, payload: { @@ -215,7 +215,7 @@ function PieSlice({ arc, pie, highlightState, openMenu, fill, tooltip, tooltipOp ); const onMouseMoveOverArc = useCallback( - (event: any) => { + (event: React.MouseEvent) => { eventBus?.publish({ type: DataHoverEvent.type, payload: { @@ -226,12 +226,16 @@ function PieSlice({ arc, pie, highlightState, openMenu, fill, tooltip, tooltipOp }, }); - const coords = localPoint(event.target.ownerSVGElement, event); - tooltip.showTooltip({ - tooltipLeft: coords!.x, - tooltipTop: coords!.y, - tooltipData: getTooltipData(pie, arc, tooltipOptions), - }); + const owner = event.currentTarget.ownerSVGElement; + + if (owner) { + const coords = localPoint(owner, event); + tooltip.showTooltip({ + tooltipLeft: coords!.x, + tooltipTop: coords!.y, + tooltipData: getTooltipData(pie, arc, tooltipOptions), + }); + } }, [eventBus, arc, tooltip, pie, tooltipOptions] ); diff --git a/public/app/plugins/panel/stat/StatMigrations.test.ts b/public/app/plugins/panel/stat/StatMigrations.test.ts index 2b5c6acca21..e75416c95ef 100644 --- a/public/app/plugins/panel/stat/StatMigrations.test.ts +++ b/public/app/plugins/panel/stat/StatMigrations.test.ts @@ -5,7 +5,7 @@ import { statPanelChangedHandler } from './StatMigrations'; describe('Stat Panel Migrations', () => { it('change from angular singlestat sparkline disabled', () => { - const old: any = { + const old = { angular: { format: 'ms', decimals: 7, @@ -21,7 +21,7 @@ describe('Stat Panel Migrations', () => { }); it('change from angular singlestat sparkline enabled', () => { - const old: any = { + const old = { angular: { format: 'ms', decimals: 7, @@ -37,7 +37,7 @@ describe('Stat Panel Migrations', () => { }); it('change from angular singlestat color background', () => { - const old: any = { + const old = { angular: { format: 'ms', decimals: 7, @@ -51,7 +51,7 @@ describe('Stat Panel Migrations', () => { }); it('change from angular singlestat with name stat', () => { - const old: any = { + const old = { angular: { valueName: 'name', }, diff --git a/public/app/plugins/panel/stat/common.ts b/public/app/plugins/panel/stat/common.ts index 93c064e2640..60000103575 100644 --- a/public/app/plugins/panel/stat/common.ts +++ b/public/app/plugins/panel/stat/common.ts @@ -50,7 +50,7 @@ export function addStandardDataReduceOptions( name: 'Calculation', description: 'Choose a reducer function / calculation', category: valueOptionsCategory, - editor: standardEditorsRegistry.get('stats-picker').editor as any, + editor: standardEditorsRegistry.get('stats-picker').editor, // TODO: Get ReducerID from generated schema one day? defaultValue: [ReducerID.lastNotNull], // Hides it when all values mode is on diff --git a/public/app/plugins/panel/state-timeline/TimelineChart.tsx b/public/app/plugins/panel/state-timeline/TimelineChart.tsx index 8c2cac0e5c8..cd853ded8ac 100644 --- a/public/app/plugins/panel/state-timeline/TimelineChart.tsx +++ b/public/app/plugins/panel/state-timeline/TimelineChart.tsx @@ -50,7 +50,7 @@ export class TimelineChart extends React.Component { }; prepConfig = (alignedFrame: DataFrame, allFrames: DataFrame[], getTimeRange: () => TimeRange) => { - this.panelContext = this.context as PanelContext; + this.panelContext = this.context; const { eventBus, sync } = this.panelContext; return preparePlotConfigBuilder({ diff --git a/public/app/plugins/panel/state-timeline/utils.test.ts b/public/app/plugins/panel/state-timeline/utils.test.ts index 809490326fd..9644a27dd69 100644 --- a/public/app/plugins/panel/state-timeline/utils.test.ts +++ b/public/app/plugins/panel/state-timeline/utils.test.ts @@ -1,5 +1,5 @@ import { ArrayVector, createTheme, FieldType, ThresholdsMode, TimeRange, toDataFrame, dateTime } from '@grafana/data'; -import { LegendDisplayMode } from '@grafana/schema'; +import { LegendDisplayMode, VizLegendOptions } from '@grafana/schema'; import { findNextStateIndex, @@ -15,7 +15,10 @@ describe('prepare timeline graph', () => { const timeRange: TimeRange = { from: dateTime(1), to: dateTime(3), - raw: {} as any, + raw: { + from: dateTime(1), + to: dateTime(3), + }, }; it('errors with no time fields', () => { const frames = [ @@ -92,7 +95,8 @@ describe('findNextStateIndex', () => { name: 'time', type: FieldType.number, values: new ArrayVector([1, undefined, undefined, 2, undefined, undefined]), - } as any; + config: {}, + }; const result = findNextStateIndex(field, 0); expect(result).toEqual(3); }); @@ -102,7 +106,8 @@ describe('findNextStateIndex', () => { name: 'time', type: FieldType.number, values: new ArrayVector([1, undefined, undefined, 2, undefined, 3]), - } as any; + config: {}, + }; const result = findNextStateIndex(field, 5); expect(result).toEqual(null); }); @@ -112,7 +117,8 @@ describe('findNextStateIndex', () => { name: 'time', type: FieldType.number, values: new ArrayVector([1, undefined, undefined, 2, undefined, 3, undefined]), - } as any; + config: {}, + }; const result = findNextStateIndex(field, 5); expect(result).toEqual(null); }); @@ -134,7 +140,8 @@ describe('findNextStateIndex', () => { undefined, undefined, ]), - } as any; + config: {}, + }; const result = findNextStateIndex(field, 3); expect(result).toEqual(8); }); @@ -144,7 +151,8 @@ describe('findNextStateIndex', () => { name: 'time', type: FieldType.number, values: new ArrayVector([1, 3, 2]), - } as any; + config: {}, + }; test('leading', () => { const result = findNextStateIndex(field, 0); @@ -232,7 +240,11 @@ describe('prepareTimelineLegendItems', () => { }, ]; - const result = prepareTimelineLegendItems(frame, { displayMode: LegendDisplayMode.List } as any, theme); + const result = prepareTimelineLegendItems( + frame, + { displayMode: LegendDisplayMode.List } as VizLegendOptions, + theme + ); expect(result).toHaveLength(1); }); diff --git a/public/app/plugins/panel/state-timeline/utils.ts b/public/app/plugins/panel/state-timeline/utils.ts index fc475e7a274..4cc969aa25c 100644 --- a/public/app/plugins/panel/state-timeline/utils.ts +++ b/public/app/plugins/panel/state-timeline/utils.ts @@ -209,7 +209,7 @@ export const preparePlotConfigBuilder: UPlotConfigPrepFn = ({ } const field = frame.fields[i]; - const config = field.config as FieldConfig; + const config: FieldConfig = field.config; const customConfig: TimelineFieldConfig = { ...defaultConfig, ...config.custom, @@ -259,8 +259,7 @@ export const preparePlotConfigBuilder: UPlotConfigPrepFn = ({ return true; }, }, - //TODO: remove any once https://github.com/leeoniya/uPlot/pull/611 got merged or the typing is fixed - scales: [xScaleKey, null as any], + scales: [xScaleKey, null], }; builder.setSync(); builder.setCursor(cursor); @@ -284,9 +283,9 @@ export function getNamesToFieldIndex(frame: DataFrame): Map { * in: 1, 1,undefined, 1,2, 2,null,2,3 * out: 1,undefined,undefined,undefined,2,undefined,null,2,3 */ -export function unsetSameFutureValues(values: any[]): any[] | undefined { +export function unsetSameFutureValues(values: unknown[]): unknown[] | undefined { let prevVal = values[0]; - let clone: any[] | undefined = undefined; + let clone: unknown[] | undefined = undefined; for (let i = 1; i < values.length; i++) { let value = values[i]; diff --git a/public/test/helpers/getDashboardModel.ts b/public/test/helpers/getDashboardModel.ts index f7c0b54cdee..f341d80943c 100644 --- a/public/test/helpers/getDashboardModel.ts +++ b/public/test/helpers/getDashboardModel.ts @@ -1,6 +1,7 @@ import { DashboardModel } from '../../app/features/dashboard/state'; +import { DashboardMeta } from '../../app/types/dashboard'; -export const getDashboardModel = (json: any, meta: any = {}) => { +export const getDashboardModel = (json: any, meta: DashboardMeta = {}) => { const getVariablesFromState = () => json.templating.list; return new DashboardModel(json, meta, getVariablesFromState); }; diff --git a/public/test/matchers/utils.ts b/public/test/matchers/utils.ts index ddba865e453..26776b1fb1f 100644 --- a/public/test/matchers/utils.ts +++ b/public/test/matchers/utils.ts @@ -22,7 +22,7 @@ export function forceObservableCompletion(subscription: Subscription, resolve: ( ); } -export function expectObservableToBeDefined(received: any): jest.CustomMatcherResult | null { +export function expectObservableToBeDefined(received: unknown): jest.CustomMatcherResult | null { if (received) { return null; } @@ -35,7 +35,7 @@ Expected ${printReceived(received)} to be ${printExpected('defined')}.`, }; } -export function expectObservableToBeObservable(received: any): jest.CustomMatcherResult | null { +export function expectObservableToBeObservable(received: unknown): jest.CustomMatcherResult | null { if (isObservable(received)) { return null; } @@ -48,7 +48,7 @@ Expected ${printReceived(received)} to be ${printExpected('an Observable')}.`, }; } -export function expectObservable(received: any): jest.CustomMatcherResult | null { +export function expectObservable(received: unknown): jest.CustomMatcherResult | null { const toBeDefined = expectObservableToBeDefined(received); if (toBeDefined) { return toBeDefined;