Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Help] Use 1 eslint server for code actions, diagnostics and formatting #21

Open
Ajaymamtora opened this issue Nov 3, 2024 · 0 comments

Comments

@Ajaymamtora
Copy link

At the moment Ive setup my sources like:

    require("none-ls.diagnostics.eslint").with({
      command = "eslint",
      args = { "-f", "json", "--stdin", "--stdin-filename", "$FILENAME" },
      to_stdin = true,
      format = "json_raw",
      check_exit_code = function(code)
        return code <= 1
      end,
      cwd = function()
        return eslint_override_cwd
      end,
    }),

    require("none-ls.code_actions.eslint").with({
      generator_opts = {
        command = "eslint",
        args = { "-f", "json", "--stdin", "--stdin-filename", "$FILENAME" },
        to_stdin = true,
        format = "json_raw",
        check_exit_code = { 0, 1 },
        cwd = function()
          return eslint_override_cwd
        end,
      }
    }),

    null_ls.builtins.formatting.uncrustify.with({
      args = function(params)
        local config_path = _G.__os.home .. "/.config/uncrustify/config.cfg"
        local format_type = "-l " .. params.ft:upper()
        return { "-c", config_path, "-q", format_type }
      end,
    }),

But I dont want to spawn 3 eslint instances. Surely theres a way to use just one?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant