Skip to content

Commit 0b5beb6

Browse files
YorizelUzaaft
andauthored
feat(pack): add oxlint pack (#1554)
* Create init.lua * Update init.lua * Create README.md * Update lua/astrocommunity/pack/oxlint/README.md Co-authored-by: Uzair Aftab <[email protected]> * Update lua/astrocommunity/pack/oxlint/init.lua * Update README.md --------- Co-authored-by: Uzair Aftab <[email protected]>
1 parent e2d034a commit 0b5beb6

File tree

2 files changed

+45
-0
lines changed

2 files changed

+45
-0
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Oxlint
2+
3+
[Oxlint](https://oxc.rs/) is designed to catch erroneous or useless code without requiring any configurations by default.
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
return {
2+
{
3+
"williamboman/mason-lspconfig.nvim",
4+
opts = function(_, opts)
5+
opts.ensure_installed = require("astrocore").list_insert_unique(opts.ensure_installed, { "oxlint" })
6+
end,
7+
},
8+
{
9+
"WhoIsSethDaniel/mason-tool-installer.nvim",
10+
optional = true,
11+
opts = function(_, opts)
12+
opts.ensure_installed = require("astrocore").list_insert_unique(opts.ensure_installed, { "oxlint" })
13+
end,
14+
},
15+
{
16+
"jay-babu/mason-null-ls.nvim",
17+
optional = true,
18+
opts = function(_, opts)
19+
opts.ensure_installed = require("astrocore").list_insert_unique(opts.ensure_installed, { "oxlint" })
20+
end,
21+
},
22+
{
23+
"stevearc/conform.nvim",
24+
optional = true,
25+
opts = function(_, opts)
26+
if not opts.formatters_by_ft then opts.formatters_by_ft = {} end
27+
-- https://oxc.rs/docs/guide/usage/linter.html
28+
local supported_ft = {
29+
"javascript",
30+
"typescript",
31+
"javascriptreact",
32+
"typescriptreact",
33+
"astro",
34+
"svelte",
35+
"vue",
36+
}
37+
for _, ft in ipairs(supported_ft) do
38+
opts.formatters_by_ft[ft] = { "oxlint" }
39+
end
40+
end,
41+
},
42+
}

0 commit comments

Comments
 (0)