From 940798120061b63883f5eb9c4d085c3732469c6e Mon Sep 17 00:00:00 2001 From: Luc Perkins Date: Wed, 5 Jun 2024 09:54:12 -0700 Subject: [PATCH] Fix nullish coalescing --- .eslintrc.json | 1 + src/helpers.ts | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 5966041..ac2dfef 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -60,6 +60,7 @@ "@typescript-eslint/prefer-for-of": "warn", "@typescript-eslint/prefer-function-type": "warn", "@typescript-eslint/prefer-includes": "error", + "@typescript-eslint/prefer-nullish-coalescing": "error", "@typescript-eslint/prefer-string-starts-ends-with": "error", "@typescript-eslint/promise-function-async": "error", "@typescript-eslint/require-array-sort-compare": "error", diff --git a/src/helpers.ts b/src/helpers.ts index 826e9d9..4fcc011 100644 --- a/src/helpers.ts +++ b/src/helpers.ts @@ -15,7 +15,7 @@ export function tailLog(daemonDir: string): Tail { export async function netrcPath(): Promise { const expectedNetrcPath = path.join( - process.env["RUNNER_TEMP"] || os.tmpdir(), + process.env["RUNNER_TEMP"] ?? os.tmpdir(), "determinate-nix-installer-netrc", ); try { @@ -24,7 +24,7 @@ export async function netrcPath(): Promise { } catch { // `nix-installer` was not used, the user may be registered with FlakeHub though. const destinedNetrcPath = path.join( - process.env["RUNNER_TEMP"] || os.tmpdir(), + process.env["RUNNER_TEMP"] ?? os.tmpdir(), "magic-nix-cache-netrc", ); try {