mirror of
https://github.com/LunarVim/LunarVim.git
synced 2025-08-03 09:35:26 +02:00
poc with local prettier working
This commit is contained in:
parent
4fad35a7e1
commit
eceb656b4b
7 changed files with 86 additions and 42 deletions
|
@ -1,3 +1,24 @@
|
|||
vim.cmd "let proj = FindRootDirectory()"
|
||||
print(vim.api.nvim_get_var "proj")
|
||||
local root_dir = vim.api.nvim_get_var "proj"
|
||||
O.formatters.filetype["javascriptreact"] = {
|
||||
-- vim.cmd "let root_dir "
|
||||
-- prettier
|
||||
function()
|
||||
return {
|
||||
exe = root_dir .. "/node_modules/.bin/prettier",
|
||||
-- TODO: append to this for args don't overwrite
|
||||
args = { "--stdin-filepath", vim.api.nvim_buf_get_name(0), "--single-quote" },
|
||||
stdin = true,
|
||||
}
|
||||
end,
|
||||
}
|
||||
|
||||
require("formatter.config").set_defaults {
|
||||
logging = false,
|
||||
filetype = O.formatters.filetype,
|
||||
}
|
||||
|
||||
if require("lv-utils").check_lsp_client_active "tsserver" then
|
||||
return
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue