Skip to content

Commit 451a37c

Browse files
committed
fix lint error
1 parent c834223 commit 451a37c

File tree

4 files changed

+9
-4
lines changed

4 files changed

+9
-4
lines changed

modules/fileicon/basic.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,8 @@ import (
1313
func BasicThemeFolderIconName(isOpen bool) string {
1414
if isOpen {
1515
return "octicon-file-directory-open-fill"
16-
} else {
17-
return "octicon-file-directory-fill"
1816
}
17+
return "octicon-file-directory-fill"
1918
}
2019

2120
func BasicThemeFolderIcon(isOpen bool) template.HTML {

routers/web/repo/treelist.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ func isExcludedEntry(entry *git.TreeEntry) bool {
6262
type FileDiffFile struct {
6363
Name string
6464
NameHash string
65-
FileIcon template.HTML
65+
FileIcon template.HTML
6666
IsSubmodule bool
6767
IsViewed bool
6868
Status string
@@ -82,7 +82,7 @@ func transformDiffTreeForUI(ctx *context.Context, commit *git.Commit, diffTree *
8282
files = append(files, FileDiffFile{
8383
Name: file.HeadPath,
8484
NameHash: nameHash,
85-
FileIcon: templates.NewRenderUtils(reqctx.FromContext(ctx)).RenderFileIcon(entry),
85+
FileIcon: templates.NewRenderUtils(reqctx.FromContext(ctx)).RenderFileIcon(entry),
8686
IsSubmodule: isSubmodule,
8787
IsViewed: isViewed,
8888
Status: file.Status,

web_src/js/components/DiffFileTreeItem.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ function getIconForDiffStatus(pType: FileStatus) {
3333
:title="item.name" :href="'#diff-' + item.file.NameHash"
3434
>
3535
<!-- file -->
36+
<!-- eslint-disable-next-line vue/no-v-html -->
3637
<span class="item-icon" v-html="item.file.FileIcon"/>
3738
<span class="gt-ellipsis tw-flex-1">{{ item.name }}</span>
3839
<SvgIcon
@@ -45,7 +46,9 @@ function getIconForDiffStatus(pType: FileStatus) {
4546
<div class="item-directory" :title="item.name" @click.stop="collapsed = !collapsed">
4647
<!-- directory -->
4748
<SvgIcon :name="collapsed ? 'octicon-chevron-right' : 'octicon-chevron-down'"/>
49+
<!-- eslint-disable-next-line vue/no-v-html -->
4850
<span v-if="collapsed" class="item-icon" v-html="pageData.folderIcon"/>
51+
<!-- eslint-disable-next-line vue/no-v-html -->
4952
<span v-else class="item-icon" v-html="pageData.openFolderIcon"/>
5053
<span class="gt-ellipsis">{{ item.name }}</span>
5154
</div>

web_src/js/components/ViewFileTreeItem.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,11 @@ onMounted(async () => {
8585
<SvgIcon v-else :name="collapsed ? 'octicon-chevron-right' : 'octicon-chevron-down'" @click.stop="doLoadChildren"/>
8686
</div>
8787
<div class="item-content">
88+
<!-- eslint-disable-next-line vue/no-v-html -->
8889
<span v-if="isDirectory && collapsed" class="item-icon" v-html="pageData.folderIcon"/>
90+
<!-- eslint-disable-next-line vue/no-v-html -->
8991
<span v-else-if="isDirectory && !collapsed" class="item-icon" v-html="pageData.openFolderIcon"/>
92+
<!-- eslint-disable-next-line vue/no-v-html -->
9093
<span v-else class="item-icon" v-html="item.fileIcon"/>
9194
<span class="gt-ellipsis tw-flex-1">{{ item.entryName }}</span>
9295
</div>

0 commit comments

Comments
 (0)