JSHint, A Static Code Analysis Tool for JavaScript
[Use it online•Docs•FAQ•Install•Contribute•Blog•Twitter]
JSHint is a community-driven tool that detects errors and potential problems in JavaScript code. Since JSHint is so flexible, you can easily adjust it in the environment you expect your code to execute. JSHint is open source and will always stay this way.
在开发的过程中代码的编程风格是一个非常特别问题,大家都知道一个好的编程风格对阅读程序的重要性,但是代码的编程风格是没有个固定的标准,很难说哪种编程风格好哪种不好,但是它们之间有些通用的准则。
在JavaScript中有两个比较常用的代码检查工具JSLint和JSHint,JSLint的可配置性比较差,很多选项是无法修改的,所以出现了JSLint的分支项目JSHint,JSHint几乎可以配置所有的编程风格检查。
如果你比较认可JSLint的编程风格可以直接使用,如果有些不太符合你的习惯,那么可以使用JSHint自定义自己的编程风格。
Who uses JSHint?
Engineers from these companies and projects use JSHint:
- Mozilla
- Wikipedia
- Bootstrap
- Disqus
- Medium
- Yahoo!
- SmugMug
- jQuery
- PDF.js
- Coursera
- Adobe Brackets
- Apache Cordova
- RedHat
- SoundCloud
- Nodejitsu
- Yelp
- Voxer
- EnyoJS
- QuickenLoans
- Cloud9
- CodeClimate
- Zendesk
- Apache CouchDB
- Codacy ref
Plugins for text editors and IDEs 文本编辑器和IDE的插件
VIM
- jshint.vim, VIM plugin and command line tool for running JSHint.
- jshint2.vim, modern VIM plugin with extra features for running JSHint.
- Syntastic, supports JSHint both older/newer than 1.1.0.
Emacs
- jshint-mode, JSHint mode for GNU Emacs.
- Flycheck, on-the-fly syntax checking extension for GNU Emacs, built-in JSHint support.
- web-mode, an autonomous major-mode for editing web templates supports JSHint.
Sublime Text
- Sublime-JSHint Gutter, JSHint plugin for graphically displaying lint results in ST2 and ST3.
- sublime-jshint, JSHint build package for ST2.
- Sublime Linter, inline lint highlighting for ST2.
Atom
- linter-jshint, JSHint plugin for Atom's Linter.
- JSHint for Atom, JSHint package for Atom.
TextMate
- JSHint Bundle for TextMate 2
- JSHint TextMate Bundle.
- JSLintMate (supports both JSHint and JSLint).
- JSHint-external TextMate Bundle
Visual Studio
- SharpLinter (supports both JSLint and JSHint).
- JSLint for Visual Studio (supports both JSLint and JSHint).
- Web Essentials (Runs JSHint automatically).
Brackets
Other
- ShiftEdit IDE has built-in support for JSHint.
- Komodo 7 now ships with built-in support for JSHint.
- JSHint integration for the Eclipse IDE
- JSHint integration for the NetBeans IDE
- JetBrains IDE family supports realtime code inspection with both JSHint and JSLint out of the box.
- JSLint plugin for Notepad++ now supports JSHint.
- JSHint plugin for Gedit .
Other cool stuff
- JSHintr is a web tool that allows you to set your own code standards, easily review a file against these standards, and share the output with other developers.
- FixMyJS is a tool that automatically fixes mistakes—such as missing semicolon, multiple definitions, etc.—reported by JSHint.
- A ruby gem for JSHint.
- Another ruby gem but without Java dependency.
- pre-commit checks your code for errors before you commit it.
- Dedicated Ant task to easily automate JSHint in Ant Maven.
- QHint - JSHint in QUnit. Check for errors in your code from within your unit tests. Lint errors result in failed tests.
- Grunt, a task-based command line build tool for JavaScript projects, supports JSHint out of the box.
- overcommit is an extensible Git hook manager with built-in JSHint linting, distributed as a Ruby gem. Read more about it.
- jshint-mojo, a plugin for Maven.
- JSXHint, a wrapper around JSHint to allow linting of files containing JSX syntax.
当install好JSHint后,别忘了重启atom编辑器,接下来就是配置JSHint,我们可以在建一个文件
~/.jshintrc
,作为全局配置,我们也可以在某个具体项目设置不同规则,放在项目根目录下。 下面是个demo,参考修改,如果想知道更多的配置选项。
linter-jshint
This plugin for linter provides an interface to JSHint. It will lint JavaScript in files with the.js
extension and optionally inside<script>
blocks in HTML or PHP files.
Installation
The Linter package must be installed in order to use this plugin. If it isn't installed, please follow the instructions here.
Plugin installation
$ apm install linter-jshint
Settings
You can configure linter-jshint by editing~/.atom/config.cson
(choose Open Your Config in Atom menu):
'linter-jshint':
# Path of the `jshint` executable
executablePath: '/path/to/bundled/jshint'
# Lint JavaScript inside `<script>` blocks in HTML or PHP files
lintInlineJavaScript: false
# Disable linter when no `.jshintrc` is found in project
disableWhenNoJshintrcFileInPath: false
Contributing
If you would like to contribute enhancements or fixes, please do the following:
- Fork the plugin repository
- Hack on a separate topic branch created from the latest
master
- Commit and push the topic branch
- Make a pull request
- Welcome to the club
Please note that modifications should follow these coding guidelines:
- Indent of 2 spaces
- Code should pass
CoffeeLint
with the provided
coffeelint.json
- Vertical whitespace helps readability, don't be afraid to use it
Thank you for helping out!
JSHint Options
This page's content is sourced from the JSHint project repository. If you spot an error, please open an issue or (better yet) make a pull request!
Enforcing options
When set to true, these options will make JSHint produce more warnings about your code.
bitwise | This option prohibits the use of bitwise operators such as^ (XOR),` |
\(OR\) and others. Bitwise operators are very rare in JavaScript programs and quite often &is simply a mistyped &&`. |
---|---|---|
camelcase | WarningThis option has been deprecated and will be removed in the next major release of JSHint.JSHint is limiting its scope to issues of code correctness. If you would like to enforce rules relating to code style, check outthe JSCS project.This option allows you to force all variable names to use either camelCase style or UPPER_CASE with underscores. | |
curly | This option requires you to always put curly braces around blocks in loops and conditionals. JavaScript allows you to omit curly braces when the block consists of only one statement, for example:while (day) shuffle();However, in some circumstances, it can lead to bugs (you'd think thatsleep() is a part of the loop while in reality it is not):while (day) shuffle(); sleep(); |
|
enforceall | WarningThis option has been deprecated and will be removed in the next major release of JSHint.The option cannot be maintained without automatically opting users in to new features. This can lead to unexpected warnings/errors in when upgrading between minor versions of JSHint.This option is a short hand for the most strict JSHint configuration as available in JSHint version 2.6.3. It enables all enforcing options and disables all relaxing options that were defined in that release. | |
eqeqeq | This options prohibits the use of== and!= in favor of=== and!== . The former try to coerce values before comparing them which can lead to some unexpected results. The latter don't do any coercion so they are generally safer. If you would like to learn more about type coercion in JavaScript, we recommendTruth, Equality and JavaScriptby Angus Croll. |
|
es3 | WarningThis option has been deprecated and will be removed in the next major release of JSHint.Useesversion: 3 instead.This option tells JSHint that your code needs to adhere to ECMAScript 3 specification. Use this option if you need your program to be executable in older browsers—such as Internet Explorer 6/7/8/9—and other legacy JavaScript environments. |
|
es5 | WarningThis option has been deprecated and will be removed in the next major release of JSHint.Useesversion: 5 instead.This option enables syntax first defined inthe ECMAScript 5.1 specification. This includes allowing reserved keywords as object properties. |
|
esversion | This option is used to specify the ECMAScript version to which the code must adhere. It can assume one of the following values:3 - If you need your program to be executable in older browsers—such as Internet Explorer 6/7/8/9—and other legacy JavaScript environments5 - To enable syntax first defined inthe ECMAScript 5.1 specification. This includes allowing reserved keywords as object properties.6 - To tell JSHint that your code usesECMAScript 6specific syntax. Note that not all browsers implement them. |
|
forin | This option requires allfor in loops to filter object's items. The for in statement allows for looping through the names of all of the properties of an object including those inherited through the prototype chain. This behavior can lead to unexpected items in your object so it is generally safer to always filter inherited properties out as shown in the example:for (key in obj) { if (obj.hasOwnProperty(key)) { // We are sure that obj[key] belongs to the object and was not inherited. }}For more in-depth understanding offor in loops in JavaScript, readExploring JavaScript for-in loopsby Angus Croll. |
|
freeze | This options prohibits overwriting prototypes of native objects such asArray ,Date and so on.// jshint freeze:trueArray.prototype.count = function (value) { return 4; };// -> Warning: Extending prototype of native object: 'Array'. |
|
futurehostile | This option enables warnings about the use of identifiers which are defined in future versions of JavaScript. Although overwriting them has no effect in contexts where they are not implemented, this practice can cause issues when migrating codebases to newer versions of the language. | |
globals | This option can be used to specify a white list of global variables that are not formally defined in the source code. This is most useful when combined with theundef option in order to suppress warnings for project-specific global variables.Setting an entry totrue enables reading and writing to that variable. Setting it tofalse will trigger JSHint to consider that variable read-only.See also the "environment" options: a set of options to be used as short hand for enabling global variables defined in common JavaScript environments.To configureglobals within an individual file, seeInline Configuration. |
|
immed | WarningThis option has been deprecated and will be removed in the next major release of JSHint.JSHint is limiting its scope to issues of code correctness. If you would like to enforce rules relating to code style, check outthe JSCS project.This option prohibits the use of immediate function invocations without wrapping them in parentheses. Wrapping parentheses assists readers of your code in understanding that the expression is the result of a function, and not the function itself. | |
indent | WarningThis option has been deprecated and will be removed in the next major release of JSHint.JSHint is limiting its scope to issues of code correctness. If you would like to enforce rules relating to code style, check outthe JSCS project.This option sets a specific tab width for your code. | |
latedef | This option prohibits the use of a variable before it was defined. JavaScript has function scope only and, in addition to that, all variables are always moved—or hoisted— to the top of the function. This behavior can lead to some very nasty bugs and that's why it is safer to always use variable only after they have been explicitly defined.Setting this option to "nofunc" will allow function declarations to be ignored.For more in-depth understanding of scoping and hoisting in JavaScript, readJavaScript Scoping and Hoistingby Ben Cherry. | |
maxcomplexity | This option lets you control cyclomatic complexity throughout your code. Cyclomatic complexity measures the number of linearly independent paths through a program's source code. Read more aboutcyclomatic complexity on Wikipedia. | |
maxdepth | This option lets you control how nested do you want your blocks to be:// jshint maxdepth:2function main(meaning) { var day = true; if (meaning === 42) { while (day) { shuffle(); if (tired) { // JSHint: Blocks are nested too deeply (3). sleep(); } } }} | |
maxerr | This options allows you to set the maximum amount of warnings JSHint will produce before giving up. Default is 50. | |
maxlen | WarningThis option has been deprecated and will be removed in the next major release of JSHint.JSHint is limiting its scope to issues of code correctness. If you would like to enforce rules relating to code style, check outthe JSCS project.This option lets you set the maximum length of a line. | |
maxparams | This option lets you set the max number of formal parameters allowed per function:// jshint maxparams:3function login(request, onSuccess) { // ...}// JSHint: Too many parameters per function (4).function logout(request, isManual, whereAmI, onSuccess) { // ...} | |
maxstatements | This option lets you set the max number of statements allowed per function:// jshint maxstatements:4function main() { var i = 0; var j = 0; // Function declarations count as one statement. Their bodies // don't get taken into account for the outer function. function inner() { var i2 = 1; var j2 = 1; return i2 + j2; } j = i + j; return j; // JSHint: Too many statements per function. (5)} | |
newcap | WarningThis option has been deprecated and will be removed in the next major release of JSHint.JSHint is limiting its scope to issues of code correctness. If you would like to enforce rules relating to code style, check outthe JSCS project.This option requires you to capitalize names of constructor functions. Capitalizing functions that are intended to be used withnew operator is just a convention that helps programmers to visually distinguish constructor functions from other types of functions to help spot mistakes when usingthis .Not doing so won't break your code in any browsers or environments but it will be a bit harder to figure out—by reading the code—if the function was supposed to be used with or without new. And this is important because when the function that was intended to be used withnew is used without it,this will point to the global object instead of a new object. |
|
noarg | This option prohibits the use ofarguments.caller andarguments.callee . Both.caller and.callee make quite a few optimizations impossible so they were deprecated in future versions of JavaScript. In fact, ECMAScript 5 forbids the use ofarguments.callee in strict mode. |
|
nocomma | This option prohibits the use of the comma operator. When misused, the comma operator can obscure the value of a statement and promote incorrect code. | |
noempty | WarningThis option has been deprecated and will be removed in the next major release of JSHint.JSHint is limiting its scope to issues of code correctness. If you would like to enforce rules relating to code style, check outthe JSCS project.This option warns when you have an empty block in your code. JSLint was originally warning for all empty blocks and we simply made it optional. There were no studies reporting that empty blocks in JavaScript break your code in any way. | |
nonbsp | This option warns about "non-breaking whitespace" characters. These characters can be entered with option-space on Mac computers and have a potential of breaking non-UTF8 web pages. | |
nonew | This option prohibits the use of constructor functions for side-effects. Some people like to call constructor functions without assigning its result to any variable:new MyConstructor();There is no advantage in this approach over simply callingMyConstructor since the object that the operatornew creates isn't used anywhere so you should generally avoid constructors like this one. |
|
predef | This option allows you to control which variables JSHint considers to be implicitly defined in the environment. Configure it with an array of string values. Prefixing a variable name with a hyphen (-) character will remove that name from the collection of predefined variables.JSHint will consider variables declared in this way to be read-only.This option cannot be specified in-line; it may only be used via the JavaScript API or from an external configuration file. | |
quotmark | WarningThis option has been deprecated and will be removed in the next major release of JSHint.JSHint is limiting its scope to issues of code correctness. If you would like to enforce rules relating to code style, check outthe JSCS project.This option enforces the consistency of quotation marks used throughout your code. It accepts three values:true if you don't want to enforce one particular style but want some consistency,"single" if you want to allow only single quotes and"double" if you want to allow only double quotes. |
|
shadow | This option suppresses warnings about variable shadowing i.e. declaring a variable that had been already declared somewhere in the outer scope."inner" - check for variables defined in the same scope only"outer" - check for variables defined in outer scopes as wellfalse - same as innertrue - allow variable shadowing | |
singleGroups | This option prohibits the use of the grouping operator when it is not strictly required. Such usage commonly reflects a misunderstanding of unary operators, for example:// jshint singleGroups: truedelete(obj.attr); // Warning: Unnecessary grouping operator. | |
strict | This option requires the code to run in ECMAScript 5's strict mode.Strict modeis a way to opt in to a restricted variant of JavaScript. Strict mode eliminates some JavaScript pitfalls that didn't cause errors by changing them to produce errors. It also fixes mistakes that made it difficult for the JavaScript engines to perform certain optimizations."global" - there must be a"use strict"; directive at global level"implied" - lint the code as if there is the"use strict"; directivefalse - disable warnings about strict modetrue - there must be a"use strict"; directive at function level; this is preferable for scripts intended to be loaded in web browsers directly because enabling strict mode globally could adversely effect other scripts running on the same page |
|
trailingcomma | This option warns when a comma is not placed after the last element in an array or object literal. Due to bugs in old versions of IE, trailing commas used to be discouraged, but since ES5 their semantics were standardized. (See#11.1.4and#11.1.5.) Now, they help to prevent the samevisual ambiguitiesthat the strict usage of semicolons helps prevent.For example, this code might have worked last Tuesday:[ b + c].forEach(print);But if one adds an element to the array and forgets to compensate for the missing comma, no syntax error is thrown, and a linter cannot determine if this was a mistake or an intentional function invocation.[ b + c (d + e)].forEach(print);If one always appends a list item with a comma, this ambiguity cannot occur:[ b + c,].forEach(print);[ b + c, (d + e),].forEach(print); | |
undef | This option prohibits the use of explicitly undeclared variables. This option is very useful for spotting leaking and mistyped variables.// jshint undef:truefunction test() { var myVar = 'Hello, World'; console.log(myvar); // Oops, typoed here. JSHint with undef will complain}If your variable is defined in another file, you can use theglobal directive to tell JSHint about it. |
|
unused | This option warns when you define and never use your variables. It is very useful for general code cleanup, especially when used in addition toundef .// jshint unused:truefunction test(a, b) { var c, d = 2; return a + d;}test(1, 2);// Line 3: 'b' was defined but never used.// Line 4: 'c' was defined but never used.In addition to that, this option will warn you about unused global variables declared via theglobal directive.When set totrue , unused parameters that are followed by a used parameter will not produce warnings. This option can be set tovars to only check for variables, not function parameters, orstrict to check all variables and parameters. |
|
varstmt | When set to true, the use of VariableStatements are forbidden. For example:// jshint varstmt: truevar a; // Warning: `var` declarations are forbidden. Use `let` or `const` instead. |
Relaxing options
When set to true, these options will make JSHint produce fewer warnings about your code.
asi | This option suppresses warnings about missing semicolons. There is a lot of FUD about semicolon spread by quite a few people in the community. The common myths are that semicolons are required all the time (they are not) and that they are unreliable. JavaScript has rules about semicolons which are followed by_all_browsers so it is up to you to decide whether you should or should not use semicolons in your code.For more information about semicolons in JavaScript readAn Open Letter to JavaScript Leaders Regarding Semicolonsby Isaac Schlueter andJavaScript Semicolon Insertion. |
---|---|
boss | This option suppresses warnings about the use of assignments in cases where comparisons are expected. More often than not, code likeif (a = 10) {} is a typo. However, it can be useful in cases like this one:for (var i = 0, person; person = people[i]; i++) {}You can silence this error on a per-use basis by surrounding the assignment with parenthesis, such as:for (var i = 0, person; (person = people[i]); i++) {} |
debug | This option suppresses warnings about thedebugger statements in your code. |
elision | This option tells JSHint that your code uses ES3 array elision elements, or empty elements (for example,[1, , , 4, , , 7] ). |
eqnull | This option suppresses warnings about== null comparisons. Such comparisons are often useful when you want to check if a variable isnull orundefined . |
esnext | WarningThis option has been deprecated and will be removed in the next major release of JSHint.Useesversion: 6 instead.This option tells JSHint that your code uses ECMAScript 6 specific syntax. Note that not all browsers implement these features.More info:Specification for ECMAScript 6 |
evil | This option suppresses warnings about the use ofeval . The use ofeval is discouraged because it can make your code vulnerable to various injection attacks and it makes it hard for JavaScript interpreter to do certain optimizations. |
expr | This option suppresses warnings about the use of expressions where normally you would expect to see assignments or function calls. Most of the time, such code is a typo. However, it is not forbidden by the spec and that's why this warning is optional. |
funcscope | This option suppresses warnings about declaring variables inside of control structures while accessing them later from the outside. Even though JavaScript has only two real scopes—global and function—such practice leads to confusion among people new to the language and hard-to-debug bugs. This is why, by default, JSHint warns about variables that are used outside of their intended scope.function test() { if (true) { var x = 0; } x += 1; // Default: 'x' used out of scope. // No warning when funcscope:true} |
globalstrict | WarningThis option has been deprecated and will be removed in the next major release of JSHint.Usestrict: "global" .This option suppresses warnings about the use of global strict mode. Global strict mode can break third-party widgets so it is not recommended.For more info about strict mode see thestrict option. |
iterator | This option suppresses warnings about the__iterator__ property. This property is not supported by all browsers so use it carefully. |
lastsemic | This option suppresses warnings about missing semicolons, but only when the semicolon is omitted for the last statement in a one-line block:var name = (function() { return 'Anton' }());This is a very niche use case that is useful only when you use automatic JavaScript code generators. |
laxbreak | WarningThis option has been deprecated and will be removed in the next major release of JSHint.JSHint is limiting its scope to issues of code correctness. If you would like to enforce rules relating to code style, check outthe JSCS project.This option suppresses most of the warnings about possibly unsafe line breakings in your code. It doesn't suppress warnings about comma-first coding style. To suppress those you have to uselaxcomma (see below). |
laxcomma | WarningThis option has been deprecated and will be removed in the next major release of JSHint.JSHint is limiting its scope to issues of code correctness. If you would like to enforce rules relating to code style, check outthe JSCS project.This option suppresses warnings about comma-first coding style:var obj = { name: 'Anton' , handle: 'valueof' , role: 'SW Engineer'}; |
loopfunc | This option suppresses warnings about functions inside of loops. Defining functions inside of loops can lead to bugs such as this one:var nums = [];for (var i = 0; i < 10; i++) { nums[i] = function (j) { return i + j; };}nums[0](2); // Prints 12 instead of 2To fix the code above you need to copy the value ofi :var nums = [];for (var i = 0; i < 10; i++) { (function (i) { nums[i] = function (j) { return i + j; }; }(i));} |
moz | This options tells JSHint that your code uses Mozilla JavaScript extensions. Unless you develop specifically for the Firefox web browser you don't need this option.More info:New in JavaScript 1.7 |
multistr | WarningThis option has been deprecated and will be removed in the next major release of JSHint.JSHint is limiting its scope to issues of code correctness. If you would like to enforce rules relating to code style, check outthe JSCS project.This option suppresses warnings about multi-line strings. Multi-line strings can be dangerous in JavaScript because all hell breaks loose if you accidentally put a whitespace in between the escape character (\ ) and a new line.Note that even though this option allows correct multi-line strings, it still warns about multi-line strings without escape characters or with anything in between the escape character and a whitespace.// jshint multistr:truevar text = "Hello\World"; // All good.text = "HelloWorld"; // Warning, no escape character.text = "Hello\World"; // Warning, there is a space after \ |
notypeof | This option suppresses warnings about invalidtypeof operator values. This operator has onlya limited set of possible return values. By default, JSHint warns when you compare its result with an invalid value which often can be a typo.// 'fuction' instead of 'function'if (typeof a == "fuction") { // Invalid typeof value 'fuction' // ...}Do not use this option unless you're absolutely sure you don't want these checks. |
noyield | This option suppresses warnings about generator functions with noyield statement in them. |
plusplus | This option prohibits the use of unary increment and decrement operators. Some people think that++ and-- reduces the quality of their coding styles and there are programming languages—such as Python—that go completely without these operators. |
proto | This option suppresses warnings about the__proto__ property. |
scripturl | This option suppresses warnings about the use of script-targeted URLs—such asjavascript:... . |
sub | WarningThis option has been deprecated and will be removed in the next major release of JSHint.JSHint is limiting its scope to issues of code correctness. If you would like to enforce rules relating to code style, check outthe JSCS project.This option suppresses warnings about using[] notation when it can be expressed in dot notation:person['name'] vs.person.name . |
supernew | This option suppresses warnings about "weird" constructions likenew function () { ... } andnew Object; . Such constructions are sometimes used to produce singletons in JavaScript:var singleton = new function() { var privateVar; this.publicMethod = function () {} this.publicMethod2 = function () {}}; |
validthis | This option suppresses warnings about possible strict violations when the code is running in strict mode and you usethis in a non-constructor function. You should use this option—in a function scope only—when you are positive that your use ofthis is valid in the strict mode (for example, if you call your function usingFunction.call ).Note:This option can be used only inside of a function scope. JSHint will fail with an error if you will try to set this option globally. |
withstmt | This option suppresses warnings about the use of thewith statement. The semantics of thewith statement can cause confusion among developers and accidental definition of global variables.More info:with Statement Considered Harmful |
Environments
These options let JSHint know about some pre-defined global variables.
browser | This option defines globals exposed by modern browsers: all the way from good olddocument andnavigator to the HTML5FileReader and other new developments in the browser world.Note:This option doesn't expose variables likealert orconsole . See optiondevel for more information. |
---|---|
browserify | This option defines globals available when usingthe Browserify toolto build a project. |
couch | This option defines globals exposed byCouchDB. CouchDB is a document-oriented database that can be queried and indexed in a MapReduce fashion using JavaScript. |
devel | This option defines globals that are usually used for logging poor-man's debugging:console ,alert , etc. It is usually a good idea to not ship them in production because, for example,console.log breaks in legacy versions of Internet Explorer. |
dojo | This option defines globals exposed by theDojo Toolkit. |
jasmine | This option defines globals exposed bythe Jasmine unit testing framework. |
jquery | This option defines globals exposed by thejQueryJavaScript library. |
mocha | This option defines globals exposed by the "BDD" and "TDD" UIs of theMocha unit testing framework. |
module | This option informs JSHint that the input code describes an ECMAScript 6 module. All module code is interpreted as strict mode code. |
mootools | This option defines globals exposed by theMooToolsJavaScript framework. |
node | This option defines globals available when your code is running inside of the Node runtime environment.Node.jsis a server-side JavaScript environment that uses an asynchronous event-driven model. This option also skips some warnings that make sense in the browser environments but don't make sense in Node such as file-leveluse strict pragmas andconsole.log statements. |
nonstandard | This option defines non-standard but widely adopted globals such asescape andunescape . |
phantom | This option defines globals available when your core is running inside of the PhantomJS runtime environment.PhantomJSis a headless WebKit scriptable with a JavaScript API. It has fast and native support for various web standards: DOM handling, CSS selector, JSON, Canvas, and SVG. |
prototypejs | This option defines globals exposed by thePrototypeJavaScript framework. |
qunit | This option defines globals exposed bythe QUnit unit testing framework. |
rhino | This option defines globals available when your code is running inside of the Rhino runtime environment.Rhinois an open-source implementation of JavaScript written entirely in Java. |
shelljs | This option defines globals exposed bythe ShellJS library. |
typed | This option defines globals for typed array constructors.More info:JavaScript typed arrays |
worker | This option defines globals available when your code is running inside of a Web Worker.Web Workersprovide a simple means for web content to run scripts in background threads. |
wsh | This option defines globals available when your code is running as a script for theWindows Script Host. |
yui | This option defines globals exposed by theYUIJavaScript framework. |