Skip to content

Built-in oxlint LSP checks project dependency but does not use project binary #16309

@JannikWempe

Description

@JannikWempe

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:

  • oxlint is installed in the project
  • ./node_modules/.bin/oxlint --version works
  • yarn 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 oxlint and oxfmt in devDependencies

Notes

The docs currently say built-in oxlint support requires:

oxlint dependency in project

That reads as if project-local install should work out of the box.

Current behavior suggests OpenCode:

  1. checks project dependencies to decide whether to enable oxlint
  2. but then tries to start some other/global oxlint binary 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

  1. Create a TS/JS project
  2. Install oxlint as a project dependency:
    yarn add -D oxlint
  3. Open a .ts file 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

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingcoreAnything pertaining to core functionality of the application (opencode server stuff)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions