chore: turn on ts/consistent-type-imports (#55166)

This commit is contained in:
thinkasany
2025-09-28 09:10:30 +08:00
committed by GitHub
parent dfc34f6ae3
commit 94d5b800a7
3 changed files with 5 additions and 7 deletions

View File

@@ -1,5 +1,4 @@
import type { CSSProperties, FC, ReactNode } from 'react';
import React from 'react';
import type React from 'react';
import type {
ColorGenInput,
ColorPickerProps as RcColorPickerProps,
@@ -24,7 +23,7 @@ export const FORMAT_HSB = 'hsb';
export type ColorFormatType = typeof FORMAT_HEX | typeof FORMAT_RGB | typeof FORMAT_HSB;
export interface PresetsItem {
label: ReactNode;
label: React.ReactNode;
colors: (string | AggregationColor)[];
/**
* Whether the initial state is collapsed
@@ -80,11 +79,11 @@ export type ColorPickerProps = Omit<
arrow?: boolean | { pointAtCenter: boolean };
panelRender?: (
panel: React.ReactNode,
extra: { components: { Picker: FC; Presets: FC } },
extra: { components: { Picker: React.FC; Presets: React.FC } },
) => React.ReactNode;
showText?: boolean | ((color: AggregationColor) => React.ReactNode);
size?: SizeType;
styles?: { popup?: CSSProperties; popupOverlayInner?: CSSProperties };
styles?: { popup?: React.CSSProperties; popupOverlayInner?: React.CSSProperties };
rootClassName?: string;
disabledAlpha?: boolean;
[key: `data-${string}`]: string;

View File

@@ -33,7 +33,6 @@ export default antfu(
'ts/explicit-function-return-type': 'off',
'ts/ban-ts-comment': 'off', // TODO: remove this
'ts/consistent-type-definitions': 'off',
'ts/consistent-type-imports': 'off', // TODO: remove this
'ts/method-signature-style': 'off', // TODO: remove this
'ts/no-non-null-asserted-optional-chain': 'off',
'unicorn/prefer-number-properties': 'off',

View File

@@ -1,6 +1,6 @@
// https://github.com/facebook/create-react-app/blob/f09d3d3a52c1b938cecc977c2bbc0942ea0a7e70/packages/react-scripts/lib/react-app.d.ts#L42-L49
declare module '*.svg' {
import * as React from 'react';
import type * as React from 'react';
export const ReactComponent: React.FC<React.SVGProps<SVGSVGElement>>;