Sunday, May 19, 2024
93
rated 0 times [  99] [ 6]  / answers: 1 / hits: 18364  / 3 Years ago, thu, october 28, 2021, 12:00:00

I am experiencing an intermittent problem with ESLint in VS Code. When saving a file, instead of formatting it, this message shows in the status bar:


enter


Apparently no one has ever reported this message on Google.


When I say it is intermittent, it was working fine, then the computer (MBP) crashed, and on restarting this is the situation. It has happened previously, but I don't recall what I did to fix it.


The app is a fairly complex Vue-based app based on a pre-configured template. In package.json:


    "@vue/cli-plugin-eslint": "^4.5.13",

"babel-eslint": "^10.1.0",
"eslint": "^7.31.0",
"eslint-plugin-import": "^2.23.4",
"eslint-plugin-vue": "^7.14.0",

In the VS Code workspace file:


        "editor.codeLens": true,
"eslint.format.enable": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true,
},
"[javascript]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
},
"[vue]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
},
"eslint.validate": [
"javascript"
],
"debug.javascript.usePreview": true,
"debug.javascript.usePreviewAutoAttach": true,
"[jsonc]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
},

I'm really not sure how to proceed to understand why vscode-eslint is reporting that it can't format JavaScript files.


EDIT


This issue regarding TypeScript gives some hints. It seems this error can result when the ESLint server is restarting or the extension host is under a lot of stress.


In my project now, most files are formatting fine, although one consistently fails. That file is called eslint.js and is part of a build process, running eslint - I don't totally understand the configuration. I suspect that saving this file somehow causes eslint to be run/reloaded, and while that is happening, eslint-vscode tries to also run it and fails.


More From » visual-studio-code

 Answers
4

This can happen for a variety of reasons. The eslint output logs will tell you the issue.


enter


In my case the settings field configFile was changed to overrideConfigFile


[#50137] Thursday, September 23, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
anjelicadixied

Total Points: 742
Total Questions: 94
Total Answers: 97

Location: Iraq
Member since Fri, Jun 5, 2020
4 Years ago
;