scss-lint-plugin
scss-lint-plugin copied to clipboard
Temp files triggers error in watch tasks
Versions
scss-lint version: I can't tell, cause it seems to be bundled with PHPStorm
OS: Mac OS X El Capitan 10.11.6 IDEA product and version: PHPStorm 2016.2
Description
SCSS-lint tries to lint JS files.
Error: ENOENT: no such file or directory, open '/Users/andy/dev/style-guide/jquery/register-plugin_scsslint_tmp802830433474418013.js' at Error (native)
There seems to be an related issue, but it does not seem to be resolved: https://github.com/idok/scss-lint-plugin/issues/13
Steps to Reproduce
- Setup Gulp watch for JavaScript bundling, minification, etc.
- Edit JS files in PHPStorm
- SCSS-Lint generates temporary files for JS and immediatly removes them
- This triggers gulp watch
- Gulp watch dies because he can't find the file again.
Expected behavior:
- SCSS-lint should never lint javascript files
- SCSS-lint should never create temporary files inside source folders
Actual behavior:
- SCSS-lint lints javascript files
- SCSS-lint creates temporary files inside source folders
@idok Any updates on this?
@idok Did you have any chance to look into this. It seems to be really weird for two reasons:
- it lints
.js
files with scsslint... - tmp files are stored inside source folders, imho they should be in a seperate
tmp/
dir
tasks/docs-scripts_scsslint_tmp1537225672253761620.js
tasks/scripts-bundle_scsslint_tmp4377624646903046346.js
I tried with other IDE's and only InteliJ based IDE suffer from this illness
I quickly searched your repo for scsslint
and the following two hints came up:
private static final String SCSS_LINT_TMP = "_scsslint_tmp";
https://github.com/idok/scss-lint-plugin/blob/63215554eb3c194478a7617ca611a1df7281d92f/intellij-common/src/com/wix/ThreadLocalActualFile.java#L25
And the file creation here:
// try to create a temp file next to original file
retFile = File.createTempFile(this.baseName + SCSS_LINT_TMP, this.extension, new File(originalFile.getParent().getPath()));
https://github.com/idok/scss-lint-plugin/blob/63215554eb3c194478a7617ca611a1df7281d92f/intellij-common/src/com/wix/ThreadLocalActualFile.java#L74-L75
I have this issue, too
Me too. Or me three. Or four. This breaks the watch and requires rerunning gulp. Inconvenient. Any help would be appreciated!
For now trying trying to mitigate by adding '!**/*scsslint*js'
to gulp watch to ignore those temp files.
@AndyOGo have you found how to disable this plugin?
@aspirinchaos
Unfortunately no, I still don't know how to disable this 😞
Though I can confirm that in case of Gulp this issue can be workarounded by adding GLOB exclusion '!**/*scsslint*js'
as asuggested already by @laurenbrandstein
Anyway I switched to webpack and didn't experience this bug there...
I have created an Issue now directly at JetBrains https://youtrack.jetbrains.com/issue/WI-37757
Hi Andy, Do you have any other plugins installed?
Hi @idok No, nothing related to SCSS.
Btw. I already found the bug here:
I quickly searched your repo for
scsslint
and the following two hints came up:private static final String SCSS_LINT_TMP = "_scsslint_tmp";
https://github.com/idok/scss-lint-plugin/blob/63215554eb3c194478a7617ca611a1df7281d92f/intellij-common/src/com/wix/ThreadLocalActualFile.java#L25
And the file creation here:
// try to create a temp file next to original file retFile = File.createTempFile(this.baseName + SCSS_LINT_TMP, this.extension, new File(originalFile.getParent().getPath()));
https://github.com/idok/scss-lint-plugin/blob/63215554eb3c194478a7617ca611a1df7281d92f/intellij-common/src/com/wix/ThreadLocalActualFile.java#L74-L75
Obviously this code seems to run for any extension (File.createTempFile(this.baseName + SCSS_LINT_TMP, this.extension,
), though it should only run for .scss
or .sass
files.
SCSS Lint plugin should and as far as I know only lints scss files. Do you have eslint plugin installed? If you uninstall SCSS Lint plugin do you still see temp js files?
@idok Sure I use ESLint, but installed as node package. Unfortunately I reported this issue about a year ago, meanwhile I changed my stack a lot. to wepback, stylelint, ... so I can't supply you with any actual logs... sorry
This issue still exist! My dev runner nodemon is restarting and throwing errors.