mattn / efm-langserver

General purpose Language Server
MIT License
1.37k stars 61 forks source link

How to integrate dotenv-linter with efm-langserver? #124

Open winston0410 opened 3 years ago

winston0410 commented 3 years ago

I am trying to use dotenv-linter with efm-langserver, but I cannot find documentation for custom integration like this. How should I approach this?

I am using nvim with efm-langserver, and this is my current setup:

local linter = {
  lintCommand = 'dotenv-linter',
  lintFormats = {
    '%f:%l %m'
  },
}

return {
  config = linter
}

Right now with this config, I get no error message for linter. This is an example .env that will yield errors. I can confirm that dotenv-linter is working on commandline.

FOO=hello
FOO=bar
FOO=world
petertriho commented 3 years ago

local dotenv_linter = { lintCommand = "dotenv-linter" lintFormats = {"%f:%l %m"} }

I have the same config and it works fine for me. I do have a autocommand to set .env filetype=conf though and conf = {dotenv_linter}