Skip to content

feat(lsp): add ESLint language server support #38

Description

@amondnet

Summary

Add ESLint Language Server Protocol support to the @pleaseai/code-lsp package, enabling real-time ESLint diagnostics for JavaScript/TypeScript files.

Approach

Download and build vscode-eslint from GitHub (following opencode reference implementation):

  • Download vscode-eslint from GitHub main branch
  • Run npm install && npm run compile to build
  • Install to ~/.cache/dora/eslint-lsp/vscode-eslint/
  • Server path: vscode-eslint/server/out/eslintServer.js

Technical Details

  • Prerequisite check: Only start if eslint is installed in the project
  • Root detection: Lock files (package-lock.json, bun.lock, yarn.lock, pnpm-lock.yaml)
  • Extensions: .ts, .tsx, .js, .jsx, .mjs, .cjs, .mts, .cts, .vue
  • Memory: Uses --max-old-space-size=8192 for large codebases

Tasks

  • T001 [P] Add getEslintResourcesDir function
  • T002 [P] Add setupEslintDependencies function (download + build)
  • T003 Add EslintServer definition with prerequisite check (depends on T001, T002)
  • T004 Add EslintServer to LSP_SERVERS array (depends on T003)
  • T005 Export EslintServer from index.ts (depends on T003)
  • T006 Update CLAUDE.md documentation
  • T007 [P] Add EslintServer unit tests

Reference

Based on opencode implementation: ref/opencode/packages/opencode/src/lsp/server.ts (ESLint: Info)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions