Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion e2e/helper/logs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ export const proxyConsole = ({
restores.push(() => {
console[type] = method;
});
console[type] = (...args: any[]) => {
console[type] = (...args: unknown[]) => {
const logMessage = args
.map((arg) => {
if (typeof arg === 'string') {
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-less/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { reduceConfigsWithContext } from 'reduce-configs';

const __dirname = path.dirname(fileURLToPath(import.meta.url));

export const isPlainObject = (obj: unknown): obj is Record<string, any> => {
export const isPlainObject = (obj: unknown): obj is Record<string, unknown> => {
return (
obj !== null &&
typeof obj === 'object' &&
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-react/src/splitChunks.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { RsbuildPluginAPI, Rspack } from '@rsbuild/core';
import type { SplitReactChunkOptions } from './index.js';

const isPlainObject = (obj: unknown): obj is Record<string, any> =>
const isPlainObject = (obj: unknown): obj is Record<string, unknown> =>
obj !== null &&
typeof obj === 'object' &&
Object.prototype.toString.call(obj) === '[object Object]';
Expand Down
28 changes: 18 additions & 10 deletions packages/plugin-sass/src/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,10 @@ function unpatchGlobalLocation() {
}
}

type CompilerTapFn<CallBack extends (...args: any[]) => void = () => void> = {
tap: (name: string, cb: CallBack) => void;
};
type CompilerTapFn<CallBack extends (...args: unknown[]) => void = () => void> =
{
tap: (name: string, cb: CallBack) => void;
};

export function patchCompilerGlobalLocation(compiler: {
hooks: {
Expand All @@ -45,6 +46,11 @@ export function patchCompilerGlobalLocation(compiler: {
compiler.hooks.done.tap('PatchGlobalLocation', unpatchGlobalLocation);
}

type ResolveUrlJoinItem = {
uri: string;
[key: string]: unknown;
};

/**
* fix resolve-url-loader can't deal with resolve.alias config
*
Expand All @@ -58,13 +64,15 @@ export const getResolveUrlJoinFn = (): ((...args: unknown[]) => void) => {
defaultJoinGenerator,
} = resolveUrlHelpers;

const rsbuildGenerator = asGenerator((item: any, ...rest: any[]) => {
// only handle relative path (not absolutely accurate, but can meet common scenarios)
if (!item.uri.startsWith('.')) {
return [null];
}
return defaultJoinGenerator(item, ...rest);
});
const rsbuildGenerator = asGenerator(
(item: ResolveUrlJoinItem, ...rest: unknown[]) => {
// only handle relative path (not absolutely accurate, but can meet common scenarios)
if (!item.uri.startsWith('.')) {
return [null];
}
return defaultJoinGenerator(item, ...rest);
},
);
return createJoinFunction(
'rsbuild-resolve-join-fn',
createJoinImplementation(rsbuildGenerator),
Expand Down
4 changes: 2 additions & 2 deletions packages/plugin-svelte/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ export interface SvelteLoaderOptions {
hotOptions?: {
/** Preserve local component state */
preserveLocalState?: boolean;
[key: string]: any;
[key: string]: unknown;
};
[key: string]: any;
[key: string]: unknown;
}

export type PluginSvelteOptions = {
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-vue/src/splitChunks.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { RsbuildPluginAPI, Rspack } from '@rsbuild/core';
import type { SplitVueChunkOptions } from './index.js';

const isPlainObject = (obj: unknown): obj is Record<string, any> =>
const isPlainObject = (obj: unknown): obj is Record<string, unknown> =>
obj !== null &&
typeof obj === 'object' &&
Object.prototype.toString.call(obj) === '[object Object]';
Expand Down
Loading