-
Notifications
You must be signed in to change notification settings - Fork 12k
Description
Describe the bug
OpenCode docs say the built-in oxlint LSP is enabled when there is an oxlint dependency in the project.
In practice, OpenCode appears to check the project dependency to decide whether to enable oxlint, but then does not use the project's installed binary when starting the LSP server.
Instead, it reports:
oxlint not found, please install oxlint
This makes the current behavior feel inconsistent with the docs: detection is project-based, but execution does not seem to be.
Expected behavior
If the built-in oxlint LSP is documented as requiring an oxlint dependency in the project, OpenCode should use that project-installed binary when starting the LSP server.
Actual behavior
OpenCode logs:
service=lsp.server oxlint not found, please install oxlint
even though:
oxlintis installed in the project./node_modules/.bin/oxlint --versionworksyarn oxlint <file>works
Debug logs
Relevant line:
INFO service=lsp.server oxlint not found, please install oxlint
At the same time, built-in oxfmt formatting works in the same repo.
Environment
- OpenCode:
1.2.19 - macOS
- project has
oxlintandoxfmtindevDependencies
Notes
The docs currently say built-in oxlint support requires:
oxlintdependency in project
That reads as if project-local install should work out of the box.
Current behavior suggests OpenCode:
- checks project dependencies to decide whether to enable
oxlint - but then tries to start some other/global
oxlintbinary instead of the project one
If that is intentional, the docs should clarify it.
If not, built-in oxlint LSP should resolve the workspace binary automatically.
Workaround
Adding a project-local opencode.json with an explicit oxlint command fixes the issue:
{
"$schema": "https://opencode.ai/config.json",
"lsp": {
"oxlint": {
"command": ["./node_modules/.bin/oxlint", "--lsp"]
}
}
}With that config in place, OpenCode successfully starts oxlint LSP and publishes diagnostics.
Plugins
No response
OpenCode version
1.2.19
Steps to reproduce
- Create a TS/JS project
- Install
oxlintas a project dependency:yarn add -D oxlint
- Open a
.tsfile in OpenCode and trigger a read/edit flow that should use LSP diagnostics
Screenshot and/or share link
No response
Operating System
macOS 26.3
Terminal
Ghostty