-
Notifications
You must be signed in to change notification settings - Fork 82
Lint source code. #179
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
Lint source code. #179
Conversation
Can you make a PR with the patches I comment first and then we leave the rest after a rebase? |
On a side note @cscott, I'd be very interested if you make a PR to switch to Grunt instead of ant. That change was made for CSS Lint some time ago and we have cleaned a lot of bloat. After that, personally, I'd like to switch to ESLint for both projects but one step at a time. |
@XhmikosR wrt c470821 -- there are a number of cases of this pattern in the code:
where the value of
but it seemed like the Strictly speaking, |
@cscott: all right then. Please fetch and rebase and while at it, run the new jshint |
@XhmikosR could you look at #157, #180, and #186? In particular, #180 is included as part of this stack; it would be nicer to merge that separately and then rebase; and #157 conflicts in a trivial way with this patch stack, so it would be better to merge that first and then rebase this on top to resolve the conflict. #186 is just gravy. And I'm assuming the |
@cscott: I merged what I could review; the rest will probably have to wait for someone else. And, yeah, I was talking about jshint.js. |
@XhmikosR ok, I'm going to hang tight and see if we can get #157 and #180 merged, then, before I rebase. If things seem to stall, I can factor out #180 from this patch (adding an explicit |
Rebased on top of PR #180. |
I still believe you should minify jshint.js. It's so many bloat for the repo. |
@XhmikosR I've minified jshint.js and updated this PR. |
a163aed
to
ba286ce
Compare
The CSS escape syntax is not the same as JavaScript escapes -- and besides, using `eval` is evil. Write a proper parser (and serializer) for CSS strings with escape sequences. Regular expressions in this patch based on those found in https://www.w3.org/TR/CSS21/grammar.html#scanner
Implement proper parsing of escape sequences in unquoted URL function arguments, and ensure escape sequences in quoted URLs are properly translated when creating a PropertyValuePart. The secondary parsing in PropertyValuePart to assign a type string can fail when the identifier contains escape sequences. Pass in a `hint` object based on the original token emitted from the lexer to disambiguate in these cases.
Rhino JAR updated to latest stable release: 1.7.7. JSHint updated to jshint/jshint#2855 which is based on 2.9.1 and restores CLI functionality to the Rhino build. It was then minified with: $ (head -1 lib/jshint.js ; tail -n +2 lib/jshint.js | uglifyjs -c -m --screw-ie8 ) > lib/jshint.min.js
This prevents inadvertent leakage of `Object` properties into the map.
This prevents inadvertent leakage of `Object` properties into the map.
How about we switch to ESLint and getting rid of ant? I just find JSHint way less powerful these days. Also, I'm not sure about the |
The I'm all for switching to eslint/jscs/whatever eventually, but please merge this first. A bunch of later patches depend on it, and I'm spending too much time rebasing and resolving conflicts. |
As long as you are around to take care of any potential regressions, I'd like to move forward to better build system. |
Update the version of jshint used by this package, and delint the code to get rid of
==
, unused variables, and maps which inherit fromObject.prototype
(and thus contain spurious keys likehasOwnProperty
).