Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conditional registration of linter/formatter for same language #175

Open
Nargonath opened this issue Sep 29, 2021 · 2 comments
Open

Conditional registration of linter/formatter for same language #175

Nargonath opened this issue Sep 29, 2021 · 2 comments

Comments

@Nargonath
Copy link

First, I'd like to thank you for the great tool.

I was not able to figure out if that's something you can already do with efm either from the issues section or the documentation. To give you a bit more context, I use NeoVim on some JavaScript projects for different companies. Some of them use eslint to lint/format their codebase and other relies on prettier as their formatter. Is there a way to give to efm multiple formatters configuration for the same language and decide based on criteria which one should be used?

FWIW I know null_ls has a similar feature: https://github.com/jose-elias-alvarez/null-ls.nvim/blob/main/doc/BUILTINS.md#conditional-registration.

@Nargonath Nargonath changed the title Multiple formatter for same language conditionally applied Conditional registration of linter/formatter for same language Sep 29, 2021
@atrautsch
Copy link
Contributor

Would something like #112 be enough for your use case?

@Nargonath
Copy link
Author

Yes that would work. I was going to say that it'd be great if we could also support passing a callback to implement whatever logic the user wants but I guess it would not be compatible with the efm's YAML config format.

One thing perhaps that would be problematic with the proposal you referred to, is where a project uses prettier as a formatter and eslint as a linter, but in other cases also eslint as both linter and formatter. Can you declare multiple configuration of eslint for the same language? 🤔

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

No branches or pull requests

2 participants