scss-lint-plugin icon indicating copy to clipboard operation
scss-lint-plugin copied to clipboard

Temp files triggers error in watch tasks

Open AndyOGo opened this issue 8 years ago • 13 comments

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

  1. Setup Gulp watch for JavaScript bundling, minification, etc.
  2. Edit JS files in PHPStorm
  3. SCSS-Lint generates temporary files for JS and immediatly removes them
  4. This triggers gulp watch
  5. 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

AndyOGo avatar Aug 24 '16 08:08 AndyOGo

@idok Any updates on this?

AndyOGo avatar Aug 30 '16 15:08 AndyOGo

@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

AndyOGo avatar Sep 16 '16 08:09 AndyOGo

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

AndyOGo avatar Sep 16 '16 08:09 AndyOGo

I have this issue, too

jillesme avatar May 12 '17 15:05 jillesme

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.

laurenbrandstein avatar Jun 03 '17 01:06 laurenbrandstein

@AndyOGo have you found how to disable this plugin?

aspirinchaos avatar Aug 23 '17 16:08 aspirinchaos

@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...

AndyOGo avatar Aug 23 '17 17:08 AndyOGo

I have created an Issue now directly at JetBrains https://youtrack.jetbrains.com/issue/WI-37757

AndyOGo avatar Aug 23 '17 18:08 AndyOGo

Hi Andy, Do you have any other plugins installed?

idok avatar Aug 27 '17 13:08 idok

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.

AndyOGo avatar Aug 29 '17 21:08 AndyOGo

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 avatar Aug 31 '17 14:08 idok

@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

AndyOGo avatar Aug 31 '17 21:08 AndyOGo

This issue still exist! My dev runner nodemon is restarting and throwing errors.

softmantk avatar Jun 25 '20 11:06 softmantk