Skip to content
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

Closed
VaclavElias opened this issue Jan 31, 2014 · 39 comments
Closed

JSHint/JSCS Errors on .min files and others? #603

VaclavElias opened this issue Jan 31, 2014 · 39 comments

Comments

@VaclavElias
Copy link

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??

@SLaks
Copy link
Collaborator

SLaks commented Jan 31, 2014

It looks like we accidentally removed the logic that skips .min and bundle output files.
However, you can always use a .jshintignore instead.

@VaclavElias
Copy link
Author

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-----
From: SLaks notifications@github.com
Date: Fri, 31 Jan 2014 11:59:50
To: madskristensen/WebEssentials2013WebEssentials2013@noreply.github.com
Reply-To: madskristensen/WebEssentials2013 reply@reply.github.com
Cc: Vaclav Eliasvaclavelias@gmail.com
Subject: Re: [WebEssentials2013] JSHint/JSCS Errors on .min files and others?
(#603)

It looks like we accidentally removed the logic that skips .min and bundle output files.
However, you can always use a .jshintignore instead.


Reply to this email directly or view it on GitHub:
#603 (comment)

@jflamb
Copy link

jflamb commented Feb 1, 2014

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.

@SLaks
Copy link
Collaborator

SLaks commented Feb 1, 2014

Validation shouldn't block the UI thread; we run all such processes asynchronously.
Can you attach a second copy of VS and pause the debugger when it's frozen, then tell us what it's stuck doing?

.jshintignore also should work.
What does your ignore file look like?
Does stock jshint (installed via npm) recognize it?

@jflamb
Copy link

jflamb commented Feb 2, 2014

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
jquery_.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?

@VaclavElias
Copy link
Author

Hey,

I have just installed 1.8 on my other computer and Visual Studio goes
unresponsive/very slow.

Rebuild of the project, very slow. ...still rebuilding.. now message Not
responding ..some output to Output window .. again Not Responing ..still
Not Responding ..

It Took 2 hours to rebuild my project!! Ok, ok, 2 minutes instead of a few
second before the update...

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:
JsHint (W069): ['jswing'] is better written in dot notation.

02/02/2014 15:45:19: JsHint: jquery.flippy.js compilation failed: JsHint
(W033): Missing semicolon.

02/02/2014 15:45:19: JsHint: jyoti-yoga.box.js compilation failed: JsHint
(W083): Don't make functions within a loop.

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
statement without curly braces

02/02/2014 15:45:19: JSCS: jquery.unobtrusive-ajax.min.js compilation
failed: JSCS: Operator = should not stick to preceding expression

02/02/2014 15:45:19: JSCS: jquery.validate.js compilation failed: JSCS:
Missing space after switch keyword

02/02/2014 15:45:19: JSCS: bootstrap.min.js compilation failed: JSCS:
Operator = should not stick to preceding expression

02/02/2014 15:45:19: JSCS: bootstrap.js compilation failed: JSCS: Multiple
line break

02/02/2014 15:45:19: JSCS: modernizr-2.6.2.js compilation failed: JSCS:
Operator , should stick to preceding expression

02/02/2014 15:45:19: JSCS: jquery.validate.min.js compilation failed: JSCS:
Operator : should not stick to following expression

02/02/2014 15:45:20: JSCS: bootstrap.min.js compilation failed: JSCS:
Operator = should not stick to preceding expression

02/02/2014 15:45:20: JSCS: jquery-1.9.1.js compilation failed: JSCS:
Operator + should not stick to following expression

02/02/2014 15:45:20: JSCS: jquery.validate.unobtrusive.min.js compilation
failed: JSCS: Operator = should not stick to following expression

02/02/2014 15:45:20: JSCS: jquery.validate.unobtrusive.js compilation
failed: JSCS: Keyword else should not be placed on new line

02/02/2014 15:45:20: JSCS: jquery-1.9.1.min.js compilation failed: JSCS:
Operator = should not stick to following expression

02/02/2014 15:45:25: JSCS: jquery.easing.1.3.js compilation failed: JSCS:
Operator * should not stick to preceding expression

02/02/2014 15:45:26: JSCS: jquery-ui-1.10.3.js compilation failed: JSCS:
Operator + should not stick to following expression

02/02/2014 15:45:26: JSCS: jquery.validate-vsdoc.js compilation failed:
JSCS: If statement without curly braces

02/02/2014 15:45:26: JSCS: jquery.validate.unobtrusive.js compilation
failed: JSCS: Keyword else should not be placed on new line

02/02/2014 15:45:26: JSCS: jquery-ui-1.10.3.min.js compilation failed:
JSCS: Operator = should not stick to following expression

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:
Operator : should not stick to following expression

02/02/2014 15:45:26: JSCS parse error: Error: Syntax error at
F:\work!development!projects\CreativeRainbow\www.nsafreespyingservice.com\JyotiYoga\JyotiYoga\Scripts_references.js:
Line 1: Unexpected token ILLEGAL

at StringChecker.checkString
(C:\Users\v.elias\AppData\Local\Microsoft\VisualStudio\12.0\Extensions\ssiypx4j.q4k\Resources\nodejs\tools\node_modules\jscs\lib\string-checker.js:209:19)

at
C:\Users\v.elias\AppData\Local\Microsoft\VisualStudio\12.0\Extensions\ssiypx4j.q4k\Resources\nodejs\tools\node_modules\jscs\lib\checker.js:58:26

at Array.0
(C:\Users\v.elias\AppData\Local\Microsoft\VisualStudio\12.0\Extensions\ssiypx4j.q4k\Resources\nodejs\tools\node_modules\vow\lib\vow.js:194:56)

at callFns
(C:\Users\v.elias\AppData\Local\Microsoft\VisualStudio\12.0\Extensions\ssiypx4j.q4k\Resources\nodejs\tools\node_modules\vow\lib\vow.js:452:35)

at process._tickCallback (node.js:415:13)

02/02/2014 15:45:26: JSCS: _references.js compilation failed: Error: Syntax
error at F:\work!development!projects\CreativeRainbow
www.nsafreespyingservice.com\JyotiYoga\JyotiYoga\Scripts_references.js:
Line 1: Unexpected token ILLEGAL

at StringChecker.checkString
(C:\Users\v.elias\AppData\Local\Microsoft\VisualStudio\12.0\Extensions\ssiypx4j.q4k\Resources\nodejs\tools\node_modules\jscs\lib\string-checker.js:209:19)

at
C:\Users\v.elias\AppData\Local\Microsoft\VisualStudio\12.0\Extensions\ssiypx4j.q4k\Resources\nodejs\tools\node_modules\jscs\lib\checker.js:58:26

at Array.0
(C:\Users\v.elias\AppData\Local\Microsoft\VisualStudio\12.0\Extensions\ssiypx4j.q4k\Resources\nodejs\tools\node_modules\vow\lib\vow.js:194:56)

at callFns
(C:\Users\v.elias\AppData\Local\Microsoft\VisualStudio\12.0\Extensions\ssiypx4j.q4k\Resources\nodejs\tools\node_modules\vow\lib\vow.js:452:35)

at process._tickCallback (node.js:415:13)

02/02/2014 15:45:26: JSCS: jquery-1.9.1.js compilation failed: JSCS:
Operator + should not stick to following expression

02/02/2014 15:45:26: JSCS: jquery-1.9.1.intellisense.js compilation failed:
JSCS: Multiple line break

02/02/2014 15:45:26: JSCS: jquery.unobtrusive-ajax.min.js compilation
failed: JSCS: Operator = should not stick to preceding expression

02/02/2014 15:45:26: JSCS: modernizr-2.6.2.js compilation failed: JSCS:
Operator , should stick to preceding expression

02/02/2014 15:45:26: JSCS: jquery.flippy.js compilation failed: JSCS: If
statement without curly braces

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:
Missing space after switch keyword

02/02/2014 15:45:26: JSCS parse error: Error: Syntax error at
F:\work!development!projects\CreativeRainbow\www.nsafreespyingservice.com\JyotiYoga\JyotiYoga\obj\Release\Package\PackageTmp\Scripts_references.js:
Line 1: Unexpected token ILLEGAL

at StringChecker.checkString
(C:\Users\v.elias\AppData\Local\Microsoft\VisualStudio\12.0\Extensions\ssiypx4j.q4k\Resources\nodejs\tools\node_modules\jscs\lib\string-checker.js:209:19)

at
C:\Users\v.elias\AppData\Local\Microsoft\VisualStudio\12.0\Extensions\ssiypx4j.q4k\Resources\nodejs\tools\node_modules\jscs\lib\checker.js:58:26

at Array.0
(C:\Users\v.elias\AppData\Local\Microsoft\VisualStudio\12.0\Extensions\ssiypx4j.q4k\Resources\nodejs\tools\node_modules\vow\lib\vow.js:194:56)

at callFns
(C:\Users\v.elias\AppData\Local\Microsoft\VisualStudio\12.0\Extensions\ssiypx4j.q4k\Resources\nodejs\tools\node_modules\vow\lib\vow.js:452:35)

at process._tickCallback (node.js:415:13)

02/02/2014 15:45:26: JSCS: _references.js compilation failed: Error: Syntax
error at F:\work!development!projects\CreativeRainbow
www.nsafreespyingservice.com\JyotiYoga\JyotiYoga\obj\Release\Package\PackageTmp\Scripts_references.js:
Line 1: Unexpected token ILLEGAL

at StringChecker.checkString
(C:\Users\v.elias\AppData\Local\Microsoft\VisualStudio\12.0\Extensions\ssiypx4j.q4k\Resources\nodejs\tools\node_modules\jscs\lib\string-checker.js:209:19)

at
C:\Users\v.elias\AppData\Local\Microsoft\VisualStudio\12.0\Extensions\ssiypx4j.q4k\Resources\nodejs\tools\node_modules\jscs\lib\checker.js:58:26

at Array.0
(C:\Users\v.elias\AppData\Local\Microsoft\VisualStudio\12.0\Extensions\ssiypx4j.q4k\Resources\nodejs\tools\node_modules\vow\lib\vow.js:194:56)

at callFns
(C:\Users\v.elias\AppData\Local\Microsoft\VisualStudio\12.0\Extensions\ssiypx4j.q4k\Resources\nodejs\tools\node_modules\vow\lib\vow.js:452:35)

at process._tickCallback (node.js:415:13)

02/02/2014 15:45:26: JSCS: jquery.validate.unobtrusive.min.js compilation
failed: JSCS: Operator = should not stick to following expression

02/02/2014 15:45:26: JSCS: less.min.js compilation failed: JSCS: Operator
=== should not stick to following expression

02/02/2014 15:45:26: JSCS: less.min.js compilation failed: JSCS: Operator
=== should not stick to following expression

02/02/2014 15:45:26: JSCS: bootstrap.js compilation failed: JSCS: Multiple
line break

02/02/2014 15:45:26: JSCS: jquery-1.9.1.min.js compilation failed: JSCS:
Operator = should not stick to following expression

02/02/2014 15:45:26: JSCS: jquery-ui-1.10.3.js compilation failed: JSCS:
Operator + should not stick to following expression

02/02/2014 15:45:26: JSCS: jquery-ui-1.10.3.min.js compilation failed:
JSCS: Operator = should not stick to following expression

02/02/2014 15:47:03: LESS: site.less compiled.

02/02/2014 15:47:04: LESS: type.less compilation failed: NameError:
variable @baseLineHeight is undefined

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:

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.NETMVC 5.1 project). It's contents looks like this:

