From cbfbac83ac416318fd6a64e7f88e63d5c0a2e52e Mon Sep 17 00:00:00 2001 From: Fernandez Ludovic Date: Sat, 29 Mar 2025 17:50:08 +0100 Subject: [PATCH 1/3] docs: improve default exclusions render --- .../gatsby-theme-docs/src/styles/global.js | 1 + .../website/expand_templates/exclusions.go | 34 +++++++++++-------- 2 files changed, 20 insertions(+), 15 deletions(-) diff --git a/docs/src/@rocketseat/gatsby-theme-docs/src/styles/global.js b/docs/src/@rocketseat/gatsby-theme-docs/src/styles/global.js index f1a5617fe722..6b6a61d464f9 100644 --- a/docs/src/@rocketseat/gatsby-theme-docs/src/styles/global.js +++ b/docs/src/@rocketseat/gatsby-theme-docs/src/styles/global.js @@ -66,6 +66,7 @@ export default function GlobalStyle() { font-weight: 400; } + span.inline-code, code.inline-code { display: inline-block; vertical-align: middle; diff --git a/scripts/website/expand_templates/exclusions.go b/scripts/website/expand_templates/exclusions.go index 99638b72d39a..daff065a96ca 100644 --- a/scripts/website/expand_templates/exclusions.go +++ b/scripts/website/expand_templates/exclusions.go @@ -11,21 +11,25 @@ import ( const exclusionTmpl = `{{- $tick := "` + "`" + `" -}} {{- range $name, $rules := . }} ### {{ $tick }}{{ $name }}{{ $tick }} -{{ range $rule := $rules }} -{{ $tick }}{{ range $linter := $rule.Linters }}{{ $linter }}{{ end }}{{ $tick }}: -{{ if $rule.Path -}} -- Path: {{ $tick }}{{ $rule.Path }}{{ $tick }} -{{ end -}} -{{ if $rule.PathExcept -}} -- Path Except: {{ $tick }}{{ $rule.PathExcept }}{{ $tick }} -{{ end -}} -{{ if $rule.Text -}} -- Text: {{ $tick }}{{ $rule.Text }}{{ $tick }} -{{ end -}} -{{ if $rule.Source -}} -- Source: {{ $tick }}{{ $rule.Source }}{{ $tick }} -{{ end -}} -{{ end }}{{ end }}` + + + + + + + + + +{{- range $rule := $rules }} + + + + +{{- end }} + +
linterIssue Text
{{ range $linter := $rule.Linters }}{{ $linter }}{{ end }}{{ if $rule.Text }}{{ $rule.Text }}{{ end }}
+ +{{ end }}` func getExclusionPresets() (string, error) { linterExclusionPresets, err := readJSONFile[map[string][]types.ExcludeRule](filepath.Join("assets", "exclusion-presets.json")) From 44aa9ca168a1af199b8cb89f3ff781a73a0bd67a Mon Sep 17 00:00:00 2001 From: Fernandez Ludovic Date: Sat, 29 Mar 2025 17:56:43 +0100 Subject: [PATCH 2/3] docs: improve --- scripts/website/expand_templates/exclusions.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/website/expand_templates/exclusions.go b/scripts/website/expand_templates/exclusions.go index daff065a96ca..aa64e1d5ec7f 100644 --- a/scripts/website/expand_templates/exclusions.go +++ b/scripts/website/expand_templates/exclusions.go @@ -10,12 +10,12 @@ import ( const exclusionTmpl = `{{- $tick := "` + "`" + `" -}} {{- range $name, $rules := . }} -### {{ $tick }}{{ $name }}{{ $tick }} +### Preset {{ $tick }}{{ $name }}{{ $tick }} - + From e3218742b97b0708307c8b34fd5118e5985b8266 Mon Sep 17 00:00:00 2001 From: Fernandez Ludovic Date: Mon, 31 Mar 2025 17:02:22 +0200 Subject: [PATCH 3/3] nitpick --- scripts/website/expand_templates/exclusions.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/website/expand_templates/exclusions.go b/scripts/website/expand_templates/exclusions.go index aa64e1d5ec7f..b84cae8a1b03 100644 --- a/scripts/website/expand_templates/exclusions.go +++ b/scripts/website/expand_templates/exclusions.go @@ -26,7 +26,7 @@ const exclusionTmpl = `{{- $tick := "` + "`" + `" -}} {{- end }} - +
linterLinter Issue Text
{{ if $rule.Text }}{{ $rule.Text }}{{ end }}
{{ end }}`