Extension 'ESLint' cannot format '../../../file.tsx'. How to debug this? - visual-studio-code

I started a project 3 months ago and since a while my ESLint formatter suddenly stopped working (like 1 week ago). Can't get it to work in any way. I didn't do any package updates. It could be that I have updated the ESLint extension itself and the global yarn version.
The formatter I am using in VSCode is:
"[typescriptreact]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
},
I have tried cleaning my Yarn packages and reinstalling them. I have tried several other ESLint settings but can't get it to work.
This issue occurs in two different projects, so I'm guessing it has to do with the extension itself. In one of my project I am getting this message as well:
When I click it and select a node path, it doesn't do anything unfortunately. Also when I switch to a completely different laptop, I still get the issue. So It probably has to do with my preferred configuration + the updated extension.
I can't seem to find a good way to debug this, and it's rather trial and error right now. Could you help me with some next steps on how to discover the problem and how to get closer to a more focused question?
Note:
If you need any more info, please let me know and I'll update asap.

Related

What is the correct way to add an option to the VSCode Settings Menu (editing VSCode's source)

(not sure if I asked this earlier somewhere, but I can't find it)
Earlier I found out how to create a usable entry on the VSCode settings menu (also usable in settings.json) by editing these VSCode source files:
vscode/src/vs/editor/common/config/editorOptions.ts
Adding a variable in export interface IEditorOptions.
Adding an enum in export const enum EditorOption.
Adding an item in export const EditorOptions.
vscode/src/vs/editor/common/standalone/standaloneEnums.ts
Adding an enum to export enum EditorOption.
I don't know if that's the correct way, I just copied other options.
I hadn't yet figured out how to access the new entry's value from the function I wanted to use it in (I had already implemented the functionality, just without the option).
I then got sidetracked and forgot about this.
Now when I try to build it I'm getting an error (it builds fine without the changes).
running yarn --cwd <mydir> run gulp vscode-linux-x64
gives Error: monaco.d.ts is no longer up to date. Please run gulp watch and commit the new file.
I'm not sure exactly how I'm supposed to run gulp watch here. I don't know anything about yarn or gulp (I'm just using the VSCode contributor instructions), and running yarn --cwd <mydir> run gulp watch doesn't fix the problem.
It sounds like vscode/src/vs/monaco.d.ts being read by the build process before being written/updated, because its timestamp changes. I'm not sure if that's my fault and/or if it's a red herring.
Does anyone know what I should be doing here? Has anyone here modified the settings menu?
Is there any documentation out there for modifying the settings menu? (I had a look, didn't find anything).

Elm VSCode plugin does not format on save

I have copied the following question from the Elm Slack channel for posterity.
I am having trouble getting the Elm VSCode plugin to format on save. I have set the absolute path to my global install of elm-format in settings.json. I have also set format on save for elm:
"[elm]": {
"editor.formatOnSave": true,
},
I am on an Ubuntu machine, and format does not happen on save or with Ctrl-Shift-I. Does anyone see something that I might be missing?
Install elm-format
Install the extension Elm Language Support for VSCode, which includes syntax and error highlighting
Configure VS code settings.json:
"[elm]": {
"editor.formatOnSave": true
},
The format on save timeout should not be an issue with VSCode 1.42 (Q1 2020)
See "Better handling of slow save operations":
VS Code allows extensions to change a file's contents when saving files to disk.
Features like Format on Save and Fix on Save are examples.
However, saving is a critical operation and extensions doing processing during a save must finish quickly so that the actual save operation can proceed.
"Quickly" used to be enforced by VS Code with timeouts that would make VS Code cancel extension save participation.
That enforcement guaranteed speedy saving but could be frustrating because sometimes expected processing would not happen.
With this release, we have given up the timeout-based approach and instead show a progress notification that allows you to cancel extensions participating in save ("Save Participants").
The notification lets you know that save operations are running and you can decide if you want to wait for a save participant to finish or not.
The following are the responses and resolution.
Response from #stoft:
Try installing elm-format locally or globally with npm, that helped me on MacOS.
Response from #razzee:
please check two things:
are you on the latest elm-format version
increase the formatting timeout of vscode, unfortunately elm-format is sometimes too slow "editor.formatOnSaveTimeout" is what the setting is called"
A global install of the latest version of elm-format was enough for format on save to work.
One case where format on save does not work by following these suggestions is in the elm-0.19-workshop. Format on save will not trigger on Elm files in intro/part1/ or any of the other "part" directories.
Not setting the paths to elm-format and elm-tests explicitely worked for me.
I ran
npm install --global elm-test elm-format
and let the extension figure out where it is.
As soon as I specify that /home/a-teammate/npm/lib/node_modules/elm-test/bin/elm-format is the elm-format I want to use, it stops working. Although pointing to the same elm-format.
Tested with elmtooling.elm-ls-vscode in version 0.9.4, elm 0.19.1 and elm-format 0.8.3
I had this issue with Prettier formatter being installed as default. I resolved it by overriding formatter for Elm specifically:
"[elm]": {
"editor.defaultFormatter": "elmTooling.elm-ls-vscode"
},

Cannot create a new project with ionic

I've seen this problem on stack overflow few days ago, and the next day I have it too.
I am unable to create a new ionic project with cordova.
When the prompt ask me if I want to integrate cordova with the app and whatever my answer was (Yes or no), I have to wait hours and hours and nothing happens and just a folder with just single file (src) is created.
I am using the latest version of Node and NPM.
I tried to uninstall everything globally and re-install it again, but still having the same problem.
Any help would be appreciated. I can't provide any more details as this is what I got. I tried everything from removing/uninstalling all and then re-install. Restart computer, even change it. The internet speed is good (I don't think it has something to do with it).
Update
I tried to add --no-git to the command and still doing the same thing:
ionic start proj tabs --no-git
Try with a --no-git. At least this helped this guy: github issue

Getting "Error: Failed to connect to OmniSharp"

I'm trying to get VSCode working with my Unity projects, and every time I select the Project icon (the little fire at the bottom) I get the following error:
Error: Failed to connect to OmniSharp
Is anyone else getting this?
You need to download the most recent version of "mono". Open up terminal and pass in brew install mono. Then "Pick a project" and select the ..-csharp.sln file and you should be up and running.
Ok, made some progress and gotten a few Unity projects working. It seems that you need some prerequisites installed, a clean up of your Unity project folder, and possibly some hand editing of your .sln and .csproj files.
I posted a (possibly) better answer over on Reddit. Hope that's not breaking stack etiquitte.
http://www.reddit.com/r/Unity3D/comments/34d6gc/visual_studio_for_mac_help_us_vote_for_unity/
i get this on windows when my project directory has a space in it
i removed the space and removed the error
i expect it will be fixed soom
I have a completely different answer: it's the runtime that VSCode is using. It doesn't match up with what it thinks it needs. I have to remember that we're still in beta and that things are changing rapidly. I had my dnvm running beta 7, but VSCode (and OmniSharp, by extension) is looking for beta 6, so it was failing. I updated my runtime using this this post as a clue. Now I have VSCode 0.7.0 using the beta 6 runtime. I have no idea how to tell what it's looking for...I just guessed based on when they were both released. HTH

Pylint in Sublime Text 2

So, I've been using Sublime for a while as a simple text editor, but I'm venturing into the land of plugins for work and I've run into an issue getting pylint to work. Specifically I have it installed and have the Sublime package manager working, but I'm not sure how to include paths in my sublime settings.
I haven't found very useful documentation on this point, but if you are willing to point me towards it that would be a perfectly acceptable answer. My basic issue is that currently every time I save a file, the following error message shows up:
"Please define the full path to 'lint.py' in the settings"
I understand this error message which is great, I just have no idea where the sublime settings are or what the standard format for defining a path is. Any help would be appreciated.
There are quite complete directions at the SublimeLinter GitHub page that should describe how to set everything up. Briefly, go to Preferences->Package Settings->SublimeLinter->Settings - Default to see where the different settings are defined. Then, open Preferences->Package Settings->SublimeLinter->Settings - User to change anything, as the main settings will be overwritten when the package is updated. Remember that settings files are in JSON format, so you'll need opening and closing curly brackets to enclose settings, and a comma between them:
{
"sublimelinter_delay": 30,
"sublimelinter_mark_style": "none"
}
I haven't gotten the error you have, are you sure you're using the regular SublimeLinter and not the new beta version? I just installed it fresh on my work machine (I've been using it for a while at home) and after restarting ST2 it's working like a charm with Python.
I had the same problem. I found it to be coming from the package "Pylinter". I removed Pylinter and added SublimeLinter, it covers more than python and is well used. I'm enjoying it quite a bit.
From your command line just run:
sudo easy_install pylint
sudo easy_install pep8
After that restart your sublime.
I encounter the same situation today. In my case, that is because I have not installed the 'pylint' in my system yet. It works fine after I installed the 'pylint' through pip.
Just for other people reference.