Skip to content

Commit

Permalink
refactor: remove explicit return statements
Browse files Browse the repository at this point in the history
  • Loading branch information
mheob committed Apr 13, 2023
1 parent 00adc68 commit e86b0ad
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
1 change: 1 addition & 0 deletions .commitlintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ module.exports = {
...defaultConfig,
prompt: {
...defaultConfig.prompt,
allowEmptyScopes: true,
},
};
5 changes: 1 addition & 4 deletions src/getDependencyReleaseLine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@ import type { GetDependencyReleaseLine, NewChangesetWithCommit } from '@changese

import { errorMessage } from './utils';

async function getDependencyReleaseLinks(
changesets: NewChangesetWithCommit[],
repository: string,
): Promise<string> {
async function getDependencyReleaseLinks(changesets: NewChangesetWithCommit[], repository: string) {
const changesetLinks = await Promise.all(
changesets.map(async (cs) => {
// istanbul ignore next: because of our mocked get-github-info -- @preserve
Expand Down
6 changes: 3 additions & 3 deletions src/getReleaseLine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ async function getGitHubLinks(
commit?: string,
commitFromSummary?: string,
prFromSummary?: number,
): Promise<GithubLinks> {
) {
let githubLinks: GithubLinks = { commit: undefined, pull: undefined, user: undefined };

if (prFromSummary) {
Expand Down Expand Up @@ -82,7 +82,7 @@ async function getGitHubLinks(
return githubLinks;
}

function getUserLink(usersFromSummary: string[], user?: string): string | undefined {
function getUserLink(usersFromSummary: string[], user?: string) {
const userLink =
usersFromSummary.length > 0
? usersFromSummary
Expand All @@ -96,7 +96,7 @@ function getUserLink(usersFromSummary: string[], user?: string): string | undefi

// add links to issue hints (fix #123) => (fix [#123](https://....))
// thanks to https://github.com/svitejs/changesets-changelog-github-compact
function linkifyIssue(line: string, repository: string): string {
function linkifyIssue(line: string, repository: string) {
return line.replace(/(?<=\( ?(?:fix|fixes|resolves|see) )(#\d+)(?= ?\))/g, (issue) => {
return `[${issue}](https://github.com/${repository}/issues/${issue.slice(1)})`;
});
Expand Down

0 comments on commit e86b0ad

Please sign in to comment.