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

ESLint Errors/Warnings Not Showing In VS Code #14

Open
rushvora opened this issue Sep 15, 2021 · 29 comments · Fixed by #27
Open

ESLint Errors/Warnings Not Showing In VS Code #14

rushvora opened this issue Sep 15, 2021 · 29 comments · Fixed by #27
Assignees
Labels
bug Something isn't working question Further information is requested

Comments

@rushvora
Copy link

When using the plugin, no warnings show up in the editor at all. The linting does work as expected, but the errors or warnings that show up in the editor disappear completely. I've attached a video of the ESLint errors showing up in VS code when the plugin is not present.

vs-code-eslint-plugin-diff-bug.mp4
@paleite paleite self-assigned this Sep 25, 2021
@paleite paleite added the bug Something isn't working label Sep 25, 2021
@paleite
Copy link
Owner

paleite commented Sep 25, 2021

thanks for reporting this! looking into it

@paleite
Copy link
Owner

paleite commented Sep 28, 2021

I think the issue here is that the files are untracked, which means they won’t be linted.
I’m working on changing this though, so the plug-in WILL lint untracked files, but in the meantime, you can stage the files you want to lint and it should work.
leaving this issue open, since i’m still working on the fix, but should be out this week

@rushvora
Copy link
Author

The errors don't show up for the tracked files either. They do show up in the shell when trying to commit, and it works perfectly at that time. Just not in VS Code when editing the file.

@paleite
Copy link
Owner

paleite commented Sep 29, 2021

I've released a new (alpha) version: https://www.npmjs.com/package/eslint-plugin-diff/v/1.0.13-0
Please try it out and see if that fixes your issues. Untracked files will now be picked up when using plugin:diff/diff.

If it's still not working for you in VSCode, could you please paste your ESLint output? You can copy/paste it from ESLint: Show Output Channel

Thanks in advance!

@rushvora
Copy link
Author

rushvora commented Sep 29, 2021

1.0.13-0 didn't change anything for me.

The output from ESLint -

[Info  - 11:23:24] ESLint server is starting
[Info  - 11:23:25] ESLint server running in node v14.16.0
[Info  - 11:23:25] ESLint server is running.
[Info  - 11:23:26] ESLint library loaded from: /path-to-folder-here/node_modules/eslint/lib/api.js

Let me know if I can help in any way. I made changes that should throw up linting errors in both tracked and untracked files. The errors get flagged to prevent the commit, but they still don't show up in VS Code.

@paleite
Copy link
Owner

paleite commented Dec 23, 2021

Hi! Please try https://www.npmjs.com/package/eslint-plugin-diff/v/1.0.13-3

I think the reason we got this bug was because the ESLint plugin for VSCode is a long-running process. I was able to replicate the issue locally and it should be fixed now. Please give it a try and let me know if it works.

Note: because the plugin is using git under the hood, it won’t be able to start showing the linter errors until after you’ve saved your file.

@paleite paleite added the question Further information is requested label Dec 23, 2021
@rushvora
Copy link
Author

On initial testing, it doesn't seem to be fixed. 😞
I'll test it out further sometime next week.

@rushvora
Copy link
Author

Still no change in behaviour for me 😓
Linting warnings/errors still don't show up in VS Code for changed lines, after the file has been saved.

@marmaak
Copy link

marmaak commented Mar 31, 2022

Hi @paleite , I tested the latest version (1.0.13-4) but at least on my side the wrong behaviour is still there. I noticed that if I change a line (introducing an error) and then save the file, VSC plugin does not highlight the error. Then if I restart the ESLint server (from VSC) it starts to show the issue on the IDE.

Could it be a cache issue maybe?

@maxerbox
Copy link

maxerbox commented Jun 2, 2022

Same with 1.0.13-4
eslintrc:

{
	"parser": "@typescript-eslint/parser",
	"extends": [
		"plugin:@typescript-eslint/recommended",
		"prettier/@typescript-eslint",
		"plugin:prettier/recommended",
		"plugin:react/recommended", // see https://github.com/jsx-eslint/eslint-plugin-react#configuration. React good practices
		"plugin:diff/diff" // see https://github.com/paleite/eslint-plugin-diff. Lint only changed files.
	],
	"settings": {
		"react": {
			"version": "16.9"
		}
	},
	"parserOptions": {
		"ecmaVersion": 2018,
		"sourceType": "module"
	},
	"rules": {
		// HACK: one day, enable those rules
		"@typescript-eslint/explicit-member-accessibility": 0,
		"@typescript-eslint/no-explicit-any": 0,
		"@typescript-eslint/explicit-function-return-type": 0,
		"@typescript-eslint/no-unused-vars": 0
	}
}

