🔧 chore: Add linters to nvim
This commit is contained in:
parent
7ed9150d33
commit
7f362ac912
5 changed files with 78 additions and 42 deletions
3
.config/git/commitlint.config.js
Normal file
3
.config/git/commitlint.config.js
Normal file
|
@ -0,0 +1,3 @@
|
|||
module.exports = {
|
||||
extends: ["gitmoji"],
|
||||
};
|
|
@ -35,6 +35,9 @@ require("lazy").setup({
|
|||
-- linting
|
||||
{ import = "lazyvim.plugins.extras.linting.eslint" },
|
||||
|
||||
-- lsp
|
||||
{ import = "lazyvim.plugins.extras.lsp.none-ls" },
|
||||
|
||||
-- test
|
||||
{ import = "lazyvim.plugins.extras.test.core" },
|
||||
|
||||
|
|
19
.config/nvim/lua/plugins/linting.lua
Normal file
19
.config/nvim/lua/plugins/linting.lua
Normal file
|
@ -0,0 +1,19 @@
|
|||
return {
|
||||
"mfussenegger/nvim-lint",
|
||||
opts = {
|
||||
linters_by_ft = {
|
||||
gitcommit = { "commitlint" },
|
||||
sql = { "sqlfluff" },
|
||||
yaml = { "yamllint" },
|
||||
bash = { "shellcheck" },
|
||||
sh = { "shellcheck" },
|
||||
},
|
||||
linters = {
|
||||
commitlint = {
|
||||
args = {
|
||||
"--config ~/.config/git/commitlint.config.js",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
|
@ -3,9 +3,11 @@ return {
|
|||
"williamboman/mason.nvim",
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
-- web
|
||||
"deno",
|
||||
"prettier",
|
||||
-- general
|
||||
"commitlint",
|
||||
|
||||
-- data/conf
|
||||
"yamllint",
|
||||
|
||||
-- shell
|
||||
"shellcheck",
|
||||
|
@ -14,6 +16,13 @@ return {
|
|||
},
|
||||
},
|
||||
|
||||
{
|
||||
"williamboman/mason-lspconfig.nvim",
|
||||
opts = {
|
||||
automatic_installation = true,
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
---@class PluginLspOpts
|
||||
|
@ -27,6 +36,7 @@ return {
|
|||
-- web
|
||||
html = {},
|
||||
cssls = {},
|
||||
denols = {},
|
||||
volar = {
|
||||
filetypes = {
|
||||
"typescript",
|
||||
|
@ -92,45 +102,6 @@ return {
|
|||
},
|
||||
},
|
||||
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
-- general
|
||||
"comment",
|
||||
|
||||
-- git
|
||||
"diff",
|
||||
"git_config",
|
||||
"git_rebase",
|
||||
"gitattributes",
|
||||
"gitcommit",
|
||||
"gitignore",
|
||||
|
||||
-- data/conf
|
||||
"ini",
|
||||
"ssh_config",
|
||||
"toml",
|
||||
|
||||
-- web
|
||||
"html",
|
||||
"css",
|
||||
"scss",
|
||||
"javascript",
|
||||
"jsdoc",
|
||||
"vue",
|
||||
|
||||
-- php
|
||||
"php",
|
||||
"phpdoc",
|
||||
|
||||
-- shell
|
||||
"bash",
|
||||
"fish",
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
"olrtg/nvim-emmet",
|
||||
config = function()
|
||||
|
|
40
.config/nvim/lua/plugins/treesitter.lua
Normal file
40
.config/nvim/lua/plugins/treesitter.lua
Normal file
|
@ -0,0 +1,40 @@
|
|||
return {
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
-- general
|
||||
"comment",
|
||||
|
||||
-- git
|
||||
"diff",
|
||||
"git_config",
|
||||
"git_rebase",
|
||||
"gitattributes",
|
||||
"gitcommit",
|
||||
"gitignore",
|
||||
|
||||
-- data/conf
|
||||
"ini",
|
||||
"ssh_config",
|
||||
"toml",
|
||||
|
||||
-- web
|
||||
"html",
|
||||
"css",
|
||||
"scss",
|
||||
"javascript",
|
||||
"jsdoc",
|
||||
"vue",
|
||||
|
||||
-- php
|
||||
"php",
|
||||
"phpdoc",
|
||||
|
||||
-- shell
|
||||
"bash",
|
||||
"fish",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
Loading…
Reference in a new issue