Chore: Type improvements 🧹 (#75271)

* fix some e2e flows types

* some type fixes

* must... fix... more...

* MOAR

* MOREMOREMORE

* 1 more
This commit is contained in:
Ashley Harrison 2023-09-22 15:06:49 +01:00 committed by GitHub
parent eba74f0408
commit ff0642bf6e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
65 changed files with 217 additions and 387 deletions

View File

@ -8,44 +8,8 @@ exports[`better eslint`] = {
"e2e/cypress/support/index.d.ts:5381": [ "e2e/cypress/support/index.d.ts:5381": [
[0, 0, 0, "Unexpected any. Specify a different type.", "0"] [0, 0, 0, "Unexpected any. Specify a different type.", "0"]
], ],
"e2e/utils/flows/addDashboard.ts:5381": [
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
[0, 0, 0, "Do not use any type assertions.", "1"]
],
"e2e/utils/flows/addDataSource.ts:5381": [ "e2e/utils/flows/addDataSource.ts:5381": [
[0, 0, 0, "Unexpected any. Specify a different type.", "0"], [0, 0, 0, "Do not use any type assertions.", "0"]
[0, 0, 0, "Do not use any type assertions.", "1"]
],
"e2e/utils/flows/addPanel.ts:5381": [
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
],
"e2e/utils/flows/configurePanel.ts:5381": [
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
],
"e2e/utils/flows/deleteDashboard.ts:5381": [
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
],
"e2e/utils/flows/deleteDataSource.ts:5381": [
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
],
"e2e/utils/flows/openDashboard.ts:5381": [
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
],
"e2e/utils/flows/revertAllChanges.ts:5381": [
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
[0, 0, 0, "Unexpected any. Specify a different type.", "1"]
],
"e2e/utils/flows/selectOption.ts:5381": [
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
[0, 0, 0, "Unexpected any. Specify a different type.", "1"]
],
"e2e/utils/support/localStorage.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, "Do not use any type assertions.", "5"]
], ],
"e2e/utils/support/scenarioContext.ts:5381": [ "e2e/utils/support/scenarioContext.ts:5381": [
[0, 0, 0, "Unexpected any. Specify a different type.", "0"] [0, 0, 0, "Unexpected any. Specify a different type.", "0"]
@ -122,9 +86,6 @@ exports[`better eslint`] = {
"packages/grafana-data/src/dataframe/dimensions.ts:5381": [ "packages/grafana-data/src/dataframe/dimensions.ts:5381": [
[0, 0, 0, "Unexpected any. Specify a different type.", "0"] [0, 0, 0, "Unexpected any. Specify a different type.", "0"]
], ],
"packages/grafana-data/src/dataframe/frameComparisons.ts:5381": [
[0, 0, 0, "Do not use any type assertions.", "0"]
],
"packages/grafana-data/src/dataframe/processDataFrame.test.ts:5381": [ "packages/grafana-data/src/dataframe/processDataFrame.test.ts:5381": [
[0, 0, 0, "Unexpected any. Specify a different type.", "0"] [0, 0, 0, "Unexpected any. Specify a different type.", "0"]
], ],
@ -190,16 +151,9 @@ exports[`better eslint`] = {
"packages/grafana-data/src/datetime/rangeutil.ts:5381": [ "packages/grafana-data/src/datetime/rangeutil.ts:5381": [
[0, 0, 0, "Do not use any type assertions.", "0"] [0, 0, 0, "Do not use any type assertions.", "0"]
], ],
"packages/grafana-data/src/datetime/timezones.ts:5381": [
[0, 0, 0, "Do not use any type assertions.", "0"],
[0, 0, 0, "Do not use any type assertions.", "1"]
],
"packages/grafana-data/src/events/EventBus.ts:5381": [ "packages/grafana-data/src/events/EventBus.ts:5381": [
[0, 0, 0, "Unexpected any. Specify a different type.", "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.", "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"]
], ],
"packages/grafana-data/src/events/common.ts:5381": [ "packages/grafana-data/src/events/common.ts:5381": [
[0, 0, 0, "Unexpected any. Specify a different type.", "0"], [0, 0, 0, "Unexpected any. Specify a different type.", "0"],
@ -276,9 +230,6 @@ exports[`better eslint`] = {
[0, 0, 0, "Do not use any type assertions.", "2"], [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.", "3"]
], ],
"packages/grafana-data/src/text/text.ts:5381": [
[0, 0, 0, "Do not use any type assertions.", "0"]
],
"packages/grafana-data/src/themes/colorManipulator.ts:5381": [ "packages/grafana-data/src/themes/colorManipulator.ts:5381": [
[0, 0, 0, "Unexpected any. Specify a different type.", "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.", "1"],
@ -300,13 +251,6 @@ exports[`better eslint`] = {
"packages/grafana-data/src/transformations/transformDataFrame.ts:5381": [ "packages/grafana-data/src/transformations/transformDataFrame.ts:5381": [
[0, 0, 0, "Unexpected any. Specify a different type.", "0"] [0, 0, 0, "Unexpected any. Specify a different type.", "0"]
], ],
"packages/grafana-data/src/transformations/transformers/calculateField.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, "Unexpected any. Specify a different type.", "4"]
],
"packages/grafana-data/src/transformations/transformers/groupBy.ts:5381": [ "packages/grafana-data/src/transformations/transformers/groupBy.ts:5381": [
[0, 0, 0, "Unexpected any. Specify a different type.", "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.", "1"]
@ -315,8 +259,7 @@ exports[`better eslint`] = {
[0, 0, 0, "Unexpected any. Specify a different type.", "0"] [0, 0, 0, "Unexpected any. Specify a different type.", "0"]
], ],
"packages/grafana-data/src/transformations/transformers/histogram.ts:5381": [ "packages/grafana-data/src/transformations/transformers/histogram.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"]
], ],
"packages/grafana-data/src/transformations/transformers/joinDataFrames.ts:5381": [ "packages/grafana-data/src/transformations/transformers/joinDataFrames.ts:5381": [
[0, 0, 0, "Unexpected any. Specify a different type.", "0"] [0, 0, 0, "Unexpected any. Specify a different type.", "0"]
@ -458,9 +401,7 @@ exports[`better eslint`] = {
[0, 0, 0, "Do not use any type assertions.", "8"] [0, 0, 0, "Do not use any type assertions.", "8"]
], ],
"packages/grafana-data/src/types/logs.ts:5381": [ "packages/grafana-data/src/types/logs.ts:5381": [
[0, 0, 0, "Do not use any type assertions.", "0"], [0, 0, 0, "Do not use any type assertions.", "0"]
[0, 0, 0, "Do not use any type assertions.", "1"],
[0, 0, 0, "Do not use any type assertions.", "2"]
], ],
"packages/grafana-data/src/types/options.ts:5381": [ "packages/grafana-data/src/types/options.ts:5381": [
[0, 0, 0, "Unexpected any. Specify a different type.", "0"], [0, 0, 0, "Unexpected any. Specify a different type.", "0"],
@ -487,10 +428,6 @@ exports[`better eslint`] = {
[0, 0, 0, "Unexpected any. Specify a different type.", "1"], [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.", "2"]
], ],
"packages/grafana-data/src/types/query.ts:5381": [
[0, 0, 0, "Do not use any type assertions.", "0"],
[0, 0, 0, "Do not use any type assertions.", "1"]
],
"packages/grafana-data/src/types/select.ts:5381": [ "packages/grafana-data/src/types/select.ts:5381": [
[0, 0, 0, "Unexpected any. Specify a different type.", "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.", "1"]
@ -514,19 +451,8 @@ exports[`better eslint`] = {
], ],
"packages/grafana-data/src/types/vector.ts:5381": [ "packages/grafana-data/src/types/vector.ts:5381": [
[0, 0, 0, "Unexpected any. Specify a different type.", "0"], [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.", "1"],
[0, 0, 0, "Unexpected any. Specify a different type.", "2"], [0, 0, 0, "Unexpected any. Specify a different type.", "2"]
[0, 0, 0, "Unexpected any. Specify a different type.", "3"],
[0, 0, 0, "Do not use any type assertions.", "4"],
[0, 0, 0, "Unexpected any. Specify a different type.", "5"],
[0, 0, 0, "Unexpected any. Specify a different type.", "6"],
[0, 0, 0, "Do not use any type assertions.", "7"],
[0, 0, 0, "Unexpected any. Specify a different type.", "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, "Do not use any type assertions.", "12"],
[0, 0, 0, "Unexpected any. Specify a different type.", "13"]
], ],
"packages/grafana-data/src/utils/OptionsUIBuilders.ts:5381": [ "packages/grafana-data/src/utils/OptionsUIBuilders.ts:5381": [
[0, 0, 0, "Unexpected any. Specify a different type.", "0"], [0, 0, 0, "Unexpected any. Specify a different type.", "0"],
@ -675,11 +601,8 @@ exports[`better eslint`] = {
[0, 0, 0, "Unexpected any. Specify a different type.", "0"], [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.", "1"],
[0, 0, 0, "Do not use any type assertions.", "2"], [0, 0, 0, "Do not use any type assertions.", "2"],
[0, 0, 0, "Do not use any type assertions.", "3"], [0, 0, 0, "Unexpected any. Specify a different type.", "3"],
[0, 0, 0, "Do not use any type assertions.", "4"], [0, 0, 0, "Unexpected any. Specify a different type.", "4"]
[0, 0, 0, "Do not use any type assertions.", "5"],
[0, 0, 0, "Unexpected any. Specify a different type.", "6"],
[0, 0, 0, "Unexpected any. Specify a different type.", "7"]
], ],
"packages/grafana-data/src/vector/AppendedVectors.ts:5381": [ "packages/grafana-data/src/vector/AppendedVectors.ts:5381": [
[0, 0, 0, "Unexpected any. Specify a different type.", "0"], [0, 0, 0, "Unexpected any. Specify a different type.", "0"],
@ -941,10 +864,6 @@ exports[`better eslint`] = {
[0, 0, 0, "Unexpected any. Specify a different type.", "1"], [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.", "2"]
], ],
"packages/grafana-ui/src/components/GraphNG/utils.ts:5381": [
[0, 0, 0, "Do not use any type assertions.", "0"],
[0, 0, 0, "Unexpected any. Specify a different type.", "1"]
],
"packages/grafana-ui/src/components/InfoBox/InfoBox.tsx:5381": [ "packages/grafana-ui/src/components/InfoBox/InfoBox.tsx:5381": [
[0, 0, 0, "Do not use any type assertions.", "0"] [0, 0, 0, "Do not use any type assertions.", "0"]
], ],
@ -953,9 +872,7 @@ exports[`better eslint`] = {
], ],
"packages/grafana-ui/src/components/JSONFormatter/json_explorer/json_explorer.ts:5381": [ "packages/grafana-ui/src/components/JSONFormatter/json_explorer/json_explorer.ts:5381": [
[0, 0, 0, "Unexpected any. Specify a different type.", "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.", "1"]
[0, 0, 0, "Do not use any type assertions.", "2"],
[0, 0, 0, "Do not use any type assertions.", "3"]
], ],
"packages/grafana-ui/src/components/Layout/Layout.story.tsx:5381": [ "packages/grafana-ui/src/components/Layout/Layout.story.tsx:5381": [
[0, 0, 0, "Do not use any type assertions.", "0"] [0, 0, 0, "Do not use any type assertions.", "0"]
@ -1062,23 +979,18 @@ exports[`better eslint`] = {
[0, 0, 0, "Unexpected any. Specify a different type.", "11"], [0, 0, 0, "Unexpected any. Specify a different type.", "11"],
[0, 0, 0, "Do not use any type assertions.", "12"], [0, 0, 0, "Do not use any type assertions.", "12"],
[0, 0, 0, "Unexpected any. Specify a different type.", "13"], [0, 0, 0, "Unexpected any. Specify a different type.", "13"],
[0, 0, 0, "Do not use any type assertions.", "14"], [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.", "15"],
[0, 0, 0, "Unexpected any. Specify a different type.", "16"], [0, 0, 0, "Unexpected any. Specify a different type.", "16"],
[0, 0, 0, "Unexpected any. Specify a different type.", "17"], [0, 0, 0, "Unexpected any. Specify a different type.", "17"],
[0, 0, 0, "Unexpected any. Specify a different type.", "18"], [0, 0, 0, "Unexpected any. Specify a different type.", "18"],
[0, 0, 0, "Unexpected any. Specify a different type.", "19"], [0, 0, 0, "Unexpected any. Specify a different type.", "19"]
[0, 0, 0, "Unexpected any. Specify a different type.", "20"]
], ],
"packages/grafana-ui/src/components/StatsPicker/StatsPicker.story.tsx:5381": [ "packages/grafana-ui/src/components/StatsPicker/StatsPicker.story.tsx:5381": [
[0, 0, 0, "Unexpected any. Specify a different type.", "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.", "1"],
[0, 0, 0, "Unexpected any. Specify a different type.", "2"] [0, 0, 0, "Unexpected any. Specify a different type.", "2"]
], ],
"packages/grafana-ui/src/components/Table/ExpandedRow.tsx:5381": [
[0, 0, 0, "Do not use any type assertions.", "0"],
[0, 0, 0, "Do not use any type assertions.", "1"]
],
"packages/grafana-ui/src/components/Table/Filter.tsx:5381": [ "packages/grafana-ui/src/components/Table/Filter.tsx:5381": [
[0, 0, 0, "Unexpected any. Specify a different type.", "0"] [0, 0, 0, "Unexpected any. Specify a different type.", "0"]
], ],
@ -1094,17 +1006,13 @@ exports[`better eslint`] = {
], ],
"packages/grafana-ui/src/components/Table/Table.tsx:5381": [ "packages/grafana-ui/src/components/Table/Table.tsx:5381": [
[0, 0, 0, "Unexpected any. Specify a different type.", "0"], [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.", "1"]
[0, 0, 0, "Do not use any type assertions.", "2"],
[0, 0, 0, "Do not use any type assertions.", "3"]
], ],
"packages/grafana-ui/src/components/Table/TableCell.tsx:5381": [ "packages/grafana-ui/src/components/Table/TableCell.tsx:5381": [
[0, 0, 0, "Do not use any type assertions.", "0"], [0, 0, 0, "Do not use any type assertions.", "0"],
[0, 0, 0, "Do not use any type assertions.", "1"], [0, 0, 0, "Do not use any type assertions.", "1"],
[0, 0, 0, "Do not use any type assertions.", "2"], [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.", "3"]
[0, 0, 0, "Do not use any type assertions.", "4"],
[0, 0, 0, "Do not use any type assertions.", "5"]
], ],
"packages/grafana-ui/src/components/Table/TableCellInspectModal.tsx:5381": [ "packages/grafana-ui/src/components/Table/TableCellInspectModal.tsx:5381": [
[0, 0, 0, "Unexpected any. Specify a different type.", "0"] [0, 0, 0, "Unexpected any. Specify a different type.", "0"]
@ -1118,20 +1026,12 @@ exports[`better eslint`] = {
[0, 0, 0, "Unexpected any. Specify a different type.", "1"] [0, 0, 0, "Unexpected any. Specify a different type.", "1"]
], ],
"packages/grafana-ui/src/components/Table/utils.ts:5381": [ "packages/grafana-ui/src/components/Table/utils.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, "Do not use any type assertions.", "1"], [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.", "2"],
[0, 0, 0, "Unexpected any. Specify a different type.", "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.", "4"],
[0, 0, 0, "Unexpected any. Specify a different type.", "5"], [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.", "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.", "12"],
[0, 0, 0, "Unexpected any. Specify a different type.", "13"]
], ],
"packages/grafana-ui/src/components/Tags/Tag.tsx:5381": [ "packages/grafana-ui/src/components/Tags/Tag.tsx:5381": [
[0, 0, 0, "Do not use any type assertions.", "0"] [0, 0, 0, "Do not use any type assertions.", "0"]
@ -1193,9 +1093,7 @@ exports[`better eslint`] = {
], ],
"packages/grafana-ui/src/components/uPlot/utils.ts:5381": [ "packages/grafana-ui/src/components/uPlot/utils.ts:5381": [
[0, 0, 0, "Do not use any type assertions.", "0"], [0, 0, 0, "Do not use any type assertions.", "0"],
[0, 0, 0, "Do not use any type assertions.", "1"], [0, 0, 0, "Do not use any type assertions.", "1"]
[0, 0, 0, "Do not use any type assertions.", "2"],
[0, 0, 0, "Do not use any type assertions.", "3"]
], ],
"packages/grafana-ui/src/options/builder/axis.tsx:5381": [ "packages/grafana-ui/src/options/builder/axis.tsx:5381": [
[0, 0, 0, "Do not use any type assertions.", "0"], [0, 0, 0, "Do not use any type assertions.", "0"],
@ -3132,9 +3030,6 @@ exports[`better eslint`] = {
"public/app/features/dashboard-scene/inspect/InspectJsonTab.tsx:5381": [ "public/app/features/dashboard-scene/inspect/InspectJsonTab.tsx:5381": [
[0, 0, 0, "Use data-testid for E2E selectors instead of aria-label", "0"] [0, 0, 0, "Use data-testid for E2E selectors instead of aria-label", "0"]
], ],
"public/app/features/dashboard-scene/scene/RowRepeaterBehavior.ts:5381": [
[0, 0, 0, "Do not use any type assertions.", "0"]
],
"public/app/features/dashboard-scene/serialization/transformSaveModelToScene.test.ts:5381": [ "public/app/features/dashboard-scene/serialization/transformSaveModelToScene.test.ts:5381": [
[0, 0, 0, "Unexpected any. Specify a different type.", "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.", "1"]
@ -3218,10 +3113,8 @@ exports[`better eslint`] = {
[0, 0, 0, "Do not use any type assertions.", "6"], [0, 0, 0, "Do not use any type assertions.", "6"],
[0, 0, 0, "Unexpected any. Specify a different type.", "7"], [0, 0, 0, "Unexpected any. Specify a different type.", "7"],
[0, 0, 0, "Do not use any type assertions.", "8"], [0, 0, 0, "Do not use any type assertions.", "8"],
[0, 0, 0, "Unexpected any. Specify a different type.", "9"], [0, 0, 0, "Do not use any type assertions.", "9"],
[0, 0, 0, "Do not use any type assertions.", "10"], [0, 0, 0, "Unexpected any. Specify a different type.", "10"]
[0, 0, 0, "Do not use any type assertions.", "11"],
[0, 0, 0, "Unexpected any. Specify a different type.", "12"]
], ],
"public/app/features/dashboard/components/DashNav/DashNavButton.tsx:5381": [ "public/app/features/dashboard/components/DashNav/DashNavButton.tsx:5381": [
[0, 0, 0, "Styles should be written using objects.", "0"] [0, 0, 0, "Styles should be written using objects.", "0"]
@ -3624,19 +3517,17 @@ exports[`better eslint`] = {
[0, 0, 0, "Unexpected any. Specify a different type.", "19"], [0, 0, 0, "Unexpected any. Specify a different type.", "19"],
[0, 0, 0, "Unexpected any. Specify a different type.", "20"], [0, 0, 0, "Unexpected any. Specify a different type.", "20"],
[0, 0, 0, "Unexpected any. Specify a different type.", "21"], [0, 0, 0, "Unexpected any. Specify a different type.", "21"],
[0, 0, 0, "Do not use any type assertions.", "22"], [0, 0, 0, "Unexpected any. Specify a different type.", "22"],
[0, 0, 0, "Unexpected any. Specify a different type.", "23"], [0, 0, 0, "Unexpected any. Specify a different type.", "23"],
[0, 0, 0, "Unexpected any. Specify a different type.", "24"], [0, 0, 0, "Unexpected any. Specify a different type.", "24"],
[0, 0, 0, "Unexpected any. Specify a different type.", "25"], [0, 0, 0, "Unexpected any. Specify a different type.", "25"],
[0, 0, 0, "Unexpected any. Specify a different type.", "26"], [0, 0, 0, "Unexpected any. Specify a different type.", "26"],
[0, 0, 0, "Unexpected any. Specify a different type.", "27"], [0, 0, 0, "Unexpected any. Specify a different type.", "27"],
[0, 0, 0, "Unexpected any. Specify a different type.", "28"], [0, 0, 0, "Do not use any type assertions.", "28"],
[0, 0, 0, "Do not use any type assertions.", "29"], [0, 0, 0, "Do not use any type assertions.", "29"],
[0, 0, 0, "Do not use any type assertions.", "30"], [0, 0, 0, "Unexpected any. Specify a different type.", "30"],
[0, 0, 0, "Unexpected any. Specify a different type.", "31"], [0, 0, 0, "Unexpected any. Specify a different type.", "31"],
[0, 0, 0, "Do not use any type assertions.", "32"], [0, 0, 0, "Do not use any type assertions.", "32"]
[0, 0, 0, "Unexpected any. Specify a different type.", "33"],
[0, 0, 0, "Do not use any type assertions.", "34"]
], ],
"public/app/features/dashboard/state/DashboardModel.repeat.test.ts:5381": [ "public/app/features/dashboard/state/DashboardModel.repeat.test.ts:5381": [
[0, 0, 0, "Unexpected any. Specify a different type.", "0"], [0, 0, 0, "Unexpected any. Specify a different type.", "0"],
@ -3677,16 +3568,13 @@ exports[`better eslint`] = {
[0, 0, 0, "Unexpected any. Specify a different type.", "23"], [0, 0, 0, "Unexpected any. Specify a different type.", "23"],
[0, 0, 0, "Unexpected any. Specify a different type.", "24"], [0, 0, 0, "Unexpected any. Specify a different type.", "24"],
[0, 0, 0, "Unexpected any. Specify a different type.", "25"], [0, 0, 0, "Unexpected any. Specify a different type.", "25"],
[0, 0, 0, "Do not use any type assertions.", "26"], [0, 0, 0, "Unexpected any. Specify a different type.", "26"],
[0, 0, 0, "Unexpected any. Specify a different type.", "27"], [0, 0, 0, "Do not use any type assertions.", "27"],
[0, 0, 0, "Unexpected any. Specify a different type.", "28"], [0, 0, 0, "Unexpected any. Specify a different type.", "28"],
[0, 0, 0, "Do not use any type assertions.", "29"], [0, 0, 0, "Unexpected any. Specify a different type.", "29"],
[0, 0, 0, "Unexpected any. Specify a different type.", "30"], [0, 0, 0, "Unexpected any. Specify a different type.", "30"],
[0, 0, 0, "Unexpected any. Specify a different type.", "31"], [0, 0, 0, "Unexpected any. Specify a different type.", "31"],
[0, 0, 0, "Unexpected any. Specify a different type.", "32"], [0, 0, 0, "Unexpected any. Specify a different type.", "32"]
[0, 0, 0, "Unexpected any. Specify a different type.", "33"],
[0, 0, 0, "Unexpected any. Specify a different type.", "34"],
[0, 0, 0, "Unexpected any. Specify a different type.", "35"]
], ],
"public/app/features/dashboard/state/PanelModel.test.ts:5381": [ "public/app/features/dashboard/state/PanelModel.test.ts:5381": [
[0, 0, 0, "Unexpected any. Specify a different type.", "0"], [0, 0, 0, "Unexpected any. Specify a different type.", "0"],
@ -3710,27 +3598,19 @@ exports[`better eslint`] = {
[0, 0, 0, "Unexpected any. Specify a different type.", "8"], [0, 0, 0, "Unexpected any. Specify a different type.", "8"],
[0, 0, 0, "Do not use any type assertions.", "9"], [0, 0, 0, "Do not use any type assertions.", "9"],
[0, 0, 0, "Unexpected any. Specify a different type.", "10"], [0, 0, 0, "Unexpected any. Specify a different type.", "10"],
[0, 0, 0, "Do not use any type assertions.", "11"], [0, 0, 0, "Unexpected any. Specify a different type.", "11"],
[0, 0, 0, "Unexpected any. Specify a different type.", "12"], [0, 0, 0, "Do not use any type assertions.", "12"],
[0, 0, 0, "Do not use any type assertions.", "13"], [0, 0, 0, "Unexpected any. Specify a different type.", "13"],
[0, 0, 0, "Unexpected any. Specify a different type.", "14"], [0, 0, 0, "Do not use any type assertions.", "14"],
[0, 0, 0, "Do not use any type assertions.", "15"], [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.", "16"],
[0, 0, 0, "Unexpected any. Specify a different type.", "17"], [0, 0, 0, "Unexpected any. Specify a different type.", "17"],
[0, 0, 0, "Do not use any type assertions.", "18"], [0, 0, 0, "Do not use any type assertions.", "18"],
[0, 0, 0, "Unexpected any. Specify a different type.", "19"], [0, 0, 0, "Unexpected any. Specify a different type.", "19"],
[0, 0, 0, "Do not use any type assertions.", "20"], [0, 0, 0, "Do not use any type assertions.", "20"],
[0, 0, 0, "Unexpected any. Specify a different type.", "21"], [0, 0, 0, "Unexpected any. Specify a different type.", "21"],
[0, 0, 0, "Do not use any type assertions.", "22"], [0, 0, 0, "Unexpected any. Specify a different type.", "22"],
[0, 0, 0, "Unexpected any. Specify a different type.", "23"], [0, 0, 0, "Unexpected any. Specify a different type.", "23"]
[0, 0, 0, "Unexpected any. Specify a different type.", "24"],
[0, 0, 0, "Unexpected any. Specify a different type.", "25"],
[0, 0, 0, "Do not use any type assertions.", "26"],
[0, 0, 0, "Unexpected any. Specify a different type.", "27"],
[0, 0, 0, "Do not use any type assertions.", "28"],
[0, 0, 0, "Unexpected any. Specify a different type.", "29"],
[0, 0, 0, "Unexpected any. Specify a different type.", "30"],
[0, 0, 0, "Unexpected any. Specify a different type.", "31"]
], ],
"public/app/features/dashboard/state/TimeModel.ts:5381": [ "public/app/features/dashboard/state/TimeModel.ts:5381": [
[0, 0, 0, "Unexpected any. Specify a different type.", "0"], [0, 0, 0, "Unexpected any. Specify a different type.", "0"],
@ -4520,8 +4400,7 @@ exports[`better eslint`] = {
], ],
"public/app/features/geo/utils/frameVectorSource.ts:5381": [ "public/app/features/geo/utils/frameVectorSource.ts:5381": [
[0, 0, 0, "Do not use any type assertions.", "0"], [0, 0, 0, "Do not use any type assertions.", "0"],
[0, 0, 0, "Do not use any type assertions.", "1"], [0, 0, 0, "Do not use any type assertions.", "1"]
[0, 0, 0, "Do not use any type assertions.", "2"]
], ],
"public/app/features/inspector/DetailText.tsx:5381": [ "public/app/features/inspector/DetailText.tsx:5381": [
[0, 0, 0, "Styles should be written using objects.", "0"] [0, 0, 0, "Styles should be written using objects.", "0"]
@ -4631,15 +4510,13 @@ exports[`better eslint`] = {
[0, 0, 0, "Unexpected any. Specify a different type.", "2"] [0, 0, 0, "Unexpected any. Specify a different type.", "2"]
], ],
"public/app/features/live/centrifuge/LiveDataStream.ts:5381": [ "public/app/features/live/centrifuge/LiveDataStream.ts:5381": [
[0, 0, 0, "Do not use any type assertions.", "0"], [0, 0, 0, "Do not use any type assertions.", "0"]
[0, 0, 0, "Do not use any type assertions.", "1"]
], ],
"public/app/features/live/centrifuge/channel.ts:5381": [ "public/app/features/live/centrifuge/channel.ts:5381": [
[0, 0, 0, "Unexpected any. Specify a different type.", "0"] [0, 0, 0, "Unexpected any. Specify a different type.", "0"]
], ],
"public/app/features/live/centrifuge/serviceWorkerProxy.ts:5381": [ "public/app/features/live/centrifuge/serviceWorkerProxy.ts:5381": [
[0, 0, 0, "Do not use any type assertions.", "0"], [0, 0, 0, "Do not use any type assertions.", "0"]
[0, 0, 0, "Do not use any type assertions.", "1"]
], ],
"public/app/features/live/centrifuge/transferHandlers.ts:5381": [ "public/app/features/live/centrifuge/transferHandlers.ts:5381": [
[0, 0, 0, "Unexpected any. Specify a different type.", "0"] [0, 0, 0, "Unexpected any. Specify a different type.", "0"]
@ -4752,9 +4629,6 @@ exports[`better eslint`] = {
[0, 0, 0, "Styles should be written using objects.", "1"], [0, 0, 0, "Styles should be written using objects.", "1"],
[0, 0, 0, "Styles should be written using objects.", "2"] [0, 0, 0, "Styles should be written using objects.", "2"]
], ],
"public/app/features/manage-dashboards/components/ImportDashboardForm.tsx:5381": [
[0, 0, 0, "Do not use any type assertions.", "0"]
],
"public/app/features/manage-dashboards/components/ImportDashboardLibraryPanelsList.tsx:5381": [ "public/app/features/manage-dashboards/components/ImportDashboardLibraryPanelsList.tsx:5381": [
[0, 0, 0, "Do not use any type assertions.", "0"], [0, 0, 0, "Do not use any type assertions.", "0"],
[0, 0, 0, "Styles should be written using objects.", "1"], [0, 0, 0, "Styles should be written using objects.", "1"],
@ -4844,12 +4718,11 @@ exports[`better eslint`] = {
[0, 0, 0, "Unexpected any. Specify a different type.", "0"] [0, 0, 0, "Unexpected any. Specify a different type.", "0"]
], ],
"public/app/features/panel/panellinks/link_srv.ts:5381": [ "public/app/features/panel/panellinks/link_srv.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.", "1"],
[0, 0, 0, "Unexpected any. Specify a different type.", "2"], [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.", "3"],
[0, 0, 0, "Unexpected any. Specify a different type.", "4"], [0, 0, 0, "Unexpected any. Specify a different type.", "4"]
[0, 0, 0, "Unexpected any. Specify a different type.", "5"]
], ],
"public/app/features/panel/state/actions.ts:5381": [ "public/app/features/panel/state/actions.ts:5381": [
[0, 0, 0, "Unexpected any. Specify a different type.", "0"] [0, 0, 0, "Unexpected any. Specify a different type.", "0"]
@ -4983,15 +4856,8 @@ exports[`better eslint`] = {
[0, 0, 0, "Unexpected any. Specify a different type.", "9"], [0, 0, 0, "Unexpected any. Specify a different type.", "9"],
[0, 0, 0, "Do not use any type assertions.", "10"], [0, 0, 0, "Do not use any type assertions.", "10"],
[0, 0, 0, "Unexpected any. Specify a different type.", "11"], [0, 0, 0, "Unexpected any. Specify a different type.", "11"],
[0, 0, 0, "Do not use any type assertions.", "12"], [0, 0, 0, "Unexpected any. Specify a different type.", "12"],
[0, 0, 0, "Do not use any type assertions.", "13"], [0, 0, 0, "Do not use any type assertions.", "13"]
[0, 0, 0, "Do not use any type assertions.", "14"],
[0, 0, 0, "Unexpected any. Specify a different type.", "15"],
[0, 0, 0, "Unexpected any. Specify a different type.", "16"],
[0, 0, 0, "Do not use any type assertions.", "17"]
],
"public/app/features/plugins/importPanelPlugin.ts:5381": [
[0, 0, 0, "Do not use any type assertions.", "0"]
], ],
"public/app/features/plugins/pluginSettings.ts:5381": [ "public/app/features/plugins/pluginSettings.ts:5381": [
[0, 0, 0, "Unexpected any. Specify a different type.", "0"], [0, 0, 0, "Unexpected any. Specify a different type.", "0"],
@ -5090,8 +4956,7 @@ exports[`better eslint`] = {
[0, 0, 0, "Unexpected any. Specify a different type.", "0"] [0, 0, 0, "Unexpected any. Specify a different type.", "0"]
], ],
"public/app/features/query/state/DashboardQueryRunner/AnnotationsQueryRunner.ts:5381": [ "public/app/features/query/state/DashboardQueryRunner/AnnotationsQueryRunner.ts:5381": [
[0, 0, 0, "Do not use any type assertions.", "0"], [0, 0, 0, "Do not use any type assertions.", "0"]
[0, 0, 0, "Do not use any type assertions.", "1"]
], ],
"public/app/features/query/state/DashboardQueryRunner/DashboardQueryRunner.ts:5381": [ "public/app/features/query/state/DashboardQueryRunner/DashboardQueryRunner.ts:5381": [
[0, 0, 0, "Unexpected any. Specify a different type.", "0"] [0, 0, 0, "Unexpected any. Specify a different type.", "0"]
@ -5102,10 +4967,7 @@ exports[`better eslint`] = {
"public/app/features/query/state/DashboardQueryRunner/testHelpers.ts:5381": [ "public/app/features/query/state/DashboardQueryRunner/testHelpers.ts:5381": [
[0, 0, 0, "Unexpected any. Specify a different type.", "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.", "1"],
[0, 0, 0, "Unexpected any. Specify a different type.", "2"], [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, "Unexpected any. Specify a different type.", "5"]
], ],
"public/app/features/query/state/DashboardQueryRunner/utils.ts:5381": [ "public/app/features/query/state/DashboardQueryRunner/utils.ts:5381": [
[0, 0, 0, "Unexpected any. Specify a different type.", "0"], [0, 0, 0, "Unexpected any. Specify a different type.", "0"],
@ -5237,10 +5099,7 @@ exports[`better eslint`] = {
[0, 0, 0, "Styles should be written using objects.", "2"] [0, 0, 0, "Styles should be written using objects.", "2"]
], ],
"public/app/features/search/page/components/columns.tsx:5381": [ "public/app/features/search/page/components/columns.tsx:5381": [
[0, 0, 0, "Do not use any type assertions.", "0"], [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.", "2"],
[0, 0, 0, "Do not use any type assertions.", "3"]
], ],
"public/app/features/search/service/bluge.ts:5381": [ "public/app/features/search/service/bluge.ts:5381": [
[0, 0, 0, "Do not use any type assertions.", "0"], [0, 0, 0, "Do not use any type assertions.", "0"],
@ -5303,9 +5162,7 @@ exports[`better eslint`] = {
[0, 0, 0, "Styles should be written using objects.", "5"] [0, 0, 0, "Styles should be written using objects.", "5"]
], ],
"public/app/features/serviceaccounts/state/reducers.ts:5381": [ "public/app/features/serviceaccounts/state/reducers.ts:5381": [
[0, 0, 0, "Do not use any type assertions.", "0"], [0, 0, 0, "Do not use any type assertions.", "0"]
[0, 0, 0, "Do not use any type assertions.", "1"],
[0, 0, 0, "Do not use any type assertions.", "2"]
], ],
"public/app/features/storage/Breadcrumb.tsx:5381": [ "public/app/features/storage/Breadcrumb.tsx:5381": [
[0, 0, 0, "Styles should be written using objects.", "0"] [0, 0, 0, "Styles should be written using objects.", "0"]
@ -5331,13 +5188,12 @@ exports[`better eslint`] = {
[0, 0, 0, "Styles should be written using objects.", "1"] [0, 0, 0, "Styles should be written using objects.", "1"]
], ],
"public/app/features/storage/StoragePage.tsx:5381": [ "public/app/features/storage/StoragePage.tsx:5381": [
[0, 0, 0, "Do not use any type assertions.", "0"], [0, 0, 0, "Styles should be written using objects.", "0"],
[0, 0, 0, "Styles should be written using objects.", "1"], [0, 0, 0, "Styles should be written using objects.", "1"],
[0, 0, 0, "Styles should be written using objects.", "2"], [0, 0, 0, "Styles should be written using objects.", "2"],
[0, 0, 0, "Styles should be written using objects.", "3"], [0, 0, 0, "Styles should be written using objects.", "3"],
[0, 0, 0, "Styles should be written using objects.", "4"], [0, 0, 0, "Styles should be written using objects.", "4"],
[0, 0, 0, "Styles should be written using objects.", "5"], [0, 0, 0, "Styles should be written using objects.", "5"]
[0, 0, 0, "Styles should be written using objects.", "6"]
], ],
"public/app/features/storage/UploadButton.tsx:5381": [ "public/app/features/storage/UploadButton.tsx:5381": [
[0, 0, 0, "Styles should be written using objects.", "0"] [0, 0, 0, "Styles should be written using objects.", "0"]
@ -5346,8 +5202,7 @@ exports[`better eslint`] = {
[0, 0, 0, "Unexpected any. Specify a different type.", "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.", "1"],
[0, 0, 0, "Do not use any type assertions.", "2"], [0, 0, 0, "Do not use any type assertions.", "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"]
], ],
"public/app/features/teams/TeamGroupSync.tsx:5381": [ "public/app/features/teams/TeamGroupSync.tsx:5381": [
[0, 0, 0, "Unexpected any. Specify a different type.", "0"], [0, 0, 0, "Unexpected any. Specify a different type.", "0"],
@ -5359,13 +5214,8 @@ exports[`better eslint`] = {
"public/app/features/teams/TeamMembers.tsx:5381": [ "public/app/features/teams/TeamMembers.tsx:5381": [
[0, 0, 0, "Unexpected any. Specify a different type.", "0"] [0, 0, 0, "Unexpected any. Specify a different type.", "0"]
], ],
"public/app/features/teams/TeamPages.tsx:5381": [
[0, 0, 0, "Do not use any type assertions.", "0"]
],
"public/app/features/teams/state/reducers.ts:5381": [ "public/app/features/teams/state/reducers.ts:5381": [
[0, 0, 0, "Do not use any type assertions.", "0"], [0, 0, 0, "Do not use any type assertions.", "0"]
[0, 0, 0, "Do not use any type assertions.", "1"],
[0, 0, 0, "Do not use any type assertions.", "2"]
], ],
"public/app/features/teams/state/selectors.ts:5381": [ "public/app/features/teams/state/selectors.ts:5381": [
[0, 0, 0, "Unexpected any. Specify a different type.", "0"] [0, 0, 0, "Unexpected any. Specify a different type.", "0"]
@ -5479,9 +5329,7 @@ exports[`better eslint`] = {
[0, 0, 0, "Do not use any type assertions.", "0"], [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.", "1"],
[0, 0, 0, "Do not use any type assertions.", "2"], [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.", "3"]
[0, 0, 0, "Do not use any type assertions.", "4"],
[0, 0, 0, "Unexpected any. Specify a different type.", "5"]
], ],
"public/app/features/transformers/extractFields/components/JSONPathEditor.tsx:5381": [ "public/app/features/transformers/extractFields/components/JSONPathEditor.tsx:5381": [
[0, 0, 0, "Styles should be written using objects.", "0"], [0, 0, 0, "Styles should be written using objects.", "0"],
@ -5559,10 +5407,6 @@ exports[`better eslint`] = {
"public/app/features/variables/adhoc/picker/AdHocFilterRenderer.tsx:5381": [ "public/app/features/variables/adhoc/picker/AdHocFilterRenderer.tsx:5381": [
[0, 0, 0, "Unexpected any. Specify a different type.", "0"] [0, 0, 0, "Unexpected any. Specify a different type.", "0"]
], ],
"public/app/features/variables/adhoc/urlParser.ts:5381": [
[0, 0, 0, "Do not use any type assertions.", "0"],
[0, 0, 0, "Unexpected any. Specify a different type.", "1"]
],
"public/app/features/variables/constant/reducer.ts:5381": [ "public/app/features/variables/constant/reducer.ts:5381": [
[0, 0, 0, "Do not use any type assertions.", "0"] [0, 0, 0, "Do not use any type assertions.", "0"]
], ],
@ -5624,10 +5468,6 @@ exports[`better eslint`] = {
"public/app/features/variables/editor/types.ts:5381": [ "public/app/features/variables/editor/types.ts:5381": [
[0, 0, 0, "Unexpected any. Specify a different type.", "0"] [0, 0, 0, "Unexpected any. Specify a different type.", "0"]
], ],
"public/app/features/variables/getAllVariableValuesForUrl.ts:5381": [
[0, 0, 0, "Do not use any type assertions.", "0"],
[0, 0, 0, "Unexpected any. Specify a different type.", "1"]
],
"public/app/features/variables/guard.ts:5381": [ "public/app/features/variables/guard.ts:5381": [
[0, 0, 0, "Unexpected any. Specify a different type.", "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.", "1"]
@ -5682,9 +5522,6 @@ exports[`better eslint`] = {
[0, 0, 0, "Unexpected any. Specify a different type.", "11"], [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.", "12"]
], ],
"public/app/features/variables/pickers/shared/VariableInput.tsx:5381": [
[0, 0, 0, "Do not use any type assertions.", "0"]
],
"public/app/features/variables/pickers/shared/VariableLink.tsx:5381": [ "public/app/features/variables/pickers/shared/VariableLink.tsx:5381": [
[0, 0, 0, "Use data-testid for E2E selectors instead of aria-label", "0"], [0, 0, 0, "Use data-testid for E2E selectors instead of aria-label", "0"],
[0, 0, 0, "Styles should be written using objects.", "1"], [0, 0, 0, "Styles should be written using objects.", "1"],
@ -5762,10 +5599,6 @@ exports[`better eslint`] = {
"public/app/features/variables/shared/testing/datasourceVariableBuilder.ts:5381": [ "public/app/features/variables/shared/testing/datasourceVariableBuilder.ts:5381": [
[0, 0, 0, "Unexpected any. Specify a different type.", "0"] [0, 0, 0, "Unexpected any. Specify a different type.", "0"]
], ],
"public/app/features/variables/shared/testing/helpers.ts:5381": [
[0, 0, 0, "Do not use any type assertions.", "0"],
[0, 0, 0, "Do not use any type assertions.", "1"]
],
"public/app/features/variables/shared/testing/optionsVariableBuilder.ts:5381": [ "public/app/features/variables/shared/testing/optionsVariableBuilder.ts:5381": [
[0, 0, 0, "Do not use any type assertions.", "0"], [0, 0, 0, "Do not use any type assertions.", "0"],
[0, 0, 0, "Do not use any type assertions.", "1"], [0, 0, 0, "Do not use any type assertions.", "1"],
@ -5873,9 +5706,6 @@ exports[`better eslint`] = {
[0, 0, 0, "Do not use any type assertions.", "0"], [0, 0, 0, "Do not use any type assertions.", "0"],
[0, 0, 0, "Do not use any type assertions.", "1"] [0, 0, 0, "Do not use any type assertions.", "1"]
], ],
"public/app/plugins/datasource/azuremonitor/components/MonitorConfig.tsx:5381": [
[0, 0, 0, "Do not use any type assertions.", "0"]
],
"public/app/plugins/datasource/azuremonitor/components/QueryEditor/QueryEditor.tsx:5381": [ "public/app/plugins/datasource/azuremonitor/components/QueryEditor/QueryEditor.tsx:5381": [
[0, 0, 0, "Do not use any type assertions.", "0"] [0, 0, 0, "Do not use any type assertions.", "0"]
], ],
@ -5885,16 +5715,14 @@ exports[`better eslint`] = {
"public/app/plugins/datasource/cloud-monitoring/CloudMonitoringMetricFindQuery.ts:5381": [ "public/app/plugins/datasource/cloud-monitoring/CloudMonitoringMetricFindQuery.ts:5381": [
[0, 0, 0, "Do not use any type assertions.", "0"], [0, 0, 0, "Do not use any type assertions.", "0"],
[0, 0, 0, "Do not use any type assertions.", "1"], [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.", "2"]
[0, 0, 0, "Unexpected any. Specify a different type.", "3"]
], ],
"public/app/plugins/datasource/cloud-monitoring/annotationSupport.ts:5381": [ "public/app/plugins/datasource/cloud-monitoring/annotationSupport.ts:5381": [
[0, 0, 0, "Do not use any type assertions.", "0"], [0, 0, 0, "Do not use any type assertions.", "0"],
[0, 0, 0, "Do not use any type assertions.", "1"] [0, 0, 0, "Do not use any type assertions.", "1"]
], ],
"public/app/plugins/datasource/cloud-monitoring/components/Aggregation.tsx:5381": [ "public/app/plugins/datasource/cloud-monitoring/components/Aggregation.tsx:5381": [
[0, 0, 0, "Do not use any type assertions.", "0"], [0, 0, 0, "Do not use any type assertions.", "0"]
[0, 0, 0, "Do not use any type assertions.", "1"]
], ],
"public/app/plugins/datasource/cloud-monitoring/components/AliasBy.tsx:5381": [ "public/app/plugins/datasource/cloud-monitoring/components/AliasBy.tsx:5381": [
[0, 0, 0, "Unexpected any. Specify a different type.", "0"], [0, 0, 0, "Unexpected any. Specify a different type.", "0"],
@ -5923,11 +5751,10 @@ exports[`better eslint`] = {
[0, 0, 0, "Unexpected any. Specify a different type.", "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.", "1"],
[0, 0, 0, "Do not use any type assertions.", "2"], [0, 0, 0, "Do not use any type assertions.", "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.", "4"],
[0, 0, 0, "Unexpected any. Specify a different type.", "5"], [0, 0, 0, "Do not use any type assertions.", "5"],
[0, 0, 0, "Do not use any type assertions.", "6"], [0, 0, 0, "Do not use any type assertions.", "6"]
[0, 0, 0, "Do not use any type assertions.", "7"]
], ],
"public/app/plugins/datasource/cloud-monitoring/functions.ts:5381": [ "public/app/plugins/datasource/cloud-monitoring/functions.ts:5381": [
[0, 0, 0, "Do not use any type assertions.", "0"], [0, 0, 0, "Do not use any type assertions.", "0"],
@ -6009,15 +5836,15 @@ exports[`better eslint`] = {
[0, 0, 0, "Unexpected any. Specify a different type.", "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.", "4"],
[0, 0, 0, "Do not use any type assertions.", "5"], [0, 0, 0, "Do not use any type assertions.", "5"],
[0, 0, 0, "Do not use any type assertions.", "6"], [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.", "7"],
[0, 0, 0, "Unexpected any. Specify a different type.", "8"], [0, 0, 0, "Unexpected any. Specify a different type.", "8"],
[0, 0, 0, "Unexpected any. Specify a different type.", "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.", "10"],
[0, 0, 0, "Unexpected any. Specify a different type.", "11"], [0, 0, 0, "Do not use any type assertions.", "11"],
[0, 0, 0, "Do not use any type assertions.", "12"], [0, 0, 0, "Do not use any type assertions.", "12"],
[0, 0, 0, "Do not use any type assertions.", "13"], [0, 0, 0, "Unexpected any. Specify a different type.", "13"],
[0, 0, 0, "Do not use any type assertions.", "14"], [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.", "15"],
[0, 0, 0, "Unexpected any. Specify a different type.", "16"], [0, 0, 0, "Unexpected any. Specify a different type.", "16"],
[0, 0, 0, "Unexpected any. Specify a different type.", "17"], [0, 0, 0, "Unexpected any. Specify a different type.", "17"],
@ -6028,9 +5855,9 @@ exports[`better eslint`] = {
[0, 0, 0, "Unexpected any. Specify a different type.", "22"], [0, 0, 0, "Unexpected any. Specify a different type.", "22"],
[0, 0, 0, "Unexpected any. Specify a different type.", "23"], [0, 0, 0, "Unexpected any. Specify a different type.", "23"],
[0, 0, 0, "Unexpected any. Specify a different type.", "24"], [0, 0, 0, "Unexpected any. Specify a different type.", "24"],
[0, 0, 0, "Unexpected any. Specify a different type.", "25"], [0, 0, 0, "Do not use any type assertions.", "25"],
[0, 0, 0, "Unexpected any. Specify a different type.", "26"], [0, 0, 0, "Unexpected any. Specify a different type.", "26"],
[0, 0, 0, "Do not use any type assertions.", "27"], [0, 0, 0, "Unexpected any. Specify a different type.", "27"],
[0, 0, 0, "Unexpected any. Specify a different type.", "28"], [0, 0, 0, "Unexpected any. Specify a different type.", "28"],
[0, 0, 0, "Unexpected any. Specify a different type.", "29"], [0, 0, 0, "Unexpected any. Specify a different type.", "29"],
[0, 0, 0, "Unexpected any. Specify a different type.", "30"], [0, 0, 0, "Unexpected any. Specify a different type.", "30"],
@ -6048,9 +5875,7 @@ exports[`better eslint`] = {
[0, 0, 0, "Unexpected any. Specify a different type.", "42"], [0, 0, 0, "Unexpected any. Specify a different type.", "42"],
[0, 0, 0, "Unexpected any. Specify a different type.", "43"], [0, 0, 0, "Unexpected any. Specify a different type.", "43"],
[0, 0, 0, "Unexpected any. Specify a different type.", "44"], [0, 0, 0, "Unexpected any. Specify a different type.", "44"],
[0, 0, 0, "Unexpected any. Specify a different type.", "45"], [0, 0, 0, "Unexpected any. Specify a different type.", "45"]
[0, 0, 0, "Unexpected any. Specify a different type.", "46"],
[0, 0, 0, "Unexpected any. Specify a different type.", "47"]
], ],
"public/app/plugins/datasource/elasticsearch/LanguageProvider.ts:5381": [ "public/app/plugins/datasource/elasticsearch/LanguageProvider.ts:5381": [
[0, 0, 0, "Unexpected any. Specify a different type.", "0"], [0, 0, 0, "Unexpected any. Specify a different type.", "0"],

View File

@ -3,7 +3,6 @@ import { v4 as uuidv4 } from 'uuid';
import { e2e } from '../index'; import { e2e } from '../index';
import { getDashboardUid } from '../support/url'; import { getDashboardUid } from '../support/url';
import { DeleteDashboardConfig } from './deleteDashboard';
import { selectOption } from './selectOption'; import { selectOption } from './selectOption';
import { setDashboardTimeRange, TimeRangeConfig } from './setDashboardTimeRange'; import { setDashboardTimeRange, TimeRangeConfig } from './setDashboardTimeRange';
@ -154,9 +153,9 @@ export const addDashboard = (config?: Partial<AddDashboardConfig>) => {
.then((url: string) => { .then((url: string) => {
const uid = getDashboardUid(url); const uid = getDashboardUid(url);
e2e.getScenarioContext().then(({ addedDashboards }: any) => { e2e.getScenarioContext().then(({ addedDashboards }) => {
e2e.setScenarioContext({ e2e.setScenarioContext({
addedDashboards: [...addedDashboards, { title, uid } as DeleteDashboardConfig], addedDashboards: [...addedDashboards, { title, uid }],
}); });
}); });

View File

@ -94,7 +94,7 @@ export const addDataSource = (config?: Partial<AddDataSourceConfig>) => {
cy.logToConsole('Added data source with name:', name); cy.logToConsole('Added data source with name:', name);
return cy.url().then(() => { return cy.url().then(() => {
e2e.getScenarioContext().then(({ addedDataSources }: any) => { e2e.getScenarioContext().then(({ addedDataSources }) => {
e2e.setScenarioContext({ e2e.setScenarioContext({
addedDataSources: [...addedDataSources, { name } as DeleteDataSourceConfig], addedDataSources: [...addedDataSources, { name } as DeleteDataSourceConfig],
}); });

View File

@ -5,7 +5,7 @@ import { getScenarioContext } from '../support/scenarioContext';
import { configurePanel, PartialAddPanelConfig } from './configurePanel'; import { configurePanel, PartialAddPanelConfig } from './configurePanel';
export const addPanel = (config?: Partial<PartialAddPanelConfig>) => export const addPanel = (config?: Partial<PartialAddPanelConfig>) =>
getScenarioContext().then(({ lastAddedDataSource }: any) => getScenarioContext().then(({ lastAddedDataSource }) =>
configurePanel({ configurePanel({
dataSourceName: lastAddedDataSource, dataSourceName: lastAddedDataSource,
panelTitle: `e2e-${uuidv4()}`, panelTitle: `e2e-${uuidv4()}`,

View File

@ -52,9 +52,8 @@ export type AddPanelConfig = ConfigurePanelConfig & AddPanelOverrides;
export type PartialEditPanelConfig = PartialConfigurePanelConfig & EditPanelOverrides; export type PartialEditPanelConfig = PartialConfigurePanelConfig & EditPanelOverrides;
export type EditPanelConfig = ConfigurePanelConfig & EditPanelOverrides; export type EditPanelConfig = ConfigurePanelConfig & EditPanelOverrides;
// @todo this actually returns type `Cypress.Chainable<AddPanelConfig | EditPanelConfig | ConfigurePanelConfig>`
export const configurePanel = (config: PartialAddPanelConfig | PartialEditPanelConfig | PartialConfigurePanelConfig) => export const configurePanel = (config: PartialAddPanelConfig | PartialEditPanelConfig | PartialConfigurePanelConfig) =>
getScenarioContext().then(({ lastAddedDashboardUid }: any) => { getScenarioContext().then(({ lastAddedDashboardUid }) => {
const fullConfig: AddPanelConfig | EditPanelConfig | ConfigurePanelConfig = { const fullConfig: AddPanelConfig | EditPanelConfig | ConfigurePanelConfig = {
chartData: { chartData: {
method: 'POST', method: 'POST',
@ -171,7 +170,6 @@ export const configurePanel = (config: PartialAddPanelConfig | PartialEditPanelC
return cy.wrap({ config: fullConfig }, { log: false }); return cy.wrap({ config: fullConfig }, { log: false });
}); });
// @todo this actually returns type `Cypress.Chainable`
const closeOptions = () => e2e.components.PanelEditor.toggleVizOptions().click(); const closeOptions = () => e2e.components.PanelEditor.toggleVizOptions().click();
export const VISUALIZATION_ALERT_LIST = 'Alert list'; export const VISUALIZATION_ALERT_LIST = 'Alert list';

View File

@ -18,7 +18,7 @@ export const deleteDashboard = ({ quick = false, title, uid }: DeleteDashboardCo
cy.logToConsole('Deleted dashboard with uid:', uid); cy.logToConsole('Deleted dashboard with uid:', uid);
e2e.getScenarioContext().then(({ addedDashboards }: any) => { e2e.getScenarioContext().then(({ addedDashboards }) => {
e2e.setScenarioContext({ e2e.setScenarioContext({
addedDashboards: addedDashboards.filter((dashboard: DeleteDashboardConfig) => { addedDashboards: addedDashboards.filter((dashboard: DeleteDashboardConfig) => {
return dashboard.title !== title && dashboard.uid !== uid; return dashboard.title !== title && dashboard.uid !== uid;

View File

@ -18,7 +18,7 @@ export const deleteDataSource = ({ id, name, quick = false }: DeleteDataSourceCo
cy.logToConsole('Deleted data source with name:', name); cy.logToConsole('Deleted data source with name:', name);
e2e.getScenarioContext().then(({ addedDataSources }: any) => { e2e.getScenarioContext().then(({ addedDataSources }) => {
e2e.setScenarioContext({ e2e.setScenarioContext({
addedDataSources: addedDataSources.filter((dataSource: DeleteDataSourceConfig) => { addedDataSources: addedDataSources.filter((dataSource: DeleteDataSourceConfig) => {
return dataSource.id !== id && dataSource.name !== name; return dataSource.id !== id && dataSource.name !== name;

View File

@ -15,9 +15,8 @@ interface OpenDashboardOptional {
export type PartialOpenDashboardConfig = Partial<OpenDashboardDefault> & OpenDashboardOptional; export type PartialOpenDashboardConfig = Partial<OpenDashboardDefault> & OpenDashboardOptional;
export type OpenDashboardConfig = OpenDashboardDefault & OpenDashboardOptional; export type OpenDashboardConfig = OpenDashboardDefault & OpenDashboardOptional;
// @todo this actually returns type `Cypress.Chainable<OpenDashboardConfig>`
export const openDashboard = (config?: PartialOpenDashboardConfig) => export const openDashboard = (config?: PartialOpenDashboardConfig) =>
getScenarioContext().then(({ lastAddedDashboardUid }: any) => { getScenarioContext().then(({ lastAddedDashboardUid }) => {
const fullConfig: OpenDashboardConfig = { const fullConfig: OpenDashboardConfig = {
uid: lastAddedDashboardUid, uid: lastAddedDashboardUid,
...config, ...config,

View File

@ -2,8 +2,8 @@ import { e2e } from '../index';
export const revertAllChanges = () => { export const revertAllChanges = () => {
e2e.getScenarioContext().then(({ addedDashboards, addedDataSources, hasChangedUserPreferences }) => { e2e.getScenarioContext().then(({ addedDashboards, addedDataSources, hasChangedUserPreferences }) => {
addedDashboards.forEach((dashboard: any) => e2e.flows.deleteDashboard({ ...dashboard, quick: true })); addedDashboards.forEach((dashboard) => e2e.flows.deleteDashboard({ ...dashboard, quick: true }));
addedDataSources.forEach((dataSource: any) => e2e.flows.deleteDataSource({ ...dataSource, quick: true })); addedDataSources.forEach((dataSource) => e2e.flows.deleteDataSource({ ...dataSource, quick: true }));
if (hasChangedUserPreferences) { if (hasChangedUserPreferences) {
e2e.flows.setDefaultUserPreferences(); e2e.flows.setDefaultUserPreferences();

View File

@ -2,13 +2,12 @@ import { e2e } from '../index';
export interface SelectOptionConfig { export interface SelectOptionConfig {
clickToOpen?: boolean; clickToOpen?: boolean;
container: any; container: Cypress.Chainable<JQuery<HTMLElement>>;
forceClickOption?: boolean; forceClickOption?: boolean;
optionText: string | RegExp; optionText: string | RegExp;
} }
// @todo this actually returns type `Cypress.Chainable` export const selectOption = (config: SelectOptionConfig) => {
export const selectOption = (config: SelectOptionConfig): any => {
const fullConfig: SelectOptionConfig = { const fullConfig: SelectOptionConfig = {
clickToOpen: true, clickToOpen: true,
forceClickOption: false, forceClickOption: false,

View File

@ -1,10 +1,9 @@
// @todo this actually returns type `Cypress.Chainable` // @todo this actually returns type `Cypress.Chainable`
const get = (key: string): any => const get = (key: string) =>
cy.wrap({ getLocalStorage: () => localStorage.getItem(key) }, { log: false }).invoke('getLocalStorage'); cy.wrap({ getLocalStorage: () => localStorage.getItem(key) }, { log: false }).invoke('getLocalStorage');
// @todo this actually returns type `Cypress.Chainable` export const getLocalStorage = (key: string) =>
export const getLocalStorage = (key: string): any => get(key).then((value) => {
get(key).then((value: any) => {
if (value === null) { if (value === null) {
return value; return value;
} else { } else {
@ -12,8 +11,7 @@ export const getLocalStorage = (key: string): any =>
} }
}); });
// @todo this actually returns type `Cypress.Chainable` export const requireLocalStorage = (key: string) =>
export const requireLocalStorage = (key: string): any =>
get(key) // `getLocalStorage()` would turn 'null' into `null` get(key) // `getLocalStorage()` would turn 'null' into `null`
.should('not.equal', null) .should('not.equal', null)
.then((value: any) => JSON.parse(value as string)); .then((value) => JSON.parse(value));

View File

@ -50,6 +50,7 @@ export function compareDataFrameStructures(a: DataFrame, b: DataFrame, skipConfi
// see e.g. https://github.com/Microsoft/TypeScript/issues/12870 // see e.g. https://github.com/Microsoft/TypeScript/issues/12870
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions // eslint-disable-next-line @typescript-eslint/consistent-type-assertions
let aKeys = Object.keys(cfgA) as Array<keyof typeof cfgA>; let aKeys = Object.keys(cfgA) as Array<keyof typeof cfgA>;
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
let bKeys = Object.keys(cfgB) as Array<keyof typeof cfgB>; let bKeys = Object.keys(cfgB) as Array<keyof typeof cfgB>;
if (aKeys.length !== bKeys.length) { if (aKeys.length !== bKeys.length) {

View File

@ -120,14 +120,14 @@ const mapInternal = (zone: string, timestamp: number): TimeZoneInfo | undefined
case InternalTimeZones.default: { case InternalTimeZones.default: {
const tz = getTimeZone(); const tz = getTimeZone();
const isInternal = tz === 'browser' || tz === 'utc'; const isInternal = tz === 'browser' || tz === 'utc';
const info = (isInternal ? mapInternal(tz, timestamp) : mapToInfo(tz, timestamp)) ?? {}; const info = isInternal ? mapInternal(tz, timestamp) : mapToInfo(tz, timestamp);
return { return {
countries: countriesByTimeZone[tz] ?? [], countries: countriesByTimeZone[tz] ?? [],
abbreviation: '', abbreviation: '',
offsetInMins: 0, offsetInMins: 0,
...info, ...info,
ianaName: (info as TimeZoneInfo).ianaName, ianaName: info?.ianaName ?? '',
name: 'Default', name: 'Default',
zone, zone,
}; };
@ -135,7 +135,7 @@ const mapInternal = (zone: string, timestamp: number): TimeZoneInfo | undefined
case InternalTimeZones.localBrowserTime: { case InternalTimeZones.localBrowserTime: {
const tz = moment.tz.guess(true); const tz = moment.tz.guess(true);
const info = mapToInfo(tz, timestamp) ?? {}; const info = mapToInfo(tz, timestamp);
return { return {
countries: countriesByTimeZone[tz] ?? [], countries: countriesByTimeZone[tz] ?? [],
@ -143,7 +143,7 @@ const mapInternal = (zone: string, timestamp: number): TimeZoneInfo | undefined
offsetInMins: new Date().getTimezoneOffset(), offsetInMins: new Date().getTimezoneOffset(),
...info, ...info,
name: 'Browser Time', name: 'Browser Time',
ianaName: (info as TimeZoneInfo).ianaName, ianaName: info?.ianaName ?? '',
zone, zone,
}; };
} }

View File

@ -123,20 +123,20 @@ class ScopedEventBus implements EventBus {
publish<T extends BusEvent>(event: T): void { publish<T extends BusEvent>(event: T): void {
if (!event.origin) { if (!event.origin) {
(event as any).origin = this; event.origin = this;
} }
this.eventBus.publish(event); this.eventBus.publish(event);
} }
filter = (event: BusEvent) => { filter<T extends BusEvent>(event: T) {
if (this.filterConfig.onlyLocal) { if (this.filterConfig.onlyLocal) {
return event.origin === this; return event.origin === this;
} }
return true; return true;
}; }
getStream<T extends BusEvent>(eventType: BusEventType<T>): Observable<T> { getStream<T extends BusEvent>(eventType: BusEventType<T>): Observable<T> {
return this.eventBus.getStream(eventType).pipe(filter(this.filter)) as Observable<T>; return this.eventBus.getStream(eventType).pipe(filter(this.filter));
} }
// syntax sugar // syntax sugar

View File

@ -7,7 +7,7 @@ import { Unsubscribable, Observable } from 'rxjs';
export interface BusEvent { export interface BusEvent {
readonly type: string; readonly type: string;
readonly payload?: any; readonly payload?: any;
readonly origin?: EventBus; origin?: EventBus;
} }
/** /**

View File

@ -18,7 +18,9 @@ export function findHighlightChunksInText({
}) { }) {
const chunks: TextMatch[] = []; const chunks: TextMatch[] = [];
for (const term of searchWords) { for (const term of searchWords) {
chunks.push(...findMatchesInText(textToHighlight, term as string)); if (typeof term === 'string') {
chunks.push(...findMatchesInText(textToHighlight, term));
}
} }
return chunks; return chunks;
} }

View File

@ -58,7 +58,7 @@ export interface CalculateFieldTransformerOptions {
// TODO: config?: FieldConfig; or maybe field overrides? since the UI exists // TODO: config?: FieldConfig; or maybe field overrides? since the UI exists
} }
type ValuesCreator = (data: DataFrame) => any[]; type ValuesCreator = (data: DataFrame) => unknown[] | undefined;
export const calculateFieldTransformer: DataTransformerInfo<CalculateFieldTransformerOptions> = { export const calculateFieldTransformer: DataTransformerInfo<CalculateFieldTransformerOptions> = {
id: DataTransformerID.calculateField, id: DataTransformerID.calculateField,
@ -178,7 +178,7 @@ function getReduceRowCreator(options: ReduceOptions, allFrames: DataFrame[]): Va
return (frame: DataFrame) => { return (frame: DataFrame) => {
// Find the columns that should be examined // Find the columns that should be examined
const columns: any[] = []; const columns = [];
for (const field of frame.fields) { for (const field of frame.fields) {
if (matcher(field, frame, allFrames)) { if (matcher(field, frame, allFrames)) {
columns.push(field.values); columns.push(field.values);
@ -239,7 +239,7 @@ function getBinaryCreator(options: BinaryOptions, allFrames: DataFrame[]): Value
const left = findFieldValuesWithNameOrConstant(frame, options.left, allFrames); const left = findFieldValuesWithNameOrConstant(frame, options.left, allFrames);
const right = findFieldValuesWithNameOrConstant(frame, options.right, allFrames); const right = findFieldValuesWithNameOrConstant(frame, options.right, allFrames);
if (!left || !right || !operator) { if (!left || !right || !operator) {
return undefined as unknown as any[]; return undefined;
} }
const arr = new Array(left.length); const arr = new Array(left.length);

View File

@ -253,7 +253,7 @@ export function buildHistogram(frames: DataFrame[], options?: HistogramTransform
for (const frame of frames) { for (const frame of frames) {
for (const field of frame.fields) { for (const field of frame.fields) {
if (field.type === FieldType.number) { if (field.type === FieldType.number) {
let fieldHist = histogram(field.values, getBucket, histFilter, histSort) as AlignedData; let fieldHist = histogram(field.values, getBucket, histFilter, histSort);
histograms.push(fieldHist); histograms.push(fieldHist);
counts.push({ counts.push({
...field, ...field,
@ -362,7 +362,7 @@ function histogram(
getBucket: (v: number) => number, getBucket: (v: number) => number,
filterOut?: any[] | null, filterOut?: any[] | null,
sort?: ((a: number, b: number) => number) | null sort?: ((a: number, b: number) => number) | null
) { ): AlignedData {
let hist = new Map(); let hist = new Map();
for (let i = 0; i < vals.length; i++) { for (let i = 0; i < vals.length; i++) {

View File

@ -157,9 +157,7 @@ export const hasLogsContextSupport = (datasource: unknown): datasource is DataSo
return false; return false;
} }
const withLogsSupport = datasource as DataSourceWithLogsContextSupport; return 'getLogRowContext' in datasource && 'showContextToggle' in datasource;
return withLogsSupport.getLogRowContext !== undefined && withLogsSupport.showContextToggle !== undefined;
}; };
/** /**
@ -259,9 +257,7 @@ export const hasLogsContextUiSupport = (datasource: unknown): datasource is Data
return false; return false;
} }
const withLogsSupport = datasource as DataSourceWithLogsContextSupport; return 'getLogRowContextUi' in datasource;
return withLogsSupport.getLogRowContextUi !== undefined;
}; };
export interface QueryFilterOptions extends KeyValue<string> {} export interface QueryFilterOptions extends KeyValue<string> {}

View File

@ -66,7 +66,10 @@ export interface DataSourceWithQueryExportSupport<TQuery extends SchemaDataQuery
export const hasQueryImportSupport = <TQuery extends SchemaDataQuery>( export const hasQueryImportSupport = <TQuery extends SchemaDataQuery>(
datasource: unknown datasource: unknown
): datasource is DataSourceWithQueryImportSupport<TQuery> => { ): datasource is DataSourceWithQueryImportSupport<TQuery> => {
return (datasource as DataSourceWithQueryImportSupport<TQuery>).importFromAbstractQueries !== undefined; if (!datasource) {
return false;
}
return 'importFromAbstractQueries' in datasource;
}; };
/** /**
@ -75,5 +78,8 @@ export const hasQueryImportSupport = <TQuery extends SchemaDataQuery>(
export const hasQueryExportSupport = <TQuery extends SchemaDataQuery>( export const hasQueryExportSupport = <TQuery extends SchemaDataQuery>(
datasource: unknown datasource: unknown
): datasource is DataSourceWithQueryExportSupport<TQuery> => { ): datasource is DataSourceWithQueryExportSupport<TQuery> => {
return (datasource as DataSourceWithQueryExportSupport<TQuery>).exportToAbstractQueries !== undefined; if (!datasource) {
return false;
}
return 'exportToAbstractQueries' in datasource;
}; };

View File

@ -16,24 +16,24 @@ declare global {
if (!Object.getOwnPropertyDescriptor(Array.prototype, 'toArray')) { if (!Object.getOwnPropertyDescriptor(Array.prototype, 'toArray')) {
Object.defineProperties(Array.prototype, { Object.defineProperties(Array.prototype, {
get: { get: {
value: function (idx: number): any { value: function (idx: number) {
return (this as any)[idx]; return this[idx];
}, },
writable: true, writable: true,
enumerable: false, enumerable: false,
configurable: true, configurable: true,
}, },
set: { set: {
value: function (idx: number, value: any) { value: function (idx: number, value: unknown) {
(this as any)[idx] = value; this[idx] = value;
}, },
writable: true, writable: true,
enumerable: false, enumerable: false,
configurable: true, configurable: true,
}, },
add: { add: {
value: function (value: any) { value: function (value: unknown) {
(this as any).push(value); this.push(value);
}, },
writable: true, writable: true,
enumerable: false, enumerable: false,
@ -106,7 +106,7 @@ export interface MutableVector<T = any> extends ReadWriteVector<T> {}
* @deprecated * @deprecated
*/ */
export function makeArrayIndexableVector<T extends Vector>(v: T): T { export function makeArrayIndexableVector<T extends Vector>(v: T): T {
return new Proxy(v, { return new Proxy<T>(v, {
get(target: Vector, property: string, receiver: Vector) { get(target: Vector, property: string, receiver: Vector) {
if (typeof property !== 'symbol') { if (typeof property !== 'symbol') {
const idx = +property; const idx = +property;
@ -116,7 +116,7 @@ export function makeArrayIndexableVector<T extends Vector>(v: T): T {
} }
return Reflect.get(target, property, receiver); return Reflect.get(target, property, receiver);
}, },
set(target: Vector, property: string, value: any, receiver: Vector) { set(target: Vector, property: string, value: unknown, receiver: Vector) {
if (typeof property !== 'symbol') { if (typeof property !== 'symbol') {
const idx = +property; const idx = +property;
if (String(idx) === property) { if (String(idx) === property) {
@ -126,5 +126,5 @@ export function makeArrayIndexableVector<T extends Vector>(v: T): T {
} }
return Reflect.set(target, property, value, receiver); return Reflect.set(target, property, value, receiver);
}, },
}) as T; });
} }

View File

@ -30,7 +30,7 @@ export function getValueMappingResult(valueMappings: ValueMapping[], value: any)
continue; continue;
} }
const valueAsNumber = parseFloat(value as string); const valueAsNumber = parseFloat(value);
if (isNaN(valueAsNumber)) { if (isNaN(valueAsNumber)) {
continue; continue;
} }
@ -76,13 +76,13 @@ export function getValueMappingResult(valueMappings: ValueMapping[], value: any)
break; break;
} }
case SpecialValueMatch.NaN: { case SpecialValueMatch.NaN: {
if (isNaN(value as number)) { if (typeof value === 'number' && isNaN(value)) {
return vm.options.result; return vm.options.result;
} }
break; break;
} }
case SpecialValueMatch.NullAndNaN: { case SpecialValueMatch.NullAndNaN: {
if (isNaN(value as number) || value == null) { if ((typeof value === 'number' && isNaN(value)) || value == null) {
return vm.options.result; return vm.options.result;
} }
break; break;

View File

@ -29,7 +29,7 @@ export function getRefField(frame: DataFrame, refFieldName?: string | null) {
function applySpanNullsThresholds(frame: DataFrame, refFieldName?: string | null) { function applySpanNullsThresholds(frame: DataFrame, refFieldName?: string | null) {
const refField = getRefField(frame, refFieldName); const refField = getRefField(frame, refFieldName);
let refValues = refField?.values as any[]; let refValues = refField?.values;
for (let i = 0; i < frame.fields.length; i++) { for (let i = 0; i < frame.fields.length; i++) {
let field = frame.fields[i]; let field = frame.fields[i];
@ -41,7 +41,7 @@ function applySpanNullsThresholds(frame: DataFrame, refFieldName?: string | null
let spanNulls = field.config.custom?.spanNulls; let spanNulls = field.config.custom?.spanNulls;
if (typeof spanNulls === 'number') { if (typeof spanNulls === 'number') {
if (spanNulls !== -1) { if (spanNulls !== -1 && refValues) {
field.values = nullToUndefThreshold(refValues, field.values, spanNulls); field.values = nullToUndefThreshold(refValues, field.values, spanNulls);
} }
} }

View File

@ -103,7 +103,11 @@ export function cssClass(className: string): string {
* Creates a new DOM element with given type and class * Creates a new DOM element with given type and class
* TODO: move me to helpers * TODO: move me to helpers
*/ */
export function createElement(type: string, className?: string, content?: Element | string): Element { export function createElement<T extends keyof HTMLElementTagNameMap>(
type: T,
className?: string,
content?: Element | string
) {
const el = document.createElement(type); const el = document.createElement(type);
if (className) { if (className) {
el.classList.add(cssClass(className)); el.classList.add(cssClass(className));

View File

@ -42,7 +42,7 @@ export class JsonExplorer {
private _isOpen: boolean | null = null; private _isOpen: boolean | null = null;
// A reference to the element that we render to // A reference to the element that we render to
private element: Element | null = null; private element: HTMLDivElement | null = null;
private skipChildren = false; private skipChildren = false;
@ -358,7 +358,7 @@ export class JsonExplorer {
togglerLink.addEventListener('click', this.toggleOpen.bind(this)); togglerLink.addEventListener('click', this.toggleOpen.bind(this));
} }
return this.element as HTMLDivElement; return this.element;
} }
/** /**
@ -404,8 +404,7 @@ export class JsonExplorer {
* Animated option is used when user triggers this via a click * Animated option is used when user triggers this via a click
*/ */
removeChildren(animated = false) { removeChildren(animated = false) {
const childrenElement = const childrenElement = this.element && this.element.querySelector<HTMLDivElement>(`div.${cssClass('children')}`);
this.element && (this.element.querySelector(`div.${cssClass('children')}`) as HTMLDivElement);
if (animated) { if (animated) {
let childrenRemoved = 0; let childrenRemoved = 0;

View File

@ -236,7 +236,7 @@ export function sharedSingleStatMigrationHandler(panel: PanelModel<SingleStatBas
} }
} }
return options as SingleStatBaseOptions; return options;
} }
export function moveThresholdsAndMappingsToField(old: any) { export function moveThresholdsAndMappingsToField(old: any) {

View File

@ -19,7 +19,7 @@ export interface Props {
} }
export function ExpandedRow({ tableStyles, nestedData, rowIndex, width, cellHeight }: Props) { export function ExpandedRow({ tableStyles, nestedData, rowIndex, width, cellHeight }: Props) {
const frames = nestedData.values as DataFrame[][]; const frames: DataFrame[][] = nestedData.values;
const subTables: React.ReactNode[] = []; const subTables: React.ReactNode[] = [];
const theme = useTheme2(); const theme = useTheme2();
const styles = useStyles2(getStyles); const styles = useStyles2(getStyles);
@ -72,7 +72,7 @@ const getStyles = (theme: GrafanaTheme2) => {
}; };
export function getExpandedRowHeight(nestedData: Field, rowIndex: number, tableStyles: TableStyles) { export function getExpandedRowHeight(nestedData: Field, rowIndex: number, tableStyles: TableStyles) {
const frames = nestedData.values as DataFrame[][]; const frames: DataFrame[][] = nestedData.values;
const height = frames[rowIndex].reduce((acc: number, frame: DataFrame) => { const height = frames[rowIndex].reduce((acc: number, frame: DataFrame) => {
if (frame.length) { if (frame.length) {

View File

@ -12,7 +12,7 @@ import {
} from 'react-table'; } from 'react-table';
import { VariableSizeList } from 'react-window'; import { VariableSizeList } from 'react-window';
import { Field, FieldType, ReducerID } from '@grafana/data'; import { FieldType, ReducerID } from '@grafana/data';
import { selectors } from '@grafana/e2e-selectors'; import { selectors } from '@grafana/e2e-selectors';
import { TableCellHeight } from '@grafana/schema'; import { TableCellHeight } from '@grafana/schema';
@ -176,7 +176,7 @@ export const Table = memo((props: Props) => {
} }
const footerItems = getFooterItems( const footerItems = getFooterItems(
headerGroups[0].headers as unknown as Array<{ id: string; field: Field }>, headerGroups[0].headers,
createFooterCalculationValues(rows), createFooterCalculationValues(rows),
footerOptions, footerOptions,
theme theme

View File

@ -30,16 +30,20 @@ export const TableCell = ({ cell, tableStyles, onCellFilterAdded, timeRange, use
cellProps.style.justifyContent = (cell.column as any).justifyContent; cellProps.style.justifyContent = (cell.column as any).justifyContent;
} }
let innerWidth = ((cell.column.width as number) ?? 24) - tableStyles.cellPadding * 2; let innerWidth = (typeof cell.column.width === 'number' ? cell.column.width : 24) - tableStyles.cellPadding * 2;
return cell.render('Cell', { return (
field, <>
tableStyles, {cell.render('Cell', {
onCellFilterAdded, field,
cellProps, tableStyles,
innerWidth, onCellFilterAdded,
timeRange, cellProps,
userProps, innerWidth,
frame, timeRange,
}) as React.ReactElement; userProps,
frame,
})}
</>
);
}; };

View File

@ -49,7 +49,7 @@ export function getTextAlign(field?: Field): Property.JustifyContent {
} }
if (field.config.custom) { if (field.config.custom) {
const custom = field.config.custom as TableFieldOptions; const custom: TableFieldOptions = field.config.custom;
switch (custom.align) { switch (custom.align) {
case 'right': case 'right':
@ -101,7 +101,7 @@ export function getColumns(
} }
for (const [fieldIndex, field] of data.fields.entries()) { for (const [fieldIndex, field] of data.fields.entries()) {
const fieldTableOptions = (field.config.custom || {}) as TableFieldOptions; const fieldTableOptions: TableFieldOptions = field.config.custom || {};
if (fieldTableOptions.hidden || field.type === FieldType.nestedFrames) { if (fieldTableOptions.hidden || field.type === FieldType.nestedFrames) {
continue; continue;
} }
@ -131,7 +131,7 @@ export function getColumns(
id: fieldIndex.toString(), id: fieldIndex.toString(),
field: field, field: field,
Header: fieldTableOptions.hideHeader ? '' : getFieldDisplayName(field, data), Header: fieldTableOptions.hideHeader ? '' : getFieldDisplayName(field, data),
accessor: (_row: any, i: number) => { accessor: (_row, i) => {
return field.values[i]; return field.values[i];
}, },
sortType: selectSortType(field.type), sortType: selectSortType(field.type),
@ -255,7 +255,7 @@ export function rowToFieldValue(row: any, field?: Field): string {
return value; return value;
} }
export function valuesToOptions(unique: Record<string, any>): SelectableValue[] { export function valuesToOptions(unique: Record<string, unknown>): SelectableValue[] {
return Object.keys(unique) return Object.keys(unique)
.reduce<SelectableValue[]>((all, key) => all.concat({ value: unique[key], label: key }), []) .reduce<SelectableValue[]>((all, key) => all.concat({ value: unique[key], label: key }), [])
.sort(sortOptions); .sort(sortOptions);
@ -293,12 +293,12 @@ export function getFilteredOptions(options: SelectableValue[], filterValues?: Se
return options.filter((option) => filterValues.some((filtered) => filtered.value === option.value)); return options.filter((option) => filterValues.some((filtered) => filtered.value === option.value));
} }
export function sortCaseInsensitive(a: Row<any>, b: Row<any>, id: string) { export function sortCaseInsensitive(a: Row, b: Row, id: string) {
return String(a.values[id]).localeCompare(String(b.values[id]), undefined, { sensitivity: 'base' }); return String(a.values[id]).localeCompare(String(b.values[id]), undefined, { sensitivity: 'base' });
} }
// sortNumber needs to have great performance as it is called a lot // sortNumber needs to have great performance as it is called a lot
export function sortNumber(rowA: Row<any>, rowB: Row<any>, id: string) { export function sortNumber(rowA: Row, rowB: Row, id: string) {
const a = toNumber(rowA.values[id]); const a = toNumber(rowA.values[id]);
const b = toNumber(rowB.values[id]); const b = toNumber(rowB.values[id]);
return a === b ? 0 : a > b ? 1 : -1; return a === b ? 0 : a > b ? 1 : -1;

View File

@ -118,11 +118,11 @@ export function getStackingGroups(frame: DataFrame) {
let stackDir = getStackDirection(transform, values); let stackDir = getStackDirection(transform, values);
let drawStyle: GraphDrawStyle = custom.drawStyle; let drawStyle: GraphDrawStyle = custom.drawStyle;
let drawStyle2 = let drawStyle2: BarAlignment | LineInterpolation | null =
drawStyle === GraphDrawStyle.Bars drawStyle === GraphDrawStyle.Bars
? (custom.barAlignment as BarAlignment) ? custom.barAlignment
: drawStyle === GraphDrawStyle.Line : drawStyle === GraphDrawStyle.Line
? (custom.lineInterpolation as LineInterpolation) ? custom.lineInterpolation
: null; : null;
let stackKey = `${stackDir}|${stackingMode}|${stackingGroup}|${buildScaleKey( let stackKey = `${stackDir}|${stackingMode}|${stackingGroup}|${buildScaleKey(

View File

@ -85,7 +85,7 @@ export class RowRepeaterBehavior extends SceneObjectBase<RowRepeaterBehaviorStat
return; return;
} }
const rowToRepeat = this.parent as SceneGridRow; const rowToRepeat = this.parent;
const { values, texts } = getMultiVariableValues(variable); const { values, texts } = getMultiVariableValues(variable);
const rows: SceneGridRow[] = []; const rows: SceneGridRow[] = [];
const rowContentHeight = getRowContentHeight(this.state.sources); const rowContentHeight = getRowContentHeight(this.state.sources);

View File

@ -6,6 +6,8 @@ export function setupLoadDashboardMock(rsp: DeepPartial<DashboardDTO>) {
const loadDashboardMock = jest.fn().mockResolvedValue(rsp); const loadDashboardMock = jest.fn().mockResolvedValue(rsp);
setDashboardLoaderSrv({ setDashboardLoaderSrv({
loadDashboard: loadDashboardMock, loadDashboard: loadDashboardMock,
// disabling type checks since this is a test util
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
} as unknown as DashboardLoaderSrv); } as unknown as DashboardLoaderSrv);
return loadDashboardMock; return loadDashboardMock;
} }
@ -27,6 +29,8 @@ export function mockResizeObserver() {
left: 100, left: 100,
right: 0, right: 0,
}, },
// disabling type checks since this is a test util
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
} as ResizeObserverEntry, } as ResizeObserverEntry,
], ],
this this

View File

@ -105,10 +105,10 @@ export class DashboardExporter {
return; return;
} }
let datasource: string = obj.datasource; let datasource = obj.datasource;
let datasourceVariable: any = null; let datasourceVariable: any = null;
const datasourceUid: string = (datasource as any)?.uid; const datasourceUid: string = datasource?.uid;
// ignore data source properties that contain a variable // ignore data source properties that contain a variable
if (datasourceUid) { if (datasourceUid) {
if (datasourceUid.indexOf('$') === 0) { if (datasourceUid.indexOf('$') === 0) {

View File

@ -790,7 +790,7 @@ export class DashboardMigrator {
if (panelDataSourceWasDefault && target.datasource?.uid !== '__expr__') { if (panelDataSourceWasDefault && target.datasource?.uid !== '__expr__') {
// We can have situations when default ds changed and the panel level data source is different from the queries // We can have situations when default ds changed and the panel level data source is different from the queries
// In this case we use the query level data source as source for truth // In this case we use the query level data source as source for truth
panel.datasource = target.datasource as DataSourceRef; panel.datasource = target.datasource;
} }
} }
} }
@ -1206,7 +1206,7 @@ export function migrateDatasourceNameToRef(
const ds = getDataSourceSrv().getInstanceSettings(nameOrRef); const ds = getDataSourceSrv().getInstanceSettings(nameOrRef);
if (!ds) { if (!ds) {
return { uid: nameOrRef as string }; // not found return { uid: nameOrRef ? nameOrRef : undefined }; // not found
} }
return getDataSourceRef(ds); return getDataSourceRef(ds);

View File

@ -1072,7 +1072,7 @@ export class DashboardModel implements TimeModel {
} }
getTimezone(): TimeZone { getTimezone(): TimeZone {
return (this.timezone ? this.timezone : contextSrv?.user?.timezone) as TimeZone; return this.timezone ? this.timezone : contextSrv?.user?.timezone;
} }
private updateSchema(old: any) { private updateSchema(old: any) {
@ -1141,7 +1141,7 @@ export class DashboardModel implements TimeModel {
// First try to find it in a collapsed row and exand it // First try to find it in a collapsed row and exand it
const collapsedPanels = this.panels.filter((p) => p.collapsed); const collapsedPanels = this.panels.filter((p) => p.collapsed);
for (const panel of collapsedPanels) { for (const panel of collapsedPanels) {
const hasPanel = panel.panels?.some((rp: any) => rp.id === panelId); const hasPanel = panel.panels?.some((rp) => rp.id === panelId);
hasPanel && this.toggleRow(panel); hasPanel && this.toggleRow(panel);
} }
@ -1263,7 +1263,7 @@ export class DashboardModel implements TimeModel {
return !isEqual(updated, originalVariables); return !isEqual(updated, originalVariables);
} }
private cloneVariablesFrom(variables: any[]): any[] { private cloneVariablesFrom(variables: any[]) {
return variables.map((variable) => ({ return variables.map((variable) => ({
name: variable.name, name: variable.name,
type: variable.type, type: variable.type,

View File

@ -1,4 +1,4 @@
import { cloneDeep, defaultsDeep, isArray, isEqual, keys } from 'lodash'; import { cloneDeep, defaultsDeep, isArray, isEqual } from 'lodash';
import { v4 as uuidv4 } from 'uuid'; import { v4 as uuidv4 } from 'uuid';
import { import {
@ -228,15 +228,15 @@ export class PanelModel implements DataConfigSource, IPanelModel {
continue; continue;
} }
if (typeof (this as any)[property] === 'function') { if (typeof this[property] === 'function') {
continue; continue;
} }
if (typeof (this as any)[property] === 'symbol') { if (typeof this[property] === 'symbol') {
continue; continue;
} }
delete (this as any)[property]; delete this[property];
} }
// copy properties from persisted model // copy properties from persisted model
@ -463,11 +463,11 @@ export class PanelModel implements DataConfigSource, IPanelModel {
clearPropertiesBeforePluginChange() { clearPropertiesBeforePluginChange() {
// remove panel type specific options // remove panel type specific options
for (const key of keys(this)) { for (const key in this) {
if (mustKeepProps[key]) { if (mustKeepProps[key]) {
continue; continue;
} }
delete (this as any)[key]; delete this[key];
} }
this.options = {}; this.options = {};

View File

@ -45,7 +45,7 @@ export class FrameVectorSource<T extends Geometry = Geometry> extends VectorSour
//eslint-disable-next-line //eslint-disable-next-line
const field = info.field as unknown as Field<Point>; const field = info.field as unknown as Field<Point>;
const geometry = new LineString(field.values.map((p) => p.getCoordinates())) as Geometry; const geometry: Geometry = new LineString(field.values.map((p) => p.getCoordinates()));
this.addFeatureInternal( this.addFeatureInternal(
new Feature({ new Feature({
frame, frame,

View File

@ -315,9 +315,7 @@ export class LiveDataStream<T = unknown> {
? lastMessage.values ? lastMessage.values
: reduceNewValuesSameSchemaMessages(messages).values; : reduceNewValuesSameSchemaMessages(messages).values;
const filteredValues = matchingFieldIndexes const filteredValues = matchingFieldIndexes ? values.filter((v, i) => matchingFieldIndexes?.includes(i)) : values;
? values.filter((v, i) => (matchingFieldIndexes as number[]).includes(i))
: values;
return { return {
key: subKey, key: subKey,

View File

@ -14,7 +14,7 @@ export class CentrifugeServiceWorkerProxy implements CentrifugeSrv {
private centrifugeWorker; private centrifugeWorker;
constructor(deps: CentrifugeSrvDeps) { constructor(deps: CentrifugeSrvDeps) {
this.centrifugeWorker = comlink.wrap<RemoteCentrifugeService>(createWorker() as comlink.Endpoint); this.centrifugeWorker = comlink.wrap<RemoteCentrifugeService>(createWorker());
this.centrifugeWorker.initialize(deps, comlink.proxy(deps.dataStreamSubscriberReadiness)); this.centrifugeWorker.initialize(deps, comlink.proxy(deps.dataStreamSubscriberReadiness));
} }

View File

@ -1,4 +1,4 @@
import React, { BaseSyntheticEvent, useEffect, useState } from 'react'; import React, { useEffect, useState } from 'react';
import { selectors } from '@grafana/e2e-selectors'; import { selectors } from '@grafana/e2e-selectors';
import { ExpressionDatasourceRef } from '@grafana/runtime/src/utils/DataSourceWithBackend'; import { ExpressionDatasourceRef } from '@grafana/runtime/src/utils/DataSourceWithBackend';
@ -60,7 +60,7 @@ export const ImportDashboardForm = ({
*/ */
useEffect(() => { useEffect(() => {
if (isSubmitted && (errors.title || errors.uid)) { if (isSubmitted && (errors.title || errors.uid)) {
onSubmit(getValues(), {} as BaseSyntheticEvent); onSubmit(getValues());
} }
}, [errors, getValues, isSubmitted, onSubmit]); }, [errors, getValues, isSubmitted, onSubmit]);
const newLibraryPanels = inputs?.libraryPanels?.filter((i) => i.state === LibraryPanelInputState.New) ?? []; const newLibraryPanels = inputs?.libraryPanels?.filter((i) => i.state === LibraryPanelInputState.New) ?? [];

View File

@ -85,7 +85,7 @@ export const getPanelLinksVariableSuggestions = (): VariableSuggestion[] => [
...getTemplateSrv() ...getTemplateSrv()
.getVariables() .getVariables()
.map((variable) => ({ .map((variable) => ({
value: variable.name as string, value: variable.name,
label: variable.name, label: variable.name,
origin: VariableOrigin.Template, origin: VariableOrigin.Template,
})), })),

View File

@ -352,7 +352,7 @@ export function getNameOrUid(ref?: string | DataSourceRef | null): string | unde
} }
const isString = typeof ref === 'string'; const isString = typeof ref === 'string';
return isString ? (ref as string) : ((ref as any)?.uid as string | undefined); return isString ? ref : ref?.uid;
} }
export function variableInterpolation(value: any[]) { export function variableInterpolation(value: any[]) {

View File

@ -53,7 +53,7 @@ function getPanelPlugin(meta: PanelPluginMeta): Promise<PanelPlugin> {
}) })
.then((pluginExports) => { .then((pluginExports) => {
if (pluginExports.plugin) { if (pluginExports.plugin) {
return pluginExports.plugin as PanelPlugin; return pluginExports.plugin;
} else if (pluginExports.PanelCtrl) { } else if (pluginExports.PanelCtrl) {
const plugin = new PanelPlugin(null); const plugin = new PanelPlugin(null);
plugin.angularPanelCtrl = pluginExports.PanelCtrl; plugin.angularPanelCtrl = pluginExports.PanelCtrl;

View File

@ -23,7 +23,7 @@ export class AnnotationsQueryRunner implements AnnotationQueryRunner {
return of([]); return of([]);
} }
const panel: PanelModel = {} as unknown as PanelModel; // deliberate setting panel to empty object because executeAnnotationQuery shouldn't depend on panelModel const panel: PanelModel = {} as PanelModel; // deliberate setting panel to empty object because executeAnnotationQuery shouldn't depend on panelModel
return executeAnnotationQuery({ dashboard, range, panel }, datasource!, annotation).pipe( return executeAnnotationQuery({ dashboard, range, panel }, datasource!, annotation).pipe(
map((result) => { map((result) => {

View File

@ -1,11 +1,11 @@
import { asyncScheduler, Observable, of, scheduled } from 'rxjs'; import { asyncScheduler, Observable, of, scheduled } from 'rxjs';
import { AnnotationEvent, getDefaultTimeRange } from '@grafana/data'; import { AnnotationEvent, getDefaultTimeRange, PanelModel } from '@grafana/data';
import { DashboardQueryRunnerOptions } from './types'; import { DashboardQueryRunnerOptions } from './types';
// function that creates an async of result Observable // function that creates an async of result Observable
export function toAsyncOfResult(result: any): Observable<any> { export function toAsyncOfResult<T>(result: T): Observable<T> {
return scheduled(of(result), asyncScheduler); return scheduled(of(result), asyncScheduler);
} }
@ -54,7 +54,7 @@ export function getDefaultOptions(): DashboardQueryRunnerOptions {
subscribe: jest.fn().mockReturnValue({ unsubscribe: jest.fn() }), subscribe: jest.fn().mockReturnValue({ unsubscribe: jest.fn() }),
publish: jest.fn(), publish: jest.fn(),
}, },
panels: [{ alert: {} } as any], panels: [{ alert: {} } as PanelModel],
meta: {}, meta: {},
}; };
const range = getDefaultTimeRange(); const range = getDefaultTimeRange();

View File

@ -43,7 +43,7 @@ export const generateColumns = (
const uidField = access.uid; const uidField = access.uid;
const kindField = access.kind; const kindField = access.kind;
let sortFieldWith = 0; let sortFieldWith = 0;
const sortField = (access as any)[response.view.dataFrame.meta?.custom?.sortBy] as Field; const sortField: Field = access[response.view.dataFrame.meta?.custom?.sortBy];
if (sortField) { if (sortField) {
sortFieldWith = 175; sortFieldWith = 175;
if (sortField.type === FieldType.time) { if (sortField.type === FieldType.time) {

View File

@ -13,7 +13,7 @@ import {
export const initialStateProfile: ServiceAccountProfileState = { export const initialStateProfile: ServiceAccountProfileState = {
serviceAccount: {} as ServiceAccountDTO, serviceAccount: {} as ServiceAccountDTO,
isLoading: true, isLoading: true,
tokens: [] as ApiKey[], tokens: [],
}; };
export const serviceAccountProfileSlice = createSlice({ export const serviceAccountProfileSlice = createSlice({
@ -41,7 +41,7 @@ export const { serviceAccountLoaded, serviceAccountTokensLoaded, serviceAccountF
// serviceAccountsListPage // serviceAccountsListPage
export const initialStateList: ServiceAccountsState = { export const initialStateList: ServiceAccountsState = {
serviceAccounts: [] as ServiceAccountDTO[], serviceAccounts: [],
isLoading: true, isLoading: true,
roleOptions: [], roleOptions: [],
query: '', query: '',

View File

@ -93,7 +93,7 @@ export default function StoragePage(props: Props) {
if (listing.value) { if (listing.value) {
const length = listing.value.length; const length = listing.value.length;
if (length === 1) { if (length === 1) {
const first = listing.value.fields[0].values[0] as string; const first: string = listing.value.fields[0].values[0];
isFolder = !path.endsWith(first); isFolder = !path.endsWith(first);
} else { } else {
// TODO: handle files/folders which do not exist // TODO: handle files/folders which do not exist

View File

@ -5,7 +5,7 @@ import { GrafanaTheme2 } from '@grafana/data';
import { ConfirmModal, FileUpload, useStyles2 } from '@grafana/ui'; import { ConfirmModal, FileUpload, useStyles2 } from '@grafana/ui';
import { filenameAlreadyExists, getGrafanaStorage } from './storage'; import { filenameAlreadyExists, getGrafanaStorage } from './storage';
import { StorageView, UploadReponse } from './types'; import { StorageView, UploadResponse } from './types';
interface Props { interface Props {
setErrorMessages: (errors: string[]) => void; setErrorMessages: (errors: string[]) => void;
@ -28,7 +28,7 @@ export function UploadButton({ setErrorMessages, setPath, path, fileNames }: Pro
setFileUploadKey((prev) => prev + 1); setFileUploadKey((prev) => prev + 1);
}, [file]); }, [file]);
const onUpload = (rsp: UploadReponse) => { const onUpload = (rsp: UploadResponse) => {
console.log('Uploaded: ' + path); console.log('Uploaded: ' + path);
if (rsp.path) { if (rsp.path) {
setPath(rsp.path); setPath(rsp.path);

View File

@ -2,13 +2,13 @@ import { DataFrame, dataFrameFromJSON, DataFrameJSON, getDisplayProcessor } from
import { config, getBackendSrv } from '@grafana/runtime'; import { config, getBackendSrv } from '@grafana/runtime';
import { backendSrv } from 'app/core/services/backend_srv'; import { backendSrv } from 'app/core/services/backend_srv';
import { UploadReponse, StorageInfo, ItemOptions, WriteValueRequest, WriteValueResponse } from './types'; import { UploadResponse, StorageInfo, ItemOptions, WriteValueRequest, WriteValueResponse } from './types';
// Likely should be built into the search interface! // Likely should be built into the search interface!
export interface GrafanaStorage { export interface GrafanaStorage {
get: <T = any>(path: string) => Promise<T>; get: <T = any>(path: string) => Promise<T>;
list: (path: string) => Promise<DataFrame | undefined>; list: (path: string) => Promise<DataFrame | undefined>;
upload: (folder: string, file: File, overwriteExistingFile: boolean) => Promise<UploadReponse>; upload: (folder: string, file: File, overwriteExistingFile: boolean) => Promise<UploadResponse>;
createFolder: (path: string) => Promise<{ error?: string }>; createFolder: (path: string) => Promise<{ error?: string }>;
delete: (path: { isFolder: boolean; path: string }) => Promise<{ error?: string }>; delete: (path: { isFolder: boolean; path: string }) => Promise<{ error?: string }>;
@ -92,7 +92,7 @@ class SimpleStorage implements GrafanaStorage {
return req.isFolder ? this.deleteFolder({ path: req.path, force: true }) : this.deleteFile({ path: req.path }); return req.isFolder ? this.deleteFolder({ path: req.path, force: true }) : this.deleteFile({ path: req.path });
} }
async upload(folder: string, file: File, overwriteExistingFile: boolean): Promise<UploadReponse> { async upload(folder: string, file: File, overwriteExistingFile: boolean): Promise<UploadResponse> {
const formData = new FormData(); const formData = new FormData();
formData.append('folder', folder); formData.append('folder', folder);
formData.append('file', file); formData.append('file', file);
@ -102,7 +102,7 @@ class SimpleStorage implements GrafanaStorage {
body: formData, body: formData,
}); });
let body = (await res.json()) as UploadReponse; let body: UploadResponse = await res.json();
if (!body) { if (!body) {
body = {} as any; body = {} as any;
} }

View File

@ -8,7 +8,7 @@ export enum StorageView {
AddRoot = 'add', AddRoot = 'add',
} }
export interface UploadReponse { export interface UploadResponse {
status: number; status: number;
statusText: string; statusText: string;

View File

@ -50,7 +50,7 @@ function mapStateToProps(state: StoreState, props: OwnProps) {
} }
} }
const pageName = props.match.params.page ?? defaultPage; const pageName = props.match.params.page ?? defaultPage;
const teamLoadingNav = getTeamLoadingNav(pageName as string); const teamLoadingNav = getTeamLoadingNav(pageName);
const pageNav = getNavModel(state.navIndex, `team-${pageName}-${teamId}`, teamLoadingNav).main; const pageNav = getNavModel(state.navIndex, `team-${pageName}-${teamId}`, teamLoadingNav).main;
const members = getTeamMembers(state.team); const members = getTeamMembers(state.team);

View File

@ -44,8 +44,8 @@ export const teamsReducer = teamsSlice.reducer;
export const initialTeamState: TeamState = { export const initialTeamState: TeamState = {
team: {} as Team, team: {} as Team,
members: [] as TeamMember[], members: [],
groups: [] as TeamGroup[], groups: [],
searchMemberQuery: '', searchMemberQuery: '',
}; };

View File

@ -81,7 +81,7 @@ export const extractFieldsTransformerEditor = ({
context={{ data: input }} context={{ data: input }}
value={options.source ?? ''} value={options.source ?? ''}
onChange={onPickSourceField} onChange={onPickSourceField}
item={fieldNamePickerSettings as any} item={fieldNamePickerSettings}
/> />
</InlineField> </InlineField>
</InlineFieldRow> </InlineFieldRow>

View File

@ -9,7 +9,7 @@ export const toUrl = (filters: AdHocVariableFilter[]): string[] => {
export const toFilters = (value: UrlQueryValue): AdHocVariableFilter[] => { export const toFilters = (value: UrlQueryValue): AdHocVariableFilter[] => {
if (isArray(value)) { if (isArray(value)) {
const values = value as any[]; const values = value;
return values.map(toFilter).filter(isFilter); return values.map(toFilter).filter(isFilter);
} }

View File

@ -19,7 +19,7 @@ export function getVariablesUrlParams(scopedVars?: ScopedVars): UrlQueryMap {
if (scopedVar) { if (scopedVar) {
params[VARIABLE_PREFIX + variable.name] = scopedVar.value; params[VARIABLE_PREFIX + variable.name] = scopedVar.value;
} else { } else {
params[VARIABLE_PREFIX + variable.name] = variableAdapters.get(variable.type).getValueForUrl(variable as any); params[VARIABLE_PREFIX + variable.name] = variableAdapters.get(variable.type).getValueForUrl(variable);
} }
} }

View File

@ -14,7 +14,7 @@ export class VariableInput extends PureComponent<Props> {
onKeyDown = (event: React.KeyboardEvent<HTMLInputElement>) => { onKeyDown = (event: React.KeyboardEvent<HTMLInputElement>) => {
if (NavigationKey[event.keyCode] && event.keyCode !== NavigationKey.select) { if (NavigationKey[event.keyCode] && event.keyCode !== NavigationKey.select) {
const clearOthers = event.ctrlKey || event.metaKey || event.shiftKey; const clearOthers = event.ctrlKey || event.metaKey || event.shiftKey;
this.props.onNavigate(event.keyCode as NavigationKey, clearOthers); this.props.onNavigate(event.keyCode, clearOthers);
event.preventDefault(); event.preventDefault();
} }
}; };

View File

@ -1,4 +1,4 @@
import { DataSourceInstanceSettings, DataSourceJsonData, DataSourcePluginMeta } from '@grafana/data'; import { DataSourceInstanceSettings, DataSourcePluginMeta } from '@grafana/data';
export function getDataSourceInstanceSetting(name: string, meta: DataSourcePluginMeta): DataSourceInstanceSettings { export function getDataSourceInstanceSetting(name: string, meta: DataSourcePluginMeta): DataSourceInstanceSettings {
return { return {
@ -8,7 +8,7 @@ export function getDataSourceInstanceSetting(name: string, meta: DataSourcePlugi
name, name,
meta, meta,
access: 'proxy', access: 'proxy',
jsonData: {} as unknown as DataSourceJsonData, jsonData: {},
readOnly: false, readOnly: false,
}; };
} }

View File

@ -9,11 +9,11 @@ import { AzureDataSourceSettings, AzureCredentials } from '../types';
import { AzureCredentialsForm } from './AzureCredentialsForm'; import { AzureCredentialsForm } from './AzureCredentialsForm';
import { DefaultSubscription } from './DefaultSubscription'; import { DefaultSubscription } from './DefaultSubscription';
const azureClouds = [ const azureClouds: SelectableValue[] = [
{ value: 'azuremonitor', label: 'Azure' }, { value: 'azuremonitor', label: 'Azure' },
{ value: 'govazuremonitor', label: 'Azure US Government' }, { value: 'govazuremonitor', label: 'Azure US Government' },
{ value: 'chinaazuremonitor', label: 'Azure China' }, { value: 'chinaazuremonitor', label: 'Azure China' },
] as SelectableValue[]; ];
export interface Props { export interface Props {
options: AzureDataSourceSettings; options: AzureDataSourceSettings;

View File

@ -11,7 +11,7 @@ import {
getLabelKeys, getLabelKeys,
getMetricTypesByService, getMetricTypesByService,
} from './functions'; } from './functions';
import { MetricKind, ValueTypes, MetricFindQueryTypes } from './types/query'; import { ValueTypes, MetricFindQueryTypes } from './types/query';
import { CloudMonitoringVariableQuery, MetricDescriptor } from './types/types'; import { CloudMonitoringVariableQuery, MetricDescriptor } from './types/types';
export default class CloudMonitoringMetricFindQuery { export default class CloudMonitoringMetricFindQuery {
@ -152,7 +152,7 @@ export default class CloudMonitoringMetricFindQuery {
return []; return [];
} }
return getAggregationOptionsByMetric(descriptor.valueType as ValueTypes, descriptor.metricKind as MetricKind).map( return getAggregationOptionsByMetric(descriptor.valueType as ValueTypes, descriptor.metricKind).map(
this.toFindQueryResult this.toFindQueryResult
); );
} }

View File

@ -5,7 +5,7 @@ import { EditorField } from '@grafana/experimental';
import { Select } from '@grafana/ui'; import { Select } from '@grafana/ui';
import { getAggregationOptionsByMetric } from '../functions'; import { getAggregationOptionsByMetric } from '../functions';
import { MetricKind, ValueTypes } from '../types/query'; import { ValueTypes } from '../types/query';
import { MetricDescriptor } from '../types/types'; import { MetricDescriptor } from '../types/types';
export interface Props { export interface Props {
@ -55,7 +55,7 @@ const useAggregationOptionsByMetric = ({ metricDescriptor }: Props): Array<Selec
return []; return [];
} }
return getAggregationOptionsByMetric(valueType as ValueTypes, metricKind as MetricKind).map((a) => ({ return getAggregationOptionsByMetric(valueType as ValueTypes, metricKind).map((a) => ({
...a, ...a,
label: a.text, label: a.text,
})); }));

View File

@ -184,9 +184,7 @@ export default class CloudMonitoringDatasource extends DataSourceWithBackend<
return []; return [];
} }
return this.getResource( return this.getResource(`metricDescriptors/v3/projects/${this.templateSrv.replace(projectName)}/metricDescriptors`);
`metricDescriptors/v3/projects/${this.templateSrv.replace(projectName)}/metricDescriptors`
) as Promise<MetricDescriptor[]>;
} }
async filterMetricsByType(projectName: string, filter: string): Promise<MetricDescriptor[]> { async filterMetricsByType(projectName: string, filter: string): Promise<MetricDescriptor[]> {

View File

@ -124,7 +124,7 @@ export class ElasticResponse {
}; };
for (let i = 0; i < esAgg.buckets.length; i++) { for (let i = 0; i < esAgg.buckets.length; i++) {
const bucket = esAgg.buckets[i]; const bucket = esAgg.buckets[i];
const stats = bucket[metric.id] as TopMetricBucket; const stats: TopMetricBucket = bucket[metric.id];
const values = stats.top.map((hit) => { const values = stats.top.map((hit) => {
if (hit.metrics[metricField]) { if (hit.metrics[metricField]) {
return hit.metrics[metricField]; return hit.metrics[metricField];
@ -239,7 +239,7 @@ export class ElasticResponse {
// If we selected more than one metric we also add each metric name // If we selected more than one metric we also add each metric name
const metricName = metric.settings.metrics.length > 1 ? `${baseName} ${metricField}` : baseName; const metricName = metric.settings.metrics.length > 1 ? `${baseName} ${metricField}` : baseName;
const stats = bucket[metric.id] as TopMetricBucket; const stats: TopMetricBucket = bucket[metric.id];
// Size of top_metrics is fixed to 1. // Size of top_metrics is fixed to 1.
addMetricValue(values, metricName, stats.top[0].metrics[metricField]); addMetricValue(values, metricName, stats.top[0].metrics[metricField]);