Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: let @typescript-eslint/no-floating-promises ESLint rule pass #6331

Merged
merged 2 commits into from
Aug 9, 2023
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 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
Loading