diff --git a/vim/lua/formatter_config.lua b/vim/lua/formatter_config.lua index 2a39c97..3ad391c 100644 --- a/vim/lua/formatter_config.lua +++ b/vim/lua/formatter_config.lua @@ -1,6 +1,6 @@ local prettier = function() return { - exe = Get_project_node_modules_path() .. "/.bin/prettier", + exe = vim.fn.getcwd() .. "/node_modules/.bin/prettier", args = { "--stdin-filepath", vim.api.nvim_buf_get_name(0), "--single-quote" }, stdin = true, } diff --git a/vim/lua/helpers.lua b/vim/lua/helpers.lua index 6b049ff..9db7bcf 100644 --- a/vim/lua/helpers.lua +++ b/vim/lua/helpers.lua @@ -1,16 +1,3 @@ --- Return the node_modules path for this project. If the project root contains a --- frontend/ directory, assume node_modules lives there. -function Get_project_node_modules_path() - local root_path = vim.fn.getcwd() - local frontend_path = root_path .. "/frontend" - local is_frontend = vim.fn.isdirectory(frontend_path) ~= 0 - local base_path = root_path - if is_frontend then - base_path = frontend_path - end - return base_path .. "/node_modules" -end - -- Return the project's go module path from go.mod, or an empty string if the file cannot be read. function Get_project_go_module_path() local root_path = vim.fn.getcwd()