{"record":{"id":"6355323267373355","repo":"golangci/golangci-lint","slug":"s-is-not-a-linter-it-cannot-be-enabled-or-disabl","errorCode":null,"errorMessage":"%s is not a linter, it cannot be enabled or disabled","messagePattern":"(.+?) is not a linter, it cannot be enabled or disabled","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/config/loader.go","lineNumber":89,"sourceCode":"\t}\n\n\tif l.mode == modeLinters {\n\t\tl.applyStringSliceHack()\n\t}\n\n\tif l.cfg.Linters.Exclusions.Generated == \"\" {\n\t\tl.cfg.Linters.Exclusions.Generated = GeneratedModeStrict\n\t}\n\n\terr = l.checkConfigurationVersion()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif !l.cfg.InternalCmdTest {\n\t\tfor _, n := range slices.Concat(l.cfg.Linters.Enable, l.cfg.Linters.Disable) {\n\t\t\tif n == \"typecheck\" {\n\t\t\t\treturn fmt.Errorf(\"%s is not a linter, it cannot be enabled or disabled\", n)\n\t\t\t}\n\t\t}\n\t}\n\n\tl.handleFormatters()\n\n\tif opts.CheckDeprecation {\n\t\terr = l.handleDeprecation()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tl.handleFormatterDeprecations()\n\t}\n\n\tl.handleGoVersion()\n\n\terr = goutil.CheckGoVersion(l.cfg.Run.Go)","sourceCodeStart":71,"sourceCodeEnd":107,"githubUrl":"https://github.com/golangci/golangci-lint/blob/ed7a235d2d771152056fdc142a9855567c5796a9/pkg/config/loader.go#L71-L107","documentation":"Loader.Load rejects 'typecheck' in linters.enable or linters.disable because typecheck is an internal analysis stage, not an enableable linter. This is common when migrating v1 configs, where typecheck could be listed.","triggerScenarios":"Config containing 'typecheck' under linters.enable or linters.disable, or the --enable/-E CLI flag passing typecheck (skipped only when InternalCmdTest is set).","commonSituations":"v1-to-v2 config migration leftovers; old CI scripts with golangci-lint run -E typecheck; copy-pasted deprecated config examples.","solutions":["Remove 'typecheck' from linters.enable and linters.disable in the config","Remove typecheck from the -E/--enable CLI flags in scripts/CI","Rely on the fact that typechecking always runs implicitly"],"exampleFix":"# before\nlinters:\n  enable:\n    - typecheck\n    - staticcheck\n# after\nlinters:\n  enable:\n    - staticcheck","handlingStrategy":"validation","validationCode":"for _, n := range append(cfg.Linters.Enable, cfg.Linters.Disable...) {\n\tif n == \"typecheck\" {\n\t\treturn errors.New(\"typecheck is internal; remove it from enable/disable\")\n\t}\n}","typeGuard":null,"tryCatchPattern":"if err := loader.Load(ctx); err != nil {\n\tif strings.Contains(err.Error(), \"typecheck\") {\n\t\tlog.Fatal(\"remove typecheck from linters config\")\n\t}\n}","preventionTips":["Never add typecheck to -E/--enable flags or linters lists","Strip legacy v1 entries when migrating","Grep configs and CI scripts for 'typecheck' after upgrading"],"tags":["golangci-lint","config-validation","migration"],"backgroundTag":"reserved-linter-name","analyzedSha":"ed7a235d2d771152056fdc142a9855567c5796a9","analyzedAt":"2026-09-02T18:47:33.865Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}