-
Notifications
You must be signed in to change notification settings - Fork 0
nvim oxlint #23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nvim oxlint #23
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| { | ||
| "enabledPlugins": { | ||
| "lua-lsp@claude-plugins-official": true | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| if vim.g.vscode then | ||
| return | ||
| end | ||
|
|
||
| -- Oxlint via native LSP. oxfmt LSP stays enabled for non-TS assets; Vite+ TS/JS | ||
| -- formatting uses conform's vp_fmt formatter (see after/plugin/conform.lua). | ||
|
|
||
| vim.lsp.config("oxlint", { | ||
| init_options = { | ||
| settings = { | ||
| run = "onType", | ||
| fixKind = "safe_fix", | ||
| }, | ||
| }, | ||
| }) | ||
|
|
||
| vim.lsp.enable("oxlint") | ||
| vim.lsp.enable("oxfmt") | ||
|
|
||
| vim.keymap.set("n", "<leader>xl", "<cmd>LspOxlintFixAll<CR>", { desc = "Oxlint fix all" }) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| local M = {} | ||
|
|
||
| ---@param bufnr integer | ||
| ---@return boolean | ||
| function M.is_project(bufnr) | ||
| local name = vim.api.nvim_buf_get_name(bufnr) | ||
| if name == "" then | ||
| return false | ||
| end | ||
|
|
||
| local root = vim.fs.root(name, { "vite.config.ts", "vite.config.mts", "package.json" }) | ||
| if not root then | ||
| return false | ||
| end | ||
|
|
||
| local pkg_path = root .. "/package.json" | ||
| if vim.fn.filereadable(pkg_path) == 1 then | ||
| local ok, data = pcall(vim.json.decode, table.concat(vim.fn.readfile(pkg_path), "\n")) | ||
| if ok and type(data) == "table" then | ||
| for _, key in ipairs({ "dependencies", "devDependencies" }) do | ||
| local deps = data[key] | ||
| if type(deps) == "table" and deps["vite-plus"] then | ||
| return true | ||
| end | ||
| end | ||
| local overrides = data.overrides | ||
| if type(overrides) == "table" and type(overrides.vite) == "string" and overrides.vite:find("vite%-plus") then | ||
| return true | ||
| end | ||
| end | ||
| end | ||
|
|
||
| for _, filename in ipairs({ "vite.config.ts", "vite.config.mts" }) do | ||
| local vite_config = root .. "/" .. filename | ||
| if vim.fn.filereadable(vite_config) == 1 then | ||
| for _, line in ipairs(vim.fn.readfile(vite_config)) do | ||
| if line:find("vite%-plus") then | ||
| return true | ||
| end | ||
| end | ||
| end | ||
| end | ||
|
|
||
| return false | ||
| end | ||
|
|
||
| return M |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -190,7 +190,7 @@ install_python_dev_packages() { | |
|
|
||
| # JavaScript/Node.js developement. | ||
| install_javascript_packages() { | ||
| prompt_and_install_shell "JavaScript packages" 'brew install fnm oven-sh/bun/bun pnpm fsouza/prettierd/prettierd && fnm install 22 && npm install -g eslint_d typescript-language-server typescript' | ||
| prompt_and_install_shell "JavaScript packages" 'brew install fnm oven-sh/bun/bun pnpm && fnm install --lts && fnm default lts-latest && eval "$(fnm env)" && npm install -g @fsouza/prettierd eslint_d@15 typescript-language-server typescript' | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🌐 Web query:
💡 Result: No, fnm default lts-latest is not a supported command for setting the default Node.js version [1]. The fnm default command expects a specific version number (e.g., 20 or 22.13.1) to set as the global default [2][3][4]. To set the default Node.js version to the latest LTS after installing it, you should follow this sequence: 1. Install the latest LTS version: fnm install --lts 2. Identify the specific version that was just installed: fnm list 3. Set that specific version as the default: fnm default <VERSION_NUMBER> (Replace <VERSION_NUMBER> with the version identified in step 2, such as 22.13.1.) The fnm default command functions as a shorthand for creating an alias named default [5][2]. Because lts-latest is not a resolvable version string within the fnm default command's logic, attempting to use it will result in an error [1]. Citations:
Fix The with: Or better, assign to a variable first to ensure clarity and robustness. 🤖 Prompt for AI Agents |
||
| } | ||
|
|
||
| # Gleam. | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.