Skip to content

How to Filter Out Specific Error Code #4239

Closed Answered by qfdk
qfdk asked this question in Q&A
Discussion options

You must be logged in to vote

After interacting with ChatGPT and consulting various documents, I found a viable solution. I'm grateful to the open-source community. Even though nobody directly helped me, the shared knowledge of the open-source community was invaluable.

local function filter_tsserver_diagnostics(_, result, ctx, config)
  if result.diagnostics == nil then
    return
  end
  -- ignore some tsserver diagnostics
  local idx = 1
  while idx <= #result.diagnostics do
    local entry = result.diagnostics[idx]
    -- codes: https://github.com/microsoft/TypeScript/blob/main/src/compiler/diagnosticMessages.json
    if entry.code == 80001 then
      -- { message = "File is a CommonJS module; it may be converted t…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@kalanzimark
Comment options

Answer selected by qfdk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants