vite-plugin-eslint
vite-plugin-eslint copied to clipboard
Cache is broken.
By default, when using this plugin, it caches the files, but then does not update them, I have noticed this many times.
If you create a file, and get an error, sometimes it does not update the cache (even after saving), and therefore even after restarting the vite dev server, and even making complete code changes (like deleting all the content in a file), it will still throw errors for things that don't exist.
Disabling cache fixes the issue, but that should be the default option until the cache option works correctly.
exactly the same, I've had to disable it but now we're painfully slow
@cmcnicholas I haven't got a large project yet, but how slow are we talking?
@cmcnicholas I haven't got a large project yet, but how slow are we talking?
20-30 seconds ~40-50 files when opening a new part of the application with some deps already loaded. This obviously will differ for others
Is there any on going work to resolve this issue? Had to disable caching as causing any lint error and then fixing it meant that using vite build --watch didn't successfully build the project once the linting issue was fixed, it froze instead.
This problem only happens when you first time execute vite
with eslint errors.
The workaround
- Disable cache
- Fix your eslint errors
- Enable cache
- Reset
vite
command
When the first execute vite
command without eslint errors, the cache will work fine.
Is there any on going work to resolve this issue? Had to disable caching as causing any lint error and then fixing it meant that using vite build --watch didn't successfully build the project once the linting issue was fixed, it froze instead.
Genuinely not sure if this project is active anymore.
This problem only happens when you first time execute vite with eslint errors.
Good observation! But this is per module, right? So if the first time a particular modules is requested an ESLint error happens, then that particular module is never reloaded, so the error sticks. So the eslint plugin somehow prevents the file/module from being registered for watching/HMR?
This problem only happens when you first time execute vite with eslint errors.
Good observation! But this is per module, right? So if the first time a particular modules is requested an ESLint error happens, then that particular module is never reloaded, so the error sticks. So the eslint plugin somehow prevents the file/module from being registered for watching/HMR?
To confirm the module is reloaded, as you can develop and HMR will update the module, I just think that rather the eslint plugin itself caches the module, and fails to update it's own cache.
@gxmari007 can you give me (or someone) contributor access so we can at least fix the issue...?
@dannysmc95 If you have a fix, even without access you could create a pull request and even publish your version.
Note the there is already a somewhat popular fork.
I haven't tried that fork because I found it after I found vite-plugin-checker, which already solved the issue for me.
This problem only happens when you first time execute vite with eslint errors.
Good observation! But this is per module, right? So if the first time a particular modules is requested an ESLint error happens, then that particular module is never reloaded, so the error sticks. So the eslint plugin somehow prevents the file/module from being registered for watching/HMR?
To confirm the module is reloaded, as you can develop and HMR will update the module, I just think that rather the eslint plugin itself caches the module, and fails to update it's own cache.
@gxmari007 can you give me (or someone) contributor access so we can at least fix the issue...?
PR welcome