feat(neovim): setup nixfmt & nix-linter
nix-linter setup doesn't seem to fully work yet
This commit is contained in:
parent
2d27c1f2aa
commit
fc3eb14f3f
2 changed files with 25 additions and 0 deletions
|
@ -19,6 +19,13 @@
|
|||
|
||||
# linters & formatters
|
||||
nodePackages.eslint
|
||||
# TODO uses custom script until json support is fixed
|
||||
(pkgs.writeScriptBin "nix-linter" ''
|
||||
echo '['
|
||||
${nix-linter}/bin/nix-linter --json-stream "$1" | sed '$!s/$/,/'
|
||||
echo ']'
|
||||
'')
|
||||
nixfmt
|
||||
# nodePackages.stylelint
|
||||
nodePackages.prettier
|
||||
];
|
||||
|
|
|
@ -61,6 +61,7 @@ config.diagnosticls.setup{
|
|||
"json",
|
||||
"yaml",
|
||||
"markdown",
|
||||
"nix",
|
||||
"html",
|
||||
"css"
|
||||
},
|
||||
|
@ -117,6 +118,19 @@ config.diagnosticls.setup{
|
|||
warning = "warning",
|
||||
},
|
||||
},
|
||||
["nix-linter"] = {
|
||||
-- TODO uses custom script until json support is fixed
|
||||
command = "nix-linter",
|
||||
sourceName = "nix-linter",
|
||||
debounce = 50,
|
||||
parseJson = {
|
||||
line = "pos.spanBegin.sourceLine",
|
||||
column = "pos.spanBegin.sourceColumn",
|
||||
endLine = "pos.spanEnd.sourceLine",
|
||||
endColumn = "pos.spanEnd.sourceColumn",
|
||||
message = "${description}",
|
||||
},
|
||||
},
|
||||
},
|
||||
filetypes = {
|
||||
javascript = {"eslint"},
|
||||
|
@ -126,6 +140,7 @@ config.diagnosticls.setup{
|
|||
["typescript.jsx"] = {"eslint"},
|
||||
typescriptreact = {"eslint"},
|
||||
css = {"stylelint"},
|
||||
nix = {"nix-linter"},
|
||||
},
|
||||
formatters = {
|
||||
eslint = {
|
||||
|
@ -159,6 +174,9 @@ config.diagnosticls.setup{
|
|||
},
|
||||
rootPatterns = {".prettierrc.json", ".git"},
|
||||
},
|
||||
nixfmt = {
|
||||
command = "nixfmt",
|
||||
},
|
||||
},
|
||||
formatFiletypes = {
|
||||
javascript = {"eslint"},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue