From 4ae31efe12219c3654babc4aa3191f60a098f4a1 Mon Sep 17 00:00:00 2001 From: Fernandez Ludovic Date: Thu, 13 Mar 2025 16:55:08 +0100 Subject: [PATCH] feat: error if typecheck is enabled or disabled --- pkg/config/loader.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkg/config/loader.go b/pkg/config/loader.go index 25e985e11231..f3c87af07ebc 100644 --- a/pkg/config/loader.go +++ b/pkg/config/loader.go @@ -60,6 +60,14 @@ func (l *Loader) Load(opts LoadOptions) error { l.cfg.Linters.Exclusions.Generated = GeneratedModeStrict } + if !l.cfg.InternalCmdTest { + for _, n := range slices.Concat(l.cfg.Linters.Enable, l.cfg.Linters.Disable) { + if n == "typecheck" { + return fmt.Errorf("%s is not a linter, it cannot be enabled or disabled", n) + } + } + } + l.handleFormatters() if opts.CheckDeprecation {