diff options
Diffstat (limited to 'configs/nvim/lua/crupest')
| -rw-r--r-- | configs/nvim/lua/crupest/constants.lua | 31 | ||||
| -rw-r--r-- | configs/nvim/lua/crupest/nvim/plugins/lint.lua | 22 | 
2 files changed, 35 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" }      }  } | 
