Skip to content
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

Bump vscode-eslint extension to 3.0.10 to fix eslint/probeFailed on newer configurations #4489

Merged
merged 1 commit into from
Jul 8, 2024

Conversation

ovistoica
Copy link
Contributor

@ovistoica ovistoica commented Jul 8, 2024

In repositories that use eslint over 9.0.0 you get errors with probeFailed from the eslint LSP server.

Example log: lsp-log: eslint

[Trace - 05:54:47 PM] Sending response 'workspace/configuration - (2)'. Processing request took 0ms
Params: {
  "jsonrpc": "2.0",
  "id": 2,
  "result": [
    {
      "validate": "probe",
      "packageManager": "npm",
      "codeAction": {
        "disableRuleComment": {
          "enable": true,
          "location": "separateLine"
        },
        "showDocumentation": {
          "enable": true
        }
      },
      "codeActionOnSave": {
        "enable": false,
        "mode": "all"
      },
      "format": true,
      "quiet": false,
      "onIgnoredFiles": "off",
      "options": {},
      "experimental": {},
      "problems": {},
      "timeBudget": {},
      "rulesCustomizations": [],
      "run": "onType",
      "nodePath": null,
      "workingDirectory": null,
      "workspaceFolder": {
        "uri": "file:///Users/ovistoica/workspace/mindle",
        "name": "mindle"
      }
    }
  ]
}


[Trace - 05:54:47 PM] Received notification 'window/logMessage'.
Params: {
  "message": "ESLint library loaded from: /Users/ovistoica/workspace/mindle/node_modules/eslint/lib/api.js",
  "type": 3
}


[Trace - 05:54:48 PM] Received request 'eslint/probeFailed - (3).
Params: {
  "textDocument": {
    "uri": "file:///Users/ovistoica/workspace/mindle/drizzle.config.ts"
  }
}


[Trace - 05:54:48 PM] Sending response 'eslint/probeFailed - (3)'. Processing request took 1ms
Params: {
  "jsonrpc": "2.0",
  "id": 3,
  "result": "LSP :: ESLint is not configured correctly. Please ensure your eslintrc is set up for the languages you are using."
}

It took me a while to understand why this was happening, and I found that the vscode-eslint version from my local VSCode didn't have this issue, so I tried using that eslintServer and the issue wasn't there anymore.

Config used for local VSCode eslintServer.js

(use-package lsp-eslint
  :demand t
  :after lsp-mode
  :config
  (setq lsp-eslint-server-command `("node"
                                    "~/.vscode/extensions/dbaeumer.vscode-eslint-3.0.10/server/out/eslintServer.js"
                                    "--stdio")))

This PR addresses this issue and makes lsp-eslint compatible with latest eslint version provided users reinstall their eslint server

Here's the PR from lsp-server-binaries to upload the latest vscode-eslint version: emacs-lsp/lsp-server-binaries#3

Why is this happening? AFAIU, there are breaking changes between eslint 8.* and 9.* so if eslint config has rules that are only valid in 9.*, the probing fails. I think this is related: https://eslint.org/docs/latest/use/configure/migration-guide

@github-actions github-actions bot added the client One or more of lsp-mode language clients label Jul 8, 2024
@ovistoica ovistoica changed the title Bump vscode-eslint extension to 3.0.10 Bump vscode-eslint extension to 3.0.10 to fix eslint/probeFailed on newer configurations Jul 8, 2024
@jcs090218
Copy link
Member

LGTM, thanks!

@jcs090218 jcs090218 merged commit b73970a into emacs-lsp:master Jul 8, 2024
10 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
client One or more of lsp-mode language clients
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants