-
Notifications
You must be signed in to change notification settings - Fork 61
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
globalDupe: true causes duplication error when watch is running #200
Comments
thanks, that seems like an easy fix |
should be resolved in 1.2.3 |
I updated to 1.2.3 and globalDupes: true is no longer working across watched files. I wasn't able to look into it that closely but it seems that when a file changes, resetOnChange gets called once for each file that is being watched causing sCache to get wiped in between each file check. |
It looks like resetOnChange is only called for a file after that file is checked for duplicates. So even if the sCache is cleared only once per file change, the first file checked after a change will throw duplicates errors every time. I'm thinking it might be better to clear the sCache in duplicates.js the very first time it executes after a file changes. There might be a better way to do this but putting this near the top of the duplicates function seems to do the trick (it clears the cache if a file is in the cache and is not the most recent file checked for duplicates):
|
I was using gulp-stylint in conjunction with a watch to validate files when they change. Using globalDupe: true causes duplication errors to be thrown on every selector when changing a watched file even though none of the selectors are duplicated.
I attempted to figure out what was going on and it seems that adding the line "this.cache.sCache = {}" to resetOnChange fixes the issue.
The text was updated successfully, but these errors were encountered: