Skip to content
This repository has been archived by the owner on Jul 17, 2022. It is now read-only.

Breaking changes #87

Open
jose-elias-alvarez opened this issue Nov 17, 2021 · 1 comment
Open

Breaking changes #87

jose-elias-alvarez opened this issue Nov 17, 2021 · 1 comment

Comments

@jose-elias-alvarez
Copy link
Owner

jose-elias-alvarez commented Nov 17, 2021

84fa70c deprecates this plugin's null-ls integrations (and ef4f4ac removes them completely).

Since I spun null-ls off from this plugin, I've received requests from users who wanted to configure the sources included here separately. It's now possible to set up diagnostics, formatting, and ESLint code actions exclusively via null-ls. As a result, I've deprecated the integrations here.

To replicate the previous functionality and migrate to the null-ls API (the recommended option), remove all ESLint / formatter-related settings from your nvim-lsp-ts-utils config and use the following as a basis:

local null_ls = require("null-ls")
null_ls.config({
    sources = {
        null_ls.builtins.diagnostics.eslint.with({ -- eslint or eslint_d
            prefer_local = "node_modules/.bin",
        }),
        null_ls.builtins.code_actions.eslint.with({ -- eslint or eslint_d
            prefer_local = "node_modules/.bin",
        }),
        null_ls.builtins.formatting.prettier.with({ -- prettier, eslint, eslint_d, or prettierd
            prefer_local = "node_modules/.bin",
        }),
    },
})
require("lspconfig")["null-ls"].setup({ on_attach = on_attach })

This will register sources for diagnostics, formatting, and code actions that automatically use project-local executables when available and fall back to global executables. Other options you may have set in eslint_opts / formatter_opts can now be passed directly into with.

You can use your plugin manager to pin to 825630a, the last commit before the deprecation, but you won't receive further updates, so I recommend migrating.

You may also want to consider migrating to the ESLint language server, which can also provide ESLint diagnostics, code actions, and formatting. I've personally switched and find it fast and stable enough to use for daily work.

I hope that shifting integrations entirely to null-ls can help this plugin stay focused and continue to grow. In the future, I'd like to make it a "full" LSP plugin like rust-tools.nvim that automatically sets up tsserver + additional functionality, and removing the burden of coordinating integrations with another plugin will help.

@jose-elias-alvarez jose-elias-alvarez pinned this issue Nov 17, 2021
Gelio added a commit to Gelio/ubuntu-dotfiles that referenced this issue Nov 18, 2021
ESLint and prettier support are deprecated in nvim-lsp-ts-utils. I was
not using them anyway, so it makes sense to remove them.

See jose-elias-alvarez/nvim-lsp-ts-utils#87
@jose-elias-alvarez jose-elias-alvarez changed the title Breaking changes and deprecation of null-ls integrations Breaking changes Dec 13, 2021
@jose-elias-alvarez
Copy link
Owner Author

6279636 switches to the new vim.diagnostic API. As a consequence, the plugin now depends on Neovim 0.6.0.

If you don't want to or cannot update, you can pin the plugin to 7c52536, but Neovim 0.6.0 contains a lot of improvements, so you should aim to update as soon as you can.

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

No branches or pull requests

1 participant