-
-
Notifications
You must be signed in to change notification settings - Fork 290
feat(pack): add prettier pack #1502
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
base: main
Are you sure you want to change the base?
Conversation
Review ChecklistDoes this PR follow the [Contribution Guidelines](development guidelines)? Following is a partial checklist: Proper conventional commit scoping:
|
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as outdated.
This comment was marked as outdated.
It would be better to do this in a separate PR
Have you tested it, per the comment you wrote in the PR desc? @azdanov |
"yaml", | ||
} | ||
|
||
local lsp_rooter_cache, prettierrc_rooter_cache |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are these needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question. I extracted what was there already in the typescript pack without changing much.
return true | ||
end | ||
|
||
local conform_formatter = function(bufnr) return has_prettier(bufnr) and { "prettierd" } or {} end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inline this.
local null_ls_formatter = function(params) | ||
if vim.tbl_contains(format_filetypes, params.filetype) then return has_prettier(params.bufnr) end | ||
return true | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inline this.
I'll test run it again next week at work to make sure nothing breaks during daily usage. I did test it when creating the PR, but maybe things changed or I missed something, since I don't use null-ls at all. |
Issue #1501
📑 Description
Extracted prettier into separate pack. I'm wondering if I should add support for other languages like html, css, yaml, json etc. Maybe via
vim.g.prettier.format_filetypes
?Still need to test it with null_ls and conform to see that it performs similar as before.
ℹ Additional Information