Skip to content

Commit a4d72a6

Browse files
committed
things
1 parent eadd71a commit a4d72a6

File tree

2 files changed

+12
-33
lines changed

2 files changed

+12
-33
lines changed

init.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ vim.g.have_nerd_font = true
102102
vim.opt.number = true
103103
-- You can also add relative line numbers, to help with jumping.
104104
-- Experiment for yourself to see if you like it!
105-
-- vim.opt.relativenumber = true
105+
vim.opt.relativenumber = true
106106

107107
-- Enable mouse mode, can be useful for resizing splits for example!
108108
vim.opt.mouse = 'a'

lua/kickstart/plugins/lint.lua

Lines changed: 11 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
return {
2-
32
{ -- Linting
43
'mfussenegger/nvim-lint',
54
event = { 'BufReadPre', 'BufNewFile' },
@@ -13,37 +12,17 @@ return {
1312
typescriptreact = { 'eslint' },
1413
}
1514

16-
-- To allow other plugins to add linters to require('lint').linters_by_ft,
17-
-- instead set linters_by_ft like this:
18-
-- lint.linters_by_ft = lint.linters_by_ft or {}
19-
-- lint.linters_by_ft['markdown'] = { 'markdownlint' }
20-
--
21-
-- However, note that this will enable a set of default linters,
22-
-- which will cause errors unless these tools are available:
23-
-- {
24-
-- clojure = { "clj-kondo" },
25-
-- dockerfile = { "hadolint" },
26-
-- inko = { "inko" },
27-
-- janet = { "janet" },
28-
-- json = { "jsonlint" },
29-
-- markdown = { "vale" },
30-
-- rst = { "vale" },
31-
-- ruby = { "ruby" },
32-
-- terraform = { "tflint" },
33-
-- text = { "vale" }
34-
-- }
35-
--
36-
-- You can disable the default linters by setting their filetypes to nil:
37-
-- lint.linters_by_ft['clojure'] = nil
38-
-- lint.linters_by_ft['dockerfile'] = nil
39-
-- lint.linters_by_ft['inko'] = nil
40-
-- lint.linters_by_ft['janet'] = nil
41-
-- lint.linters_by_ft['json'] = nil
42-
-- lint.linters_by_ft['markdown'] = nil
43-
-- lint.linters_by_ft['rst'] = nil
44-
-- lint.linters_by_ft['ruby'] = nil
45-
-- lint.linters_by_ft['terraform'] = nil
46-
-- lint.linters_by_ft['text'] = nil
15+
-- Check if eslint is installed before setting it as a linter
16+
local function is_executable(name)
17+
return vim.fn.executable(name) == 1
18+
end
19+
20+
if not is_executable 'eslint' then
21+
lint.linters_by_ft.javascript = nil
22+
lint.linters_by_ft.javascriptreact = nil
23+
lint.linters_by_ft.typescript = nil
24+
lint.linters_by_ft.typescriptreact = nil
25+
end
4726

4827
-- Create autocommand which carries out the actual linting
4928
-- on the specified events.

0 commit comments

Comments
 (0)