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
6 changes: 3 additions & 3 deletions packages/rspack/src/FileSystem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,8 @@ class ThreadsafeIntermediateNodeFS extends ThreadsafeOutputNodeFS {
});
this.read = memoizeFn(() => {
const readFn = fs.read.bind(fs);
return async (fd: number, length: number, position: number) => {
new Promise((resolve) => {
return (fd: number, length: number, position: number) => {
return new Promise((resolve, reject) => {
readFn(
fd,
{
Expand All @@ -265,7 +265,7 @@ class ThreadsafeIntermediateNodeFS extends ThreadsafeOutputNodeFS {
},
(err, _bytesRead, buffer) => {
if (err) {
resolve(err);
reject(err);
} else {
resolve(buffer);
}
Expand Down
4 changes: 2 additions & 2 deletions packages/rspack/src/browser/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ export enum RequestType {
CompilationGetAssetPathWithInfo = 'CompilationGetAssetPathWithInfo',
}

export async function run() {
throw new Error('Not support browser');
export function run(): Promise<never> {
return Promise.reject(new Error('Not support browser'));
}
Original file line number Diff line number Diff line change
Expand Up @@ -286,9 +286,9 @@ export class SubresourceIntegrityPlugin extends NativeSubresourceIntegrityPlugin
const hwpHooks = getHooks(compilation);
hwpHooks.beforeAssetTagGeneration.tapPromise(
PLUGIN_NAME,
async (data) => {
(data) => {
self.handleHwpPluginArgs(data);
return data;
return Promise.resolve(data);
},
);

Expand All @@ -297,13 +297,13 @@ export class SubresourceIntegrityPlugin extends NativeSubresourceIntegrityPlugin
name: PLUGIN_NAME,
stage: 10000,
},
async (data) => {
(data) => {
self.handleHwpBodyTags(
data,
compiler.outputPath,
compiler.options.output.crossOriginLoading,
);
return data;
return Promise.resolve(data);
},
);
});
Expand Down
4 changes: 2 additions & 2 deletions packages/rspack/src/loader-runner/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -648,10 +648,10 @@ function worker(workerOptions: WorkerOptions) {
const waitFor = createWaitForPendingRequest(sendRequest);

loaderImpl(workerOptions, sendRequest, waitFor)
.then(async (data) => {
.then((data) => {
workerData.workerPort.postMessage({ type: 'done', data });
})
.catch(async (err) => {
.catch((err) => {
workerData.workerPort.postMessage({
type: 'done-error',
error: serializeError(err),
Expand Down
2 changes: 1 addition & 1 deletion rslint.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"@typescript-eslint/no-confusing-void-expression": "off",
"@typescript-eslint/promise-function-async": "off",
"@typescript-eslint/use-unknown-in-catch-callback-variable": "off",
"@typescript-eslint/require-await": "off",
"@typescript-eslint/require-await": "error",
"@typescript-eslint/switch-exhaustiveness-check": "off",
"@typescript-eslint/return-await": "off",
"@typescript-eslint/non-nullable-type-assertion-style": "off",
Expand Down
Loading