From 135176f0735bcf6e674ecfc9268e8d6d3fa6b488 Mon Sep 17 00:00:00 2001 From: Alexandr Garbuzov Date: Sat, 12 Aug 2023 09:11:12 +0300 Subject: [PATCH] Enable consistent return eslint rule (#3065) --- .eslintrc.json | 2 +- scripts/preview-theme.js | 4 +++- src/fetchers/repo-fetcher.js | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 56121657c1ecb..27ac580085d72 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -38,7 +38,7 @@ // "setWithoutGet": true // }], // "block-scoped-var": "warn", - // "consistent-return": "error", + "consistent-return": "error", // "curly": "error", // "default-case": "warn", diff --git a/scripts/preview-theme.js b/scripts/preview-theme.js index 8e2f0041e11a2..a6686360b1a79 100644 --- a/scripts/preview-theme.js +++ b/scripts/preview-theme.js @@ -113,7 +113,7 @@ const isPreviewComment = (inputs, comment) => { * @param {string} owner Owner of the repository. * @param {string} repo Repository name. * @param {string} commenter Comment author. - * @returns {Object} The GitHub comment object. + * @returns {Object | undefined} The GitHub comment object. */ const findComment = async (octokit, issueNumber, owner, repo, commenter) => { const parameters = { @@ -141,6 +141,8 @@ const findComment = async (octokit, issueNumber, owner, repo, commenter) => { debug(`No theme preview comment found.`); } } + + return undefined; }; /** diff --git a/src/fetchers/repo-fetcher.js b/src/fetchers/repo-fetcher.js index 75c31475a6a1c..98e0a72ba6ef2 100644 --- a/src/fetchers/repo-fetcher.js +++ b/src/fetchers/repo-fetcher.js @@ -109,6 +109,8 @@ const fetchRepo = async (username, reponame) => { starCount: data.organization.repository.stargazers.totalCount, }; } + + throw new Error("Unexpected behavior"); }; export { fetchRepo };