🔧 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
|
-- linting
|
||||||
{ import = "lazyvim.plugins.extras.linting.eslint" },
|
{ import = "lazyvim.plugins.extras.linting.eslint" },
|
||||||
|
|
||||||
|
-- lsp
|
||||||
|
{ import = "lazyvim.plugins.extras.lsp.none-ls" },
|
||||||
|
|
||||||
-- test
|
-- test
|
||||||
{ import = "lazyvim.plugins.extras.test.core" },
|
{ 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",
|
"williamboman/mason.nvim",
|
||||||
opts = {
|
opts = {
|
||||||
ensure_installed = {
|
ensure_installed = {
|
||||||
-- web
|
-- general
|
||||||
"deno",
|
"commitlint",
|
||||||
"prettier",
|
|
||||||
|
-- data/conf
|
||||||
|
"yamllint",
|
||||||
|
|
||||||
-- shell
|
-- shell
|
||||||
"shellcheck",
|
"shellcheck",
|
||||||
|
@ -14,6 +16,13 @@ return {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"williamboman/mason-lspconfig.nvim",
|
||||||
|
opts = {
|
||||||
|
automatic_installation = true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
"neovim/nvim-lspconfig",
|
"neovim/nvim-lspconfig",
|
||||||
---@class PluginLspOpts
|
---@class PluginLspOpts
|
||||||
|
@ -27,6 +36,7 @@ return {
|
||||||
-- web
|
-- web
|
||||||
html = {},
|
html = {},
|
||||||
cssls = {},
|
cssls = {},
|
||||||
|
denols = {},
|
||||||
volar = {
|
volar = {
|
||||||
filetypes = {
|
filetypes = {
|
||||||
"typescript",
|
"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",
|
"olrtg/nvim-emmet",
|
||||||
config = function()
|
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