bootstrap_.js
jquery_.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?

Reply to this email directly or view it on GitHubhttps://github.com//issues/603#issuecomment-33896903
.

@SLaks
Copy link
Collaborator

SLaks commented Feb 2, 2014

Again, disable JS Lint on Build (and perhaps also LESS Compile on Build) to prevent that.

@NikGovorov
Copy link

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.

@ashclarke
Copy link

It seems that JS Lint on build also seems to be ignoring the .jshintignore file in the root of the project. I end up with about 54000 errors (coming from the 7 third-party files and the 2 files from the bundle containing them all). None of the other 7 files are minified.

If I run it on the js folder, the linter then recognises the ignore file and the errors are gone.

@bizcad
Copy link

bizcad commented Feb 6, 2014

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:

 legacy.js
 somelib/*.*
 *.js

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.

@ChrisTorng
Copy link
Contributor

The only way useful I found is go to "Tools - Options - Web Essentials - JavaScript", set Run on Build/Save to False.

@ChrisTorng
Copy link
Contributor

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:

"excludeFiles": ["C:/Solution/Project/Scripts/*", "C:/Solution/Project/Scripts/kendo/*"]

But this way will generate another Build error per js file:

JSCS parse error: <?xml version="1.0" encoding="utf-8"?>
<checkstyle version="4.3">
</checkstyle>

And information item per js file:

<?xml version="1.0" encoding="utf-8"?>
<checkstyle version="4.3">
</checkstyle>

I don't know how to avoid it. So maybe the best way is just the first easy way.

@VaclavElias
Copy link
Author

So is it normal and official that when you install Web Essential from now
on that we, mortals have to make some changes in our project?? This hasn't
been before like that. Web Essential is supposed to help with your
performance and not give you extra tasks.

Can any Web Essential developer confirm that:

  1. There is a bug in 1.8 which is going to be fixed or
  2. This is just a special nature of the project I / we have got and we have
    to fix it ourselves

Note, that the version before 1.8 is just absolutely fine.

On 6 February 2014 09:26, ChrisTorng notifications@github.com wrote:

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:

"excludeFiles": ["C:/Solution/Project/Scripts/", "C:/Solution/Project/Scripts/kendo/"]

But this way will generate another Build error per js file:

JSCS parse error:

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.

Reply to this email directly or view it on GitHubhttps://github.com//issues/603#issuecomment-34305469
.

@SLaks
Copy link
Collaborator

SLaks commented Feb 6, 2014

@ChrisTorng Can you report the config & error issues to JSCS?

@ChrisTorng
Copy link
Contributor

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

"Scripts/**"
"Scripts/*"
"*"
"**"
"***"
"*.js"
"x.js"
"Scripts\*"
"Scripts\\*"
"Scripts\\**"

all without luck.

I think the JSCS excludeFiles should be ok, I guess the problem is the integration piece of Web Essentials.

@nschonni
Copy link
Contributor

nschonni commented Feb 7, 2014

Copying from the JSCS issue

Minimatch is the library that both JSCS and JSHint use for the globbing (matching) patterns for the ignore files. This is the same format as your regualr .gitignore files.

@am11
Copy link
Contributor

am11 commented Feb 7, 2014

@ChrisTorng, can you try *\\Scripts\\*?

Also, if its a Web Essentials issue, can you please make an SSCCE? I will take a stab at it.

Thanks.

@ChrisTorng
Copy link
Contributor

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.
*\\Scripts\\* have no use too.

@SLaks
Copy link
Collaborator

SLaks commented Feb 7, 2014

WE does not have any default exclusions for JSCS.
We do have for JSHint (https://github.com/madskristensen/WebEssentials2013/blob/master/EditorExtensions/Commands/JavaScript/JsHintReporter.cs#L24), but we forgot to use that logic for JSCS.

@ChrisTorng
Copy link
Contributor

Just see the new 1.8.5 version. Address issue here.

  • Performance fixes
  • Disabled JS linting on build
    • Was causing node.exe to run wild

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.

@am11
Copy link
Contributor

am11 commented Feb 7, 2014

Got it: **\\Scripts\\** works. Ignore the <xml message. It will be fixed with vNext in conjunction with the vNext of JSCS. It was caused by jscs-dev/node-jscs#212, which is now fixed.

@am11
Copy link
Contributor

am11 commented Feb 7, 2014

Also, if you have node installed, from cmd you can install npm install -g minimatch and then you can test it yourself:

var minimatch = require("minimatch.js");
minimatch.Minimatch("**\\Scripts\\**").match("C:\\temp\\Scripts\\foo.js"); // returns true

@ChrisTorng
Copy link
Contributor

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

@ChrisTorng
Copy link
Contributor

Just found that Run on build True won't run JSCS, maybe this is just what the new version changed. And I found **/Scripts/** do the work too.

@SLaks
Copy link
Collaborator

SLaks commented Feb 7, 2014

Yes; the new version temporarily disabled JS linting on build while we work out a good solution.

@nschonni
Copy link
Contributor

nschonni commented Feb 7, 2014

With default excludeFiles "test/data/*.js",

That is not a JSCS default, but the setting file specific to the JSCS project

@am11
Copy link
Contributor

am11 commented Feb 7, 2014

Run JSCS on minified js is stupid.

Yes; we should have **\\*.min.js in default .jscs.json (soon to become; .jscsrc.. based on jscs-dev/node-jscs@67ba75b).

@nschonni
Copy link
Contributor

nschonni commented Feb 7, 2014

You should use unix style paths for ignore files **/*.min.js (same as already used in your .gitignore)

