Frontend: Enable TS IsolatedModules (#95586)

* chore(typescript): enable isolatedModules

* chore(frontend): fix ts errors related to isolated modules
This commit is contained in:
Jack Westbrook 2024-10-31 14:00:32 +01:00 committed by GitHub
parent 7619d9cb11
commit 2bcc46c338
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
14 changed files with 33 additions and 26 deletions

View File

@ -26,7 +26,7 @@ import {
SortOrder,
} from './richHistoryTypes';
export { RichHistorySearchFilters, RichHistorySettings, SortOrder };
export { type RichHistorySearchFilters, type RichHistorySettings, SortOrder };
/*
* Add queries to rich history. Save only queries within the retention period, or that are starred.

View File

@ -1,4 +1,4 @@
export { HistorySrv, historySrv, RevisionsModel } from './HistorySrv';
export { HistorySrv, historySrv, type RevisionsModel } from './HistorySrv';
export { VersionHistoryTable } from './VersionHistoryTable';
export { VersionHistoryHeader } from './VersionHistoryHeader';
export { VersionsHistoryButtons } from './VersionHistoryButtons';

View File

@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
export { TraceSpan, TraceResponse, Trace, TraceProcess, TraceLink, CriticalPathSection } from './trace';
export { SpanBarOptions, SpanBarOptionsData } from '../settings/SpanBarSettings';
export { default as TTraceTimeline } from './TTraceTimeline';
export { default as TNil } from './TNil';
export { SpanLinkFunc, SpanLinkDef } from './links';
export type { TraceSpan, TraceResponse, Trace, TraceProcess, TraceLink, CriticalPathSection } from './trace';
export type { SpanBarOptions, SpanBarOptionsData } from '../settings/SpanBarSettings';
export type { default as TTraceTimeline } from './TTraceTimeline';
export type { default as TNil } from './TNil';
export type { SpanLinkFunc, SpanLinkDef } from './links';

View File

@ -10,7 +10,7 @@ import {
VariableHide,
TypedVariableModel,
} from '@grafana/data';
export { BaseVariableModel as VariableModel } from '@grafana/data';
export type { BaseVariableModel as VariableModel } from '@grafana/data';
import { TemplateSrv } from '@grafana/runtime';
import { NEW_VARIABLE_ID } from './constants';

View File

@ -1,4 +1,4 @@
export {
export type {
GrafanaTemplateVariableQueryType,
UnknownQuery,
AppInsightsMetricNameQuery,

View File

@ -5,14 +5,14 @@ import {
} from './dataquery.gen';
export {
QueryEditorPropertyType,
QueryEditorProperty,
QueryEditorPropertyExpression,
QueryEditorGroupByExpression,
QueryEditorFunctionExpression,
QueryEditorFunctionParameterExpression,
QueryEditorArrayExpression,
type QueryEditorProperty,
type QueryEditorPropertyExpression,
type QueryEditorGroupByExpression,
type QueryEditorFunctionExpression,
type QueryEditorFunctionParameterExpression,
type QueryEditorArrayExpression,
QueryEditorExpressionType,
QueryEditorExpression,
type QueryEditorExpression,
} from './dataquery.gen';
export interface QueryEditorOperator<T extends QueryEditorOperatorValueType> extends QueryEditorOperatorBase {

View File

@ -19,7 +19,7 @@ import {
} from './dataquery.gen';
export * from './dataquery.gen';
export { ElasticsearchDataQuery as ElasticsearchQuery } from './dataquery.gen';
export type { ElasticsearchDataQuery as ElasticsearchQuery } from './dataquery.gen';
// We want to extend the settings of the Logs query with additional properties that
// are not part of the schema. This is a workaround, because exporting LogsSettings

View File

@ -12,4 +12,4 @@
// See the License for the specific language governing permissions and
// limitations under the License.
export { TraceSpan, TraceResponse, Trace, TraceProcess, TraceLink, CriticalPathSection } from './trace';
export type { TraceSpan, TraceResponse, Trace, TraceProcess, TraceLink, CriticalPathSection } from './trace';

View File

@ -33,7 +33,7 @@ export enum LokiVisualQueryOperationCategory {
Formats = 'Formats',
LineFilters = 'Line filters',
LabelFilters = 'Label filters',
BinaryOps = BINARY_OPERATIONS_KEY,
BinaryOps = `${BINARY_OPERATIONS_KEY}`,
}
export enum LokiOperationId {

View File

@ -28,12 +28,12 @@ export const defaultOptions: Partial<Options> = {
};
export {
Options,
CandlestickColors,
type Options,
type CandlestickColors,
defaultCandlestickColors,
CandleStyle,
ColorStrategy,
VizDisplayMode,
CandlestickFieldMap,
FieldConfig,
type CandlestickFieldMap,
type FieldConfig,
};

View File

@ -53,4 +53,10 @@ export interface MapLayerState<TConfig = unknown> extends LayerElement {
mouseEvents: Subject<FeatureLike | undefined>;
}
export { Options, MapViewConfig, TooltipOptions, TooltipMode, defaultMapViewConfig } from './panelcfg.gen';
export {
type Options,
type MapViewConfig,
type TooltipOptions,
TooltipMode,
defaultMapViewConfig,
} from './panelcfg.gen';

View File

@ -2,7 +2,7 @@ import React, { ReactNode } from 'react';
import { DataFrame } from '@grafana/data';
export { Options } from './panelcfg.gen';
export type { Options } from './panelcfg.gen';
type onClickFilterLabelType = (key: string, value: string, frame?: DataFrame) => void;
type onClickFilterOutLabelType = (key: string, value: string, frame?: DataFrame) => void;

View File

@ -2,7 +2,7 @@ import { SimulationNodeDatum, SimulationLinkDatum } from 'd3-force';
import { DataFrame, Field, IconName } from '@grafana/data';
export { Options as NodeGraphOptions, ArcOption } from './panelcfg.gen';
export type { Options as NodeGraphOptions, ArcOption } from './panelcfg.gen';
export type NodeDatum = SimulationNodeDatum & {
id: string;

View File

@ -9,6 +9,7 @@
"resolveJsonModule": true,
"useUnknownInCatchVariables": true,
"incremental": true,
"isolatedModules": true,
"tsBuildInfoFile": "./tsconfig.tsbuildinfo",
"paths": {
"@grafana/schema/dist/esm/*": ["../packages/grafana-schema/src/*"]