Skip to Content
JavaScript: The Good Parts
book

JavaScript: The Good Parts

by Douglas Crockford
May 2008
Intermediate to advanced
172 pages
4h 54m
English
O'Reilly Media, Inc.
Content preview from JavaScript: The Good Parts

Options

The implementation of JSLint accepts an option object that allows you to determine the subset of JavaScript that is acceptable to you. It is also possible to set those options within the source of a script.

An option specification can look like this:

/*jslint nomen: true, evil: false */

An option specification starts with /*jslint. Notice that there is no space before the j. The specification contains a sequence of name/value pairs, where the names are JSLint options and the values are true or false. An option specification takes precedence over the option object. All of the options default to false. Table C-1 lists the options available in using JSLint.

Table C-1. JSLint options

Option

Meaning

adsafe

true if ADsafe.org rules should be enforced

bitwise

true if bitwise operators should not be allowed

browser

true if the standard browser globals should be predefined

cap

true if uppercase HTML should be allowed

debug

true if debugger statements should be allowed

eqeqeq

true if === should be required

evil

true if eval should be allowed

for in

true if unfiltered for in statements should be allowed

fragment

true if HTML fragments should be allowed

laxbreak

true if statement breaks should not be checked

nomen

true if names should be checked

on

true if HTML event handlers should be allowed

passfail

true if the scan should stop on first error

plusplus

true if ++ and -- should not be allowed

rhino

true if the Rhino environment ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Modern JavaScript for the Impatient

Modern JavaScript for the Impatient

Cay S. Horstmann
Head First JavaScript Programming

Head First JavaScript Programming

Eric T. Freeman, Elisabeth Robson
Learn JavaScript

Learn JavaScript

Shaun Wassell

Publisher Resources

ISBN: 9780596517748Supplemental ContentCatalog PageErrata