@coderealm
Copy link

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.
It is frustrating to build and because it hangs the UI thread on VS 2013. No development can be done.

@VaclavElias
Copy link
Author

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:

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.

It is frustrating to build and because it hangs the UI thread on VS 2013.
No development can be done.

Reply to this email directly or view it on GitHubhttps://github.com//issues/603#issuecomment-34541216
.

@ChrisTorng
Copy link
Contributor

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

"excludeFiles": ["test/data/*.js"],

into

"excludeFiles": ["**/*.min.js", "**/*.debug.js", "**/*.intellisense.js", "**/*-vsdoc.js"],

to skip JSCS only on minified js. Or change to

"excludeFiles": ["**"],

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 "**/Scripts/*.js".

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.

@am11
Copy link
Contributor

am11 commented Feb 8, 2014

You can also send PR to vswebessentials.com's repo with updated docs.

@coderealm
Copy link

Hi,

Many thanks for your response. I saw it in one of the threads and applied
it and it was fixed.
Once again thanks.

Julius

On Sat, Feb 8, 2014 at 2:08 PM, ChrisTorng notifications@github.com wrote:

Am I now one of WE team? ;)

If you don't need JSHint and JSCS's function, just goto "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.

While JSCS, it may delay you about serval seconds with minified js. If you
don't wanna wait, then goto "Web Essentials - Edit global JSCS settings".
Change