@maxerbox
Copy link

maxerbox commented Jun 8, 2022

Work now in 1.0.15

@marmaak
Copy link

marmaak commented Jun 13, 2022

To me it is sill not working. My staging area is empty and VSC shows me linting errors in files that are not touched at all. Same if I change a file introducing some linting issues, save it and the VSC linter does not show me anything.

I can see from VSC logs that the plugin is correctly activated but for some reasons it is not working as it will when we run it from the command line

@paleite
Copy link
Owner

paleite commented Jun 14, 2022

To me it is sill not working. My staging area is empty and VSC shows me linting errors in files that are not touched at all. Same if I change a file introducing some linting issues, save it and the VSC linter does not show me anything.

I can see from VSC logs that the plugin is correctly activated but for some reasons it is not working as it will when we run it from the command line

@marmaak Which OS are you running? WSL? Which version of the plugin are you running?
Could you post some of your logs/output so we can investigate further?

@marmaak
Copy link

marmaak commented Jun 14, 2022

Sure, sorry if I didn't do this before, my bad:

  • OS: Windows 10
  • Bash: GitBash (even if I don't think this is relevant)
  • Plugin version: 1.0.15
  • VSC version: 1.68.0
  • Additional plugins used: deprecation, eslint-plugin-jsdoc, @angular-eslint/eslint-plugin, @typescript-eslint and prettier
  • Anything else that can help?

This is my VSC logs. I started from a clean situation, then I introduced a long line that should be linted (I even tried to save the file).

image

If a turn the plugin off the error appears properly the IDE

@maxerbox
Copy link

I can try to debug it if you give a reproducible repo ;)

@paleite
Copy link
Owner

paleite commented Jul 28, 2022

Yes, if you could provide a repository for us to debug, that would be immensely helpful. Could you create a Codespace on GitHub which reproduces the issue?

And thanks for your patience. I know how frustrating it can be when something doesn't work properly and it's hard to reproduce.

@skycrazyk
Copy link

skycrazyk commented Jul 29, 2022

I have the same issue. Eslint plugin for vscode starts highlighting errors if I Restart Extension Host

UPD: But through few seconds it fails again

UPD: In same time eslint-webpack-plugin shows errors correctly

@IsLand-x
Copy link
Contributor

IsLand-x commented Aug 1, 2022

I have the same issue as @skycrazyk 's.

@paleite
Copy link
Owner

paleite commented Aug 2, 2022

@IsLand-x could you provide me with a reproduction repo, so i can debug it and finally find a fix for this? It's really annoying that it's been an issue for so long. i wanna make sure my plugin works well for you, as well!

@IsLand-x
Copy link
Contributor

IsLand-x commented Aug 2, 2022

@paleite I think i find the bug in the source code. If you're not urgent, I'll try to make a pr to fix it this weekend.

image

The simplest way to fix the bug is NOT to cache the untracked file list when get the processor. Instead, getting untracked file every time preprocess the text. (To get better performance, can cache the file list here)
image

@IsLand-x
Copy link
Contributor

IsLand-x commented Aug 2, 2022

I'll provide a minimal reproduction repo late when I arrive home today. I'm still working at company now.

@IsLand-x
Copy link
Contributor

IsLand-x commented Aug 2, 2022

@IsLand-x
Copy link
Contributor

IsLand-x commented Aug 6, 2022

Heres a pr to fix the bug #27

@paleite
Copy link
Owner

paleite commented Aug 7, 2022

Thanks @IsLand-x for debugging and providing a fix!

I've released a pre-release version of it so you can try it out now: npm i eslint-plugin-diff@2.0.2-1

And I'll release a stable version soon

@gokulk16
Copy link

gokulk16 commented Oct 5, 2023

Was trying the new release and the issue is still not fixed.

@paleite paleite reopened this Nov 9, 2023
@neilkumar-circle
Copy link

Also seeing this issue in the latest version

@dileepbc3141
Copy link

restarting eslint server in vs code worked for me

@mclods
Copy link

mclods commented Nov 1, 2024

I'm also facing this issue. Restarting also does not help.

@Aetherinox
Copy link

Mine is a bit different. I see errors fine. No warnings though. And I've checked to make sure in the plugin settings I don't have quiet mode enabled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.