{"id":43921489,"url":"https://github.com/davidosomething/format-ts-errors.nvim","last_synced_at":"2026-02-06T22:33:34.949Z","repository":{"id":214351078,"uuid":"629704408","full_name":"davidosomething/format-ts-errors.nvim","owner":"davidosomething","description":"Neovim plugin to format tsserver LSP errors","archived":false,"fork":false,"pushed_at":"2025-03-25T17:06:18.000Z","size":74,"stargazers_count":79,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-25T18:23:44.054Z","etag":null,"topics":["neovim-plugin"],"latest_commit_sha":null,"homepage":"","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/davidosomething.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-04-18T21:27:21.000Z","updated_at":"2025-03-25T17:06:21.000Z","dependencies_parsed_at":"2024-11-07T18:32:49.684Z","dependency_job_id":"f913645e-9bb2-457c-a95f-5c8a88fe70c8","html_url":"https://github.com/davidosomething/format-ts-errors.nvim","commit_stats":null,"previous_names":["davidosomething/format-ts-errors.nvim"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/davidosomething/format-ts-errors.nvim","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidosomething%2Fformat-ts-errors.nvim","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidosomething%2Fformat-ts-errors.nvim/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidosomething%2Fformat-ts-errors.nvim/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidosomething%2Fformat-ts-errors.nvim/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/davidosomething","download_url":"https://codeload.github.com/davidosomething/format-ts-errors.nvim/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidosomething%2Fformat-ts-errors.nvim/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29179420,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-06T22:12:24.066Z","status":"ssl_error","status_checked_at":"2026-02-06T22:12:09.859Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["neovim-plugin"],"created_at":"2026-02-06T22:33:32.352Z","updated_at":"2026-02-06T22:33:34.944Z","avatar_url":"https://github.com/davidosomething.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":"# format-ts-errors.nvim\n\nMake `ts_ls` (the TypeScript LSP) errors a little nicer looking by formatting\nobjects.\n\nThis plugin favors composability and direct API access over doing it for you.\n\n## screenshots\n\n![screenshot 1][screenshot]\n![screenshot 2][screenshot2]\n\n## Installation\n\n**Lazy.nvim** add:\n\n```lua\n{\n    \"davidosomething/format-ts-errors.nvim\"\n}\n```\n\nYou can configure the output with a setup function, e.g.:\n\n````lua\n{\n    \"davidosomething/format-ts-errors.nvim\",\n    config = function()\n      require(\"format-ts-errors\").setup({\n        add_markdown = true, -- wrap output with markdown ```ts ``` markers\n        start_indent_level = 0, -- initial indent\n      })\n    end,\n}\n````\n\nThen in the lsp setup:\n\n```lua\nlocal lspconfig = require(\"lspconfig\")\nlspconfig.tsserver.setup({\n  handlers = {\n    [\"textDocument/publishDiagnostics\"] = function(\n      _,\n      result,\n      ctx,\n      config\n    )\n      if result.diagnostics == nil then\n        return\n      end\n\n      -- ignore some tsserver diagnostics\n      local idx = 1\n      while idx \u003c= #result.diagnostics do\n        local entry = result.diagnostics[idx]\n\n        local formatter = require('format-ts-errors')[entry.code]\n        entry.message = formatter and formatter(entry.message) or entry.message\n\n        -- codes: https://github.com/microsoft/TypeScript/blob/main/src/compiler/diagnosticMessages.json\n        if entry.code == 80001 then\n          -- { message = \"File is a CommonJS module; it may be converted to an ES module.\", }\n          table.remove(result.diagnostics, idx)\n        else\n          idx = idx + 1\n        end\n      end\n\n      vim.lsp.diagnostic.on_publish_diagnostics(\n        _,\n        result,\n        ctx,\n        config\n      )\n    end,\n  },\n})\n```\n\nOr use it in vim.diagnostic.config({ float = { format = function... } })\nAn example can be found in my own dotfiles:\n[https://github.com/davidosomething/dotfiles/commit/ea55d6eb3ba90784f09f9f8652ae3e20a9bdefd7#diff-62fa333ae509823f7ed9ffb0e95acfba597ad6e5644c2a3b72551a6ccc05667dR162-R181]\n\n### Config options\n\n#### start_indent_level\n\n```lua\nstart_indent_level = 0\n```\n\nWill yield:\n\n````markdown\n```ts\nsome code (not indented)\n```\n````\n\nWhereas 1:\n\n```lua\nstart_indent_level = 1\n```\n\nWill yield:\n\n````markdown\n```ts\n  some code (indented)\n```\n````\n\n[screenshot]: https://raw.githubusercontent.com/davidosomething/format-ts-errors.nvim/meta/screenshot.png\n[screenshot2]: https://raw.githubusercontent.com/davidosomething/format-ts-errors.nvim/meta/screenshot-2.png\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidosomething%2Fformat-ts-errors.nvim","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavidosomething%2Fformat-ts-errors.nvim","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidosomething%2Fformat-ts-errors.nvim/lists"}