"excludeFiles": ["test/data/*.js"],

into

"excludeFiles": ["/*.min.js", "/.debug.js", "__/.intellisense.js", "*/-vsdoc.js"],

to skip JSCS only on minified js. Or change to

"excludeFiles": ["**"],

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 "*/Scripts/.js". And it don't know
about sub dir, so you need to exclude every single path if you add path
name into the pattern.

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, so it don't change what I say here.

Hope these information are right and helpful.

Reply to this email directly or view it on GitHubhttps://github.com//issues/603#issuecomment-34544689
.

@ChrisTorng
Copy link
Contributor

I'm afraid of my poor English make WE site less professional... 👎
Anyone can just take it, make it better then PR. 👍

@coderealm
Copy link

Hi,

Hope you are well. I saw a thread that led me to the solution. I am good
now, many thanks for your help.

Regards,

Julius

On Sat, Feb 8, 2014 at 4:26 PM, ChrisTorng notifications@github.com wrote:

I'm afraid of my poor English make WE site less professional... [image:
👎]
Anyone can just take it, make it better then PR. [image: 👍]

Reply to this email directly or view it on GitHubhttps://github.com//issues/603#issuecomment-34548158
.

@madskristensen
Copy link
Owner

This has been fixed

@softwarebear
Copy link

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-)

@softwarebear
Copy link

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.

@ChrisTorng
Copy link
Contributor

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 excludeFiles config still works, but not necessary anymore.
Whenever jscs-dev/node-jscs#212 get solved and integrated into WE, I will clear out my hack about omit <xml... And jscs-dev/node-jscs#238 related to my hack about total error limit. Seems they almost reach new version (with jscs-dev/node-jscs#212 ?) 1.3.0? https://github.com/mdevils/node-jscs/releases

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests