mirror of
https://github.com/LazyVim/LazyVim.git
synced 2026-07-25 14:01:06 +00:00
feat: updated eslint
This commit is contained in:
parent
42fc9a4d66
commit
1c5312d637
1 changed files with 20 additions and 0 deletions
|
|
@ -1,9 +1,11 @@
|
||||||
if lazyvim_docs then
|
if lazyvim_docs then
|
||||||
-- Set to false to disable auto format
|
-- Set to false to disable auto format
|
||||||
vim.g.lazyvim_eslint_auto_format = true
|
vim.g.lazyvim_eslint_auto_format = true
|
||||||
|
vim.g.lazyvim_eslint_auto_fix_all = true
|
||||||
end
|
end
|
||||||
|
|
||||||
local auto_format = vim.g.lazyvim_eslint_auto_format == nil or vim.g.lazyvim_eslint_auto_format
|
local auto_format = vim.g.lazyvim_eslint_auto_format == nil or vim.g.lazyvim_eslint_auto_format
|
||||||
|
local auto_fix_all = vim.g.lazyvim_eslint_auto_fix_all == nil or vim.g.lazyvim_eslint_auto_fix_all
|
||||||
|
|
||||||
return {
|
return {
|
||||||
{
|
{
|
||||||
|
|
@ -17,6 +19,24 @@ return {
|
||||||
-- helps eslint find the eslintrc when it's placed in a subfolder instead of the cwd root
|
-- helps eslint find the eslintrc when it's placed in a subfolder instead of the cwd root
|
||||||
workingDirectories = { mode = "auto" },
|
workingDirectories = { mode = "auto" },
|
||||||
format = auto_format,
|
format = auto_format,
|
||||||
|
codeActionOnSave = {
|
||||||
|
enable = true,
|
||||||
|
mode = "all",
|
||||||
|
},
|
||||||
|
validate = "on",
|
||||||
|
probe = {
|
||||||
|
"javascript",
|
||||||
|
"javascriptreact",
|
||||||
|
"typescript",
|
||||||
|
"typescriptreact",
|
||||||
|
"vue",
|
||||||
|
"html",
|
||||||
|
"markdown",
|
||||||
|
"json",
|
||||||
|
"jsonc",
|
||||||
|
},
|
||||||
|
autoFixOnSave = auto_fix_all,
|
||||||
|
quiet = false,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue