Skip to content

Commit be0fbbd

Browse files
authored
chore(deps): update Biome to v2 (#1072)
1 parent c90c3dd commit be0fbbd

File tree

55 files changed

+175
-142
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+175
-142
lines changed

biome.json

Lines changed: 36 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,11 @@
11
{
2-
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
3-
"organizeImports": {
4-
"enabled": true,
5-
"include": [
6-
"./**/*.js",
7-
"./**/*.jsx",
8-
"./**/*.ts",
9-
"./**/*.tsx",
10-
"./**/*.mjs",
11-
"./**/*.mjsx",
12-
"./**/*.cjs",
13-
"./**/*.cjsx",
14-
"./**/*.mts",
15-
"./**/*.mtsx",
16-
"./**/*.cts",
17-
"./**/*.ctsx"
18-
]
2+
"$schema": "https://biomejs.dev/schemas/2.0.0/schema.json",
3+
"assist": {
4+
"actions": {
5+
"source": {
6+
"organizeImports": "on"
7+
}
8+
}
199
},
2010
"vcs": {
2111
"enabled": true,
@@ -27,7 +17,12 @@
2717
"ignoreUnknown": true
2818
},
2919
"formatter": {
30-
"ignore": ["**/.rslib/*", "./tests/e2e/react-component/public/umd/*"],
20+
"includes": [
21+
"**",
22+
"!**/*.vue",
23+
"!**/.rslib/**/*",
24+
"!tests/e2e/react-component/public/umd/**/*"
25+
],
3126
"indentStyle": "space"
3227
},
3328
"javascript": {
@@ -48,10 +43,12 @@
4843
},
4944
"linter": {
5045
"enabled": true,
51-
"ignore": [
52-
"**/.rslib/*",
53-
"./tests/integration/**/*/src/*",
54-
"./tests/e2e/react-component/public/umd/*"
46+
"includes": [
47+
"**",
48+
"!**/*.vue",
49+
"!**/.rslib/**/*",
50+
"!tests/integration/**/*/src/**/*",
51+
"!tests/e2e/react-component/public/umd/**/*"
5552
],
5653
"rules": {
5754
"recommended": true,
@@ -62,14 +59,30 @@
6259
"options": {
6360
"filenameCases": ["camelCase", "PascalCase", "export"]
6461
}
65-
}
62+
},
63+
"noParameterAssign": "error",
64+
"useAsConstAssertion": "error",
65+
"useDefaultParameterLast": "error",
66+
"useEnumInitializers": "error",
67+
"useSelfClosingElements": "error",
68+
"useSingleVarDeclarator": "error",
69+
"noUnusedTemplateLiteral": "error",
70+
"useNumberNamespace": "error",
71+
"noInferrableTypes": "error",
72+
"noUselessElse": "error"
6673
},
6774
"suspicious": {
6875
"noExplicitAny": "off",
6976
"noConfusingVoidType": "off"
7077
},
7178
"performance": {
7279
"noDelete": "off"
80+
},
81+
"correctness": {
82+
"useHookAtTopLevel": "off"
83+
},
84+
"nursery": {
85+
"useUniqueElementIds": "off"
7386
}
7487
}
7588
}

examples/express-plugin/src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import type { RequestHandler } from 'express';
22
import { logRequest } from './logger';
3-
import { type LoggerOptions, defaultOptions } from './types';
3+
import { defaultOptions, type LoggerOptions } from './types';
44

55
export function expressLogger(
66
options: Partial<LoggerOptions> = {},
77
): RequestHandler {
88
const mergedOptions = { ...defaultOptions, ...options };
9-
return (req, res, next) => {
9+
return (req, _res, next) => {
1010
logRequest(req, mergedOptions);
1111
next();
1212
};

examples/module-federation/mf-react-component/.storybook/main.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { createRequire } from 'node:module';
22
import { dirname, join } from 'node:path';
33
import type { StorybookConfig } from 'storybook-react-rsbuild';
4+
45
const require = createRequire(import.meta.url);
56

67
/**

examples/module-federation/mf-react-component/src/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { init, loadRemote } from '@module-federation/enhanced/runtime';
2-
import { Suspense, createElement, lazy } from 'react';
2+
import { createElement, lazy, Suspense } from 'react';
33
import { CounterButton } from './CounterButton';
44
import { useCounter } from './useCounter';
55

examples/vue-component-bundleless/.storybook/main.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { createRequire } from 'node:module';
22
import { dirname, join } from 'node:path';
33
import type { StorybookConfig } from 'storybook-vue3-rsbuild';
4+
45
const require = createRequire(import.meta.url);
56

67
/**

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
"pnpm-lock.yaml": "pnpm dedupe --check"
4343
},
4444
"devDependencies": {
45-
"@biomejs/biome": "^1.9.4",
45+
"@biomejs/biome": "^2.0.0",
4646
"@changesets/cli": "^2.29.4",
4747
"@types/fs-extra": "^11.0.4",
4848
"@types/node": "^22.15.31",

packages/core/src/cli/build.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { type RsbuildInstance, createRsbuild } from '@rsbuild/core';
1+
import { createRsbuild, type RsbuildInstance } from '@rsbuild/core';
22
import { composeRsbuildEnvironments, pruneEnvironments } from '../config';
33
import type { RslibConfig } from '../types/config';
44
import type { BuildOptions } from './commands';

packages/core/src/cli/inspect.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { type RsbuildInstance, createRsbuild } from '@rsbuild/core';
1+
import { createRsbuild, type RsbuildInstance } from '@rsbuild/core';
22
import { composeRsbuildEnvironments, pruneEnvironments } from '../config';
33
import type { RslibConfig } from '../types/config';
44
import type { InspectOptions } from './commands';

packages/core/src/cli/mf.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { createRsbuild } from '@rsbuild/core';
21
import type { RsbuildInstance } from '@rsbuild/core';
2+
import { createRsbuild } from '@rsbuild/core';
33
import { composeRsbuildEnvironments, pruneEnvironments } from '../config';
44
import type { RslibConfig } from '../types';
55
import type { CommonOptions } from './commands';

packages/core/src/config.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
import fs from 'node:fs';
22
import path, { dirname, extname, isAbsolute, join } from 'node:path';
33
import {
4+
defineConfig as defineRsbuildConfig,
45
type EnvironmentConfig,
6+
loadConfig as loadRsbuildConfig,
7+
mergeRsbuildConfig,
58
type RsbuildConfig,
69
type RsbuildEntry,
710
type RsbuildPlugin,
811
type RsbuildPlugins,
912
type Rspack,
10-
type ToolsConfig,
11-
defineConfig as defineRsbuildConfig,
12-
loadConfig as loadRsbuildConfig,
13-
mergeRsbuildConfig,
1413
rspack,
14+
type ToolsConfig,
1515
} from '@rsbuild/core';
1616
import { glob } from 'tinyglobby';
1717
import { composeAssetConfig } from './asset/assetConfig';
@@ -23,9 +23,9 @@ import {
2323
SWC_HELPERS,
2424
} from './constant';
2525
import {
26-
RSLIB_CSS_ENTRY_FLAG,
2726
composeCssConfig,
2827
cssExternalHandler,
28+
RSLIB_CSS_ENTRY_FLAG,
2929
} from './css/cssConfig';
3030
import { type CssLoaderOptionsAuto, isCssGlobalFile } from './css/utils';
3131
import { composeEntryChunkConfig } from './plugins/EntryChunkPlugin';
@@ -254,7 +254,7 @@ const composeExternalsWarnConfig = (
254254
}
255255
// object
256256
else if (typeof externals === 'object') {
257-
if (Object.prototype.hasOwnProperty.call(externals, request)) {
257+
if (Object.hasOwn(externals, request)) {
258258
if (handleMatchedExternal(externals[request]!, request)) {
259259
callback(true, true);
260260
} else {
@@ -1277,7 +1277,7 @@ const composeBundlelessExternalConfig = (
12771277
// NOTE: If request is a phantom dependency, which means it can be resolved but not specified in dependencies or peerDependencies in package.json, the output will be incorrect to use when the package is published
12781278
// return the original request instead of the resolved request
12791279
return undefined;
1280-
} catch (e) {
1280+
} catch (_e) {
12811281
// catch error when request can not be resolved by resolver
12821282
// e.g. A react component library importing and using 'react' but while not defining
12831283
// it in devDependencies and peerDependencies. Preserve 'react' as-is if so.
@@ -1637,11 +1637,11 @@ export async function composeCreateRsbuildConfig(
16371637
const constantRsbuildConfig = await createConstantRsbuildConfig();
16381638
const {
16391639
lib: libConfigsArray,
1640-
mode,
1640+
mode: _mode,
16411641
root,
16421642
plugins: sharedPlugins,
1643-
dev,
1644-
server,
1643+
dev: _dev,
1644+
server: _server,
16451645
...sharedRsbuildConfig
16461646
} = rslibConfig;
16471647

0 commit comments

Comments
 (0)