-
-
Notifications
You must be signed in to change notification settings - Fork 262
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
JSHint/JSCS Errors on .min files and others? #603
Comments
It looks like we accidentally removed the logic that skips |
Thank you. Visual Studio was naughty today. Let's see if it is what you said or it just needs a restart and a few slaps :-) Sent using BlackBerry® from Orange -----Original Message----- It looks like we accidentally removed the logic that skips Reply to this email directly or view it on GitHub: |
I'm having the same problem. I'm using VS 2013 (with Update 1) and I've updated Web Essentials to the latest version. I'm building a new ASP.NET MVC 5 project (with all NuGet packages updated to latest). Shortly after the build completes, the Output window gets a set of JSCS "warnings." I've tried adding a .jshintignore file to my Scripts folder (with jquery_.js and bootstrap_.js) but the warnings still show up after every build. I also tried editing the global JSCS settings via the Web Essentials menu and adding Scripts/jquery*.js to the excludeFiles property. The worst part of this is that it blocks the main VS UI thread while it's doing this validation. So VS goes unresponsive for some 30 seconds or so, then writes the warnings to the Output window. I'd also suggest that these warnings should be in a separate channel of the Output window and not the Build channel. |
Validation shouldn't block the UI thread; we run all such processes asynchronously.
|
The blocking issue has gone away. I wonder if something was getting JITd the first time or two. Something was definitely blocking the UI thread. I created a .jshintignore file in my Scripts folder (this is an ASP.NET MVC 5.1 project). It's contents looks like this: bootstrap_.js I don't have jshint (or npm) installed because I'm not doing node.js development. Are you maybe over-emphasizing the node.js development scenario here? |
Hey, I have just installed 1.8 on my other computer and Visual Studio goes Rebuild of the project, very slow. ...still rebuilding.. now message Not It Took 2 hours to rebuild my project!! Ok, ok, 2 minutes instead of a few So do we still need to do something or the 1.8 should be reviewed???? :-) Scripts folder says about 37,000 Messages.. Output from rebuild: 02/02/2014 15:45:19: JsHint: jquery.easing.1.3.js compilation failed: 02/02/2014 15:45:19: JsHint: jquery.flippy.js compilation failed: JsHint 02/02/2014 15:45:19: JsHint: jyoti-yoga.box.js compilation failed: JsHint 02/02/2014 15:45:19: JSCS: jquery.unobtrusive-ajax.js compilation failed: 02/02/2014 15:45:19: JSCS: jquery.flippy.js compilation failed: JSCS: If 02/02/2014 15:45:19: JSCS: jquery.unobtrusive-ajax.min.js compilation 02/02/2014 15:45:19: JSCS: jquery.validate.js compilation failed: JSCS: 02/02/2014 15:45:19: JSCS: bootstrap.min.js compilation failed: JSCS: 02/02/2014 15:45:19: JSCS: bootstrap.js compilation failed: JSCS: Multiple 02/02/2014 15:45:19: JSCS: modernizr-2.6.2.js compilation failed: JSCS: 02/02/2014 15:45:19: JSCS: jquery.validate.min.js compilation failed: JSCS: 02/02/2014 15:45:20: JSCS: bootstrap.min.js compilation failed: JSCS: 02/02/2014 15:45:20: JSCS: jquery-1.9.1.js compilation failed: JSCS: 02/02/2014 15:45:20: JSCS: jquery.validate.unobtrusive.min.js compilation 02/02/2014 15:45:20: JSCS: jquery.validate.unobtrusive.js compilation 02/02/2014 15:45:20: JSCS: jquery-1.9.1.min.js compilation failed: JSCS: 02/02/2014 15:45:25: JSCS: jquery.easing.1.3.js compilation failed: JSCS: 02/02/2014 15:45:26: JSCS: jquery-ui-1.10.3.js compilation failed: JSCS: 02/02/2014 15:45:26: JSCS: jquery.validate-vsdoc.js compilation failed: 02/02/2014 15:45:26: JSCS: jquery.validate.unobtrusive.js compilation 02/02/2014 15:45:26: JSCS: jquery-ui-1.10.3.min.js compilation failed: 02/02/2014 15:45:26: JSCS: jquery.unobtrusive-ajax.js compilation failed: 02/02/2014 15:45:26: JSCS: jquery.validate.min.js compilation failed: JSCS: 02/02/2014 15:45:26: JSCS parse error: Error: Syntax error at at StringChecker.checkString at at Array.0 at callFns at process._tickCallback (node.js:415:13) 02/02/2014 15:45:26: JSCS: _references.js compilation failed: Error: Syntax at StringChecker.checkString at at Array.0 at callFns at process._tickCallback (node.js:415:13) 02/02/2014 15:45:26: JSCS: jquery-1.9.1.js compilation failed: JSCS: 02/02/2014 15:45:26: JSCS: jquery-1.9.1.intellisense.js compilation failed: 02/02/2014 15:45:26: JSCS: jquery.unobtrusive-ajax.min.js compilation 02/02/2014 15:45:26: JSCS: modernizr-2.6.2.js compilation failed: JSCS: 02/02/2014 15:45:26: JSCS: jquery.flippy.js compilation failed: JSCS: If 02/02/2014 15:45:26: JSCS: sometext.box.js compilation failed: 02/02/2014 15:45:26: JSCS: jquery.validate.js compilation failed: JSCS: 02/02/2014 15:45:26: JSCS parse error: Error: Syntax error at at StringChecker.checkString at at Array.0 at callFns at process._tickCallback (node.js:415:13) 02/02/2014 15:45:26: JSCS: _references.js compilation failed: Error: Syntax at StringChecker.checkString at at Array.0 at callFns at process._tickCallback (node.js:415:13) 02/02/2014 15:45:26: JSCS: jquery.validate.unobtrusive.min.js compilation 02/02/2014 15:45:26: JSCS: less.min.js compilation failed: JSCS: Operator 02/02/2014 15:45:26: JSCS: less.min.js compilation failed: JSCS: Operator 02/02/2014 15:45:26: JSCS: bootstrap.js compilation failed: JSCS: Multiple 02/02/2014 15:45:26: JSCS: jquery-1.9.1.min.js compilation failed: JSCS: 02/02/2014 15:45:26: JSCS: jquery-ui-1.10.3.js compilation failed: JSCS: 02/02/2014 15:45:26: JSCS: jquery-ui-1.10.3.min.js compilation failed: 02/02/2014 15:47:03: LESS: site.less compiled. 02/02/2014 15:47:04: LESS: type.less compilation failed: NameError: 02/02/2014 15:47:04: LESS: variables.less compiled. 02/02/2014 15:47:04: LESS: bootstrap-responsive.less compiled. 02/02/2014 15:47:04: LESS: variables.less compiled. 02/02/2014 15:47:04: LESS: site.less compiled. 02/02/2014 15:47:05: LESS: bootstrap-responsive.less compiled. 02/02/2014 15:47:05: LESS: Site.less compiled. 02/02/2014 15:47:05: LESS: sometext.less compiled. 02/02/2014 15:47:05: LESS: variables.less compiled. 02/02/2014 15:47:05: LESS: sometext-base.less compiled. 02/02/2014 15:47:05: LESS: roulette.less compiled. 02/02/2014 15:47:05: LESS: sometext.less compiled. 02/02/2014 15:47:05: LESS: base.less compiled. 02/02/2014 15:47:05: LESS: engage.less compiled. 02/02/2014 15:47:05: LESS: bootstrap.less compiled. 02/02/2014 15:47:05: LESS: site.less compiled. 02/02/2014 15:47:06: LESS: bootstrap-responsive.less compiled. 02/02/2014 15:47:06: LESS: bootstrap.less compiled. 02/02/2014 15:47:06: LESS: bootstrap.less compiled. On 2 February 2014 10:19, Jim Lamb notifications@github.com wrote:
|
Again, disable JS Lint on Build (and perhaps also LESS Compile on Build) to prevent that. |
I've also mentioned that new version of webessentials(jshint/jscs) scans files that are not under a project, in my case it's typescript output files. |
It seems that JS Lint on build also seems to be ignoring the If I run it on the |
I am adding libraries to a new project in my solution and used nuget to get angular and update the other 3rd party libs like jQuery and bootstrap. After I installed the latest WebEssentials, compiling was pretty fast, but I was getting 23,000 jshint and JSCS errors in these third party libs, and it took an unreasonably long time to list the messages. Since I cannot resolve all the problems in their libs, I moved all the unused angular features (like routing for now) into a folder ~\Scripts\Unused_Javascript. I can move them back when I need them. Then, in the Solution Explorer, I used right click -> Add -> New Item on the Scripts folder, searched for "ignore" added a .jshintignore file into the scripts folder. I altered the template output, so that it looked like this:
That got rid of the jshint errors on the 3rd party libs. My app files in the /app folder are still run. However, I am still getting 22,000+ JSCS errors in the Error's list from JSCS. And VS 2013 becomes unresponsive until the error list updates, which takes a couple of minutes. Modifying the .jscs.json file as per http://stackoverflow.com/questions/21499526/how-can-i-configure-web-essentials-2013-to-ignore-files did not change this behabior. I searched my C:/ drive and found 3 versions of .jscs.json. I tried modifying them all to no avail. I cannot see how to disable JSCS, so I am uninstalling Web Essentials. |
The only way useful I found is go to "Tools - Options - Web Essentials - JavaScript", set Run on Build/Save to False. |
Another method is go to "Web Essentials - Edit global JSCS settings", to set excludeFiles. But multiple excludeFiles is wrong syntax. Should use [ "a", "b"] syntax. And should use absolute path, (while setting in global?) with path divider '/', '' is not allowed. Sub directory is no use, you should specify every single path. So a valid setting like this:
But this way will generate another Build error per js file:
And information item per js file:
I don't know how to avoid it. So maybe the best way is just the first easy way. |
So is it normal and official that when you install Web Essential from now Can any Web Essential developer confirm that:
Note, that the version before 1.8 is just absolutely fine. On 6 February 2014 09:26, ChrisTorng notifications@github.com wrote:
|
@ChrisTorng Can you report the config & error issues to JSCS? |
According to the response of @nschonni in Issue #232: JSCS on Web Essentials, excludeFiles with absolute path, generate parse error. He provide a sample of "Scripts/**". I don't understand the content of https://github.com/isaacs/minimatch. I have test
all without luck. I think the JSCS excludeFiles should be ok, I guess the problem is the integration piece of Web Essentials. |
Copying from the JSCS issue
|
@ChrisTorng, can you try Also, if its a Web Essentials issue, can you please make an SSCCE? I will take a stab at it. Thanks. |
Before make an SSCCE, I think this is a very common issue, start from 1.8. Take a look at Issues, from 7 days ago, there are many JSCS problems, this #603 is the first, then #606, #609, #621, #623, #629. And How can I configure Web Essentials 2013 to ignore files?. Does Web Essentials have a default excludeFiles rules, not seem from global .jscs.json, for JSCS? If yes, what is it? Why it's not working? Maybe due to our Windows/VS environment issue, not the problem of solution/project. If not, then the only rule is the global default "test/data/*.js". This rule won't match anything in typical ASP.NET project. That means JSCS will run on all the js. Any included minified js will generate more then thouands information items easily. Any empty ASP.NET (so this is just the SSCCE) with default NuGet js packages can have serval thouands items. That makes VS eat up lots memory, slow down until not able to use. Turn off JSCS (unfourtunately with JSLint) is only a workaround. I wish to use these functions. I think the best way is Web Essentials has a default excludeFiles rule in option settings, at least exclude common minified js, even better to exclude common NuGet js cause we developer will only focus on those js we wrote. And we can modify that rule by solution/project settings. Before Web Essentials can provide a good default exclude rule, I hope to fix it by edit .jscs.json, so trying any combination of possible pattern. |
WE does not have any default exclusions for JSCS. |
Just see the new 1.8.5 version. Address issue here.
Install it. But the problem still remain. New version doesn't change my Run on build/save settings, doesn't change global .jscs.json excludeFiles. I turn on Run on save before install new version (cause I'm still trying every possible excludeFiles patterns). New install doesn't change Run on save value, keeps on True. I only click on jquery-1.10.2.min.js, not open, just preview, VS stop respond for a while, then shows 8280 information items. Not even save, just preview, JSCS runs. So this is another problem. But if turn off Run on save, preview won't run JSCS. |
Got it: |
Also, if you have node installed, from var minimatch = require("minimatch.js");
minimatch.Minimatch("**\\Scripts\\**").match("C:\\temp\\Scripts\\foo.js"); // returns true |
@SLaks, @am11, can't you reproduce this problem easily? With default excludeFiles "test/data/*.js", and Run on build/save turn on, every js will run JSCS. Just make a build, then VS becomes not responding. Run JSCS on minified js is stupid. Minified js will always violate those rules. We won't fix any items on minified js. Run JSCS on included third-party js is also useless. Only the author should fix them, not us. We want it only run on our own js. So please, makes a good default exclude rules first, then let us modify it (by telling us the right pattern?) to meet our need. Preview should not run if your setting is "Run on save". But if you have another settings "Run on preview/open" that's ok. And JSLint and JSCS should have different settings. At last, still thanks for all efforts on making Web Essentials awesome. |
Just found that Run on build True won't run JSCS, maybe this is just what the new version changed. And I found |
Yes; the new version temporarily disabled JS linting on build while we work out a good solution. |
That is not a JSCS default, but the setting file specific to the JSCS project |
Yes; we should have |
You should use unix style paths for ignore files |
How long will it take for Web Essentials Team to write a "How to exclude.." properly so we all will know how to exclude these built errors, rather than these phrase here which give some us no clues to resolve the build errors. |
True :) I had to downgrade to 1.7 as it was stopping me working :( On 8 February 2014 11:08, coderealm notifications@github.com wrote:
|
Am I now one of WE team? ;) Update to refine If you don't need JSHint and JSCS's function, just go to "Tools - Options - Web Essentials - JavaScript", set "Run on build" and "Run on save" to False. If you wish to use them, keep "Run on build" False, set "Run on save" to True. All js will be JSHint and JSCS while preview, open and save. They can only be turn on or off togetter from Options right now. With this change, you can build successfully without slow down. Error list will only be filled with currently opened js's JSHint and JSCS items. That should reduce lots of items compare to build. Only if you never preview and open minified js. By default setting, JSHint won't run on all minified and some common js library, but JSCS will run always. While JSCS, it may delay you about serval seconds with minified js. If you don't wanna wait, then go to "Web Essentials - Edit global JSCS settings". Change
into
to skip JSCS only on minified js. Or change to
to stop JSCS totally, only keep JSHint running. Of cause you can write your own rule to exclude those you don't need. Just put double stars at the beginning, use '/' instead of '', other part just use single star for wildcard. Like With exclude rule, it will still generate an xml information item for each js, that will be fix later (hopefully), but at last you can start coding. At last, you can upgrade to 1.8.5, but it only stop "Run on build" from running. "Run on save" still need these settings. So it don't change what I say here. Hope these informations are right and helpful, with current version of 1.8 and 1.8.5. |
You can also send PR to vswebessentials.com's repo with updated docs. |
Hi, Many thanks for your response. I saw it in one of the threads and applied Julius On Sat, Feb 8, 2014 at 2:08 PM, ChrisTorng notifications@github.com wrote:
|
I'm afraid of my poor English make WE site less professional... 👎 |
Hi, Hope you are well. I saw a thread that led me to the solution. I am good Regards, Julius On Sat, Feb 8, 2014 at 4:26 PM, ChrisTorng notifications@github.com wrote:
|
This has been fixed |
No it hasn't ... still can't exclude files or folders of files in JSCS or JSHint With VS 12.0.30110.00 Update 1 & WE 2013 1.8 and 1.8.5 ... If I change excludeFiles value in .jscs.json file to that as suggested by ChrisTorng above ... "excludeFiles": ["/*.min.js", "/.debug.js", "__/.intellisense.js", "*/-vsdoc.js"], ... then I get this in the build output window ... 2014-02-14 15:40:36: JSCS: ace.min.js compilation failed: ... when I change and save ace.min.js. It appears to dislike the ** directory wildcard. Sorry guys but this feature is practically useless without line numbers in the warnings too ... 2014-02-14 16:04:52: JsHint: prettify.js compilation failed: JsHint (W033): Missing semicolon. ... the date isn't very good at highlighting where it is. Nice idea ... but a bit more polish required. R 8-) |
Ok ... I've found the Error List window reports all the errors nicely ... so is easy to navigate to each problem. But still cannot get .jshintignore file to work. |
For anyone who concerning this issue. The newest Web Essentials 2013 1.9 has "Better ignore logic for the lint runners", all the problems are cleared. You can turn on "Run on build" now. It has default ignore rule for common js library and minified js. The same rule shared between JSCS and JSHint. The |
Hi,
Not sure if it is my Visaual Studio 2013 but after recent update of Web Essentials I have got like 29654 JSHint/JSCS errors and my Scripts folder (with bootstrap.js, jquery, knockout, ..). Most of the files are minimised. Does it make sense to check out these files for such errors and hints??
The text was updated successfully, but these errors were encountered: