poc with local prettier working

This commit is contained in:
christianchiarulli 2021-07-13 00:48:37 -04:00
parent 4fad35a7e1
commit eceb656b4b
7 changed files with 86 additions and 42 deletions

View file

@ -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