some fixes for JS/ TS
This commit is contained in:
@@ -1 +1,9 @@
|
||||
sudo pacman -S nodejs npm starship fastfetch tree-sitter-cli
|
||||
sudo pacman -S --needed \
|
||||
nodejs \
|
||||
npm \
|
||||
starship \
|
||||
fastfetch \
|
||||
tree-sitter-cli
|
||||
|
||||
npm install -g vscode-js-debug
|
||||
npm install -g eslint_d
|
||||
|
||||
@@ -8,6 +8,16 @@
|
||||
4. Set global keymaps and LSP keymaps
|
||||
]]
|
||||
|
||||
-- ============================================================================
|
||||
-- STEP 0: SETUP NODE PATH (for fnm)
|
||||
-- ============================================================================
|
||||
local fnm_current = vim.fn.trim(vim.fn.system("fnm current 2>/dev/null"))
|
||||
if fnm_current ~= "" then
|
||||
local fnm_dir = vim.fn.expand("~/.local/share/fnm")
|
||||
local fnm_bin_path = fnm_dir .. "/node-versions/" .. fnm_current .. "/installation/bin"
|
||||
vim.env.PATH = fnm_bin_path .. ":" .. vim.env.PATH
|
||||
end
|
||||
|
||||
-- ============================================================================
|
||||
-- STEP 1: BOOTSTRAP LAZY.NVIM
|
||||
-- ============================================================================
|
||||
|
||||
@@ -14,14 +14,14 @@ return {
|
||||
require("mason-lspconfig").setup({
|
||||
ensure_installed = {
|
||||
"pyright", -- Python
|
||||
"tsserver", -- TypeScript/JavaScript
|
||||
"ts_ls", -- TypeScript/JavaScript
|
||||
"jsonls", -- JSON
|
||||
"yamlls", -- YAML
|
||||
"html", -- HTML
|
||||
"cssls", -- CSS
|
||||
"bashls", -- Bash
|
||||
"lua_ls", -- Lua
|
||||
"stylua",
|
||||
--"stylua",
|
||||
},
|
||||
automatic_enable = true,
|
||||
})
|
||||
@@ -55,7 +55,7 @@ return {
|
||||
})
|
||||
|
||||
-- Type- and JavaScript
|
||||
vim.lsp.config("tsserver", {
|
||||
vim.lsp.config("ts_ls", {
|
||||
settings = {
|
||||
typescript = {
|
||||
inlayHints = {
|
||||
@@ -92,7 +92,7 @@ return {
|
||||
-- Enable servers
|
||||
vim.lsp.enable("lua_ls")
|
||||
vim.lsp.enable("pyright")
|
||||
vim.lsp.enable("tsserver")
|
||||
vim.lsp.enable("ts_ls")
|
||||
vim.lsp.enable("jsonls")
|
||||
vim.lsp.enable("yamlls")
|
||||
vim.lsp.enable("html")
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
return {
|
||||
"nvimtools/none-ls.nvim",
|
||||
"nvimtools/none-ls-extras.nvim",
|
||||
config = function()
|
||||
local null_ls = require("null-ls")
|
||||
local eslint_path = "/home/mathias/.local/share/fnm/node-versions/v25.8.1/installation/bin/eslint"
|
||||
|
||||
null_ls.setup({
|
||||
sources = {
|
||||
@@ -10,10 +12,10 @@ return {
|
||||
null_ls.builtins.formatting.black,
|
||||
null_ls.builtins.diagnostics.black,
|
||||
null_ls.builtins.formatting.prettier,
|
||||
null_ls.builtins.diagnostics.eslint,
|
||||
null_ls.builtins.formatting.eslint,
|
||||
null_ls.builtins.formatting.shfmt,
|
||||
null_ls.builtins.diagnostics.shellcheck,
|
||||
require("none-ls.diagnostics.eslint_d").with({ command = eslint_path }),
|
||||
require("none-ls.formatting.eslint_d").with({ command = eslint_path }),
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user