Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Narwhal keywords #58

Closed
wants to merge 1 commit into from

3 participants

@cuberoot

Hi Douglas,

I've added a narwhal option to my fork of JSLint that adds support for a few extra keywords. See http://narwhaljs.org/ for info about Narwhal.

Cheers!
Mike

@douglascrockford

I'm not sure it's worth the trouble for just 3 global variables.

@jdalton

RingoJS has those 3 globals too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 11 additions and 3 deletions.
  1. +11 −3 jslint.js
View
14 jslint.js
@@ -1,5 +1,5 @@
// jslint.js
-// 2011-07-19
+// 2011-07-24
// Copyright (c) 2002 Douglas Crockford (www.JSLint.com)
@@ -172,6 +172,7 @@
// indent the indentation factor
// maxerr the maximum number of errors to allow
// maxlen the maximum length of a source line
+// narwhal true, if Narwhal globals should be predefined
// newcap true, if constructor names capitalization is ignored
// node true, if Node.js globals should be predefined
// nomen true, if names may have dangling _
@@ -327,7 +328,7 @@
missing_property: string, missing_space_a_b: string, missing_url: string,
missing_use_strict: string, mixed: string, mm: boolean, mode: string,
move_invocation: string, move_var: string, n: string, name: string,
- name_function: string, nav: object, nested_comment: string,
+ name_function: string, narwhal: boolean, nav: object, nested_comment: string,
newcap: boolean, node: boolean, noframes: object, nomen, noscript: object,
not: string, not_a_constructor: string, not_a_defined: string,
not_a_function: string, not_a_label: string, not_a_scope: string,
@@ -903,6 +904,9 @@ var JSLINT = (function () {
lines,
lookahead,
member,
+ narwhal = array_to_object([
+ 'require', 'exports', 'print'
+ ], false),
node = array_to_object([
'Buffer', 'clearInterval', 'clearTimeout', 'console', 'exports',
'global', 'module', 'process', 'querystring', 'require',
@@ -1280,6 +1284,10 @@ var JSLINT = (function () {
add_to_predefined(windows);
option.windows = false;
}
+ if (option.narwhal) {
+ add_to_predefined(narwhal);
+ option.narwhal = false;
+ }
if (option.node) {
add_to_predefined(node);
option.node = false;
@@ -6938,7 +6946,7 @@ klass: do {
};
itself.jslint = itself;
- itself.edition = '2011-07-19';
+ itself.edition = '2011-07-24';
return itself;
Something went wrong with that request. Please try again.