Skip to content

Commit 9ec57c8

Browse files
authored
docs: improve linters page (#4571)
1 parent 94a0179 commit 9ec57c8

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

docs/src/docs/usage/linters.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
title: Linters
33
---
44

5+
import { FaGithub, FaGitlab } from "react-icons/fa";
6+
57
To see a list of supported linters and which linters are enabled/disabled:
68

79
```sh

scripts/website/expand_templates/linters.go

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,17 @@ func getLintersListMarkdown(enabled bool) string {
7575
func getName(lc *types.LinterWrapper) string {
7676
name := lc.Name
7777

78-
if lc.OriginalURL != "" {
79-
name = fmt.Sprintf("[%s](%s)", name, lc.OriginalURL)
78+
if hasSettings(lc.Name) {
79+
name = fmt.Sprintf("[%[1]s](#%[2]s \"%[1]s configuration\")", name, lc.Name)
8080
}
8181

82-
if hasSettings(lc.Name) {
83-
name = fmt.Sprintf("%s [%s](#%s)", name, spanWithID(listItemPrefix+lc.Name, "Configuration", "⚙️"), lc.Name)
82+
if lc.OriginalURL != "" {
83+
icon := "<FaGithub size={'0.8rem'} />"
84+
if strings.Contains(lc.OriginalURL, "gitlab") {
85+
icon = "<FaGitlab size={'0.8rem'} />"
86+
}
87+
88+
name = fmt.Sprintf("%s&nbsp;[%s](%s)", name, spanWithID(listItemPrefix+lc.Name, lc.Name+" repository", icon), lc.OriginalURL)
8489
}
8590

8691
if lc.Deprecation == nil {

0 commit comments

Comments
 (0)