fix: local warning in the frontend development (#17727)

This commit is contained in:
Stephen Liu 2021-12-15 15:52:42 +08:00 committed by GitHub
parent 37cc2c4d15
commit 142b5bc506
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 27 additions and 21 deletions

View File

@ -20,10 +20,10 @@
import React from 'react';
import { useTheme, css } from '@superset-ui/core';
import { Tooltip as BaseTooltip } from 'antd';
import { TooltipProps } from 'antd/lib/tooltip';
import type { TooltipProps } from 'antd/lib/tooltip';
import { Global } from '@emotion/react';
export { TooltipProps } from 'antd/lib/tooltip';
export type { TooltipProps } from 'antd/lib/tooltip';
export const Tooltip = ({ overlayStyle, color, ...props }: TooltipProps) => {
const theme = useTheme();

View File

@ -18,7 +18,7 @@
* under the License.
*/
import React, { ReactNode, ReactText, ReactElement } from 'react';
import {
import type {
AdhocColumn,
Column,
DatasourceType,
@ -29,9 +29,9 @@ import {
import { sharedControls } from './shared-controls';
import sharedControlComponents from './shared-controls/components';
export { Metric } from '@superset-ui/core';
export { ControlFormItemSpec } from './components/ControlForm';
export { ControlComponentProps } from './shared-controls/components/types';
export type { Metric } from '@superset-ui/core';
export type { ControlFormItemSpec } from './components/ControlForm';
export type { ControlComponentProps } from './shared-controls/components/types';
// eslint-disable-next-line @typescript-eslint/no-explicit-any
type AnyDict = Record<string, any>;

View File

@ -31,7 +31,7 @@ export { default as getChartComponentRegistry } from './registries/ChartComponen
export { default as getChartControlPanelRegistry } from './registries/ChartControlPanelRegistrySingleton';
export { default as getChartMetadataRegistry } from './registries/ChartMetadataRegistrySingleton';
export { default as getChartTransformPropsRegistry } from './registries/ChartTransformPropsRegistrySingleton';
export { BuildQuery } from './registries/ChartBuildQueryRegistrySingleton';
export type { BuildQuery } from './registries/ChartBuildQueryRegistrySingleton';
export { default as ChartDataProvider } from './components/ChartDataProvider';

View File

@ -58,13 +58,17 @@ export {
Input as AntdInput,
} from 'antd';
export { Card as AntdCard } from 'antd';
export { default as Modal, ModalProps } from 'antd/lib/modal';
export { FormInstance } from 'antd/lib/form';
export { RadioChangeEvent } from 'antd/lib/radio';
export { TreeProps } from 'antd/lib/tree';
export { default as Alert, AlertProps } from 'antd/lib/alert';
export { default as Select, SelectProps } from 'antd/lib/select';
export { default as List, ListItemProps } from 'antd/lib/list';
export { default as Modal } from 'antd/lib/modal';
export type { ModalProps } from 'antd/lib/modal';
export type { FormInstance } from 'antd/lib/form';
export type { RadioChangeEvent } from 'antd/lib/radio';
export type { TreeProps } from 'antd/lib/tree';
export { default as Alert } from 'antd/lib/alert';
export { default as Select } from 'antd/lib/select';
export { default as List } from 'antd/lib/list';
export type { AlertProps } from 'antd/lib/alert';
export type { SelectProps } from 'antd/lib/select';
export type { ListItemProps } from 'antd/lib/list';
export { default as Collapse } from 'src/components/Collapse';
export { default as Badge } from 'src/components/Badge';

View File

@ -33,4 +33,4 @@ export default function Form(props: FormProps) {
return <StyledForm {...props} />;
}
export { FormProps };
export type { FormProps };

View File

@ -21,4 +21,5 @@ import FormItem from './FormItem';
import FormLabel from './FormLabel';
import LabeledErrorBoundInput from './LabeledErrorBoundInput';
export { Form, FormItem, FormLabel, LabeledErrorBoundInput, FormProps };
export { Form, FormItem, FormLabel, LabeledErrorBoundInput };
export type { FormProps };

View File

@ -165,7 +165,7 @@ IconFileNames.forEach(fileName => {
);
});
export { IconType };
export type { IconType };
export default {
...AntdEnhancedIcons,

View File

@ -20,7 +20,7 @@ import React from 'react';
import { styled } from '@superset-ui/core';
import Select, { SelectProps } from 'antd/lib/select';
export {
export type {
OptionType as NativeSelectOptionType,
SelectProps as NativeSelectProps,
} from 'antd/lib/select';

View File

@ -22,7 +22,7 @@ import AntDSlider, {
SliderRangeProps,
} from 'antd/lib/slider';
export { SliderSingleProps, SliderRangeProps };
export type { SliderSingleProps, SliderRangeProps };
export default function Slider(props: SliderSingleProps | SliderRangeProps) {
return <AntDSlider {...props} css={{ marginLeft: 0, marginRight: 0 }} />;

View File

@ -27,4 +27,4 @@ const StyledSwitch = styled(BaseSwitch)`
`;
export const Switch = (props: SwitchProps) => <StyledSwitch {...props} />;
export { SwitchProps };
export type { SwitchProps };

View File

@ -18,7 +18,8 @@
*/
import { FeatureFlagMap, FeatureFlag } from '@superset-ui/core';
export { FeatureFlagMap, FeatureFlag } from '@superset-ui/core';
export { FeatureFlag } from '@superset-ui/core';
export type { FeatureFlagMap } from '@superset-ui/core';
export function initFeatureFlags(featureFlags: FeatureFlagMap) {
if (!window.featureFlags) {