-
-
Notifications
You must be signed in to change notification settings - Fork 250
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: Driven by NodeJs #392
Comments
BTW, we should move half of the files from the Mads, do you want to do that? |
Let me make a 1.6 release now and then move it |
Note that JSON itself does not support comments; see the full syntax at http://www.json.org/ JSHint removes comments before parsing the file: https://github.com/jshint/jshint/blob/2.x/src/cli.js#L396 |
The JSON editor that we're building in VS will be able to handle comments even though some parsers can't handle comments. |
I think we should create a designer for jshintrc files with a property grid bound to a settings object parsed from JSON (like we already have in the JSHint settings files) We can then allow users to right-click a project (or folder), Add New Item, JSHint Configuration, and get a nice UI to build it. |
A .jshintrc item template is already in SideWaffle I believe. Same with .jshintignore. |
For ignores, I think we should get rid of the separate user-level ignore list in options & instead add a We can add a |
I'll talk to the crew about a Markdown icon. It has to be registered on in Windows for it to take effect in Solution Explorer, but there might be a way that doesn't require Admin privileges. |
Agreed, a great editor for .jshintignore would be awesome |
We can make a Windows file type without admin by writing to However, we also need a good icon. |
Speaking of which, we should add IntelliSense for Registry paths & values in |
Great then. I assume it just requires a .ico file, correct? I'll get on it |
Yes; preferably matching VS's icon style & with a 256px image for Explorer. |
Would be nice, if we have syntax highlighting (and intellisence if applicable) support for .reg, .bat, .com and .ps1 in Visual Studio. Some projects use these files and its very unexpected to see those opening as plain text in an IDE like Visual Studio. :) @SLaks, thanks for the input. Nice idea about organizing compliers in one place. I was thinking about moving JsHint's variants to Margin. Also, would it make sense to change @madskristensen, speaking of JSON, unlike Newtonsoft's JSON.NET, the current implementation of |
None of this (including existing compilers) have anything to do with Margins; Mads will move all of those classes out of that folder soon. After moving the files, we should extract the last bits of source map code from the margin classes to fully decouple them. |
Pull requests welcome. |
Note that System.Web.Helpers.Json deserializes objects to dictionaries and therefore cannot preserve original property order. JSON.Net does preserve property order, but AFAIK still doesn't preserve whitespace, making it less than perfect for this as well. I am not aware of any .Net JSON API that preserves whitespace tokens. |
In contrast, look at my code to preserve whitespace & comments for XML settings files in Rebracer; https://github.com/SLaks/Rebracer/blob/master/Rebracer/Utilities/XmlMerger.cs and https://github.com/SLaks/Rebracer/blob/master/Rebracer.Tests/UtilitiesTets/XmlMergerTests.cs#L196 |
@am11 VS uses JSON.NET internally. It's the best .NET implementation of a JSON parser and we should use it whenever possible instead of other serializers/parsers. |
From Bing images: http://www.bing.com/images/search?&q=markdown+icon This one looks very VS'ish: At the same time, I believe there are better options than this. B-) |
No; the lines are too thick & the angle doesn't belong. |
Providing colorization, Intellisense, validation etc. for non-web file types such as |
We can use whatever icon for POC purposes while we find a better icon. The point here is to have an icon for .md, and secondarily that it looks sweet |
@madskristensen, so would it be a modified (better) version of JSON.NET as there are some issues with JSON.NET (preserving whitespaces which @SLaks mentioned and handling single-line comments)? |
@madskristensen, please don't forget aboutthe IcedCoffeeScript icon (#360): in contrast with: |
@am11 with the change of the vsix manifest this http://visualstudiogallery.msdn.microsoft.com/fd129629-a1a1-417c-ac80-c9ac7a67b968 runs in VS2013, and offers allot of syntax highlighting including .json |
I think we should get the icon for |
@am11 For issues found with JSON.NET, we should contribute to that project to have them fixed instead of doing all the workarounds in WE. |
@SLaks, would it also differentiate between tabs (\t) and whitespace? @madskristensen, that makes sense too! Btw, the iced coffee glass with straw one was taken from their official website: http://maxtaco.github.io/coffee-script/ |
I've been very disappointed with TextHighlighterExtension. |
@madskristensen, YES! both sass and scss 👍 |
@am11 We also need unit tests for JSHint compilation. |
Yes and now for SASS too. :) |
I just confirmed that SideWaffle has both a |
To clarify, JSHint looks for the closest This happens regardless of solution structure; in particular, a solution-level |
OAN, should we merge the hardcoded list of ignore files and user-defined (persistent) files in a global |
@am11 I think that would be cool |
@SLaks That makes sense. The best thing is if WE just uses the regular JSHint behavior instead of supplying its own. Do you want to create an issue for that with a description of what needs to be done? Then I think we can close this issue |
@SLaks, can we search
|
@madskristensen, close it after the |
Yup I guess its done as we have a separate issue for it. |
Do you think we should fix |
@am11 As I said before, that isn't a good idea. |
So how do we provide the default settings? Are they already set in JSHint and so there is no need for a global |
Yes; JSHint works fine without any config files. |
@SLaks, yes! That really makes sense. So should we also get rid off the hardcoded files to ignore logic too? |
We can't simply get rid of that entirely, since JSHint won't skip those files by default. I think it would make most sense to keep the hard-coded ignore list, but use default Note that if we want to support a user-global |
Ok, so if I understand you correctly, the tasks are:
How does that sound? |
Perfect. So the JSHint tab in WE Options would then edit either the user-profile or solution-level We can use https://github.com/SLaks/ConfOxide, which is almost finished, to easily databind to the JSON file & preserve property order (but unfortunately not formatting). |
I'm not sure we can edit the If this is true, then the 1-4 tasks are correct, right? |
Yes. We should then add a designer for |
I don't think we need a designer for I agree with adding a gesture to editing the user-global
I'll close this issue and open #441 with all these tasks since they are so inter-connected. |
For |
I agree, but I don't think it is super important. It's more of a nice-to-have. Also, some users might be really annoyed by it |
True |
We are planning on rewriting JsHint compiler driven by NodeJs. As discussed with @madskristensen, we would have a standard
.jshintrc
(a global settings) file along withWE2013-settings.xml
in User Profile folder.Momentarily, In our
JsHintRunner
class, we have at least three ways to ignore js files, to skip them when seeding files toJsHintCompiler
:.jshintignore
file in the project folder or sub folders.I am thinking about merging first two in one
.jshintignore
file and place it in the settings directory (along with.jshintrc
file along withWE2013-settings.xml
).The catch:
This means we will no longer have anything related to JsHint in
WE2013-settings.xml
.PROS:
.jshintrc
andjshintignore
.settings-backup
under Resources. So, if global file is missing under user profile, it will justFile.Copy()
without parsing and caching the contents..jshintrc
dynamically and yet engaging File I/O.CONS (off the top of my head, there is one):
We won't be giving options under VS's
Tools > Options > Web Essentials
dialog. User would have to change settings in standard.jshintrc
and.jshintignore
filesPoint to ponder:
.jshintrc
is essentially aJSON
file:https://github.com/gruntjs/grunt-contrib-jshint/blob/master/.jshintrc
https://gist.github.com/haschek/2595796
Evidentially, these files can have single line comments. Unfortunately
System.Web.Helpers.Json
doesn't support parsing JSON with comments whileNewtonSoft's JSON.NET
only supports multi-line comments, and throws exception for single-line comments.(I guess the current implementation must also has this problem).Therefore, provisioning of settings in VS's GUI options dialog is going to be problematic either way.
Have any suggestions, ideas? Please chip-in!
Thanks.
The text was updated successfully, but these errors were encountered: