{"record":{"id":"17330738961c2a45","repo":"golangci/golangci-lint","slug":"unknown-linters-v-run-golangci-lint-help-lin","errorCode":null,"errorMessage":"unknown linters: '%v', run 'golangci-lint help linters' to see the list of supported linters","messagePattern":"unknown linters: '(.+?)', run 'golangci-lint help linters' to see the list of supported linters","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/lint/lintersdb/validator.go","lineNumber":64,"sourceCode":"\n\tfor _, name := range cfg.Disable {\n\t\tlcs := v.m.GetLinterConfigs(name)\n\t\tif len(lcs) == 0 {\n\t\t\tunknownNames = append(unknownNames, name)\n\t\t\tcontinue\n\t\t}\n\n\t\tfor _, lc := range lcs {\n\t\t\tif lc.IsDeprecated() && lc.Deprecation.Level > linter.DeprecationWarning {\n\t\t\t\tv.m.log.Warnf(\"The linter %q is deprecated (step 2) and deactivated. \"+\n\t\t\t\t\t\"It should be removed from the list of disabled linters. \"+\n\t\t\t\t\t\"https://golangci-lint.run/docs/product/roadmap/#linter-deprecation-cycle\", lc.Name())\n\t\t\t}\n\t\t}\n\t}\n\n\tif len(unknownNames) > 0 {\n\t\treturn fmt.Errorf(\"unknown linters: '%v', run 'golangci-lint help linters' to see the list of supported linters\",\n\t\t\tstrings.Join(unknownNames, \",\"))\n\t}\n\n\treturn nil\n}\n\nfunc (v Validator) alternativeNamesDeprecation(cfg *config.Linters) error {\n\tif v.m.cfg.InternalTest || v.m.cfg.InternalCmdTest || os.Getenv(logutils.EnvTestRun) == \"1\" {\n\t\treturn nil\n\t}\n\n\taltNames := map[string][]string{}\n\tfor _, lc := range v.m.GetAllSupportedLinterConfigs() {\n\t\tfor _, alt := range lc.AlternativeNames {\n\t\t\taltNames[alt] = append(altNames[alt], lc.Name())\n\t\t}\n\t}\n","sourceCodeStart":46,"sourceCodeEnd":82,"githubUrl":"https://github.com/golangci/golangci-lint/blob/ed7a235d2d771152056fdc142a9855567c5796a9/pkg/lint/lintersdb/validator.go#L46-L82","documentation":"validateLintersNames checks every linter name requested via config (`linters.enable`, CLI flags, presets) against the registry of known linters and formatters. If any name is not registered, golangci-lint aborts before running and lists all unknown names. This guards against silent no-op configuration from typos or removed linters.","triggerScenarios":"Running golangci-lint with `linters.enable`/`disable` entries (or `--enableX` flags) containing a name that no linter in the built-in registry or loaded plugins matches; the error message joins all unknown names with commas.","commonSituations":"Typo in .golangci.yml linter name; linter removed or renamed in a newer golangci-lint version (e.g. renamed deprecated linters); custom linter from a plugin not compiled/loaded; copying config between projects with different golangci-lint versions.","solutions":["Run `golangci-lint help linters` to list supported linters and compare with the names in your config/flags","Fix typos or remove the unknown name from .golangci.yml (`linters.enable`, `linters.disable`) or the --enable/--disable flags","If the linter was deprecated, check the deprecation roadmap (linked in the source) for its replacement","If it is a custom linter, ensure the plugin is built and referenced correctly in the `linters-settings`/plugin configuration for your golangci-lint build"],"exampleFix":"// before (.golangci.yml)\nlinters:\n  enable:\n    - goerr113   # unknown in current version\n// after\nlinters:\n  enable:\n    - err113     # renamed linter","handlingStrategy":"validation","validationCode":"// Validate linter names before writing them into config / running:\n// $ golangci-lint help linters\nconst known = new Set(execSync('golangci-lint help linters --format json').toString().trim().split('\\n'));\nconst requested = ['gofmt', 'err113', 'my-typo'];\nconst unknown = requested.filter(n => !known.has(n));\nif (unknown.length) throw new Error(`unknown linters: ${unknown.join(',')}`);","typeGuard":"function isKnownLinter(name, knownSet) {\n  return typeof name === 'string' && knownSet.has(name);\n}","tryCatchPattern":null,"preventionTips":["After upgrading golangci-lint, run `golangci-lint config verify` in CI","Pin linter names to the output of `golangci-lint help linters` for your exact version","Check the deprecation roadmap before enabling a linter mentioned in old docs","Keep plugin-based custom linters' build/load config in sync with the golangci-lint version"],"tags":["golangci-lint","configuration","linters"],"backgroundTag":"unknown-linter-name","analyzedSha":"ed7a235d2d771152056fdc142a9855567c5796a9","analyzedAt":"2026-09-02T18:47:33.865Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}