question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Extension 'ESlint' cannot format file 'index.ts' caused by probing failure

See original GitHub issue

I encountered the problem Extension 'ESlint' cannot format file 'index.ts' while trying to format my TypeScript code in a Vue project. Here is the snapshot:

image

And here is my settings.json in the workspace:

"eslint.format.enable": true,
"editor.codeActionsOnSave": {
  "source.fixAll.eslint": true
},
"[typescript]": {
  "editor.defaultFormatter": "dbaeumer.vscode-eslint"
}

Then, I try to turn on the trace log of plugin with "eslint.trace.server": "verbose". The plugin gives the following output:

[Info  - 下午10:17:00] ESLint library loaded from: D:\code\web\***\node_modules\eslint\lib\api.js
[Trace - 下午10:17:01] Received request 'eslint/probeFailed - (4)'.
Params: {
    "textDocument": {
        "uri": "file:///d%3A/code/web/***/src/backend/index.ts"
    }
}


[Trace - 下午10:17:01] Sending notification 'textDocument/didClose'.
Params: {
    "textDocument": {
        "uri": "file:///d%3A/code/web/***/src/backend/index.ts"
    }
}


[Trace - 下午10:17:01] Sending response 'eslint/probeFailed - (4)'. Processing request took 0ms
No result returned.

It seems that probing failure causes the problem. So, I use the settings "eslint.validate": ["typescript"] to enforce validating of TypeScript. Finally, the problem got solved, and soon it is available to format my TypeScript code with ESLint.

The question has been reported for multiple times (#1086, #850, #951), is it a bug or feature?

The following information may be useful:

  • The project is generated by @vue/cli v4
  • Problem can be reproduced on any kinds of TypeScript file, even a Hello World
  • The .ts file can be fixed by eslint --fix index.ts
  • OS System: Windows 10 20H2
  • Node: v14 globally installed, v12 used by VSCode
  • VSCode version: v1.52.1
  • Extension version: v2.1.14

Thank you for help!

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
dbaeumercommented, Mar 17, 2021

@jamiehaywood great that you figured it out. I agree ESLint can be confusing especially you need some configuration to validate anything other than js.

Looking forward to your PR. I will close the issue

@maximumstock can you please provide me with a GitHub repository I can clone that demos what you are experiencing.

1reaction
mrvissercommented, Feb 11, 2021

I had this issue just now, same error, not vue or anything, just a typescript project with no TSX files.

I nuked my node_modules, ran npm install, then shift+cmd+p: Reload window / restart vscode, and that fixed it for me. I didn’t update the eslint.validate setting.

Not the solution we need, but perhaps the one that we deserve.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Extension 'eslint' is configured as formatter but it cannot format ...
This issue regarding TypeScript gives some hints. It seems this error can result when the ESLint server is restarting or the extension host...
Read more >
Extension 'ESlint' cannot format file 'index.ts' caused by probing failure
I encountered the problem Extension 'ESlint' cannot format file 'index.ts' while trying to format my TypeScript code in a Vue project. Here is...
Read more >
jsEnable": true ). eslint - ADocLib
I encountered the problem Extension 'ESlint' cannot format file 'index.ts' while trying to format my TypeScript code in a Vue project. Here is...
Read more >
VS Code ESLint extension - Visual Studio Marketplace
Integrates ESLint into VS Code. If you are new to ESLint check the documentation. The extension uses the ESLint library installed in the...
Read more >
ESLint not working in VSCode? Help build a troubleshooting ...
Since .eslintrc configuration files automatically extend configuration files in higher directories, this can cause weird issues. Make sure you ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found