diff --git a/package.json b/package.json index 71242a47f8b..6a391bc5987 100644 --- a/package.json +++ b/package.json @@ -76,7 +76,7 @@ "@emotion/core": "10.0.27", "@grafana/api-documenter": "7.11.2", "@grafana/api-extractor": "7.10.1", - "@grafana/eslint-config": "2.1.1", + "@grafana/eslint-config": "2.2.0", "@rtsao/plugin-proposal-class-properties": "7.0.1-patch.1", "@testing-library/jest-dom": "5.11.5", "@testing-library/react": "11.1.2", diff --git a/packages/grafana-data/src/events/EventBus.ts b/packages/grafana-data/src/events/EventBus.ts index b917cec40e3..a9d1020b626 100644 --- a/packages/grafana-data/src/events/EventBus.ts +++ b/packages/grafana-data/src/events/EventBus.ts @@ -1,7 +1,14 @@ import EventEmitter from 'eventemitter3'; import { Unsubscribable, Observable } from 'rxjs'; -import { AppEvent } from './types'; -import { EventBus, LegacyEmitter, BusEventHandler, BusEventType, LegacyEventHandler, BusEvent } from './types'; +import { + EventBus, + LegacyEmitter, + BusEventHandler, + BusEventType, + LegacyEventHandler, + BusEvent, + AppEvent, +} from './types'; /** * @alpha diff --git a/packages/grafana-data/src/transformations/transformers/reduce.ts b/packages/grafana-data/src/transformations/transformers/reduce.ts index 72ed775fc6e..63a45492ccb 100644 --- a/packages/grafana-data/src/transformations/transformers/reduce.ts +++ b/packages/grafana-data/src/transformations/transformers/reduce.ts @@ -1,7 +1,7 @@ import { map } from 'rxjs/operators'; import { DataTransformerID } from './ids'; -import { DataTransformerInfo, MatcherConfig } from '../../types/transformations'; +import { DataTransformerInfo, MatcherConfig, FieldMatcher } from '../../types/transformations'; import { fieldReducers, reduceField, ReducerID } from '../fieldReducer'; import { alwaysFieldMatcher, notTimeFieldMatcher } from '../matchers/predicates'; import { DataFrame, Field, FieldType } from '../../types/dataFrame'; @@ -10,7 +10,6 @@ import { KeyValue } from '../../types/data'; import { guessFieldTypeForField } from '../../dataframe/processDataFrame'; import { getFieldMatcher } from '../matchers'; import { getFieldDisplayName } from '../../field'; -import { FieldMatcher } from '../../types/transformations'; export enum ReduceTransformerMode { SeriesToRows = 'seriesToRows', // default diff --git a/packages/grafana-toolkit/package.json b/packages/grafana-toolkit/package.json index 4e0eb8e8d0c..ae978a1c949 100644 --- a/packages/grafana-toolkit/package.json +++ b/packages/grafana-toolkit/package.json @@ -29,7 +29,7 @@ "@babel/core": "7.9.0", "@babel/preset-env": "7.9.0", "@grafana/data": "next", - "@grafana/eslint-config": "2.1.0", + "@grafana/eslint-config": "2.2.0", "@grafana/tsconfig": "^1.0.0-rc1", "@grafana/ui": "next", "@types/command-exists": "^1.2.0", diff --git a/packages/grafana-toolkit/src/config/webpack.plugin.config.test.ts b/packages/grafana-toolkit/src/config/webpack.plugin.config.test.ts index 2aad1198574..7d893834c56 100644 --- a/packages/grafana-toolkit/src/config/webpack.plugin.config.test.ts +++ b/packages/grafana-toolkit/src/config/webpack.plugin.config.test.ts @@ -1,5 +1,6 @@ import { findModuleFiles, loadWebpackConfig } from './webpack.plugin.config'; import fs from 'fs'; +// eslint-disable-next-line no-duplicate-imports import * as webpackConfig from './webpack.plugin.config'; jest.mock('./webpack/loaders', () => ({ diff --git a/packages/grafana-ui/src/components/BarGauge/BarGauge.tsx b/packages/grafana-ui/src/components/BarGauge/BarGauge.tsx index 34411ff6281..66d1c738aff 100644 --- a/packages/grafana-ui/src/components/BarGauge/BarGauge.tsx +++ b/packages/grafana-ui/src/components/BarGauge/BarGauge.tsx @@ -15,17 +15,11 @@ import { getColorForTheme, FALLBACK_COLOR, TextDisplayOptions, + VizOrientation, } from '@grafana/data'; import { selectors } from '@grafana/e2e-selectors'; - -// Components import { FormattedValueDisplay } from '../FormattedValueDisplay/FormattedValueDisplay'; - -// Utils import { measureText, calculateFontSize } from '../../utils/measureText'; - -// Types -import { VizOrientation } from '@grafana/data'; import { Themeable } from '../../types'; const MIN_VALUE_HEIGHT = 18; diff --git a/packages/grafana-ui/src/components/Forms/Legacy/Select/Select.tsx b/packages/grafana-ui/src/components/Forms/Legacy/Select/Select.tsx index fe059064bfc..186188a897a 100644 --- a/packages/grafana-ui/src/components/Forms/Legacy/Select/Select.tsx +++ b/packages/grafana-ui/src/components/Forms/Legacy/Select/Select.tsx @@ -4,15 +4,13 @@ import React, { PureComponent } from 'react'; // Ignoring because I couldn't get @types/react-select work with Torkel's fork // @ts-ignore -import { default as ReactSelect } from '@torkelo/react-select'; +import { default as ReactSelect, components } from '@torkelo/react-select'; // @ts-ignore import Creatable from '@torkelo/react-select/creatable'; // @ts-ignore import { CreatableProps } from 'react-select'; // @ts-ignore import { default as ReactAsyncSelect } from '@torkelo/react-select/async'; -// @ts-ignore -import { components } from '@torkelo/react-select'; // Components import { SelectOption } from './SelectOption'; @@ -23,8 +21,7 @@ import IndicatorsContainer from './IndicatorsContainer'; import NoOptionsMessage from './NoOptionsMessage'; import resetSelectStyles from '../../../Select/resetSelectStyles'; import { CustomScrollbar } from '../../../CustomScrollbar/CustomScrollbar'; -import { PopoverContent } from '../../../Tooltip/Tooltip'; -import { Tooltip } from '../../../Tooltip/Tooltip'; +import { PopoverContent, Tooltip } from '../../../Tooltip/Tooltip'; import { SelectableValue } from '@grafana/data'; /** diff --git a/packages/grafana-ui/src/components/GraphNG/GraphNG.story.tsx b/packages/grafana-ui/src/components/GraphNG/GraphNG.story.tsx index d1b1462380d..7a8ff24cf12 100644 --- a/packages/grafana-ui/src/components/GraphNG/GraphNG.story.tsx +++ b/packages/grafana-ui/src/components/GraphNG/GraphNG.story.tsx @@ -1,8 +1,7 @@ -import { FieldColorModeId, toDataFrame } from '@grafana/data'; +import { FieldColorModeId, toDataFrame, dateTime } from '@grafana/data'; import React from 'react'; import { withCenteredStory } from '../../utils/storybook/withCenteredStory'; import { GraphNG } from './GraphNG'; -import { dateTime } from '@grafana/data'; import { LegendDisplayMode } from '../VizLegend/types'; import { prepDataForStorybook } from '../../utils/storybook/data'; import { useTheme } from '../../themes'; diff --git a/packages/grafana-ui/src/components/GraphNG/GraphNG.tsx b/packages/grafana-ui/src/components/GraphNG/GraphNG.tsx index 8cb23ea2fb5..8e5df06f449 100755 --- a/packages/grafana-ui/src/components/GraphNG/GraphNG.tsx +++ b/packages/grafana-ui/src/components/GraphNG/GraphNG.tsx @@ -15,6 +15,8 @@ import { reduceField, TimeRange, TimeZone, + getFieldColorModeForField, + getFieldSeriesColor, } from '@grafana/data'; import { useTheme } from '../../themes'; import { UPlotChart } from '../uPlot/Plot'; @@ -31,7 +33,6 @@ import { LegendDisplayMode, VizLegendItem, VizLegendOptions } from '../VizLegend import { VizLegend } from '../VizLegend/VizLegend'; import { UPlotConfigBuilder } from '../uPlot/config/UPlotConfigBuilder'; import { useRevision } from '../uPlot/hooks'; -import { getFieldColorModeForField, getFieldSeriesColor } from '@grafana/data'; import { GraphNGLegendEvent, GraphNGLegendEventMode } from './types'; import { isNumber } from 'lodash'; diff --git a/packages/grafana-ui/src/components/Logs/LogLabels.tsx b/packages/grafana-ui/src/components/Logs/LogLabels.tsx index 44b149a3e27..25d99003608 100644 --- a/packages/grafana-ui/src/components/Logs/LogLabels.tsx +++ b/packages/grafana-ui/src/components/Logs/LogLabels.tsx @@ -1,10 +1,9 @@ import React, { FunctionComponent } from 'react'; import { css, cx } from 'emotion'; -import { Labels } from '@grafana/data'; +import { GrafanaTheme, Labels } from '@grafana/data'; import { stylesFactory } from '../../themes'; import { Themeable } from '../../types/theme'; -import { GrafanaTheme } from '@grafana/data'; import { withTheme } from '../../themes/ThemeContext'; // Levels are already encoded in color, filename is a Loki-ism diff --git a/packages/grafana-ui/src/components/Logs/LogRowContext.tsx b/packages/grafana-ui/src/components/Logs/LogRowContext.tsx index e635f8e212c..1216c832844 100644 --- a/packages/grafana-ui/src/components/Logs/LogRowContext.tsx +++ b/packages/grafana-ui/src/components/Logs/LogRowContext.tsx @@ -1,11 +1,9 @@ import React, { useContext, useRef, useState, useLayoutEffect, useEffect } from 'react'; -import { LogRowModel } from '@grafana/data'; +import { GrafanaTheme, DataQueryError, LogRowModel } from '@grafana/data'; import { css, cx } from 'emotion'; import { Alert } from '../Alert/Alert'; import { LogRowContextRows, LogRowContextQueryErrors, HasMoreContextRows } from './LogRowContextProvider'; -import { GrafanaTheme } from '@grafana/data'; -import { DataQueryError } from '@grafana/data'; import { ThemeContext } from '../../themes/ThemeContext'; import { CustomScrollbar } from '../CustomScrollbar/CustomScrollbar'; import { List } from '../List/List'; diff --git a/packages/grafana-ui/src/components/Logs/LogRowContextProvider.tsx b/packages/grafana-ui/src/components/Logs/LogRowContextProvider.tsx index 423cc848bd8..c1ab7ed42fe 100644 --- a/packages/grafana-ui/src/components/Logs/LogRowContextProvider.tsx +++ b/packages/grafana-ui/src/components/Logs/LogRowContextProvider.tsx @@ -1,9 +1,15 @@ -import { LogRowModel, toDataFrame, Field, FieldCache, LogsSortOrder } from '@grafana/data'; +import { + LogRowModel, + toDataFrame, + Field, + FieldCache, + LogsSortOrder, + DataQueryResponse, + DataQueryError, +} from '@grafana/data'; import React, { useState, useEffect } from 'react'; import useAsync from 'react-use/lib/useAsync'; -import { DataQueryResponse, DataQueryError } from '@grafana/data'; - export interface RowContextOptions { direction?: 'BACKWARD' | 'FORWARD'; limit?: number; diff --git a/packages/grafana-ui/src/components/Logs/getLogRowStyles.ts b/packages/grafana-ui/src/components/Logs/getLogRowStyles.ts index 96e01f117ba..8364403cb36 100644 --- a/packages/grafana-ui/src/components/Logs/getLogRowStyles.ts +++ b/packages/grafana-ui/src/components/Logs/getLogRowStyles.ts @@ -1,6 +1,5 @@ import { css } from 'emotion'; -import { LogLevel } from '@grafana/data'; -import { GrafanaTheme } from '@grafana/data'; +import { GrafanaTheme, LogLevel } from '@grafana/data'; import { styleMixins, stylesFactory } from '../../themes'; export const getLogRowStyles = stylesFactory((theme: GrafanaTheme, logLevel?: LogLevel) => { diff --git a/packages/grafana-ui/src/components/Table/BarGaugeCell.tsx b/packages/grafana-ui/src/components/Table/BarGaugeCell.tsx index 421b85e8fae..d008fc8fe27 100644 --- a/packages/grafana-ui/src/components/Table/BarGaugeCell.tsx +++ b/packages/grafana-ui/src/components/Table/BarGaugeCell.tsx @@ -1,8 +1,7 @@ import React, { FC } from 'react'; -import { ThresholdsConfig, ThresholdsMode, VizOrientation } from '@grafana/data'; +import { ThresholdsConfig, ThresholdsMode, VizOrientation, getFieldConfigWithMinMax } from '@grafana/data'; import { BarGauge, BarGaugeDisplayMode } from '../BarGauge/BarGauge'; import { TableCellProps, TableCellDisplayMode } from './types'; -import { getFieldConfigWithMinMax } from '@grafana/data'; const defaultScale: ThresholdsConfig = { mode: ThresholdsMode.Absolute, diff --git a/packages/grafana-ui/src/components/TableInputCSV/TableInputCSV.tsx b/packages/grafana-ui/src/components/TableInputCSV/TableInputCSV.tsx index e0633e398ca..8538af7f660 100644 --- a/packages/grafana-ui/src/components/TableInputCSV/TableInputCSV.tsx +++ b/packages/grafana-ui/src/components/TableInputCSV/TableInputCSV.tsx @@ -1,9 +1,8 @@ import React from 'react'; import debounce from 'lodash/debounce'; import { css } from 'emotion'; -import { DataFrame, CSVConfig, readCSV } from '@grafana/data'; +import { GrafanaTheme, DataFrame, CSVConfig, readCSV } from '@grafana/data'; import { Icon } from '../Icon/Icon'; -import { GrafanaTheme } from '@grafana/data'; import { Themeable } from '../../types/theme'; import { TextArea } from '../TextArea/TextArea'; import { stylesFactory, withTheme } from '../../themes'; diff --git a/packages/grafana-ui/src/components/TimePicker/TimeRangePicker.tsx b/packages/grafana-ui/src/components/TimePicker/TimeRangePicker.tsx index 14a92c80f25..5efc8a2efbe 100644 --- a/packages/grafana-ui/src/components/TimePicker/TimeRangePicker.tsx +++ b/packages/grafana-ui/src/components/TimePicker/TimeRangePicker.tsx @@ -12,8 +12,16 @@ import { stylesFactory } from '../../themes/stylesFactory'; import { withTheme, useTheme } from '../../themes/ThemeContext'; // Types -import { isDateTime, rangeUtil, GrafanaTheme, dateTimeFormat, timeZoneFormatUserFriendly } from '@grafana/data'; -import { TimeRange, TimeZone, dateMath } from '@grafana/data'; +import { + isDateTime, + rangeUtil, + GrafanaTheme, + dateTimeFormat, + timeZoneFormatUserFriendly, + TimeRange, + TimeZone, + dateMath, +} from '@grafana/data'; import { Themeable } from '../../types'; import { otherOptions, quickOptions } from './rangeOptions'; import { ButtonGroup, ToolbarButton } from '../Button'; diff --git a/packages/grafana-ui/src/components/TimePicker/TimeRangePicker/TimeRangeList.tsx b/packages/grafana-ui/src/components/TimePicker/TimeRangePicker/TimeRangeList.tsx index 99756b3188c..e2b2af4450e 100644 --- a/packages/grafana-ui/src/components/TimePicker/TimeRangePicker/TimeRangeList.tsx +++ b/packages/grafana-ui/src/components/TimePicker/TimeRangePicker/TimeRangeList.tsx @@ -1,7 +1,6 @@ import React, { ReactNode } from 'react'; import { css } from 'emotion'; -import { TimeOption, TimeZone } from '@grafana/data'; -import { TimeRange } from '@grafana/data'; +import { TimeRange, TimeOption, TimeZone } from '@grafana/data'; import { TimePickerTitle } from './TimePickerTitle'; import { TimeRangeOption } from './TimeRangeOption'; import { mapOptionToTimeRange } from './mapper'; diff --git a/packages/grafana-ui/src/components/VizLegend/VizLegendListItem.tsx b/packages/grafana-ui/src/components/VizLegend/VizLegendListItem.tsx index b820e04382a..dfdf4942ab6 100644 --- a/packages/grafana-ui/src/components/VizLegend/VizLegendListItem.tsx +++ b/packages/grafana-ui/src/components/VizLegend/VizLegendListItem.tsx @@ -1,8 +1,7 @@ import React from 'react'; import { css, cx } from 'emotion'; import { VizLegendSeriesIcon } from './VizLegendSeriesIcon'; -import { VizLegendItem } from './types'; -import { SeriesColorChangeHandler } from './types'; +import { VizLegendItem, SeriesColorChangeHandler } from './types'; import { VizLegendStatsList } from './VizLegendStatsList'; import { useStyles } from '../../themes'; import { GrafanaTheme } from '@grafana/data'; diff --git a/packages/grafana-ui/src/components/VizLegend/VizLegendTableItem.tsx b/packages/grafana-ui/src/components/VizLegend/VizLegendTableItem.tsx index 7b74c0968d5..7b0185f1913 100644 --- a/packages/grafana-ui/src/components/VizLegend/VizLegendTableItem.tsx +++ b/packages/grafana-ui/src/components/VizLegend/VizLegendTableItem.tsx @@ -1,8 +1,7 @@ import React from 'react'; import { css, cx } from 'emotion'; import { VizLegendSeriesIcon } from './VizLegendSeriesIcon'; -import { VizLegendItem } from './types'; -import { SeriesColorChangeHandler } from './types'; +import { VizLegendItem, SeriesColorChangeHandler } from './types'; import { useStyles } from '../../themes/ThemeContext'; import { styleMixins } from '../../themes'; import { GrafanaTheme, formattedValueToString } from '@grafana/data'; diff --git a/packages/jaeger-ui-components/src/TracePageHeader/SpanGraph/ViewingLayer.tsx b/packages/jaeger-ui-components/src/TracePageHeader/SpanGraph/ViewingLayer.tsx index 4371c12ef14..8bbb4f1f5f6 100644 --- a/packages/jaeger-ui-components/src/TracePageHeader/SpanGraph/ViewingLayer.tsx +++ b/packages/jaeger-ui-components/src/TracePageHeader/SpanGraph/ViewingLayer.tsx @@ -18,13 +18,10 @@ import { css } from 'emotion'; import GraphTicks from './GraphTicks'; import Scrubber from './Scrubber'; -import { TUpdateViewRangeTimeFunction, UIButton, ViewRange, ViewRangeTimeUpdate } from '../..'; -import { withTheme, Theme, autoColor } from '../../Theme'; -import { TNil } from '../..'; +import { TUpdateViewRangeTimeFunction, UIButton, ViewRange, ViewRangeTimeUpdate, TNil } from '../..'; +import { withTheme, Theme, autoColor, createStyle } from '../../Theme'; import DraggableManager, { DraggableBounds, DraggingUpdate, EUpdateTypes } from '../../utils/DraggableManager'; -import { createStyle } from '../../Theme'; - export const getStyles = createStyle((theme: Theme) => { // Need this cause emotion will merge emotion generated classes into single className if used with cx from emotion // package and the selector won't work diff --git a/packages/jaeger-ui-components/src/TracePageHeader/TracePageHeader.tsx b/packages/jaeger-ui-components/src/TracePageHeader/TracePageHeader.tsx index e7b23ddadcf..fcd3771c40f 100644 --- a/packages/jaeger-ui-components/src/TracePageHeader/TracePageHeader.tsx +++ b/packages/jaeger-ui-components/src/TracePageHeader/TracePageHeader.tsx @@ -34,7 +34,6 @@ import { getTraceLinks } from '../model/link-patterns'; import ExternalLinks from '../common/ExternalLinks'; import { createStyle } from '../Theme'; import { uTxMuted } from '../uberUtilityStyles'; -import { useMemo } from 'react'; const getStyles = createStyle((theme: Theme) => { const TracePageHeaderOverviewItemValueDetail = css` @@ -223,7 +222,7 @@ export default function TracePageHeader(props: TracePageHeaderEmbedProps) { } = props; const styles = getStyles(useTheme()); - const links = useMemo(() => { + const links = React.useMemo(() => { if (!trace) { return []; } diff --git a/packages/jaeger-ui-components/src/TracePageHeader/TracePageSearchBar.tsx b/packages/jaeger-ui-components/src/TracePageHeader/TracePageSearchBar.tsx index d3e923a4e1a..7af95d6e707 100644 --- a/packages/jaeger-ui-components/src/TracePageHeader/TracePageSearchBar.tsx +++ b/packages/jaeger-ui-components/src/TracePageHeader/TracePageSearchBar.tsx @@ -24,6 +24,7 @@ import { TNil } from '../types'; import { UIButton, UIInputGroup } from '../uiElementsContext'; import { createStyle } from '../Theme'; import { ubFlexAuto, ubJustifyEnd } from '../uberUtilityStyles'; +// eslint-disable-next-line no-duplicate-imports import { memo } from 'react'; export const getStyles = createStyle(() => { diff --git a/plugins-bundled/internal/input-datasource/src/testHelpers.ts b/plugins-bundled/internal/input-datasource/src/testHelpers.ts index 47b3308f60c..ed92a3dd85d 100644 --- a/plugins-bundled/internal/input-datasource/src/testHelpers.ts +++ b/plugins-bundled/internal/input-datasource/src/testHelpers.ts @@ -1,5 +1,4 @@ -import { DataQueryRequest, DataQuery, CoreApp } from '@grafana/data'; -import { dateTime } from '@grafana/data'; +import { DataQueryRequest, DataQuery, CoreApp, dateTime } from '@grafana/data'; export function getQueryOptions( options: Partial> diff --git a/public/app/app.ts b/public/app/app.ts index 5835374ba2b..71628c38e73 100644 --- a/public/app/app.ts +++ b/public/app/app.ts @@ -8,9 +8,9 @@ import 'abortcontroller-polyfill/dist/polyfill-patch-fetch'; // fetch polyfill n import ttiPolyfill from 'tti-polyfill'; import 'file-saver'; -import 'lodash'; import 'jquery'; -import 'angular'; +import _ from 'lodash'; +import angular from 'angular'; import 'angular-route'; import 'angular-sanitize'; import 'angular-bindonce'; @@ -19,12 +19,8 @@ import 'react-dom'; import 'vendor/bootstrap/bootstrap'; import 'vendor/angular-other/angular-strap'; - -import $ from 'jquery'; -import angular from 'angular'; import config from 'app/core/config'; // @ts-ignore ignoring this for now, otherwise we would have to extend _ interface with move -import _ from 'lodash'; import { AppEvents, setLocale, diff --git a/public/app/core/components/Login/LoginCtrl.tsx b/public/app/core/components/Login/LoginCtrl.tsx index ddb54453121..cc0ab4a917e 100644 --- a/public/app/core/components/Login/LoginCtrl.tsx +++ b/public/app/core/components/Login/LoginCtrl.tsx @@ -1,10 +1,9 @@ -import React from 'react'; +import React, { PureComponent } from 'react'; import config from 'app/core/config'; import { updateLocation } from 'app/core/actions'; import { connect } from 'react-redux'; import { StoreState } from 'app/types'; -import { PureComponent } from 'react'; import { getBackendSrv } from '@grafana/runtime'; import { hot } from 'react-hot-loader'; import appEvents from 'app/core/app_events'; diff --git a/public/app/core/components/Select/TeamPicker.tsx b/public/app/core/components/Select/TeamPicker.tsx index 9fa5e50a9fe..ce2491c13ff 100644 --- a/public/app/core/components/Select/TeamPicker.tsx +++ b/public/app/core/components/Select/TeamPicker.tsx @@ -1,7 +1,6 @@ import React, { Component } from 'react'; -import _ from 'lodash'; +import _, { debounce } from 'lodash'; import { AsyncSelect } from '@grafana/ui'; -import { debounce } from 'lodash'; import { getBackendSrv } from '@grafana/runtime'; export interface Team { diff --git a/public/app/core/components/Select/UserPicker.tsx b/public/app/core/components/Select/UserPicker.tsx index c20e95c910e..9417283401a 100644 --- a/public/app/core/components/Select/UserPicker.tsx +++ b/public/app/core/components/Select/UserPicker.tsx @@ -1,12 +1,11 @@ // Libraries import React, { Component } from 'react'; -import _ from 'lodash'; +import _, { debounce } from 'lodash'; // Components import { AsyncSelect } from '@grafana/ui'; // Utils & Services -import { debounce } from 'lodash'; import { getBackendSrv } from '@grafana/runtime'; // Types diff --git a/public/app/core/specs/rangeutil.test.ts b/public/app/core/specs/rangeutil.test.ts index e22ac5c2970..4de4d6af03a 100644 --- a/public/app/core/specs/rangeutil.test.ts +++ b/public/app/core/specs/rangeutil.test.ts @@ -1,6 +1,5 @@ -import { rangeUtil } from '@grafana/data'; +import { rangeUtil, dateTime } from '@grafana/data'; import _ from 'lodash'; -import { dateTime } from '@grafana/data'; describe('rangeUtil', () => { describe('Can get range grouped list of ranges', () => { diff --git a/public/app/core/specs/time_series.test.ts b/public/app/core/specs/time_series.test.ts index 0434461fdb7..655d9bce233 100644 --- a/public/app/core/specs/time_series.test.ts +++ b/public/app/core/specs/time_series.test.ts @@ -1,5 +1,4 @@ -import TimeSeries from 'app/core/time_series2'; -import { updateLegendValues } from 'app/core/time_series2'; +import TimeSeries, { updateLegendValues } from 'app/core/time_series2'; describe('TimeSeries', () => { let points, series: any; diff --git a/public/app/core/utils/richHistory.test.ts b/public/app/core/utils/richHistory.test.ts index 7f35a0f84fb..390b109e6af 100644 --- a/public/app/core/utils/richHistory.test.ts +++ b/public/app/core/utils/richHistory.test.ts @@ -8,9 +8,9 @@ import { deleteAllFromRichHistory, deleteQueryInRichHistory, filterAndSortQueries, + SortOrder, } from './richHistory'; import store from 'app/core/store'; -import { SortOrder } from './richHistory'; import { dateTime, DataQuery } from '@grafana/data'; const mock: any = { diff --git a/public/app/features/alerting/getAlertingValidationMessage.ts b/public/app/features/alerting/getAlertingValidationMessage.ts index a92f2e67e6d..5b782094a2b 100644 --- a/public/app/features/alerting/getAlertingValidationMessage.ts +++ b/public/app/features/alerting/getAlertingValidationMessage.ts @@ -1,6 +1,5 @@ -import { DataQuery } from '@grafana/data'; +import { DataQuery, DataTransformerConfig } from '@grafana/data'; import { DataSourceSrv } from '@grafana/runtime'; -import { DataTransformerConfig } from '@grafana/data'; export const getDefaultCondition = () => ({ type: 'query', diff --git a/public/app/features/annotations/event_editor.ts b/public/app/features/annotations/event_editor.ts index 791232333a8..8dae652e0cf 100644 --- a/public/app/features/annotations/event_editor.ts +++ b/public/app/features/annotations/event_editor.ts @@ -1,8 +1,7 @@ import _ from 'lodash'; import { coreModule } from 'app/core/core'; import { MetricsPanelCtrl } from 'app/plugins/sdk'; -import { AnnotationEvent } from '@grafana/data'; -import { dateTime } from '@grafana/data'; +import { AnnotationEvent, dateTime } from '@grafana/data'; import { AnnotationsSrv } from './all'; export class EventEditorCtrl { diff --git a/public/app/features/dashboard/components/DashNav/DashNavTimeControls.tsx b/public/app/features/dashboard/components/DashNav/DashNavTimeControls.tsx index 6923444507c..3706eb22439 100644 --- a/public/app/features/dashboard/components/DashNav/DashNavTimeControls.tsx +++ b/public/app/features/dashboard/components/DashNav/DashNavTimeControls.tsx @@ -1,12 +1,11 @@ // Libraries import React, { Component } from 'react'; -import { dateMath, GrafanaTheme, TimeZone } from '@grafana/data'; +import { dateMath, GrafanaTheme, TimeZone, TimeRange } from '@grafana/data'; import { css } from 'emotion'; // Types import { DashboardModel } from '../../state'; import { LocationState, CoreEvents } from 'app/types'; -import { TimeRange } from '@grafana/data'; // Components import { RefreshPicker, withTheme, stylesFactory, Themeable, defaultIntervals } from '@grafana/ui'; diff --git a/public/app/features/dashboard/components/Inspector/InspectDataTab.tsx b/public/app/features/dashboard/components/Inspector/InspectDataTab.tsx index 447d097523a..e188aabfc40 100644 --- a/public/app/features/dashboard/components/Inspector/InspectDataTab.tsx +++ b/public/app/features/dashboard/components/Inspector/InspectDataTab.tsx @@ -10,9 +10,9 @@ import { SelectableValue, toCSV, transformDataFrame, + CSVConfig, } from '@grafana/data'; import { Button, Container, Field, HorizontalGroup, Spinner, Select, Switch, Table, VerticalGroup } from '@grafana/ui'; -import { CSVConfig } from '@grafana/data'; import { selectors } from '@grafana/e2e-selectors'; import { getPanelInspectorStyles } from './styles'; diff --git a/public/app/features/dashboard/state/reducers.test.ts b/public/app/features/dashboard/state/reducers.test.ts index b32acb97864..2674b32ab38 100644 --- a/public/app/features/dashboard/state/reducers.test.ts +++ b/public/app/features/dashboard/state/reducers.test.ts @@ -4,9 +4,10 @@ import { dashboardInitFetching, dashboardInitSlow, loadDashboardPermissions, + dashboardReducer, + initialState, } from './reducers'; import { DashboardInitPhase, DashboardState, OrgRole, PermissionLevel } from 'app/types'; -import { dashboardReducer, initialState } from './reducers'; import { DashboardModel } from './DashboardModel'; describe('dashboard reducer', () => { diff --git a/public/app/features/dashboard/utils/panel.ts b/public/app/features/dashboard/utils/panel.ts index 89f74f48859..cbc6077384d 100644 --- a/public/app/features/dashboard/utils/panel.ts +++ b/public/app/features/dashboard/utils/panel.ts @@ -4,12 +4,10 @@ import store from 'app/core/store'; // Models import { DashboardModel } from 'app/features/dashboard/state/DashboardModel'; import { PanelModel } from 'app/features/dashboard/state/PanelModel'; -import { TimeRange, AppEvents } from '@grafana/data'; +import { TimeRange, AppEvents, rangeUtil, dateMath } from '@grafana/data'; // Utils import { isString as _isString } from 'lodash'; -import { rangeUtil } from '@grafana/data'; -import { dateMath } from '@grafana/data'; import appEvents from 'app/core/app_events'; import config from 'app/core/config'; diff --git a/public/app/features/datasources/DataSourceDashboards.test.tsx b/public/app/features/datasources/DataSourceDashboards.test.tsx index f47ba005e05..c8770f550c8 100644 --- a/public/app/features/datasources/DataSourceDashboards.test.tsx +++ b/public/app/features/datasources/DataSourceDashboards.test.tsx @@ -1,8 +1,7 @@ import React from 'react'; import { shallow } from 'enzyme'; import { DataSourceDashboards, Props } from './DataSourceDashboards'; -import { DataSourceSettings } from '@grafana/data'; -import { NavModel } from '@grafana/data'; +import { DataSourceSettings, NavModel } from '@grafana/data'; import { PluginDashboard } from 'app/types'; const setup = (propOverrides?: object) => { diff --git a/public/app/features/datasources/DataSourceDashboards.tsx b/public/app/features/datasources/DataSourceDashboards.tsx index 23cab72315b..1f71b8ad76b 100644 --- a/public/app/features/datasources/DataSourceDashboards.tsx +++ b/public/app/features/datasources/DataSourceDashboards.tsx @@ -17,8 +17,7 @@ import { getDataSource } from './state/selectors'; // Types import { PluginDashboard, StoreState } from 'app/types'; -import { DataSourceSettings } from '@grafana/data'; -import { NavModel } from '@grafana/data'; +import { DataSourceSettings, NavModel } from '@grafana/data'; export interface Props { navModel: NavModel; diff --git a/public/app/features/explore/NodeGraphContainer.tsx b/public/app/features/explore/NodeGraphContainer.tsx index b289d84457e..f121512cf62 100644 --- a/public/app/features/explore/NodeGraphContainer.tsx +++ b/public/app/features/explore/NodeGraphContainer.tsx @@ -1,10 +1,9 @@ import React from 'react'; -import { Badge, NodeGraph } from '@grafana/ui'; +import { Badge, NodeGraph, Collapse } from '@grafana/ui'; import { DataFrame, TimeRange } from '@grafana/data'; import { ExploreId, StoreState } from '../../types'; import { splitOpen } from './state/main'; import { connect, ConnectedProps } from 'react-redux'; -import { Collapse } from '@grafana/ui'; import { useLinks } from './utils/links'; interface Props { diff --git a/public/app/features/explore/QueryRow.test.tsx b/public/app/features/explore/QueryRow.test.tsx index dc48d372be2..cf0b04e3bcf 100644 --- a/public/app/features/explore/QueryRow.test.tsx +++ b/public/app/features/explore/QueryRow.test.tsx @@ -2,8 +2,7 @@ import React from 'react'; import { QueryRow, QueryRowProps } from './QueryRow'; import { shallow } from 'enzyme'; import { ExploreId } from 'app/types/explore'; -import { EventBusExtended } from '@grafana/data'; -import { DataSourceApi, TimeRange, AbsoluteTimeRange, PanelData } from '@grafana/data'; +import { DataSourceApi, TimeRange, AbsoluteTimeRange, PanelData, EventBusExtended } from '@grafana/data'; const setup = (propOverrides?: object) => { const props: QueryRowProps = { diff --git a/public/app/features/explore/RichHistory/RichHistory.test.tsx b/public/app/features/explore/RichHistory/RichHistory.test.tsx index 13a45c75fba..92ea6b49539 100644 --- a/public/app/features/explore/RichHistory/RichHistory.test.tsx +++ b/public/app/features/explore/RichHistory/RichHistory.test.tsx @@ -2,8 +2,7 @@ import React from 'react'; import { mount } from 'enzyme'; import { GrafanaTheme } from '@grafana/data'; import { ExploreId } from '../../../types/explore'; -import { RichHistory, RichHistoryProps } from './RichHistory'; -import { Tabs } from './RichHistory'; +import { RichHistory, RichHistoryProps, Tabs } from './RichHistory'; import { Tab } from '@grafana/ui'; jest.mock('../state/selectors', () => ({ getExploreDatasources: jest.fn() })); diff --git a/public/app/features/explore/RichHistory/RichHistory.tsx b/public/app/features/explore/RichHistory/RichHistory.tsx index 5cb34bcc65d..f277cd90e08 100644 --- a/public/app/features/explore/RichHistory/RichHistory.tsx +++ b/public/app/features/explore/RichHistory/RichHistory.tsx @@ -3,12 +3,11 @@ import React, { PureComponent } from 'react'; //Services & Utils import { RICH_HISTORY_SETTING_KEYS, SortOrder } from 'app/core/utils/richHistory'; import store from 'app/core/store'; -import { withTheme, TabbedContainer, TabConfig } from '@grafana/ui'; +import { Themeable, withTheme, TabbedContainer, TabConfig } from '@grafana/ui'; //Types import { RichHistoryQuery, ExploreId } from 'app/types/explore'; import { SelectableValue } from '@grafana/data'; -import { Themeable } from '@grafana/ui'; //Components import { RichHistorySettings } from './RichHistorySettings'; diff --git a/public/app/features/explore/RichHistory/RichHistoryQueriesTab.tsx b/public/app/features/explore/RichHistory/RichHistoryQueriesTab.tsx index 43cfd5ce982..59e5f3b09fa 100644 --- a/public/app/features/explore/RichHistory/RichHistoryQueriesTab.tsx +++ b/public/app/features/explore/RichHistory/RichHistoryQueriesTab.tsx @@ -6,7 +6,7 @@ import { uniqBy, debounce } from 'lodash'; import { RichHistoryQuery, ExploreId } from 'app/types/explore'; // Utils -import { stylesFactory, useTheme } from '@grafana/ui'; +import { stylesFactory, useTheme, RangeSlider, Select } from '@grafana/ui'; import { GrafanaTheme, SelectableValue } from '@grafana/data'; import { @@ -20,7 +20,6 @@ import { // Components import RichHistoryCard from './RichHistoryCard'; import { sortOrderOptions } from './RichHistory'; -import { RangeSlider, Select } from '@grafana/ui'; import { FilterInput } from 'app/core/components/FilterInput/FilterInput'; export interface Props { diff --git a/public/app/features/explore/RichHistory/RichHistoryStarredTab.tsx b/public/app/features/explore/RichHistory/RichHistoryStarredTab.tsx index c0ef21625f0..fcf808470c7 100644 --- a/public/app/features/explore/RichHistory/RichHistoryStarredTab.tsx +++ b/public/app/features/explore/RichHistory/RichHistoryStarredTab.tsx @@ -6,14 +6,13 @@ import { uniqBy, debounce } from 'lodash'; import { RichHistoryQuery, ExploreId } from 'app/types/explore'; // Utils -import { stylesFactory, useTheme } from '@grafana/ui'; +import { stylesFactory, useTheme, Select } from '@grafana/ui'; import { GrafanaTheme, SelectableValue } from '@grafana/data'; import { filterAndSortQueries, createDatasourcesList, SortOrder } from 'app/core/utils/richHistory'; // Components import RichHistoryCard from './RichHistoryCard'; import { sortOrderOptions } from './RichHistory'; -import { Select } from '@grafana/ui'; import { FilterInput } from 'app/core/components/FilterInput/FilterInput'; export interface Props { diff --git a/public/app/features/explore/state/explorePane.ts b/public/app/features/explore/state/explorePane.ts index c4bb995cd4a..44f4eff737c 100644 --- a/public/app/features/explore/state/explorePane.ts +++ b/public/app/features/explore/state/explorePane.ts @@ -1,10 +1,9 @@ import { AnyAction } from 'redux'; import { isEqual } from 'lodash'; -import { getQueryKeys } from 'app/core/utils/explore'; import { ExploreId, ExploreItemState } from 'app/types/explore'; -import { queryReducer } from './query'; +import { queryReducer, runQueries, setQueriesAction } from './query'; import { datasourceReducer } from './datasource'; -import { timeReducer } from './time'; +import { timeReducer, updateTime } from './time'; import { historyReducer } from './history'; import { makeExplorePaneState, makeInitialUpdateState, loadAndInitDatasource, createEmptyQueryResponse } from './utils'; import { createAction, PayloadAction } from '@reduxjs/toolkit'; @@ -23,14 +22,13 @@ import { ensureQueries, generateNewKeyAndAddRefIdIfMissing, getTimeRangeFromUrl, + getQueryKeys, } from 'app/core/utils/explore'; // Types import { ThunkResult } from 'app/types'; import { getTimeZone } from 'app/features/profile/state/selectors'; import { updateLocation } from '../../../core/actions'; import { serializeStateToUrlParam } from '@grafana/data/src/utils/url'; -import { runQueries, setQueriesAction } from './query'; -import { updateTime } from './time'; import { toRawTimeRange } from '../utils/time'; import { getDataSourceSrv } from '@grafana/runtime'; diff --git a/public/app/features/explore/useLiveTailControls.ts b/public/app/features/explore/useLiveTailControls.ts index a13780661d3..b18bd8b8409 100644 --- a/public/app/features/explore/useLiveTailControls.ts +++ b/public/app/features/explore/useLiveTailControls.ts @@ -3,9 +3,8 @@ import { useDispatch } from 'react-redux'; import { RefreshPicker } from '@grafana/ui'; import { changeRefreshInterval } from './state/time'; -import { setPausedStateAction } from './state/query'; +import { setPausedStateAction, runQueries } from './state/query'; import { ExploreId } from '../../types'; -import { runQueries } from './state/query'; /** * Hook that gives you all the functions needed to control the live tailing. diff --git a/public/app/features/playlist/playlists_ctrl.ts b/public/app/features/playlist/playlists_ctrl.ts index e42e0e262ca..7885d1430fd 100644 --- a/public/app/features/playlist/playlists_ctrl.ts +++ b/public/app/features/playlist/playlists_ctrl.ts @@ -1,13 +1,12 @@ import { IScope } from 'angular'; import _ from 'lodash'; import { AppEvents } from '@grafana/data'; -import { OrgRole } from 'app/types'; +import { OrgRole, AppEventEmitter, CoreEvents } from 'app/types'; import { getBackendSrv } from '@grafana/runtime'; import coreModule from '../../core/core_module'; import config from '../../core/config'; import { NavModelSrv } from 'app/core/nav_model_srv'; -import { AppEventEmitter, CoreEvents } from 'app/types'; import { promiseToDigest } from '../../core/utils/promiseToDigest'; export class PlaylistsCtrl { diff --git a/public/app/features/playlist/specs/playlist_edit_ctrl.test.ts b/public/app/features/playlist/specs/playlist_edit_ctrl.test.ts index 5af2744c225..a28ef698a44 100644 --- a/public/app/features/playlist/specs/playlist_edit_ctrl.test.ts +++ b/public/app/features/playlist/specs/playlist_edit_ctrl.test.ts @@ -1,4 +1,3 @@ -import '../playlist_edit_ctrl'; import { PlaylistEditCtrl } from '../playlist_edit_ctrl'; import { ILocationService, IScope } from 'angular'; import { AppEventEmitter } from '../../../types'; diff --git a/public/app/features/plugins/plugin_loader.ts b/public/app/features/plugins/plugin_loader.ts index da48fa60ef1..dbe0dc6c98c 100644 --- a/public/app/features/plugins/plugin_loader.ts +++ b/public/app/features/plugins/plugin_loader.ts @@ -21,17 +21,6 @@ import config from 'app/core/config'; import TimeSeries from 'app/core/time_series2'; import TableModel from 'app/core/table_model'; import { coreModule, appEvents, contextSrv } from 'app/core/core'; -import { - DataSourcePlugin, - AppPlugin, - PanelPlugin, - PluginMeta, - DataSourcePluginMeta, - dateMath, - DataSourceApi, - DataSourceJsonData, - DataQuery, -} from '@grafana/data'; import * as flatten from 'app/core/utils/flatten'; import * as ticks from 'app/core/utils/ticks'; import { BackendSrv, getBackendSrv } from 'app/core/services/backend_srv'; @@ -129,7 +118,7 @@ exposeToPlugin('app/core/services/backend_srv', { }); exposeToPlugin('app/plugins/sdk', sdk); -exposeToPlugin('app/core/utils/datemath', dateMath); +exposeToPlugin('app/core/utils/datemath', grafanaData.dateMath); exposeToPlugin('app/core/utils/flatten', flatten); exposeToPlugin('app/core/utils/kbn', kbn); exposeToPlugin('app/core/utils/ticks', ticks); @@ -191,7 +180,7 @@ export async function importPluginModule(path: string): Promise { return grafanaRuntime.SystemJS.import(path); } -export function importDataSourcePlugin(meta: DataSourcePluginMeta): Promise { +export function importDataSourcePlugin(meta: grafanaData.DataSourcePluginMeta): Promise { return importPluginModule(meta.module).then((pluginExports) => { if (pluginExports.plugin) { const dsPlugin = pluginExports.plugin as GenericDataSourcePlugin; @@ -200,10 +189,10 @@ export function importDataSourcePlugin(meta: DataSourcePluginMeta): Promise, - DataQuery, - DataSourceJsonData + const dsPlugin = new grafanaData.DataSourcePlugin< + grafanaData.DataSourceApi, + grafanaData.DataQuery, + grafanaData.DataSourceJsonData >(pluginExports.Datasource); dsPlugin.setComponentsFromLegacyExports(pluginExports); dsPlugin.meta = meta; @@ -214,9 +203,9 @@ export function importDataSourcePlugin(meta: DataSourcePluginMeta): Promise { +export function importAppPlugin(meta: grafanaData.PluginMeta): Promise { return importPluginModule(meta.module).then((pluginExports) => { - const plugin = pluginExports.plugin ? (pluginExports.plugin as AppPlugin) : new AppPlugin(); + const plugin = pluginExports.plugin ? (pluginExports.plugin as grafanaData.AppPlugin) : new grafanaData.AppPlugin(); plugin.init(meta); plugin.meta = meta; plugin.setComponentsFromLegacyExports(pluginExports); @@ -228,11 +217,11 @@ import { getPanelPluginNotFound, getPanelPluginLoadError } from '../dashboard/da import { GenericDataSourcePlugin } from '../datasources/settings/PluginSettings'; interface PanelCache { - [key: string]: Promise; + [key: string]: Promise; } const panelCache: PanelCache = {}; -export function importPanelPlugin(id: string): Promise { +export function importPanelPlugin(id: string): Promise { const loaded = panelCache[id]; if (loaded) { @@ -248,9 +237,9 @@ export function importPanelPlugin(id: string): Promise { panelCache[id] = importPluginModule(meta.module) .then((pluginExports) => { if (pluginExports.plugin) { - return pluginExports.plugin as PanelPlugin; + return pluginExports.plugin as grafanaData.PanelPlugin; } else if (pluginExports.PanelCtrl) { - const plugin = new PanelPlugin(null); + const plugin = new grafanaData.PanelPlugin(null); plugin.angularPanelCtrl = pluginExports.PanelCtrl; return plugin; } diff --git a/public/app/features/plugins/plugin_page_ctrl.ts b/public/app/features/plugins/plugin_page_ctrl.ts index 3ed40d22e35..a2a2c5cad34 100644 --- a/public/app/features/plugins/plugin_page_ctrl.ts +++ b/public/app/features/plugins/plugin_page_ctrl.ts @@ -2,10 +2,9 @@ import angular from 'angular'; import _ from 'lodash'; import { getPluginSettings } from './PluginSettingsCache'; -import { PluginMeta } from '@grafana/data'; +import { PluginMeta, AppEvents } from '@grafana/data'; import { NavModelSrv } from 'app/core/core'; import { GrafanaRootScope } from 'app/routes/GrafanaCtrl'; -import { AppEvents } from '@grafana/data'; import { promiseToDigest } from '../../core/utils/promiseToDigest'; export class AppPageCtrl { diff --git a/public/app/features/plugins/specs/datasource_srv.test.ts b/public/app/features/plugins/specs/datasource_srv.test.ts index 8817efa358f..54ea49f9a32 100644 --- a/public/app/features/plugins/specs/datasource_srv.test.ts +++ b/public/app/features/plugins/specs/datasource_srv.test.ts @@ -1,4 +1,3 @@ -import 'app/features/plugins/datasource_srv'; import { DatasourceSrv } from 'app/features/plugins/datasource_srv'; import { DataSourceInstanceSettings, DataSourcePlugin } from '@grafana/data'; diff --git a/public/app/features/query/components/QueryEditorRowTitle.tsx b/public/app/features/query/components/QueryEditorRowTitle.tsx index e6b5054486d..a1b5cf52c85 100644 --- a/public/app/features/query/components/QueryEditorRowTitle.tsx +++ b/public/app/features/query/components/QueryEditorRowTitle.tsx @@ -1,9 +1,8 @@ -import React from 'react'; +import React, { useState } from 'react'; import { css, cx } from 'emotion'; import { DataQuery, GrafanaTheme } from '@grafana/data'; import { Icon, Input, stylesFactory, useTheme, FieldValidationMessage } from '@grafana/ui'; import { selectors } from '@grafana/e2e-selectors'; -import { useState } from 'react'; export interface Props { query: DataQuery; diff --git a/public/app/features/query/state/PanelQueryRunner.test.ts b/public/app/features/query/state/PanelQueryRunner.test.ts index dd557c80217..7645dd08475 100644 --- a/public/app/features/query/state/PanelQueryRunner.test.ts +++ b/public/app/features/query/state/PanelQueryRunner.test.ts @@ -9,14 +9,6 @@ jest.mock('@grafana/data', () => ({ import { PanelQueryRunner } from './PanelQueryRunner'; // Importing this way to be able to spy on grafana/data import * as grafanaData from '@grafana/data'; -import { - DataConfigSource, - DataQueryRequest, - DataTransformerConfig, - GrafanaTheme, - PanelData, - ScopedVars, -} from '@grafana/data'; import { DashboardModel } from '../../dashboard/state/index'; import { setDataSourceSrv, setEchoSrv } from '@grafana/runtime'; import { Echo } from '../../../core/services/echo/Echo'; @@ -48,21 +40,25 @@ interface ScenarioContext { maxDataPoints?: number | null; dsInterval?: string; minInterval?: string; - scopedVars: ScopedVars; + scopedVars: grafanaData.ScopedVars; // Filled in by the Scenario runner - events?: PanelData[]; - res?: PanelData; - queryCalledWith?: DataQueryRequest; + events?: grafanaData.PanelData[]; + res?: grafanaData.PanelData; + queryCalledWith?: grafanaData.DataQueryRequest; runner: PanelQueryRunner; } type ScenarioFn = (ctx: ScenarioContext) => void; -function describeQueryRunnerScenario(description: string, scenarioFn: ScenarioFn, panelConfig?: DataConfigSource) { +function describeQueryRunnerScenario( + description: string, + scenarioFn: ScenarioFn, + panelConfig?: grafanaData.DataConfigSource +) { describe(description, () => { let setupFn = () => {}; - const defaultPanelConfig: DataConfigSource = { + const defaultPanelConfig: grafanaData.DataConfigSource = { getFieldOverrideOptions: () => undefined, getTransformations: () => undefined, }; @@ -98,7 +94,7 @@ function describeQueryRunnerScenario(description: string, scenarioFn: ScenarioFn const datasource: any = { name: 'TestDB', interval: ctx.dsInterval, - query: (options: DataQueryRequest) => { + query: (options: grafanaData.DataQueryRequest) => { ctx.queryCalledWith = options; return Promise.resolve(response); }, @@ -121,7 +117,7 @@ function describeQueryRunnerScenario(description: string, scenarioFn: ScenarioFn ctx.runner = new PanelQueryRunner(panelConfig || defaultPanelConfig); ctx.runner.getData({ withTransforms: true, withFieldConfig: true }).subscribe({ - next: (data: PanelData) => { + next: (data: grafanaData.PanelData) => { ctx.res = data; ctx.events?.push(data); }, @@ -221,7 +217,7 @@ describe('PanelQueryRunner', () => { (ctx) => { it('should apply when field override options are set', async () => { ctx.runner.getData({ withTransforms: true, withFieldConfig: true }).subscribe({ - next: (data: PanelData) => { + next: (data: grafanaData.PanelData) => { return data; }, }); @@ -238,7 +234,7 @@ describe('PanelQueryRunner', () => { overrides: [], }, replaceVariables: (v) => v, - theme: {} as GrafanaTheme, + theme: {} as grafanaData.GrafanaTheme, }), getTransformations: () => undefined, } @@ -252,7 +248,7 @@ describe('PanelQueryRunner', () => { spy.mockClear(); ctx.runner.getData({ withTransforms: true, withFieldConfig: true }).subscribe({ - next: (data: PanelData) => { + next: (data: grafanaData.PanelData) => { return data; }, }); @@ -263,7 +259,7 @@ describe('PanelQueryRunner', () => { { getFieldOverrideOptions: () => undefined, // @ts-ignore - getTransformations: () => [({} as unknown) as DataTransformerConfig], + getTransformations: () => [({} as unknown) as grafanaData.DataTransformerConfig], } ); @@ -274,7 +270,7 @@ describe('PanelQueryRunner', () => { const spy = jest.spyOn(grafanaData, 'transformDataFrame'); spy.mockClear(); ctx.runner.getData({ withTransforms: false, withFieldConfig: true }).subscribe({ - next: (data: PanelData) => { + next: (data: grafanaData.PanelData) => { return data; }, }); @@ -284,7 +280,7 @@ describe('PanelQueryRunner', () => { it('should not apply field config when applyFieldConfig option is false', async () => { ctx.runner.getData({ withFieldConfig: false, withTransforms: true }).subscribe({ - next: (data: PanelData) => { + next: (data: grafanaData.PanelData) => { return data; }, }); @@ -302,10 +298,10 @@ describe('PanelQueryRunner', () => { overrides: [], }, replaceVariables: (v) => v, - theme: {} as GrafanaTheme, + theme: {} as grafanaData.GrafanaTheme, }), // @ts-ignore - getTransformations: () => [({} as unknown) as DataTransformerConfig], + getTransformations: () => [({} as unknown) as grafanaData.DataTransformerConfig], } ); @@ -316,7 +312,7 @@ describe('PanelQueryRunner', () => { const spy = jest.spyOn(grafanaData, 'transformDataFrame'); spy.mockClear(); ctx.runner.getData({ withTransforms: false, withFieldConfig: true }).subscribe({ - next: (data: PanelData) => { + next: (data: grafanaData.PanelData) => { return data; }, }); @@ -326,7 +322,7 @@ describe('PanelQueryRunner', () => { it('should not apply field config when applyFieldConfig option is false', async () => { ctx.runner.getData({ withFieldConfig: false, withTransforms: true }).subscribe({ - next: (data: PanelData) => { + next: (data: grafanaData.PanelData) => { return data; }, }); @@ -344,7 +340,7 @@ describe('PanelQueryRunner', () => { overrides: [], }, replaceVariables: (v) => v, - theme: {} as GrafanaTheme, + theme: {} as grafanaData.GrafanaTheme, }), // @ts-ignore getTransformations: () => [{}], diff --git a/public/app/features/variables/query/actions.ts b/public/app/features/variables/query/actions.ts index 9bd4f84f510..22e24c2fb62 100644 --- a/public/app/features/variables/query/actions.ts +++ b/public/app/features/variables/query/actions.ts @@ -1,8 +1,7 @@ -import { toDataQueryError } from '@grafana/runtime'; +import { toDataQueryError, getDataSourceSrv } from '@grafana/runtime'; import { updateOptions } from '../state/actions'; import { QueryVariableModel } from '../types'; import { ThunkResult } from '../../../types'; -import { getDataSourceSrv } from '@grafana/runtime'; import { getVariable } from '../state/selectors'; import { addVariableEditorError, changeVariableEditorExtended, removeVariableEditorError } from '../editor/reducer'; import { changeVariableProp } from '../state/sharedReducer'; diff --git a/public/app/plugins/datasource/cloudwatch/components/ConfigEditor.tsx b/public/app/plugins/datasource/cloudwatch/components/ConfigEditor.tsx index ac72a564a3a..879d2710551 100644 --- a/public/app/plugins/datasource/cloudwatch/components/ConfigEditor.tsx +++ b/public/app/plugins/datasource/cloudwatch/components/ConfigEditor.tsx @@ -3,13 +3,13 @@ import { InlineFormLabel, LegacyForms, Button } from '@grafana/ui'; const { Select, Input } = LegacyForms; import { AppEvents, + SelectableValue, DataSourcePluginOptionsEditorProps, onUpdateDatasourceJsonDataOptionSelect, onUpdateDatasourceResetOption, onUpdateDatasourceJsonDataOption, onUpdateDatasourceSecureJsonDataOption, } from '@grafana/data'; -import { SelectableValue } from '@grafana/data'; import { getDatasourceSrv } from 'app/features/plugins/datasource_srv'; import { CloudWatchDatasource } from '../datasource'; import { CloudWatchJsonData, CloudWatchSecureJsonData } from '../types'; diff --git a/public/app/plugins/datasource/cloudwatch/specs/datasource.test.ts b/public/app/plugins/datasource/cloudwatch/specs/datasource.test.ts index aa07231bc71..0df067f7c33 100644 --- a/public/app/plugins/datasource/cloudwatch/specs/datasource.test.ts +++ b/public/app/plugins/datasource/cloudwatch/specs/datasource.test.ts @@ -9,7 +9,6 @@ import { } from '@grafana/data'; import * as redux from 'app/store/store'; -import '../datasource'; import { CloudWatchDatasource, MAX_ATTEMPTS } from '../datasource'; import { TemplateSrv } from 'app/features/templating/template_srv'; import { CloudWatchLogsQuery, CloudWatchLogsQueryStatus, CloudWatchMetricsQuery, LogAction } from '../types'; diff --git a/public/app/plugins/datasource/dashboard/DashboardQueryEditor.tsx b/public/app/plugins/datasource/dashboard/DashboardQueryEditor.tsx index ce9bcef2570..de9dd0ac39d 100644 --- a/public/app/plugins/datasource/dashboard/DashboardQueryEditor.tsx +++ b/public/app/plugins/datasource/dashboard/DashboardQueryEditor.tsx @@ -3,11 +3,10 @@ import { LegacyForms, VerticalGroup } from '@grafana/ui'; import { DataQuery, PanelData, SelectableValue } from '@grafana/data'; import { css } from 'emotion'; -import { DashboardQuery, ResultInfo } from './types'; +import { DashboardQuery, ResultInfo, SHARED_DASHBODARD_QUERY } from './types'; import config from 'app/core/config'; import { getDatasourceSrv } from 'app/features/plugins/datasource_srv'; import { PanelModel } from 'app/features/dashboard/state'; -import { SHARED_DASHBODARD_QUERY } from './types'; import { getDashboardSrv } from 'app/features/dashboard/services/DashboardSrv'; import { filterPanelDataToQuery } from 'app/features/query/components/QueryEditorRow'; import { DashboardQueryRow } from './DashboardQueryRow'; diff --git a/public/app/plugins/datasource/grafana-azure-monitor-datasource/app_insights/app_insights_datasource.ts b/public/app/plugins/datasource/grafana-azure-monitor-datasource/app_insights/app_insights_datasource.ts index 79eab35e5a3..cfa6fd475e9 100644 --- a/public/app/plugins/datasource/grafana-azure-monitor-datasource/app_insights/app_insights_datasource.ts +++ b/public/app/plugins/datasource/grafana-azure-monitor-datasource/app_insights/app_insights_datasource.ts @@ -1,5 +1,4 @@ -import { ScopedVars, MetricFindValue } from '@grafana/data'; -import { DataQueryRequest, DataSourceInstanceSettings } from '@grafana/data'; +import { DataQueryRequest, DataSourceInstanceSettings, ScopedVars, MetricFindValue } from '@grafana/data'; import { getBackendSrv, getTemplateSrv, DataSourceWithBackend } from '@grafana/runtime'; import _, { isString } from 'lodash'; diff --git a/public/app/plugins/datasource/grafana-azure-monitor-datasource/insights_analytics/insights_analytics_datasource.ts b/public/app/plugins/datasource/grafana-azure-monitor-datasource/insights_analytics/insights_analytics_datasource.ts index a285cacf3bb..f62bae6ad1f 100644 --- a/public/app/plugins/datasource/grafana-azure-monitor-datasource/insights_analytics/insights_analytics_datasource.ts +++ b/public/app/plugins/datasource/grafana-azure-monitor-datasource/insights_analytics/insights_analytics_datasource.ts @@ -1,5 +1,4 @@ -import { ScopedVars } from '@grafana/data'; -import { DataSourceInstanceSettings } from '@grafana/data'; +import { ScopedVars, DataSourceInstanceSettings } from '@grafana/data'; import { getTemplateSrv } from '@grafana/runtime'; import { AzureDataSourceJsonData, AzureMonitorQuery, AzureQueryType } from '../types'; diff --git a/public/app/plugins/datasource/influxdb/specs/query_ctrl.test.ts b/public/app/plugins/datasource/influxdb/specs/query_ctrl.test.ts index f1217fb2dfb..b127396f442 100644 --- a/public/app/plugins/datasource/influxdb/specs/query_ctrl.test.ts +++ b/public/app/plugins/datasource/influxdb/specs/query_ctrl.test.ts @@ -1,4 +1,3 @@ -import '../query_ctrl'; import { uiSegmentSrv } from 'app/core/services/segment_srv'; import { InfluxQueryCtrl } from '../query_ctrl'; import InfluxDatasource from '../datasource'; diff --git a/public/app/plugins/datasource/loki/components/LokiQueryFieldForm.tsx b/public/app/plugins/datasource/loki/components/LokiQueryFieldForm.tsx index 4a184fc9efc..8332b70057e 100644 --- a/public/app/plugins/datasource/loki/components/LokiQueryFieldForm.tsx +++ b/public/app/plugins/datasource/loki/components/LokiQueryFieldForm.tsx @@ -10,6 +10,7 @@ import { QueryField, TypeaheadInput, BracesPlugin, + DOMUtil, } from '@grafana/ui'; // Utils & Services @@ -17,7 +18,6 @@ import { import { Plugin, Node } from 'slate'; // Types -import { DOMUtil } from '@grafana/ui'; import { ExploreQueryFieldProps, AbsoluteTimeRange } from '@grafana/data'; import { LokiQuery, LokiOptions } from '../types'; import { LanguageMap, languages as prismLanguages } from 'prismjs'; diff --git a/public/app/plugins/datasource/loki/result_transformer.test.ts b/public/app/plugins/datasource/loki/result_transformer.test.ts index 17cb50f6b50..fc9095c4f57 100644 --- a/public/app/plugins/datasource/loki/result_transformer.test.ts +++ b/public/app/plugins/datasource/loki/result_transformer.test.ts @@ -8,7 +8,6 @@ import { LokiMatrixResult, } from './types'; import * as ResultTransformer from './result_transformer'; -import { enhanceDataFrame, lokiPointsToTimeseriesPoints } from './result_transformer'; import { setTemplateSrv } from '@grafana/runtime'; import { TemplateSrv } from 'app/features/templating/template_srv'; @@ -243,7 +242,7 @@ describe('loki result transformer', () => { describe('enhanceDataFrame', () => { it('adds links to fields', () => { const df = new MutableDataFrame({ fields: [{ name: 'line', values: ['nothing', 'trace1=1234', 'trace2=foo'] }] }); - enhanceDataFrame(df, { + ResultTransformer.enhanceDataFrame(df, { derivedFields: [ { matcherRegex: 'trace1=(\\w+)', @@ -302,7 +301,7 @@ describe('enhanceDataFrame', () => { it('returns data as is if step, start, and end align', () => { const options: Partial = { start: 1 * 1e9, end: 4 * 1e9, step: 1 }; - const result = lokiPointsToTimeseriesPoints(data, options as TransformerOptions); + const result = ResultTransformer.lokiPointsToTimeseriesPoints(data, options as TransformerOptions); expect(result).toEqual([ [1, 1000], [0, 2000], diff --git a/public/app/plugins/datasource/prometheus/components/PromQueryField.tsx b/public/app/plugins/datasource/prometheus/components/PromQueryField.tsx index 804d65ba40f..ac997ec2979 100644 --- a/public/app/plugins/datasource/prometheus/components/PromQueryField.tsx +++ b/public/app/plugins/datasource/prometheus/components/PromQueryField.tsx @@ -10,6 +10,8 @@ import { TypeaheadOutput, QueryField, BracesPlugin, + DOMUtil, + SuggestionsState, } from '@grafana/ui'; import { LanguageMap, languages as prismLanguages } from 'prismjs'; @@ -26,7 +28,6 @@ import { HistoryItem, TimeRange, } from '@grafana/data'; -import { DOMUtil, SuggestionsState } from '@grafana/ui'; import { PrometheusDatasource } from '../datasource'; const HISTOGRAM_GROUP = '__histograms__'; diff --git a/public/app/plugins/datasource/zipkin/utils/transforms.ts b/public/app/plugins/datasource/zipkin/utils/transforms.ts index 45cd8195ad2..d0888e66c32 100644 --- a/public/app/plugins/datasource/zipkin/utils/transforms.ts +++ b/public/app/plugins/datasource/zipkin/utils/transforms.ts @@ -1,5 +1,4 @@ -import { identity } from 'lodash'; -import { keyBy } from 'lodash'; +import { identity, keyBy } from 'lodash'; import { ZipkinAnnotation, ZipkinEndpoint, ZipkinSpan } from '../types'; import { TraceKeyValuePair, TraceLog, TraceProcess, TraceSpanData, TraceData } from '@grafana/data'; diff --git a/public/app/plugins/panel/graph/specs/graph.test.ts b/public/app/plugins/panel/graph/specs/graph.test.ts index a2826688e76..b528330dd00 100644 --- a/public/app/plugins/panel/graph/specs/graph.test.ts +++ b/public/app/plugins/panel/graph/specs/graph.test.ts @@ -1,4 +1,3 @@ -import '../module'; import { GraphCtrl } from '../module'; import { MetricsPanelCtrl } from 'app/features/panel/metrics_panel_ctrl'; import { PanelCtrl } from 'app/features/panel/panel_ctrl'; diff --git a/public/app/plugins/panel/graph/specs/series_override_ctrl.test.ts b/public/app/plugins/panel/graph/specs/series_override_ctrl.test.ts index 0cee670a461..190c6ff0493 100644 --- a/public/app/plugins/panel/graph/specs/series_override_ctrl.test.ts +++ b/public/app/plugins/panel/graph/specs/series_override_ctrl.test.ts @@ -1,4 +1,3 @@ -import '../series_overrides_ctrl'; import { SeriesOverridesCtrl } from '../series_overrides_ctrl'; describe('SeriesOverridesCtrl', () => { diff --git a/public/app/plugins/panel/live/LivePanel.tsx b/public/app/plugins/panel/live/LivePanel.tsx index 40859581203..06b25b0c134 100755 --- a/public/app/plugins/panel/live/LivePanel.tsx +++ b/public/app/plugins/panel/live/LivePanel.tsx @@ -1,6 +1,6 @@ import React, { PureComponent } from 'react'; import { Unsubscribable, PartialObserver } from 'rxjs'; -import { FeatureInfoBox, stylesFactory, Button, JSONFormatter, CustomScrollbar } from '@grafana/ui'; +import { FeatureInfoBox, stylesFactory, Button, JSONFormatter, CustomScrollbar, CodeEditor } from '@grafana/ui'; import { GrafanaTheme, PanelProps, @@ -19,7 +19,6 @@ import { TablePanel } from '../table/TablePanel'; import { LivePanelOptions, MessageDisplayMode } from './types'; import { config, getGrafanaLiveSrv, MeasurementCollector } from '@grafana/runtime'; import { css, cx } from 'emotion'; -import { CodeEditor } from '@grafana/ui'; interface Props extends PanelProps {} diff --git a/public/app/plugins/panel/piechart/PieChartOptionsBox.tsx b/public/app/plugins/panel/piechart/PieChartOptionsBox.tsx index 646dc6c7a80..4a36b6ef58f 100644 --- a/public/app/plugins/panel/piechart/PieChartOptionsBox.tsx +++ b/public/app/plugins/panel/piechart/PieChartOptionsBox.tsx @@ -1,15 +1,9 @@ -// Libraries import React, { PureComponent } from 'react'; - -// Components -import { LegacyForms, InlineFormLabel } from '@grafana/ui'; -const { Select, FormField } = LegacyForms; - -// Types +import { LegacyForms, InlineFormLabel, PieChartType } from '@grafana/ui'; import { PanelEditorProps } from '@grafana/data'; -import { PieChartType } from '@grafana/ui'; import { PieChartOptions } from './types'; +const { Select, FormField } = LegacyForms; const labelWidth = 8; const pieChartOptions = [ diff --git a/public/app/plugins/panel/piechart/PieChartPanel.tsx b/public/app/plugins/panel/piechart/PieChartPanel.tsx index b56b8d6f0a0..1f4af45d17f 100644 --- a/public/app/plugins/panel/piechart/PieChartPanel.tsx +++ b/public/app/plugins/panel/piechart/PieChartPanel.tsx @@ -1,16 +1,8 @@ -// Libraries import React, { PureComponent } from 'react'; - -// Services & Utils import { config } from 'app/core/config'; - -// Components import { PieChart } from '@grafana/ui'; -import { getFieldDisplayValues } from '@grafana/data'; - -// Types import { PieChartOptions } from './types'; -import { PanelProps } from '@grafana/data'; +import { getFieldDisplayValues, PanelProps } from '@grafana/data'; interface Props extends PanelProps {} diff --git a/public/app/plugins/panel/singlestat/module.ts b/public/app/plugins/panel/singlestat/module.ts index 007de7c03e9..c20f1211078 100644 --- a/public/app/plugins/panel/singlestat/module.ts +++ b/public/app/plugins/panel/singlestat/module.ts @@ -3,7 +3,6 @@ import { auto } from 'angular'; import $ from 'jquery'; import 'vendor/flot/jquery.flot'; import 'vendor/flot/jquery.flot.gauge'; -import 'app/features/panel/panellinks/link_srv'; import { DataFrame, diff --git a/public/app/plugins/panel/singlestat/specs/singlestat.test.ts b/public/app/plugins/panel/singlestat/specs/singlestat.test.ts index ca96a1f2fab..98440f92f87 100644 --- a/public/app/plugins/panel/singlestat/specs/singlestat.test.ts +++ b/public/app/plugins/panel/singlestat/specs/singlestat.test.ts @@ -1,7 +1,6 @@ import { SingleStatCtrl, ShowData } from '../module'; -import { dateTime, ReducerID, getFieldDisplayName } from '@grafana/data'; +import { dateTime, ReducerID, getFieldDisplayName, LegacyResponseData } from '@grafana/data'; import { LinkSrv } from 'app/features/panel/panellinks/link_srv'; -import { LegacyResponseData } from '@grafana/data'; import { DashboardModel } from 'app/features/dashboard/state'; interface TestContext { diff --git a/public/app/plugins/panel/stat/types.ts b/public/app/plugins/panel/stat/types.ts index f795e6d1c28..197c0d86e86 100644 --- a/public/app/plugins/panel/stat/types.ts +++ b/public/app/plugins/panel/stat/types.ts @@ -12,8 +12,8 @@ import { getFieldDisplayName, escapeStringForRegex, VizOrientation, + PanelOptionsEditorBuilder, } from '@grafana/data'; -import { PanelOptionsEditorBuilder } from '@grafana/data'; // Structure copied from angular export interface StatPanelOptions extends SingleStatBaseOptions { diff --git a/public/app/plugins/panel/timeseries/plugins/ContextMenuPlugin.tsx b/public/app/plugins/panel/timeseries/plugins/ContextMenuPlugin.tsx index dffa49cbebd..990f9825075 100644 --- a/public/app/plugins/panel/timeseries/plugins/ContextMenuPlugin.tsx +++ b/public/app/plugins/panel/timeseries/plugins/ContextMenuPlugin.tsx @@ -16,8 +16,8 @@ import { getDisplayProcessor, getFieldDisplayName, InterpolateFunction, + TimeZone, } from '@grafana/data'; -import { TimeZone } from '@grafana/data'; import { useClickAway } from 'react-use'; import { getFieldLinksSupplier } from '../../../../features/panel/panellinks/linkSuppliers'; diff --git a/public/app/routes/GrafanaCtrl.ts b/public/app/routes/GrafanaCtrl.ts index a55add105b4..db3633a9330 100644 --- a/public/app/routes/GrafanaCtrl.ts +++ b/public/app/routes/GrafanaCtrl.ts @@ -6,7 +6,14 @@ import Drop from 'tether-drop'; // Utils and servies import { colors } from '@grafana/ui'; -import { getTemplateSrv, setBackendSrv, setDataSourceSrv, setLegacyAngularInjector } from '@grafana/runtime'; +import { + getTemplateSrv, + setBackendSrv, + setDataSourceSrv, + setLegacyAngularInjector, + LocationUpdate, + setLocationSrv, +} from '@grafana/runtime'; import config from 'app/core/config'; import coreModule from 'app/core/core_module'; import { profiler } from 'app/core/profiler'; @@ -17,7 +24,6 @@ import { KeybindingSrv, setKeybindingSrv } from 'app/core/services/keybindingSrv import { AngularLoader, setAngularLoader } from 'app/core/services/AngularLoader'; import { configureStore } from 'app/store/configureStore'; -import { LocationUpdate, setLocationSrv } from '@grafana/runtime'; import { updateLocation } from 'app/core/actions'; // Types @@ -28,10 +34,9 @@ import { ContextSrv } from 'app/core/services/context_srv'; import { BridgeSrv } from 'app/core/services/bridge_srv'; import { PlaylistSrv } from 'app/features/playlist/playlist_srv'; import { DashboardSrv, setDashboardSrv } from 'app/features/dashboard/services/DashboardSrv'; -import { ILocationService, ITimeoutService, IRootScopeService, IAngularEvent } from 'angular'; +import { ILocationService, ITimeoutService, IRootScopeService, IAngularEvent, auto } from 'angular'; import { AppEvent, AppEvents, locationUtil } from '@grafana/data'; import { backendSrv } from 'app/core/services/backend_srv'; -import { auto } from 'angular'; import { initGrafanaLive } from 'app/features/live/live'; export type GrafanaRootScope = IRootScopeService & AppEventEmitter & AppEventConsumer & { colors: string[] }; diff --git a/public/app/types/plugins.ts b/public/app/types/plugins.ts index 65e505fb620..17b2e32207c 100644 --- a/public/app/types/plugins.ts +++ b/public/app/types/plugins.ts @@ -1,5 +1,4 @@ -import { PluginError, PluginMeta } from '@grafana/data'; -import { PanelPlugin } from '@grafana/data'; +import { PluginError, PluginMeta, PanelPlugin } from '@grafana/data'; import { TemplateSrv } from '@grafana/runtime'; export interface PluginDashboard { diff --git a/public/test/helpers/getQueryOptions.ts b/public/test/helpers/getQueryOptions.ts index 47b3308f60c..ed92a3dd85d 100644 --- a/public/test/helpers/getQueryOptions.ts +++ b/public/test/helpers/getQueryOptions.ts @@ -1,5 +1,4 @@ -import { DataQueryRequest, DataQuery, CoreApp } from '@grafana/data'; -import { dateTime } from '@grafana/data'; +import { DataQueryRequest, DataQuery, CoreApp, dateTime } from '@grafana/data'; export function getQueryOptions( options: Partial> diff --git a/public/test/jest-setup.ts b/public/test/jest-setup.ts index 00dc9a93c61..88c2ab05fb7 100644 --- a/public/test/jest-setup.ts +++ b/public/test/jest-setup.ts @@ -1,6 +1,5 @@ import { configure } from 'enzyme'; import Adapter from '@wojtekmaj/enzyme-adapter-react-17'; -import 'jquery'; import $ from 'jquery'; import 'mutationobserver-shim'; @@ -9,7 +8,6 @@ global.$ = global.jQuery = $; import '../vendor/flot/jquery.flot'; import '../vendor/flot/jquery.flot.time'; -import 'angular'; import angular from 'angular'; angular.module('grafana', ['ngRoute']); diff --git a/public/test/specs/helpers.ts b/public/test/specs/helpers.ts index 2eb6835b413..cdac951d253 100644 --- a/public/test/specs/helpers.ts +++ b/public/test/specs/helpers.ts @@ -2,11 +2,9 @@ import each from 'lodash/each'; import template from 'lodash/template'; import config from 'app/core/config'; -import { dateMath } from '@grafana/data'; import { angularMocks, sinon } from '../lib/common'; import { PanelModel } from 'app/features/dashboard/state/PanelModel'; -import { RawTimeRange } from '@grafana/data'; -import { PanelPluginMeta } from '@grafana/data'; +import { RawTimeRange, PanelPluginMeta, dateMath } from '@grafana/data'; import { GrafanaRootScope } from 'app/routes/GrafanaCtrl'; export function ControllerTestContext(this: any) { diff --git a/yarn.lock b/yarn.lock index bf23239b3fe..0b5e41f72da 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3543,10 +3543,10 @@ typescript "3.7.5" yaml "^1.8.3" -"@grafana/eslint-config@2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@grafana/eslint-config/-/eslint-config-2.1.0.tgz#334e7eb4e5cc5f92f5b1485c795e6c38c802484d" - integrity sha512-JDybQbeUTbgKHWDThDjlfFuAamH5Cb+NArkPWhWFK7j1z0jfUZZX7uO1MMIq8Lgq+fW30pVIrc8ka3Ls/DAFAA== +"@grafana/eslint-config@2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@grafana/eslint-config/-/eslint-config-2.2.0.tgz#3eda5b5a15b3226d14f40a5c45b07dec1f2242b8" + integrity sha512-veSCw2FmuKCEnDHjgGImwvNyOIAZ0CSM32cfMg9/jkePCuMXWXuQPA/UgajGbxX7NWdOqMZCPpa6TwcOv9hYJg== dependencies: "@typescript-eslint/eslint-plugin" "4.0.1" "@typescript-eslint/parser" "4.0.1" @@ -3559,22 +3559,6 @@ prettier "2.2.1" typescript "4.0.2" -"@grafana/eslint-config@2.1.1": - version "2.1.1" - resolved "https://registry.yarnpkg.com/@grafana/eslint-config/-/eslint-config-2.1.1.tgz#006755f3807866ba96e2fecf534d4491c7b8e051" - integrity sha512-tr4XLqTpAe4zLDQBiPHxmPRyYL9p+BfPNBezFw9np1bcsYI8d0A7spSwEJUiSne09j7vo07HUZgNBjSFa8qdrA== - dependencies: - "@typescript-eslint/eslint-plugin" "4.0.1" - "@typescript-eslint/parser" "4.0.1" - eslint "7.4.0" - eslint-config-prettier "7.2.0" - eslint-plugin-jsdoc "28.6.1" - eslint-plugin-prettier "3.3.1" - eslint-plugin-react "7.21.5" - eslint-plugin-react-hooks "4.1.2" - prettier "2.2.1" - typescript "4.0.2" - "@grafana/slate-react@0.22.9-grafana": version "0.22.9-grafana" resolved "https://registry.yarnpkg.com/@grafana/slate-react/-/slate-react-0.22.9-grafana.tgz#07f35f0ffc018f616b9f82fa6e5ba65fae75c6a0"