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
4 changes: 2 additions & 2 deletions packages/rspack/src/FileSystem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -242,15 +242,15 @@ class ThreadsafeIntermediateNodeFS extends ThreadsafeOutputNodeFS {
this.write = memoizeFn(() => {
const writeFn = util.promisify(fs.write.bind(fs));
return async (fd: number, content: Buffer, position: number) => {
return await writeFn(fd, content, {
return writeFn(fd, content, {
position,
});
};
});
this.writeAll = memoizeFn(() => {
const writeFn = util.promisify(fs.writeFile.bind(fs));
return async (fd: number, content: Buffer) => {
return await writeFn(fd, content);
return writeFn(fd, content);
};
});
this.read = memoizeFn(() => {
Expand Down
2 changes: 1 addition & 1 deletion packages/rspack/src/builtin-plugin/ExternalsPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export class ExternalsPlugin extends RspackBuiltinPlugin {
const processResolveResult = this.#processResolveResult;

return async (ctx: RawExternalItemFnCtx) => {
return await new Promise((resolve, reject) => {
return new Promise((resolve, reject) => {
const data = ctx.data();
const promise = item(
{
Expand Down
10 changes: 5 additions & 5 deletions packages/rspack/src/builtin-plugin/RsdoctorPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ export const createRsdoctorPluginHooksRegisters: CreatePartialRegisters<
},
function (queried) {
return async function (data: JsRsdoctorModuleGraph) {
return await queried.promise(data);
return queried.promise(data);
};
},
),
Expand All @@ -174,7 +174,7 @@ export const createRsdoctorPluginHooksRegisters: CreatePartialRegisters<
},
function (queried) {
return async function (data: JsRsdoctorChunkGraph) {
return await queried.promise(data);
return queried.promise(data);
};
},
),
Expand All @@ -187,7 +187,7 @@ export const createRsdoctorPluginHooksRegisters: CreatePartialRegisters<
},
function (queried) {
return async function (data: JsRsdoctorModuleIdsPatch) {
return await queried.promise(data);
return queried.promise(data);
};
},
),
Expand All @@ -200,7 +200,7 @@ export const createRsdoctorPluginHooksRegisters: CreatePartialRegisters<
},
function (queried) {
return async function (data: JsRsdoctorModuleSourcesPatch) {
return await queried.promise(data);
return queried.promise(data);
};
},
),
Expand All @@ -213,7 +213,7 @@ export const createRsdoctorPluginHooksRegisters: CreatePartialRegisters<
},
function (queried) {
return async function (data: JsRsdoctorAssetPatch) {
return await queried.promise(data);
return queried.promise(data);
};
},
),
Expand Down
10 changes: 5 additions & 5 deletions packages/rspack/src/taps/compilation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ export const createCompilationHooksRegisters: CreatePartialRegisters<

function (queried) {
return async function () {
return await queried.promise(
return queried.promise(
getCompiler().__internal__get_compilation()!.modules,
);
};
Expand Down Expand Up @@ -329,7 +329,7 @@ export const createCompilationHooksRegisters: CreatePartialRegisters<

function (queried) {
return async function () {
return await queried.promise(
return queried.promise(
getCompiler().__internal__get_compilation()!.chunks,
getCompiler().__internal__get_compilation()!.modules,
);
Expand All @@ -346,7 +346,7 @@ export const createCompilationHooksRegisters: CreatePartialRegisters<

function (queried) {
return async function () {
return await queried.promise(
return queried.promise(
getCompiler().__internal__get_compilation()!.chunks,
getCompiler().__internal__get_compilation()!.modules,
);
Expand Down Expand Up @@ -403,7 +403,7 @@ export const createCompilationHooksRegisters: CreatePartialRegisters<

function (queried) {
return async function () {
return await queried.promise(
return queried.promise(
getCompiler().__internal__get_compilation()!.assets,
);
};
Expand Down Expand Up @@ -447,7 +447,7 @@ export const createCompilationHooksRegisters: CreatePartialRegisters<

function (queried) {
return async function () {
return await queried.promise();
return queried.promise();
};
},
),
Expand Down
16 changes: 4 additions & 12 deletions packages/rspack/src/taps/compiler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,7 @@ export const createCompilerHooksRegisters: CreatePartialRegisters<

function (queried) {
return async function () {
return await queried.promise(
getCompiler().__internal__get_compilation()!,
);
return queried.promise(getCompiler().__internal__get_compilation()!);
};
},
),
Expand All @@ -62,9 +60,7 @@ export const createCompilerHooksRegisters: CreatePartialRegisters<

function (queried) {
return async function () {
return await queried.promise(
getCompiler().__internal__get_compilation()!,
);
return queried.promise(getCompiler().__internal__get_compilation()!);
};
},
),
Expand All @@ -90,9 +86,7 @@ export const createCompilerHooksRegisters: CreatePartialRegisters<

function (queried) {
return async function () {
return await queried.promise(
getCompiler().__internal__get_compilation()!,
);
return queried.promise(getCompiler().__internal__get_compilation()!);
};
},
),
Expand All @@ -105,9 +99,7 @@ export const createCompilerHooksRegisters: CreatePartialRegisters<

function (queried) {
return async function () {
return await queried.promise(
getCompiler().__internal__get_compilation()!,
);
return queried.promise(getCompiler().__internal__get_compilation()!);
};
},
),
Expand Down
2 changes: 1 addition & 1 deletion rslint.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"@typescript-eslint/use-unknown-in-catch-callback-variable": "off",
"@typescript-eslint/require-await": "error",
"@typescript-eslint/switch-exhaustiveness-check": "off",
"@typescript-eslint/return-await": "off",
"@typescript-eslint/return-await": "error",
"@typescript-eslint/non-nullable-type-assertion-style": "off",
"@typescript-eslint/no-misused-spread": "off",
"@typescript-eslint/unbound-method": "off",
Expand Down
Loading