aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/helpers/branch-like.ts
diff options
context:
space:
mode:
authorPhilippe Perrin <philippe.perrin@sonarsource.com>2022-11-02 11:08:39 +0100
committersonartech <sonartech@sonarsource.com>2022-11-02 20:03:01 +0000
commit2ab6fc273ecbf405f7c126fab11ddc0b9bf516da (patch)
treea6e005b4f57fb488d3e551b7df52399e69b0674c /server/sonar-web/src/main/js/helpers/branch-like.ts
parent60e4b88e4567c1af3051b6cdc4c8858f8b0fca21 (diff)
downloadsonarqube-2ab6fc273ecbf405f7c126fab11ddc0b9bf516da.tar.gz
sonarqube-2ab6fc273ecbf405f7c126fab11ddc0b9bf516da.zip
SONAR-13368 Bump to prettier@2.7.1
Diffstat (limited to 'server/sonar-web/src/main/js/helpers/branch-like.ts')
-rw-r--r--server/sonar-web/src/main/js/helpers/branch-like.ts28
1 files changed, 14 insertions, 14 deletions
diff --git a/server/sonar-web/src/main/js/helpers/branch-like.ts b/server/sonar-web/src/main/js/helpers/branch-like.ts
index 261bea49cae..2f7a766fc94 100644
--- a/server/sonar-web/src/main/js/helpers/branch-like.ts
+++ b/server/sonar-web/src/main/js/helpers/branch-like.ts
@@ -25,7 +25,7 @@ import {
BranchParameters,
BranchStatusData,
MainBranch,
- PullRequest
+ PullRequest,
} from '../types/branch-like';
import { Dict } from '../types/types';
@@ -38,7 +38,7 @@ export function isMainBranch(branchLike?: BranchLike): branchLike is MainBranch
}
export function sortBranches(branches: Branch[]) {
- return orderBy(branches, [b => b.isMain, b => b.name], ['desc', 'asc']);
+ return orderBy(branches, [(b) => b.isMain, (b) => b.name], ['desc', 'asc']);
}
export function isPullRequest(branchLike?: BranchLike): branchLike is PullRequest {
@@ -46,7 +46,7 @@ export function isPullRequest(branchLike?: BranchLike): branchLike is PullReques
}
export function sortPullRequests(pullRequests: PullRequest[]) {
- return orderBy(pullRequests, pr => getPullRequestDisplayName(pr));
+ return orderBy(pullRequests, (pr) => getPullRequestDisplayName(pr));
}
export function getPullRequestDisplayName(pullRequest: PullRequest) {
@@ -84,34 +84,34 @@ export function isSameBranchLike(a: BranchLike | undefined, b: BranchLike | unde
export function getBrancheLikesAsTree(branchLikes: BranchLike[]): BranchLikeTree {
const mainBranch = branchLikes.find(isMainBranch);
const branches = orderBy(
- branchLikes.filter(isBranch).filter(b => !isMainBranch(b)),
- b => b.name
+ branchLikes.filter(isBranch).filter((b) => !isMainBranch(b)),
+ (b) => b.name
);
- const pullRequests = orderBy(branchLikes.filter(isPullRequest), b => parseInt(b.key, 10), [
- 'desc'
+ const pullRequests = orderBy(branchLikes.filter(isPullRequest), (b) => parseInt(b.key, 10), [
+ 'desc',
]);
const parentlessPullRequests = pullRequests.filter(
- pr => !pr.isOrphan && ![mainBranch, ...branches].find(b => !!b && b.name === pr.base)
+ (pr) => !pr.isOrphan && ![mainBranch, ...branches].find((b) => !!b && b.name === pr.base)
);
- const orphanPullRequests = pullRequests.filter(pr => pr.isOrphan);
+ const orphanPullRequests = pullRequests.filter((pr) => pr.isOrphan);
const tree: BranchLikeTree = {
- branchTree: branches.map(b => ({ branch: b, pullRequests: getPullRequests(b) })),
+ branchTree: branches.map((b) => ({ branch: b, pullRequests: getPullRequests(b) })),
parentlessPullRequests,
- orphanPullRequests
+ orphanPullRequests,
};
if (mainBranch) {
tree.mainBranchTree = {
branch: mainBranch,
- pullRequests: getPullRequests(mainBranch)
+ pullRequests: getPullRequests(mainBranch),
};
}
return tree;
function getPullRequests(branch: Branch) {
- return pullRequests.filter(pr => !pr.isOrphan && pr.base === branch.name);
+ return pullRequests.filter((pr) => !pr.isOrphan && pr.base === branch.name);
}
}
@@ -132,7 +132,7 @@ export function fillBranchLike(
if (branch) {
return {
isMain: false,
- name: branch
+ name: branch,
} as Branch;
} else if (pullRequest) {
return { base: '', branch: '', key: pullRequest, title: '' } as PullRequest;