Skip to content

Commit

Permalink
feat(nvim): update none-ls tools
Browse files Browse the repository at this point in the history
  • Loading branch information
AlejandroSuero committed Sep 16, 2024
1 parent e0bf205 commit dee5ea3
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 15 deletions.
2 changes: 2 additions & 0 deletions roles/neovim/files/lua/aome/lsp/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,8 @@ local servers = {

biome = true,

eslint = true,

ts_ls = {
init_options = ts_util.init_options,
cmd = { "typescript-language-server", "--stdio" },
Expand Down
37 changes: 22 additions & 15 deletions roles/neovim/files/lua/custom/plugins/lsp/none-ls.lua
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,18 @@ return {
},
formatting.prettier.with {
condition = function(utils)
return utils.root_has_file { "package-lock.json" }
return utils.root_has_file { "package-lock.json", "pnpm-lock.yaml" }
and not utils.root_has_file { "biome.json", "biome.jsonc" }
end,
},
formatting.prettierd.with {
condition = function(utils)
return utils.root_has_file { "pnpm-lock.yaml" }
return utils.root_has_file { "pnpm-lock.yaml", "package-lock.json" }
and not utils.root_has_file { "biome.json", "biome.jsonc" }
end,
},
formatting.phpcsfixer,

diagnostics.markdownlint.with {
condition = function(utils)
return utils.root_has_file { ".markdownlint.json" }
Expand Down Expand Up @@ -108,27 +110,32 @@ return {
},
diagnostics.selene.with {
condition = function(utils)
return utils.root_has_file { "selene.toml", ".selene.toml" }
return utils.root_has_file { "selene.toml", ".selene.toml" } and not utils.root_has_file { ".luacheckrc" }
end,
},
-- diagnostics.stylua.with {
-- condition = function(utils)
-- return utils.root_has_file { "stylua.toml", ".stylua.toml" }
-- end,
-- },
require("none-ls-luacheck.diagnostics.luacheck").with {
condition = function(utils)
return utils.root_has_file { ".luacheckrc" }
end,
},
require("none-ls.diagnostics.eslint").with {
condition = function(utils)
return utils.root_has_file { "package-lock.json" }
return utils.root_has_file { ".luacheckrc" } and not utils.root_has_file { "selene.toml", ".selene.toml" }
end,
},
require("none-ls.diagnostics.eslint_d").with {
filetypes = {
"javascript",
"typescript",
"javascriptreact",
"typescriptreact",
"astro",
},
condition = function(utils)
return utils.root_has_file { "pnpm-lock.yaml" }
return utils.root_has_file {
".eslintrc.js",
".eslintrc.cjs",
".eslintrc.json",
"eslint.config.js",
"eslint.config.cjs",
"eslint.config.json",
"eslint.config.cjs",
}
end,
},
},
Expand Down

0 comments on commit dee5ea3

Please sign in to comment.