chore: migrate @biomejs/biome from 1.9.4 to 2.0.0 (#54118)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: thinkasany <480968828@qq.com>
Co-authored-by: afc163 <afc163@gmail.com>
This commit is contained in:
dependabot[bot]
2025-06-18 18:55:45 +08:00
committed by GitHub
parent 0de8a30b43
commit fe28d002e4
13 changed files with 92 additions and 81 deletions

View File

@@ -46,9 +46,10 @@ type Color = Extract<GetProp<ColorPickerProps, 'value'>, string | { cleared: any
const { Header, Content, Sider } = Layout;
const TokenChecker: React.FC = () => {
const token = theme.useToken();
if (process.env.NODE_ENV !== 'production') {
// eslint-disable-next-line no-console
console.log('Demo Token:', theme.useToken());
console.log('Demo Token:', token);
}
return null;
};

View File

@@ -269,6 +269,7 @@ createRoot(document.getElementById('container')).render(<Demo />);
action="https://codesandbox.io/api/v1/sandboxes/define"
method="POST"
target="_blank"
rel="noreferrer"
ref={codeSandboxIconRef}
onClick={() => {
track({ type: 'codesandbox', demo: assetId });
@@ -312,6 +313,7 @@ createRoot(document.getElementById('container')).render(<Demo />);
action="https://codepen.io/pen/define"
method="POST"
target="_blank"
rel="noreferrer"
ref={codepenIconRef}
onClick={() => {
track({ type: 'codepen', demo: assetId });

View File

@@ -1,17 +1,18 @@
{
"files": {
"ignoreUnknown": true,
"ignore": [
".dumi/tmp*",
".dumi/scripts/clarity.js",
"dist/*",
"es/**/*",
"lib/**/*",
"_site/**/*",
"node_modules",
"server",
"scripts/previewEditor/**/*",
"package.json"
"includes": [
"**",
"!.dumi/tmp*",
"!.dumi/scripts/clarity.js",
"!dist/*",
"!es/**/*",
"!lib/**/*",
"!_site/**/*",
"!node_modules",
"!server",
"!scripts/previewEditor/**/*",
"!package.json"
]
},
"formatter": {
@@ -21,12 +22,17 @@
"indentWidth": 2
},
"javascript": {
"jsxRuntime": "reactClassic",
"formatter": {
"quoteStyle": "single"
}
},
"organizeImports": {
"enabled": false
"assist": {
"actions": {
"source": {
"organizeImports": "off"
}
}
},
"linter": {
"rules": {
@@ -39,10 +45,14 @@
},
"complexity": {
"noUselessTypeConstraint": "off",
"noForEach": "off"
"noForEach": "off",
"useDateNow": "off"
},
"correctness": {
"useExhaustiveDependencies": "off"
"useExhaustiveDependencies": "off",
"useHookAtTopLevel": "off",
"noUnusedFunctionParameters": "off",
"noUnusedVariables": "off"
},
"suspicious": {
"noGlobalIsNan": "off",
@@ -50,18 +60,26 @@
"noExplicitAny": "off",
"noArrayIndexKey": "off",
"noConfusingVoidType": "off",
"noThenProperty": "off"
"noThenProperty": "off",
"noTemplateCurlyInString": "off"
},
"performance": {
"noDelete": "off",
"noAccumulatingSpread": "off"
"noAccumulatingSpread": "off",
"noDynamicNamespaceImportAccess": "off"
},
"a11y": {
"noAriaHiddenOnFocusable": "off",
"noLabelWithoutControl": "off",
"useFocusableInteractive": "off",
"useKeyWithClickEvents": "off",
"useSemanticElements": "off"
"useSemanticElements": "off",
"noStaticElementInteractions": "off",
"useAriaPropsSupportedByRole": "off",
"useAriaPropsForRole": "off"
},
"nursery": {
"useUniqueElementIds": "off"
}
}
},
@@ -72,7 +90,7 @@
},
"overrides": [
{
"include": ["**/*.test.ts", "**/*.test.tsx", "tests/**/*", "scripts/**/*", ".dumi/**/*"],
"includes": ["**/*.test.ts", "**/*.test.tsx", "tests/**/*", "scripts/**/*", ".dumi/**/*"],
"linter": {
"rules": {
"style": {
@@ -94,7 +112,7 @@
}
},
{
"include": ["components/*/demo/*"],
"includes": ["components/*/demo/*"],
"linter": {
"rules": {
"correctness": {

View File

@@ -1,6 +1,5 @@
export function easeInOutCubic(t: number, b: number, c: number, d: number) {
const cc = c - b;
// biome-ignore lint: it is a common easing function
t /= d / 2;
if (t < 1) {
return (cc / 2) * t * t * t + b;

View File

@@ -12,7 +12,7 @@ import { useToken } from '../../theme/internal';
const { defaultAlgorithm, darkAlgorithm, compactAlgorithm } = theme;
/* biome-ignore lint/style/noVar: has to be a global variable */ /* eslint-disable-next-line no-var */
/* eslint-disable-next-line no-var */
var mockCanUseDom = true;
jest.mock('rc-util/lib/Dom/canUseDom', () => () => mockCanUseDom);

View File

@@ -32,55 +32,53 @@ const App: React.FC = () => (
</Space.Compact>
</Space.Compact>
</Space.Compact>
<>
<br />
<Space.Compact block>
<Space.Compact>
<TimePicker />
<Button type="primary">Submit</Button>
</Space.Compact>
<Space.Compact>
<Cascader
options={[
{
value: 'zhejiang',
label: 'Zhejiang',
children: [
{
value: 'hangzhou',
label: 'Hangzhou',
children: [
{
value: 'xihu',
label: 'West Lake',
},
],
},
],
},
{
value: 'jiangsu',
label: 'Jiangsu',
children: [
{
value: 'nanjing',
label: 'Nanjing',
children: [
{
value: 'zhonghuamen',
label: 'Zhong Hua Men',
},
],
},
],
},
]}
placeholder="Select Address"
/>
<Button type="primary">Submit</Button>
</Space.Compact>
<br />
<Space.Compact block>
<Space.Compact>
<TimePicker />
<Button type="primary">Submit</Button>
</Space.Compact>
</>
<Space.Compact>
<Cascader
options={[
{
value: 'zhejiang',
label: 'Zhejiang',
children: [
{
value: 'hangzhou',
label: 'Hangzhou',
children: [
{
value: 'xihu',
label: 'West Lake',
},
],
},
],
},
{
value: 'jiangsu',
label: 'Jiangsu',
children: [
{
value: 'nanjing',
label: 'Nanjing',
children: [
{
value: 'zhonghuamen',
label: 'Zhong Hua Men',
},
],
},
],
},
]}
placeholder="Select Address"
/>
<Button type="primary">Submit</Button>
</Space.Compact>
</Space.Compact>
</>
);

View File

@@ -3,10 +3,8 @@ import { Button, Popconfirm, Space } from 'antd';
const App: React.FC = () => (
<Space>
<>
Button
<Button>Button</Button>
</>
Button
<Button>Button</Button>
Button
<Popconfirm title="Are you sure delete this task?" okText="Yes" cancelText="No">
<Button>Delete</Button>

View File

@@ -74,7 +74,6 @@ const Progress: React.FC<Readonly<ProgressProps>> = ({ percent, prefixCls }) =>
>
<svg
viewBox={`0 0 ${viewSize} ${viewSize}`}
// biome-ignore lint/a11y/noNoninteractiveElementToInteractiveRole: progressbar could be readonly
role="progressbar"
aria-valuemin={0}
aria-valuemax={100}

View File

@@ -52,7 +52,6 @@ p {
abbr[title],
abbr[data-original-title] {
-webkit-text-decoration: underline dotted;
text-decoration: underline;
text-decoration: underline dotted;
border-bottom: 0;
cursor: help;

View File

@@ -18,7 +18,6 @@ const derivative: DerivativeFunc<SeedToken, MapToken> = (token, mapToken) => {
}, {});
})
.reduce((prev, cur) => {
// biome-ignore lint/style/noParameterAssign: it is a reduce
prev = { ...prev, ...cur };
return prev;
}, {});

View File

@@ -26,7 +26,6 @@ export default function derivative(token: SeedToken): MapToken {
}, {});
})
.reduce<MapToken>((prev, cur) => {
// biome-ignore lint/style/noParameterAssign: it is a reduce
prev = { ...prev, ...cur };
return prev;
}, {} as MapToken);

View File

@@ -245,7 +245,6 @@ const InternalUpload: React.ForwardRefRenderFunction<UploadRef, UploadProps> = (
const onSuccess = (response: any, file: RcFile, xhr: any) => {
try {
if (typeof response === 'string') {
// biome-ignore lint/style/noParameterAssign: we need to modify response
response = JSON.parse(response);
}
} catch {

View File

@@ -166,7 +166,7 @@
"@ant-design/v5-patch-for-react-19": "^1.0.2",
"@antfu/eslint-config": "^4.0.0",
"@antv/g6": "^4.8.24",
"@biomejs/biome": "^1.9.4",
"@biomejs/biome": "^2.0.0",
"@codecov/webpack-plugin": "^1.4.0",
"@codesandbox/sandpack-react": "^2.19.10",
"@dnd-kit/core": "^6.2.0",