diff --git a/.dumi/theme/builtins/Previewer/stackblitzConfig.ts b/.dumi/theme/builtins/Previewer/stackblitzConfig.ts index aee8e4d3ab..70d48a2801 100644 --- a/.dumi/theme/builtins/Previewer/stackblitzConfig.ts +++ b/.dumi/theme/builtins/Previewer/stackblitzConfig.ts @@ -145,7 +145,7 @@ export default defineConfig({ } }`, // .gitignore - [`.gitignore`]: `# Logs + '.gitignore': `# Logs logs *.log npm-debug.log* @@ -159,7 +159,7 @@ dist dist-ssr *.local`, // eslint.config.js - [`eslint.config.js`]: `import js from '@eslint/js' + 'eslint.config.js': `import js from '@eslint/js' import globals from 'globals' import reactHooks from 'eslint-plugin-react-hooks' import reactRefresh from 'eslint-plugin-react-refresh' diff --git a/.dumi/theme/slots/Content/ContributorAvatar.tsx b/.dumi/theme/slots/Content/ContributorAvatar.tsx index 3b745f5844..a0b66c1843 100644 --- a/.dumi/theme/slots/Content/ContributorAvatar.tsx +++ b/.dumi/theme/slots/Content/ContributorAvatar.tsx @@ -8,9 +8,7 @@ interface ContributorAvatarProps { } const ContributorAvatar: React.FC = (props) => { - const { - item: { username, url } = {}, - } = props; + const { item: { username, url } = {} } = props; if (username?.includes('github-actions')) { return null; } diff --git a/biome.json b/biome.json index 634aa97c43..41eb0a7f42 100644 --- a/biome.json +++ b/biome.json @@ -47,9 +47,12 @@ "complexity": { "noUselessTypeConstraint": "off", "noForEach": "off", - "useDateNow": "off" + "useDateNow": "off", + "noImportantStyles": "off", + "useIndexOf": "off" }, "correctness": { + "useUniqueElementIds": "off", "useExhaustiveDependencies": "off", "useHookAtTopLevel": "off", "noUnusedFunctionParameters": "off", @@ -62,7 +65,9 @@ "noArrayIndexKey": "off", "noConfusingVoidType": "off", "noThenProperty": "off", - "noTemplateCurlyInString": "off" + "noTemplateCurlyInString": "off", + "useIterableCallbackReturn": "off", + "noUnknownAtRules": "off" }, "performance": { "noDelete": "off", @@ -78,9 +83,6 @@ "noStaticElementInteractions": "off", "useAriaPropsSupportedByRole": "off", "useAriaPropsForRole": "off" - }, - "nursery": { - "useUniqueElementIds": "off" } } }, diff --git a/components/_util/isPrimitive.ts b/components/_util/isPrimitive.ts index 77d9b63345..990ece6137 100644 --- a/components/_util/isPrimitive.ts +++ b/components/_util/isPrimitive.ts @@ -1,3 +1,4 @@ -const isPrimitive = (value: unknown) => (typeof value !== 'object' && typeof value !== 'function') || value === null; +const isPrimitive = (value: unknown) => + (typeof value !== 'object' && typeof value !== 'function') || value === null; export default isPrimitive; diff --git a/components/badge/__tests__/index.test.tsx b/components/badge/__tests__/index.test.tsx index b64f61b2d6..786ec100d1 100644 --- a/components/badge/__tests__/index.test.tsx +++ b/components/badge/__tests__/index.test.tsx @@ -268,6 +268,8 @@ describe('Badge', () => { // styles expect(element).toHaveStyle({ backgroundColor: 'rgb(255, 255, 0)' }); - expect(element?.querySelector('sup')).toHaveStyle({ backgroundColor: 'rgb(0, 0, 255)' }); + expect(element?.querySelector('sup')).toHaveStyle({ + backgroundColor: 'rgb(0, 0, 255)', + }); }); }); diff --git a/components/button/button-group.tsx b/components/button/button-group.tsx index 619ee7cac5..89cbbaebc1 100644 --- a/components/button/button-group.tsx +++ b/components/button/button-group.tsx @@ -57,6 +57,6 @@ const ButtonGroup: React.FC = (props) => {
); -} +}; export default ButtonGroup; diff --git a/components/date-picker/__tests__/DatePicker.test.tsx b/components/date-picker/__tests__/DatePicker.test.tsx index 2d21d37406..4f537d07f0 100644 --- a/components/date-picker/__tests__/DatePicker.test.tsx +++ b/components/date-picker/__tests__/DatePicker.test.tsx @@ -427,7 +427,9 @@ describe('DatePicker', () => { expect(errSpy).toHaveBeenCalledWith( 'Warning: [antd: DatePicker] `popupStyle` is deprecated. Please use `styles.popup.root` instead.', ); - expect(container.querySelector('.ant-picker-dropdown')).toHaveStyle('background-color: rgb(255, 0, 0)'); + expect(container.querySelector('.ant-picker-dropdown')).toHaveStyle( + 'background-color: rgb(255, 0, 0)', + ); errSpy.mockRestore(); }); diff --git a/components/date-picker/__tests__/RangePicker.test.tsx b/components/date-picker/__tests__/RangePicker.test.tsx index d7452b3f88..3347b270e5 100644 --- a/components/date-picker/__tests__/RangePicker.test.tsx +++ b/components/date-picker/__tests__/RangePicker.test.tsx @@ -179,7 +179,9 @@ describe('RangePicker', () => { expect(errSpy).toHaveBeenCalledWith( 'Warning: [antd: DatePicker.RangePicker] `popupStyle` is deprecated. Please use `styles.popup.root` instead.', ); - expect(container.querySelector('.ant-picker-dropdown')).toHaveStyle('background-color: rgb(255, 0, 0)'); + expect(container.querySelector('.ant-picker-dropdown')).toHaveStyle( + 'background-color: rgb(255, 0, 0)', + ); errSpy.mockRestore(); }); diff --git a/components/date-picker/style/variants.ts b/components/date-picker/style/variants.ts index ea7873c864..31f1c83088 100644 --- a/components/date-picker/style/variants.ts +++ b/components/date-picker/style/variants.ts @@ -1,7 +1,12 @@ import { unit } from '@ant-design/cssinjs'; import type { CSSObject } from '@ant-design/cssinjs'; -import { genBorderlessStyle, genFilledStyle, genOutlinedStyle, genUnderlinedStyle } from '../../input/style/variants'; +import { + genBorderlessStyle, + genFilledStyle, + genOutlinedStyle, + genUnderlinedStyle, +} from '../../input/style/variants'; import type { PickerToken } from './token'; const genVariantsStyle = (token: PickerToken): CSSObject => { diff --git a/components/form/ErrorList.tsx b/components/form/ErrorList.tsx index 9f43a72856..e9f60de19f 100644 --- a/components/form/ErrorList.tsx +++ b/components/form/ErrorList.tsx @@ -50,7 +50,7 @@ const ErrorList: React.FC = ({ fieldId, onVisibleChanged, }) => { - const { prefixCls } = React.useContext(FormItemPrefixContext); + const { prefixCls } = React.useContext(FormItemPrefixContext); const baseClassName = `${prefixCls}-item-explain`; @@ -91,11 +91,11 @@ const ErrorList: React.FC = ({ })); }, [fullKeyList]); - const helpProps: { id?: string } = { }; + const helpProps: { id?: string } = {}; if (fieldId) { helpProps.id = `${fieldId}_help`; - } + } return wrapCSSVar( { ) => ( onActive?.(-1)} /> - onActive?.(1)} /> + onActive?.(1)} + /> diff --git a/components/list/__tests__/Item.test.tsx b/components/list/__tests__/Item.test.tsx index 9a579a8bbd..05e2f10b6a 100644 --- a/components/list/__tests__/Item.test.tsx +++ b/components/list/__tests__/Item.test.tsx @@ -276,7 +276,9 @@ describe('List Item Layout', () => { getItem(item)} />, , ); - expect(container.querySelector('.ant-list-item-extra')!).toHaveStyle('color: rgb(255, 192, 203)'); + expect(container.querySelector('.ant-list-item-extra')!).toHaveStyle( + 'color: rgb(255, 192, 203)', + ); expect(container.querySelector('.ant-list-item-action')!).toHaveStyle('color: rgb(0, 128, 0)'); expect(container.querySelector('.ant-list-item-extra')!).toHaveClass( diff --git a/components/locale/tr_TR.ts b/components/locale/tr_TR.ts index 72a962dd00..de0a316275 100644 --- a/components/locale/tr_TR.ts +++ b/components/locale/tr_TR.ts @@ -78,7 +78,7 @@ const localeValues: Locale = { copy: 'Kopyala', copied: 'Kopyalandı', expand: 'Genişlet', - collapse: 'Daralt' + collapse: 'Daralt', }, Form: { optional: '(opsiyonel)', diff --git a/components/typography/Base/index.tsx b/components/typography/Base/index.tsx index 05b47eab11..3fdfb989b1 100644 --- a/components/typography/Base/index.tsx +++ b/components/typography/Base/index.tsx @@ -112,13 +112,13 @@ function wrapperDecorations( const ELLIPSIS_STR = '...'; const DECORATION_PROPS = [ - 'delete', - 'mark', - 'code', - 'underline', - 'strong', - 'keyboard', - 'italic' + 'delete', + 'mark', + 'code', + 'underline', + 'strong', + 'keyboard', + 'italic', ] as const; const Base = React.forwardRef((props, ref) => { @@ -466,13 +466,13 @@ const Base = React.forwardRef((props, ref) => { onEllipsis={onJsEllipsis} expanded={expanded} miscDeps={[ - copied, - expanded, - copyLoading, - enableEdit, - enableCopy, - textLocale, - ...DECORATION_PROPS.map(key => props[key as keyof BlockProps]) + copied, + expanded, + copyLoading, + enableEdit, + enableCopy, + textLocale, + ...DECORATION_PROPS.map((key) => props[key as keyof BlockProps]), ]} > {(node, canEllipsis) => diff --git a/components/upload/__tests__/uploadlist.test.tsx b/components/upload/__tests__/uploadlist.test.tsx index 441335bac4..666a154675 100644 --- a/components/upload/__tests__/uploadlist.test.tsx +++ b/components/upload/__tests__/uploadlist.test.tsx @@ -161,7 +161,6 @@ describe('Upload List', () => { it('should be uploading when upload a file', async () => { const done = jest.fn(); - // biome-ignore lint/style/useConst: test only let wrapper: ReturnType; let latestFileList: UploadFile[] | null = null; const onChange: UploadProps['onChange'] = async ({ file, fileList: eventFileList }) => { @@ -1201,7 +1200,6 @@ describe('Upload List', () => { it('should render when upload non-image file and configure thumbUrl in onChange', async () => { const thumbUrl = 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png'; - // biome-ignore lint/style/useConst: test only let wrapper: ReturnType; const onChange = jest.fn[]>( ({ fileList: files }) => { @@ -1258,7 +1256,6 @@ describe('Upload List', () => { it('should not render when upload non-image file without thumbUrl in onChange', async () => { (global as any).testName = 'should not render when upload non-image file without thumbUrl in onChange'; - // biome-ignore lint/style/useConst: test only let wrapper: ReturnType; const onChange = jest.fn[]>( ({ fileList: files }) => { @@ -1302,7 +1299,6 @@ describe('Upload List', () => { it('[deprecated] should support transformFile', (done) => { jest.useRealTimers(); - // biome-ignore lint/style/useConst: test only let wrapper: ReturnType; let lastFile: UploadFile; diff --git a/tests/__mocks__/rc-util/lib/Portal.tsx b/tests/__mocks__/rc-util/lib/Portal.tsx index b00287b9c5..91b5aa18aa 100644 --- a/tests/__mocks__/rc-util/lib/Portal.tsx +++ b/tests/__mocks__/rc-util/lib/Portal.tsx @@ -28,12 +28,14 @@ class MockPortal extends React.Component { } } -const CustomPortal = React.forwardRef((props, ref) => { - const context = React.useContext(TriggerMockContext); - if (context?.mock === false) { - return ; - } - return ; -}); +const CustomPortal = React.forwardRef( + (props, ref) => { + const context = React.useContext(TriggerMockContext); + if (context?.mock === false) { + return ; + } + return ; + }, +); -export default CustomPortal; \ No newline at end of file +export default CustomPortal; diff --git a/webpack.config.js b/webpack.config.js index 88f6a7981a..eb665de5f1 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -62,7 +62,7 @@ function addPluginsForProduction(config) { enableBundleAnalysis: process.env.CODECOV_TOKEN !== undefined, bundleName: 'antd.min', uploadToken: process.env.CODECOV_TOKEN, - gitService: "github", + gitService: 'github', }), new CircularDependencyPlugin({ failOnError: true,