1 | # |
---|
2 | # Configuration File for JavaScript Lint 0.3.0 |
---|
3 | # Developed by Matthias Miller (http://www.JavaScriptLint.com) |
---|
4 | # |
---|
5 | # This configuration file can be used to lint a collection of scripts, or to enable |
---|
6 | # or disable warnings for scripts that are linted via the command line. |
---|
7 | # |
---|
8 | |
---|
9 | ### Warnings |
---|
10 | # Enable or disable warnings based on requirements. |
---|
11 | # Use "+WarningName" to display or "-WarningName" to suppress. |
---|
12 | # |
---|
13 | +no_return_value # function {0} does not always return a value |
---|
14 | +duplicate_formal # duplicate formal argument {0} |
---|
15 | +equal_as_assign # test for equality (==) mistyped as assignment (=)?{0} |
---|
16 | +var_hides_arg # variable {0} hides argument |
---|
17 | -redeclared_var # redeclaration of {0} {1} |
---|
18 | -anon_no_return_value # anonymous function does not always return a value |
---|
19 | +missing_semicolon # missing semicolon |
---|
20 | +meaningless_block # meaningless block; curly braces have no impact |
---|
21 | +comma_separated_stmts # multiple statements separated by commas (use semicolons?) |
---|
22 | +unreachable_code # unreachable code |
---|
23 | +missing_break # missing break statement |
---|
24 | +missing_break_for_last_case # missing break statement for last case in switch |
---|
25 | -comparison_type_conv # comparisons against null, 0, true, false, or an empty string allowing implicit type conversion (use === or !==) |
---|
26 | -inc_dec_within_stmt # increment (++) and decrement (--) operators used as part of greater statement |
---|
27 | +useless_void # use of the void type may be unnecessary (void is always undefined) |
---|
28 | +multiple_plus_minus # unknown order of operations for successive plus (e.g. x+++y) or minus (e.g. x---y) signs |
---|
29 | +use_of_label # use of label |
---|
30 | +block_without_braces # block statement without curly braces |
---|
31 | +leading_decimal_point # leading decimal point may indicate a number or an object member |
---|
32 | +trailing_decimal_point # trailing decimal point may indicate a number or an object member |
---|
33 | +octal_number # leading zeros make an octal number |
---|
34 | +nested_comment # nested comment |
---|
35 | +misplaced_regex # regular expressions should be preceded by a left parenthesis, assignment, colon, or comma |
---|
36 | +ambiguous_newline # unexpected end of line; it is ambiguous whether these lines are part of the same statement |
---|
37 | +empty_statement # empty statement or extra semicolon |
---|
38 | -missing_option_explicit # the "option explicit" control comment is missing |
---|
39 | +partial_option_explicit # the "option explicit" control comment, if used, must be in the first script tag |
---|
40 | +dup_option_explicit # duplicate "option explicit" control comment |
---|
41 | +useless_assign # useless assignment |
---|
42 | +ambiguous_nested_stmt # block statements containing block statements should use curly braces to resolve ambiguity |
---|
43 | +ambiguous_else_stmt # the else statement could be matched with one of multiple if statements (use curly braces to indicate intent) |
---|
44 | -missing_default_case # missing default case in switch statement |
---|
45 | +duplicate_case_in_switch # duplicate case in switch statements |
---|
46 | +default_not_at_end # the default case is not at the end of the switch statement |
---|
47 | +legacy_cc_not_understood # couldn't understand control comment using /*@keyword@*/ syntax |
---|
48 | +jsl_cc_not_understood # couldn't understand control comment using /*jsl:keyword*/ syntax |
---|
49 | +useless_comparison # useless comparison; comparing identical expressions |
---|
50 | +with_statement # with statement hides undeclared variables; use temporary variable instead |
---|
51 | +trailing_comma_in_array # extra comma is not recommended in array initializers |
---|
52 | +assign_to_function_call # assignment to a function call |
---|
53 | -parseint_missing_radix # parseInt missing radix parameter |
---|
54 | |
---|
55 | |
---|
56 | ### Output format |
---|
57 | # Customize the format of the error message. |
---|
58 | # __FILE__ indicates current file path |
---|
59 | # __FILENAME__ indicates current file name |
---|
60 | # __LINE__ indicates current line |
---|
61 | # __ERROR__ indicates error message |
---|
62 | # |
---|
63 | # Visual Studio syntax (default): |
---|
64 | +output-format __FILE__(__LINE__): __ERROR__ |
---|
65 | # Alternative syntax: |
---|
66 | #+output-format __FILE__:__LINE__: __ERROR__ |
---|
67 | |
---|
68 | |
---|
69 | ### Context |
---|
70 | # Show the in-line position of the error. |
---|
71 | # Use "+context" to display or "-context" to suppress. |
---|
72 | # |
---|
73 | +context |
---|
74 | |
---|
75 | |
---|
76 | ### Semicolons |
---|
77 | # By default, assignments of an anonymous function to a variable or |
---|
78 | # property (such as a function prototype) must be followed by a semicolon. |
---|
79 | # |
---|
80 | +lambda_assign_requires_semicolon |
---|
81 | |
---|
82 | |
---|
83 | ### Control Comments |
---|
84 | # Both JavaScript Lint and the JScript interpreter confuse each other with the syntax for |
---|
85 | # the /*@keyword@*/ control comments and JScript conditional comments. (The latter is |
---|
86 | # enabled in JScript with @cc_on@). The /*jsl:keyword*/ syntax is preferred for this reason, |
---|
87 | # although legacy control comments are enabled by default for backward compatibility. |
---|
88 | # |
---|
89 | +legacy_control_comments |
---|
90 | |
---|
91 | |
---|
92 | ### JScript Function Extensions |
---|
93 | # JScript allows member functions to be defined like this: |
---|
94 | # function MyObj() { /*constructor*/ } |
---|
95 | # function MyObj.prototype.go() { /*member function*/ } |
---|
96 | # |
---|
97 | # It also allows events to be attached like this: |
---|
98 | # function window::onload() { /*init page*/ } |
---|
99 | # |
---|
100 | # This is a Microsoft-only JavaScript extension. Enable this setting to allow them. |
---|
101 | # |
---|
102 | -jscript_function_extensions |
---|
103 | |
---|
104 | |
---|
105 | ### Defining identifiers |
---|
106 | # By default, "option explicit" is enabled on a per-file basis. |
---|
107 | # To enable this for all files, use "+always_use_option_explicit" |
---|
108 | +always_use_option_explicit |
---|
109 | |
---|
110 | # Define certain identifiers of which the lint is not aware. |
---|
111 | # (Use this in conjunction with the "undeclared identifier" warning.) |
---|
112 | # |
---|
113 | # Common uses for webpages might be: |
---|
114 | +define window |
---|
115 | +define document |
---|
116 | +define jQuery |
---|
117 | +define console |
---|
118 | |
---|
119 | |
---|
120 | ### Files |
---|
121 | # Specify which files to lint |
---|
122 | # Use "+recurse" to enable recursion (disabled by default). |
---|
123 | # To add a set of files, use "+process FileName", "+process Folder\Path\*.js", |
---|
124 | # or "+process Folder\Path\*.htm". |
---|
125 | # |
---|
126 | #+process jsl-test.js |
---|
127 | +process jqplot.axisLabelRenderer.js |
---|
128 | +process jqplot.axisTickRenderer.js |
---|
129 | +process jqplot.canvasGridRenderer.js |
---|
130 | +process jqplot.core.js |
---|
131 | +process jqplot.divTitleRenderer.js |
---|
132 | +process jqplot.linearAxisRenderer.js |
---|
133 | +process jqplot.linearTickGenerator.js |
---|
134 | +process jqplot.lineRenderer.js |
---|
135 | +process jqplot.markerRenderer.js |
---|
136 | +process jqplot.shadowRenderer.js |
---|
137 | +process jqplot.shapeRenderer.js |
---|
138 | +process jqplot.sprintf.js |
---|
139 | +process jqplot.tableLegendRenderer.js |
---|
140 | +process jqplot.themeEngine.js |
---|
141 | +process jquery.jqplot.js |
---|
142 | +process jsdate.js |
---|
143 | +process plugins/*.js |
---|