fix(nvim): remove Get_project_node_modules_path()

This commit is contained in:
Rob Watson 2023-10-01 08:09:02 +02:00
parent 7c1ab65e48
commit 9535194a33
2 changed files with 1 additions and 14 deletions

View File

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

View File

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