Neovim: Enable linters

This commit is contained in:
Tony Grosinger 2024-05-30 08:34:45 -07:00
parent 81fe04dd51
commit 37e1f3ed8d

View File

@ -5,14 +5,9 @@ return {
event = { 'BufReadPre', 'BufNewFile' }, event = { 'BufReadPre', 'BufNewFile' },
config = function() config = function()
local lint = require 'lint' local lint = require 'lint'
lint.linters_by_ft = {
markdown = { 'markdownlint' },
}
-- To allow other plugins to add linters to require('lint').linters_by_ft, -- Defining in this format allows other plugins to define linters.
-- instead set linters_by_ft like this: -- require('lint').linters_by_ft
-- lint.linters_by_ft = lint.linters_by_ft or {}
-- lint.linters_by_ft['markdown'] = { 'markdownlint' }
-- --
-- However, note that this will enable a set of default linters, -- However, note that this will enable a set of default linters,
-- which will cause errors unless these tools are available: -- which will cause errors unless these tools are available:
@ -28,7 +23,10 @@ return {
-- terraform = { "tflint" }, -- terraform = { "tflint" },
-- text = { "vale" } -- text = { "vale" }
-- } -- }
-- lint.linters_by_ft['markdown'] = { 'markdownlint' }
lint.linters_by_ft['typescript'] = { 'eslint' }
lint.linters_by_ft['javascript'] = { 'eslint' }
-- You can disable the default linters by setting their filetypes to nil: -- You can disable the default linters by setting their filetypes to nil:
-- lint.linters_by_ft['clojure'] = nil -- lint.linters_by_ft['clojure'] = nil
-- lint.linters_by_ft['dockerfile'] = nil -- lint.linters_by_ft['dockerfile'] = nil