-- ┌                                               ┐
-- │            Formatting, diagnostics            │
-- └                                               ┘
return {
    "nvimtools/none-ls.nvim",
    dependencies = {
        "nvimtools/none-ls-extras.nvim",
    },
    config = function()
        local null_ls = require("null-ls")

        null_ls.setup({
            sources = {
                null_ls.builtins.formatting.stylua,
                null_ls.builtins.formatting.prettier.with({
                    filetypes = {
                        "css",
                        "scss",
                        "less",
                        "html",
                        "json",
                        "yaml",
                        "markdown",
                        "graphql",
                    },
                    extra_args = {
                        "--print-width",
                        "120",
                        "--tab-width",
                        "4",
                        "--bracket-spacing",
                        "true",
                        "--bracket-same-line",
                        "true",
                        "--arrow-parens",
                        "avoid",
                        "--jsx-single-quote",
                        "true",
                        "--trailing-comma",
                        "es5",
                        "--no-semi",
                        "false",
                        "--single-quote",
                        "true",
                        "--single-attribute-per-line",
                        "true",
                        "--bracket-same-line",
                        "true",
                        "--vue-indent-script-and-style",
                        "true",
                    },
                }),
                null_ls.builtins.formatting.shfmt,
                null_ls.builtins.formatting.asmfmt,
                null_ls.builtins.code_actions.proselint,
                require("none-ls.diagnostics.eslint_d"),
                require("none-ls.code_actions.eslint_d"),
                require("none-ls.formatting.eslint_d"),
                null_ls.builtins.formatting.black,
                null_ls.builtins.formatting.clang_format
            },
        })
    end,
}
