-- plugins/mason.lua
return {
  {
    "williamboman/mason.nvim",
    lazy = false,
    config = function()
      require("mason").setup()
    end,
  },
  {
    "williamboman/mason-lspconfig.nvim",
    lazy = false,
    opts = {
      auto_install = true,
      ensure_installed = {
        "lua_ls",
        "pyright",
        "emmet_ls",
        "bashls",
        "ts_ls",
        "solargraph",
        "html",
        "texlab",
        "ltex",
        "dockerls",
        "yamlls",
        "taplo",
      },
    },
  },
  {
    "WhoIsSethDaniel/mason-tool-installer.nvim",
    lazy = false,
    dependencies = { "williamboman/mason.nvim" },
    opts = {
      ensure_installed = {
        -- linters
        "jsonlint",
        "yamllint",
        "shellcheck",
        "stylelint",
        "htmlhint",
        "hadolint",
        -- "eslint_d",
        "rubocop",
        "markdownlint",
        -- formatters (optional)
        -- "black",
        "stylua",
        "shfmt",
        "prettier",
      },
      auto_update = true,
      run_on_start = true,
    },
    config = function(_, opts)
      require("mason-tool-installer").setup(opts)
    end,
  },
}
