Skip to content

Commit

Permalink
chore: let @typescript-eslint/no-floating-promises ESLint rule pass (
Browse files Browse the repository at this point in the history
  • Loading branch information
ngbrown committed Aug 9, 2023
1 parent 002ed42 commit ff45f1d
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 12 deletions.
2 changes: 1 addition & 1 deletion packages/remix-dev/__tests__/utils/withApp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@ export default async <Result>(
// errors when attempting to removing the temporary directory.
// Retrying a couple times seems to get it to succeed.
// See https://github.com/jprichardson/node-fs-extra/issues?q=EBUSY%3A+resource+busy+or+locked%2C+rmdir
retry(async () => await fse.remove(TEMP_DIR), 3, 200);
await retry(async () => await fse.remove(TEMP_DIR), 3, 200);
}
};
2 changes: 1 addition & 1 deletion packages/remix-dev/cli/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ export async function watch(
: await readConfig(remixRootOrConfig);

let resolved = await resolveDev(config);
devServer.liveReload(config, resolved);
void devServer.liveReload(config, resolved);
return await new Promise(() => {});
}

Expand Down
2 changes: 1 addition & 1 deletion packages/remix-dev/compiler/compiler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export let create = async (ctx: Context): Promise<Compiler> => {
if (error === undefined) {
error = thrown;
}
cancel();
void cancel();
return err(thrown);
};

Expand Down
2 changes: 1 addition & 1 deletion packages/remix-dev/compiler/fileWatchCache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export function createFileWatchCache(): FileWatchCache {
): Promise<CacheValue<T>> {
promiseForCacheKey.set(key, promise);

promise
void promise
.catch(() => {
// Swallow errors to prevent the build from crashing and remove the
// rejected promise from the cache so consumers can retry
Expand Down
4 changes: 2 additions & 2 deletions packages/remix-dev/compiler/watch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export async function watch(

let restart = debounce(async () => {
let start = Date.now();
compiler.dispose();
void compiler.dispose();

try {
ctx.config = await reloadConfig(ctx.config.rootDirectory);
Expand Down Expand Up @@ -130,6 +130,6 @@ export async function watch(

return async () => {
await watcher.close().catch(() => undefined);
compiler.dispose();
void compiler.dispose();
};
}
10 changes: 6 additions & 4 deletions packages/remix-react/components.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -412,11 +412,13 @@ function useKeyedPrefetchLinks(matches: AgnosticDataRouteMatch[]) {
React.useEffect(() => {
let interrupted: boolean = false;

getKeyedPrefetchLinks(matches, manifest, routeModules).then((links) => {
if (!interrupted) {
setKeyedPrefetchLinks(links);
void getKeyedPrefetchLinks(matches, manifest, routeModules).then(
(links) => {
if (!interrupted) {
setKeyedPrefetchLinks(links);
}
}
});
);

return () => {
interrupted = true;
Expand Down
2 changes: 1 addition & 1 deletion packages/remix-react/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ export async function parseDeferredReadableStream(
}

// Read the rest of the stream and resolve deferred promises
(async () => {
void (async () => {
try {
for await (let section of sectionReader) {
// Determine event type and data
Expand Down
2 changes: 1 addition & 1 deletion packages/remix-serve/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ let onListen = () => {
);
}
if (process.env.NODE_ENV === "development") {
broadcastDevReady(build);
void broadcastDevReady(build);
}
};

Expand Down

0 comments on commit ff45f1d

Please sign in to comment.