Skip to content
This repository has been archived by the owner on Jul 17, 2022. It is now read-only.

Help with ESLint diagnostics #75

Discussion options

You must be logged in to vote

Your guess is correct. null-ls uses .git as a root pattern marker and uses that as its cwd when spawning processes. In this case ESLint isn't smart enough to search for tsconfig.json upwards from the current file's path, so it errors out when it can't find one at the root.

I tried setting up a similar structure locally, and I think we can solve this with the new cwd option that was just added to null-ls:

on_attach = function(client, bufnr)
    require("nvim-lsp-ts-utils").setup({
        eslint_opts = {
            cwd = function(params)
                return require("lspconfig.util").root_pattern("tsconfig.json")(params.bufname)
            end,
        },
    })
end

Can you update to t…

Replies: 3 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@jose-elias-alvarez
Comment options

@onosendi
Comment options

Answer selected by onosendi
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