diff options
author | crupest <crupest@outlook.com> | 2023-11-19 00:51:47 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2023-11-19 00:51:47 +0800 |
commit | 8aea2c0afa64fd516efe55d2dbb46b47552041ea (patch) | |
tree | fc27d99b5f2647a23d49ae2379732321ad6c1d99 | |
parent | 61a6cc36e4f0309523a4a0f42174460999e536e6 (diff) | |
download | crupest-8aea2c0afa64fd516efe55d2dbb46b47552041ea.tar.gz crupest-8aea2c0afa64fd516efe55d2dbb46b47552041ea.tar.bz2 crupest-8aea2c0afa64fd516efe55d2dbb46b47552041ea.zip |
config(nvim): extract out constants.
-rw-r--r-- | configs/nvim/lua/crupest/constants.lua | 31 | ||||
-rw-r--r-- | configs/nvim/lua/crupest/nvim/plugins/lint.lua | 22 | ||||
-rw-r--r-- | configs/nvim/nvim-words.txt | 1 |
3 files changed, 36 insertions, 18 deletions
diff --git a/configs/nvim/lua/crupest/constants.lua b/configs/nvim/lua/crupest/constants.lua new file mode 100644 index 0000000..c8238e7 --- /dev/null +++ b/configs/nvim/lua/crupest/constants.lua @@ -0,0 +1,31 @@ +local config_patterns = { + cspell = { + ".cspell.json", + "cspell.json", + ".cSpell.json", + "cSpell.json", + "cspell.config.js", + "cspell.config.cjs", + "cspell.config.json", + "cspell.config.yaml", + "cspell.config.yml", + "cspell.yaml", + "cspell.yml", + }, + nodejs = { + "package.json" + }, + deno = { + "deno.json", "deno.jsonc" + } +} + +local filetypes = { + js_ts = { 'javascript', 'javascriptreact', 'typescript', 'typescriptreact' } + +} + +return { + config_patterns = config_patterns, + filetypes = filetypes, +} diff --git a/configs/nvim/lua/crupest/nvim/plugins/lint.lua b/configs/nvim/lua/crupest/nvim/plugins/lint.lua index 491c0d1..1db4d32 100644 --- a/configs/nvim/lua/crupest/nvim/plugins/lint.lua +++ b/configs/nvim/lua/crupest/nvim/plugins/lint.lua @@ -1,38 +1,24 @@ local lint = require("lint") local find = require('crupest.system.find') +local constants = require("crupest.constants") -local cspell_config_filenames = { - ".cspell.json", - "cspell.json", - ".cSpell.json", - "cSpell.json", - "cspell.config.js", - "cspell.config.cjs", - "cspell.config.json", - "cspell.config.yaml", - "cspell.config.yml", - "cspell.yaml", - "cspell.yml", -} - -local frontend_file_type = { 'javascript', 'javascriptreact', 'typescript', 'typescriptreact' } local my_linters = { { name = "cspell", exe_places = { "npm", "global" }, - config_files = cspell_config_filenames, + config_files = constants.config_patterns.cspell, }, { name = "eslint", exe_places = { "npm" }, - filetypes = frontend_file_type, + filetypes = constants.filetypes.js_ts, config_files = { "package.json" } }, { name = "deno", exe_places = { "global" }, - filetypes = frontend_file_type, + filetypes = constants.filetypes.js_ts, config_files = { "deno.json", "deno.jsonc" } } } diff --git a/configs/nvim/nvim-words.txt b/configs/nvim/nvim-words.txt index 911b3b2..e4a2d60 100644 --- a/configs/nvim/nvim-words.txt +++ b/configs/nvim/nvim-words.txt @@ -33,6 +33,7 @@ toggleterm everforest autopairs neotree +gitsigns # languages clangd |