Skip to content

Commit a438c38

Browse files
committed
Update spelling list and use eslint LSP instead of eslint_d
1 parent 084fc4a commit a438c38

File tree

3 files changed

+18
-14
lines changed

3 files changed

+18
-14
lines changed

home/.config/nvim/lua/plugin-config/lsp/init.lua

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ local servers = {
3737
"tailwindcss",
3838
"graphql",
3939
"dockerls",
40+
41+
--------------
42+
-- Linting / Formatting
43+
-- null_ls not needed for these
44+
"eslint"
4045
}
4146

4247

@@ -45,9 +50,6 @@ local servers = {
4550
-- https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md
4651
---------------------------
4752
local mySettings = {
48-
eslint = {
49-
format = true,
50-
},
5153
tailwindcss = {
5254
tailwindCSS = {
5355
includeLanguages = {
@@ -135,6 +137,15 @@ for _, serverName in ipairs(servers) do
135137
keymap(bufnr)
136138
end
137139
})
140+
elseif (serverName == 'eslint') then
141+
server.setup({
142+
on_attach = function(client, bufnr)
143+
vim.api.nvim_create_autocmd("BufWritePre", {
144+
buffer = bufnr,
145+
command = "EslintFixAll",
146+
})
147+
end,
148+
})
138149
else
139150
server.setup({
140151
capabilities = capabilities,

home/.config/nvim/lua/plugin-config/lsp/integrations.lua

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
--
66
-- Be sure to :checkhealth to see if any underlying tools are missing
77
--
8-
-- pnpm add --global eslint_d @fsouza/prettierd cspell typescript
8+
-- pnpm add --global @fsouza/prettierd cspell typescript
99
--
1010
---------------------------------------------------------
1111
local null_ls = require('null-ls')
@@ -17,6 +17,7 @@ local lsp_formatting = function(buffer)
1717
filter = function(client)
1818
-- By default, ignore any formatters provider by other LSPs
1919
-- (such as those managed via lspconfig or mason)
20+
-- Also "eslint as a formatter" doesn't work :(
2021
return client.name == "null-ls"
2122
end,
2223
bufnr = buffer,
@@ -45,15 +46,7 @@ end
4546

4647
null_ls.setup({
4748
sources = {
48-
-- ESlint, but faster (daemonized)
49-
-- Install eslint_d globally -- it'll defer to local eslint
50-
null_ls.builtins.diagnostics.eslint_d.with({
51-
filetypes = { "javascript", "typescript", "javascript.glimmer", "typescript.glimmer" }
52-
}),
53-
null_ls.builtins.formatting.eslint_d.with({
54-
filetypes = { "javascript", "typescript", "javascript.glimmer", "typescript.glimmer" }
55-
}),
56-
-- Same for prettier
49+
-- Prettier, but faster (daemonized)
5750
null_ls.builtins.formatting.prettierd.with({
5851
filetypes = {
5952
"css", "json", "jsonc","javascript", "typescript",

home/.cspell.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"words":["nvim","statusline","treesitter","autopairs","keymap","tailwindcss","neovim","daemonized","lspconfig","builtins","checkhealth","pnpm","augroup","bufnr","dotfiles","nullvoxpopuli","Passwordless","Yubikey","envfile","noninteractive","Ryzen"],"version":"0.2","language":"en","flagWords":[],"ignorePaths":["node_modules\/**","dist\/**",".git\/**","tmp\/**","declarations\/**"]}
1+
{"words":["nvim","statusline","treesitter","autopairs","keymap","tailwindcss","neovim","daemonized","lspconfig","builtins","checkhealth","pnpm","augroup","bufnr","dotfiles","nullvoxpopuli","Passwordless","Yubikey","envfile","noninteractive","Ryzen","glimdown","instanceof","unidirectionally","codemirror","tabindex","fontawesome","fortawesome","runloop","iframe","Statecharts","xstate","qunit","htmlbars","statechart","concat","keydown","cosmiconfig"],"language":"en","version":"0.2","ignorePaths":["node_modules\/**","dist\/**",".git\/**","tmp\/**","declarations\/**"],"flagWords":[]}

0 commit comments

Comments
 (0)