Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 407111

Summary: Setting global JSLint options hides "variable is not defined" warning
Product: [ECD] Orion Reporter: Mark Macdonald <mamacdon>
Component: ClientAssignee: Mark Macdonald <mamacdon>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: antonm
Version: 2.0   
Target Milestone: 4.0 M1   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Mark Macdonald CLA 2013-05-02 16:12:30 EDT
1. Go to Settings > Validation
2. Under JSLint options, enter
 browser:true devel:true 
3. Create a new .js file that contains this code, save save it:
foo++;
4. Expect to see a "undefined variable" error, but I see nothing.
5. Remove the global JSLINT option that we set earlier, reload the editor, and the error will return.

Setting the equivalent flags in a /*jslint browser:true devel:true */ block produces the expected behavior.
Comment 1 Mark Macdonald CLA 2013-05-02 16:18:38 EDT
Apparently you need to pass the `undef:true` flag to get the behavior I expected. By default, Orion does set that flag, but when you provide your own custom flags in the Settings page, we expect you to set *all* the options manually -- Orion doesn't provide any defaults.

This is not very intuitive. Maybe we should relabel the options field as "override JSLint options", and then list which flags are set by default. That way, the default flags will be provided unless explicitly overridden by the user.
Comment 2 Mark Macdonald CLA 2013-07-18 11:57:45 EDT
http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=098676e

This is implemented. Orion's default options will be passed to JSLint unless the user specifically overrides them. 

FWIW, the defaults passed by Orion are:
> bitwise: false, eqeqeq: true, es5: true, immed: true, indent: 1, maxerr: 300,
> newcap: true, nomen: false, onevar: false, plusplus: false, regexp: true, 
> strict: false, undef: true, white: false