2
0
mirror of https://github.com/webgefrickel/dotfiles synced 2024-11-13 01:10:27 +00:00

Moare linting with null-ls

This commit is contained in:
Steffen Rademacker 2021-12-20 10:59:35 +01:00
parent e9eca451a0
commit cbcc575a72
8 changed files with 64 additions and 8 deletions

View File

@ -24,6 +24,7 @@ curl -Ls https://raw.githubusercontent.com/jarun/nnn/master/plugins/getplugs | s
ln -s ~/dotfiles/lazygit ~/.config/lazygit
ln -s ~/Dotfiles/starship.toml ~/.config/starship.toml
ln -s ~/Dotfiles/yamllint.yml ~/.config/yamllint/config
ln -s ~/dotfiles/lazygit ~/Library/Application\ Support/lazygit
# node cli tools and helpers

View File

@ -4,6 +4,7 @@ brew install neovim --HEAD
brew install tmux
gem install neovim
pip install neovim
pip install yamllint
# link config files
ln -s ~/dotfiles/nvim ~/.config/nvim
@ -13,13 +14,18 @@ ln -s ~/dotfiles/tmux.conf ~/.tmux.conf
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
# additional language-servers for nvim-lspconfig
npm i -g eslint_d
npm i -g markdownlint
npm i -g fixjson
npm i -g neovim
npm i -g stylelint-lsp
npm i -g typescript
npm i -g typescript
npm i -g typescript-language-server
npm i -g vscode-langservers-extracted
npm i -g yaml-language-server
# additional tools for code validation via null-ls
# packer + treesitter
nvim +PackerSync +TSUpdate
nvim +checkhealth

View File

@ -1,4 +1,15 @@
require('fzf-lua').setup({
files = {
multiprocess = true,
},
grep = {
multiprocess = true,
},
git = {
files = {
multiprocess = true,
},
},
winopts = {
width = 0.80,
height = 0.78,

View File

@ -14,12 +14,7 @@ lspconfig.cssls.setup({
},
},
})
lspconfig.eslint.setup({})
lspconfig.html.setup({})
lspconfig.jsonls.setup({})
lspconfig.phpactor.setup({})
lspconfig.stylelint_lsp.setup({
filetypes = { 'css', 'sass', 'scss' }
})
lspconfig.tsserver.setup({})
lspconfig.yamlls.setup({})

View File

@ -0,0 +1,34 @@
local null_ls = require('null-ls')
local b = null_ls.builtins
-- register any number of sources simultaneously
local sources = {
-- js and friends via eslint_d
b.diagnostics.eslint_d,
b.formatting.eslint_d,
b.code_actions.eslint_d,
-- css and scss-files
b.diagnostics.stylelint.with({
prefer_local = 'node_modules/.bin',
}),
b.formatting.stylelint.with({
prefer_local = 'node_modules/.bin',
}),
-- markdown, json and yaml
b.diagnostics.markdownlint,
b.formatting.markdownlint,
b.diagnostics.yamllint,
b.formatting.fixjson,
-- other languages
b.diagnostics.php,
b.diagnostics.tsc,
b.code_actions.shellcheck,
b.diagnostics.shellcheck,
}
null_ls.setup({
sources = sources,
})

View File

@ -60,6 +60,13 @@ return require('packer').startup(function(use)
},
}
-- null-ls for diagnostics and formatting
use {
'jose-elias-alvarez/null-ls.nvim',
config = get_config('null-ls'),
requires = { 'nvim-lua/plenary.nvim' },
}
-- hop for easy navigation
use {
'phaazon/hop.nvim',

3
yamllint.yml Normal file
View File

@ -0,0 +1,3 @@
rules:
document-start:
present: false

View File

@ -13,7 +13,6 @@ export PATH=/opt/homebrew/bin:$PATH
export PATH=/opt/homebrew/sbin:$PATH
export PATH=/opt/homebrew/opt/curl/bin:$PATH
export PATH=/Users/webgefrickel/git/bin:$PATH
export PATH=/Users/webgefrickel/phpactor/bin:$PATH
export SHELL=/opt/homebrew/bin/zsh
export TERM=xterm-256color
export VISUAL="/opt/homebrew/bin/nvim"