Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

export jslint for commonjs #4

Closed
wants to merge 2 commits into from

3 participants

Oleg Slobodskoi Douglas Crockford Marcel Korpel
Oleg Slobodskoi

To avoid ugly evals of jslint in any commonjs env. like nodejs, would be nice to export jslint.

kof added some commits
Oleg Slobodskoi kof I think there should be typeof predefined[v] !== 'boolean' instead of…
… "predefined[v] !== 'boolean'" because predefined is a has with boolean values :)


Actually there is no need to check the type, better way is just "predefined[v] !== true"
a1c2a4f
Oleg Slobodskoi kof export jslint for commonjs env 0a6d07b
Douglas Crockford

No thanks. That doesn't need to be in the common source file. It could be trivially appended.

Marcel Korpel

Then you don't have to test for predefined[v] !== true, but could just use
!predefined[v]

yes, but it is not explicitly and conflicts with jslint ideas.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 2 unique commits by 1 author.

Nov 27, 2010
Oleg Slobodskoi kof I think there should be typeof predefined[v] !== 'boolean' instead of…
… "predefined[v] !== 'boolean'" because predefined is a has with boolean values :)


Actually there is no need to check the type, better way is just "predefined[v] !== true"
a1c2a4f
Oleg Slobodskoi kof export jslint for commonjs env 0a6d07b
This page is out of date. Refresh to see the latest.

Showing 1 changed file with 6 additions and 1 deletion. Show diff stats Hide diff stats

  1. +6 1 fulljslint.js
7 fulljslint.js 100755 → 100644
@@ -4096,7 +4096,7 @@ loop: for (;;) {
4096 4096 // then we have an undefined variable.
4097 4097
4098 4098 } else if (funct['(global)']) {
4099   - if (option.undef && predefined[v] !== 'boolean') {
  4099 + if (option.undef && typeof predefined[v] !== 'boolean') {
4100 4100 warning("'{a}' is not defined.", token, v);
4101 4101 }
4102 4102 note_implied(token);
@@ -5784,3 +5784,8 @@ loop: for (;;) {
5784 5784 return itself;
5785 5785
5786 5786 }());
  5787 +
  5788 +// export JSLINT if in commonjs env
  5789 +if (typeof exports !== 'undefined') {
  5790 + exports.JSLINT = JSLINT;
  5791 +}

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.