craftzdog / dotfiles-public

My personal dotfiles
6.44k stars 1.16k forks source link

Alternative for null-ls #132

Closed ilyaliao closed 1 year ago

ilyaliao commented 1 year ago

Hi Takuya !

Recently, the author of null-ls announced that they will stop maintaining the plugin, and it was archived today..

I'm wondering if you're considering using other plugins to replace null-ls? I've seen suggestions to use formatters like neoformat or formatter for code formatting, As for eslint, Lsp Eslint might be a good option.

Take care and rest well. If you need it, I'll keep an eye on updates in this area and hope to assist you!

craftzdog commented 1 year ago

yeah I'm aware of that - will look into them

Lamarcke commented 1 year ago

I'm currently using nvim-lint and formatter.nvim to achieve the same result. My formatter.nvim config:

return {
    "mhartington/formatter.nvim",
    config = function()
        local formatter = require("formatter")
        local default_formatters = require("formatter.defaults")
        local prettierd = default_formatters.prettierd
        local stylua = default_formatters.stylua
        formatter.setup({
            filetype = {
                javascript = {
                    prettierd
                },
                javascriptreact = {
                    prettierd
                },
                typescript = {
                    prettierd
                },
                typescriptreact = {
                    prettierd
                },
                lua = {
                    stylua
                }
            }

        })
    end
}

My nvim-lint config:

return {
    "mfussenegger/nvim-lint",
    config = function()
        local lint = require("lint")
        lint.linters_by_ft = {
            javascript = {
                "eslint_d"
            },
            typescript = {
                "eslint_d"
            },
            javascriptreact = {
                "eslint_d"
            },
            typescriptreact = {
                "eslint_d"
            }
        }

        -- Autocommand for nvim-lint
        vim.api.nvim_create_autocmd({ "InsertLeave", "BufWritePost" }, {
            callback = function()
                  lint.try_lint()
            end,
        })

    end

}

You should then use :h vim.diagnostic.config to change how diagnostics are displayed.

Both plugins are standalone, so no dependency on external binaries like the efm language server.

ilyaliao commented 1 year ago

I am currently using LSP Eslint, which has been ported from VS Code and includes the EslintFixAll feature, meeting my requirements (I don't use Prettier).

截圖 2023-08-14 下午11 13 17

It provides excellent code actions.

截圖 2023-08-14 下午11 14 02

kuzyo commented 1 year ago

Looks like null_ls is going to be picked by community and developed under this project - https://github.com/nvimtools/none-ls.nvim

craftzdog commented 1 year ago

yep, that's great news! I'm planning to make another video on my recent setup (maybe next month) let me close this for now

kuzyo commented 1 year ago

Eager to check on your new theme 🚀.

harshv5094 commented 1 year ago

yep, that's great news! I'm planning to make another video on my recent setup (maybe next month) let me close this for now

We are very exited to see your new setup.