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

Breaking changes #87

Open
Open
@jose-elias-alvarez

Description

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.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions