-
Notifications
You must be signed in to change notification settings - Fork 341
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
Reload eslint config and clear cache #477
Comments
No this is currently not possible. But you can always reload the Window which will reload the eslint server / plugin. |
And kill the terminals 😿 |
Valid point. |
I have had to refresh my VSCode window every <5 minutes for the past four hours. Well, I didn't know that that restarted the server until someone told me, so I was really closing VSCode entirely for about half of that time. Being able to manually restart the server is probably not valuable in general, but when you're trying to debug why ESLint and other tooling aren't playing nicely together, it would be MAGICAL |
For those who were also wondering what this means/how to do it: Open the command palette ( |
I'll 👍 this feature too; mucking about with your .eslintconfig file is a nightmare if you have to reload VSCode every time you change a rule to see if it works, especially if you have an underpowered computer and lots of extensions (and if your workplace forces the use of shitty antivirus software that make launching VSCode take 30 seconds!!!). |
The extension should handle changes to |
I will accept a PR that add a corresponding command to the extension. |
I didn't realize until later that you only have to close and re-open the file. That, and a combination of errors were making me think I had to reload the whole instance. I think the problem is more with the UX around presenting errors in the eslint config for new users. I've been using VSCode for a year and I'm still a little unsure of where to look for the error messages when an extension is not behaving (except for vscode-vim, which tells me an error happened every 30 seconds 😄 ). Perhaps a notification that an eslintrc file was found but can't be loaded because x, y, and z. It might also help to tell the user that a change was detected, but won't be applied until you close and re-open all currently open files. I believe that would stop this particular issue from being commented on. |
This is really becoming a headache when:
@dbaeumer Do you mean a command like |
@futagoza the For the rest the plugin actually should react and reparse things after changes to the following patterns:
The case that is not covered are arbitrary changes to the |
@dbaeumer It seems either this isn't the case anymore, or the ESLint plugins aren't being reloaded when there are changes to the // .eslintrc*
{
"extends": "@futagoza",
"root": true
}
// tsconfig.json
{
"extends": "@futagoza/tsconfig",
"include": [ "." ]
}
// src/tsconfig.json
{
"extends": "@futagoza/tsconfig/node",
"include": [
"**/*.ts"
],
"compilerOptions": {
"outDir": "../out",
"rootDir": "."
}
} Both compiling and linting work fine via the CLI, but vscode-eslint complains every time I create a new file. I've tried modifying the |
@futagoza can you provide me with a GitHub repository I can clone that demos this? But as said adding new TS files is currently not handled correctly. |
@dbaeumer If you add a new ts file and you get an error, try adding |
I also encountered the same problem, it seems that eslint will only verify the file when it is reloaded. When I fixed these errors, the old error message still exists. This is very frustrating. Does anyone know of any way to solve this problem? |
Something is definitely not how it should be, this is happening to me on a daily basis. ESLint starts hanging, showing errors where there are none and auto-formatting stops working. The only thing that works is reloading vscode. |
@BertelBB Oh, my God, why is this? I am constantly reloading vscode at least half of my time every day, which is too bad. |
Same problem there. I'm glad i find this issue and i no more feel lonely. :) I am on i3 tiling window manager, so my terminals are in another pane so i use |
I'm having the same issue as @futagoza. Every time I add a new Typescript file, the ES Lint plugin doesn't pick it up. I get a single error on the first line of code complaining the file isn't in my project. If I run eslint manually via a terminal it works fine. Only way to get the vs code plugin to work again is to reload the window, which is a pain since I sometimes have 5-10 terminals open. While it'd be nice to fix this specific bug, it seems a more general solution of a command (via CTRL+SHIFT+P) to restart the plugin/server somehow would be more generally useful |
We seem to be having this problem after switching git branches on the terminal... it always complains import foobar "does not match the underlying filesystem" afterwards, which is quite annoying. Is this the same issue or a different one? And yes, reloading window fixes it. |
@mb21 sounds like the same issue. A PR with a specific command to reload the server is still welcome :-) |
@ecraig12345 good point. I think stopping & restarting the server is the most save thing to do. |
is it seriously not implemented yet? |
confirm the issue: |
@rusakovic I'm using ESLint and Typescript-ESLint and that workaround doesn't work, the error just stays there. But reloading the window works, obviously. |
this plugin has started caching a bad file path somewhere hidden, causing false positive results that the normal CLI does not report, and it's driving me crazy trying to find a way to clear this plugin's cache 😞 |
@vdh a window reload does a hard reload of the ESLint server. So even a command as requested in this issue will not help you. |
Version 2.1.17 now contains a Restart Server command. |
Of course, to actually use the 2.1.7 update VS Code requires a reload, which is exactly what this ticket's functionality is supposed to avoid. 😩 Regardless, @dbaeumer - thank you for adding the server restart functionality! (It will make life easier in the near future.) |
@dbaeumer - Tangential confused observation, you mentioned the 2.1.17 release, I am able to update to the 2.1.17 in my VS Code, and the package.json indicates the main branch is at version 2.1.17, however when I look at the tagged versions they stop at |
@metasean thanks for reporting the missing tags. My fault. For the reload on new version install: this is VS Code and nothing the extension can fix by itself. |
I added the tags. |
Deleting the |
How do you actually use this command? |
@al3x-huang Open the Command Palette (by default |
+1, it would be very useful when developing an Eslint plugin. |
Is there a way to tell the plugin to reload the configuration and clear the cache?
For example, when using eslint-plugin-graphql and updating the GraphQL schema, errors in the GraphQL queries are still reported based on the old schema.
The text was updated successfully, but these errors were encountered: