craftzdog / dotfiles-public

My personal dotfiles

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Alternative for null-ls

CofCat456 opened this issue · comments

commented

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!

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

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.

commented

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

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

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

Eager to check on your new theme 🚀.

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.