reid / node-jslint

The JavaScript Code Quality Tool — for Node.js.
http://jslint.com/
Other
491 stars 101 forks source link

Top level unused variables don't raise an error #126

Closed mantoni closed 9 years ago

mantoni commented 9 years ago

When using JSLint with node modules, top level variables that are not used do not raise an error as expected. This PR adds a failing unit test demonstrating the issue. I'm not sure whether this is a node-jslint or a jslint issue.

Please advice on how to get this fixed.

smikes commented 9 years ago

Thanks.

I believe this behavior stems from jslint, so it's not something we can address in node-jslint. However now is an excellent time to raise the issue, because Crockford is working on the next edition of jslint which will support Ecmascript 6 - http://new.jslint.com/jslint.html . Your test case (var unused = null) generates no warnings about unused in the current version of new jslint. You can raise issues in the jslint Google+ group: https://plus.google.com/u/0/communities/104441363299760713736?cfem=1

mantoni commented 9 years ago

Update: This got fixed very quickly for new jslint. It works on the website now. There is no backport to the current stable version of jslint though. I saw pre-releases of node-jslint on npm, but the sources don't seem to live in this repo. Can I use a pre-release to test the latest new.jslint version?

smikes commented 9 years ago

Yes I will build one today. Thanks for pinging me.

On Tue, Mar 24, 2015 at 3:55 PM, Maximilian Antoni notifications@github.com wrote:

Update: This got fixed very quickly for new jslint. It works on the website now. There is no backport to the current stable version of jslint though. I saw pre-releases of node-jslint on npm, but the sources don't seem to live in this repo. Can I use a pre-release to test the latest new.jslint version?

Reply to this email directly or view it on GitHub: https://github.com/reid/node-jslint/pull/126#issuecomment-85709631

smikes commented 9 years ago

New version on npm, and I have also pushed the jslint-es6 branch from my own repo to this one.

mantoni commented 9 years ago

:+1: Thanks.