From c618402f7c7233ddbf0f90784e1e823c1a0d5d99 Mon Sep 17 00:00:00 2001 From: Micah Effiong Date: Thu, 8 Jun 2023 21:56:21 +0100 Subject: [PATCH] added fix for .js formatting --- lua/custom/plugins/null-ls.lua | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 lua/custom/plugins/null-ls.lua diff --git a/lua/custom/plugins/null-ls.lua b/lua/custom/plugins/null-ls.lua new file mode 100644 index 00000000..d440de60 --- /dev/null +++ b/lua/custom/plugins/null-ls.lua @@ -0,0 +1,23 @@ +-- This fixes JS formatting +-- since the autoformat plugin provided by the kickstart +-- does not support tsserver (see kickstart.plugins.autoformat) +-- this is ment to provide safe formatting using prettier. +-- +-- This could also be extended to support other languages +-- but at the moment it serves a a fix for JS (tsserver) formatting + +return { + 'jose-elias-alvarez/null-ls.nvim', + config = function() + local null_ls = require("null-ls") + local formatter = null_ls.builtins.formatting + + null_ls.setup({ + sources = { + formatter.prettier, + -- null_ls.builtins.diagnostics.eslint, + -- null_ls.builtins.completion.spell, + }, + }) + end +}