From 91920abd69234976b04b1f9d947682c0a118216a Mon Sep 17 00:00:00 2001 From: Daniel Rozenberg Date: Wed, 14 Jun 2023 15:30:04 -0400 Subject: [PATCH] Minor changes for lint/type-checking --- build-system/release-tagger/utils.js | 4 +++- build-system/tasks/build-story-localization.js | 6 +++++- build-system/tasks/e2e/amp-driver.js | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/build-system/release-tagger/utils.js b/build-system/release-tagger/utils.js index 993867ffce01f..71f4d6081f347 100644 --- a/build-system/release-tagger/utils.js +++ b/build-system/release-tagger/utils.js @@ -4,9 +4,11 @@ */ const dedent = require('dedent'); -const {GraphQlQueryResponseData, graphql} = require('@octokit/graphql'); // eslint-disable-line @typescript-eslint/no-unused-vars +const {graphql} = require('@octokit/graphql'); const {Octokit} = require('@octokit/rest'); +/** @typedef {import('@octokit/graphql').GraphQlQueryResponseData} GraphQlQueryResponseData */ + /** * GitHub API util functions */ diff --git a/build-system/tasks/build-story-localization.js b/build-system/tasks/build-story-localization.js index a171ed6e8a56b..60d24476a348c 100755 --- a/build-system/tasks/build-story-localization.js +++ b/build-system/tasks/build-story-localization.js @@ -23,7 +23,11 @@ function getLanguageCodeFallbacks(languageCode) { if (!languageCode) { return [FALLBACK_LANGUAGE_CODE]; } - const matches = languageCode.match(LANGUAGE_CODE_CHUNK_REGEX) || []; + const matches = languageCode.match(LANGUAGE_CODE_CHUNK_REGEX); + if (!matches) { + return [FALLBACK_LANGUAGE_CODE]; + } + return matches.reduce( (fallbackLanguageCodeList, _, index) => { const fallbackLanguageCode = matches diff --git a/build-system/tasks/e2e/amp-driver.js b/build-system/tasks/e2e/amp-driver.js index 4ddf1dc2954a1..c393b28fafee6 100644 --- a/build-system/tasks/e2e/amp-driver.js +++ b/build-system/tasks/e2e/amp-driver.js @@ -119,7 +119,7 @@ const EnvironmentBehaviorMap = { /** * @param {string} url - * @param {{isEmail: boolean}=} opts + * @param {{isEmail: boolean}} opts * @return {string} */ function getViewerUrl(url, {isEmail} = {isEmail: false}) {