Closed msiirodrigo2670 closed 4 months ago
Happy to contribute toward this when the time comes.
The time has come!
https://github.com/oxc-project/oxc/issues/1462 has been merged.
Here is how I set up with my neovim. Just leave here if anyone want to take a try.
return {
{
"mfussenegger/nvim-lint",
opts = {
linters_by_ft = {
javascript = { "oxlint" },
typescript = { "oxlint" },
javascriptreact = { "oxlint" },
typescriptreact = { "oxlint" },
},
},
init = function()
-- Register oxlint, based on `lua/lint/linters/jshint.lua`
require("lint").linters.oxlint = {
name = "oxlint",
-- cargo install --features allocator --git https://github.com/oxc-project/oxc oxc_cli
cmd = "oxlint", // NOTE: this is using oxlint bin from cargo
stdin = false,
args = { "--format", "unix" },
stream = "stdout",
ignore_exitcode = true,
parser = require("lint.parser").from_errorformat("%f:%l:%c: %m", {
source = "oxlint",
severity = vim.diagnostic.severity.WARN,
}),
}
end,
},
}
Here is how I set up with my neovim. Just leave here if anyone want to take a try.
return { { "mfussenegger/nvim-lint", opts = { linters_by_ft = { javascript = { "oxlint" }, typescript = { "oxlint" }, javascriptreact = { "oxlint" }, typescriptreact = { "oxlint" }, }, }, init = function() -- Register oxlint, based on `lua/lint/linters/jshint.lua` require("lint").linters.oxlint = { name = "oxlint", -- cargo install --features allocator --git https://github.com/oxc-project/oxc oxc_cli cmd = "oxlint", // NOTE: this is using oxlint bin from cargo stdin = false, args = { "--format", "unix" }, stream = "stdout", ignore_exitcode = true, parser = require("lint.parser").from_errorformat("%f:%l:%c: %m", { source = "oxlint", severity = vim.diagnostic.severity.WARN, }), } end, }, }
What is interesting is if you try this in a vue SFC with the template tags before the script tags, oxlint is reporting the position of the warning offset from the top of the file in the template relative to where the setup tags start:
I guess this finally solves the debate of whether to put setup
at the beginning or end of the file :rofl:
OXC Linter Documentation
Features
.eslintignore
.<script>
content of.vue
,.astro
,.svelte
files by default.