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
|
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
|
-- STEP 1: BOOTSTRAP LAZY.NVIM
|
||||||
-- ============================================================================
|
-- ============================================================================
|
||||||
|
|||||||
@@ -14,14 +14,14 @@ return {
|
|||||||
require("mason-lspconfig").setup({
|
require("mason-lspconfig").setup({
|
||||||
ensure_installed = {
|
ensure_installed = {
|
||||||
"pyright", -- Python
|
"pyright", -- Python
|
||||||
"tsserver", -- TypeScript/JavaScript
|
"ts_ls", -- TypeScript/JavaScript
|
||||||
"jsonls", -- JSON
|
"jsonls", -- JSON
|
||||||
"yamlls", -- YAML
|
"yamlls", -- YAML
|
||||||
"html", -- HTML
|
"html", -- HTML
|
||||||
"cssls", -- CSS
|
"cssls", -- CSS
|
||||||
"bashls", -- Bash
|
"bashls", -- Bash
|
||||||
"lua_ls", -- Lua
|
"lua_ls", -- Lua
|
||||||
"stylua",
|
--"stylua",
|
||||||
},
|
},
|
||||||
automatic_enable = true,
|
automatic_enable = true,
|
||||||
})
|
})
|
||||||
@@ -55,7 +55,7 @@ return {
|
|||||||
})
|
})
|
||||||
|
|
||||||
-- Type- and JavaScript
|
-- Type- and JavaScript
|
||||||
vim.lsp.config("tsserver", {
|
vim.lsp.config("ts_ls", {
|
||||||
settings = {
|
settings = {
|
||||||
typescript = {
|
typescript = {
|
||||||
inlayHints = {
|
inlayHints = {
|
||||||
@@ -92,7 +92,7 @@ return {
|
|||||||
-- Enable servers
|
-- Enable servers
|
||||||
vim.lsp.enable("lua_ls")
|
vim.lsp.enable("lua_ls")
|
||||||
vim.lsp.enable("pyright")
|
vim.lsp.enable("pyright")
|
||||||
vim.lsp.enable("tsserver")
|
vim.lsp.enable("ts_ls")
|
||||||
vim.lsp.enable("jsonls")
|
vim.lsp.enable("jsonls")
|
||||||
vim.lsp.enable("yamlls")
|
vim.lsp.enable("yamlls")
|
||||||
vim.lsp.enable("html")
|
vim.lsp.enable("html")
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
return {
|
return {
|
||||||
"nvimtools/none-ls.nvim",
|
"nvimtools/none-ls.nvim",
|
||||||
|
"nvimtools/none-ls-extras.nvim",
|
||||||
config = function()
|
config = function()
|
||||||
local null_ls = require("null-ls")
|
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({
|
null_ls.setup({
|
||||||
sources = {
|
sources = {
|
||||||
@@ -10,10 +12,10 @@ return {
|
|||||||
null_ls.builtins.formatting.black,
|
null_ls.builtins.formatting.black,
|
||||||
null_ls.builtins.diagnostics.black,
|
null_ls.builtins.diagnostics.black,
|
||||||
null_ls.builtins.formatting.prettier,
|
null_ls.builtins.formatting.prettier,
|
||||||
null_ls.builtins.diagnostics.eslint,
|
|
||||||
null_ls.builtins.formatting.eslint,
|
|
||||||
null_ls.builtins.formatting.shfmt,
|
null_ls.builtins.formatting.shfmt,
|
||||||
null_ls.builtins.diagnostics.shellcheck,
|
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