Skip to content

Commit

Permalink
Enable consistent return eslint rule (#3065)
Browse files Browse the repository at this point in the history
  • Loading branch information
qwerty541 authored Aug 12, 2023
1 parent c394ea3 commit 135176f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
// "setWithoutGet": true
// }],
// "block-scoped-var": "warn",
// "consistent-return": "error",
"consistent-return": "error",
// "curly": "error",
// "default-case": "warn",

Expand Down
4 changes: 3 additions & 1 deletion scripts/preview-theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down Expand Up @@ -141,6 +141,8 @@ const findComment = async (octokit, issueNumber, owner, repo, commenter) => {
debug(`No theme preview comment found.`);
}
}

return undefined;
};

/**
Expand Down
2 changes: 2 additions & 0 deletions src/fetchers/repo-fetcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ const fetchRepo = async (username, reponame) => {
starCount: data.organization.repository.stargazers.totalCount,
};
}

throw new Error("Unexpected behavior");
};

export { fetchRepo };
Expand Down

0 comments on commit 135176f

Please sign in to comment.