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

Bug 438320

Summary: [eslint] adding an /*eslint */ directive makes options sticky
Product: [ECD] Orion Reporter: Mark Macdonald <mamacdon>
Component: JS ToolsAssignee: Michael Rennie <Michael_Rennie>
Status: RESOLVED WORKSFORME QA Contact:
Severity: normal    
Priority: P3 CC: Michael_Rennie
Version: 6.0   
Target Milestone: 7.0   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Bug Depends on: 438095    
Bug Blocks:    

Description Mark Macdonald CLA 2014-06-26 16:51:16 EDT
1. Create a file containing this code, and save:

(function(useless) {
}());

2. You should see an "unused parameter" warning: 
> Parameter 'useless' is never used.

3. Now change the code to this, and save:

/*eslint no-unused-params:0*/
(function(useless) {
}());

4. The warning goes away.
5. Now remove the /*eslint */ line, and save again.

I expected the warning to return, but it doesn't. It seems that options set by an /*eslint */ block remain in effect until the page is reloaded.
Comment 1 Michael Rennie CLA 2014-06-26 17:24:41 EDT
testing with the eslint 0.6.2 branch this works as expected:

adding and removing the comment causes the error to be suppressed / shown as expected.

Until we actually release the eslit update and can test this more I will mark it as dependent.
Comment 2 Michael Rennie CLA 2014-07-08 23:38:07 EDT
(In reply to Michael Rennie from comment #1)
> testing with the eslint 0.6.2 branch this works as expected:
> 
> adding and removing the comment causes the error to be suppressed / shown as
> expected.
> 
> Until we actually release the eslit update and can test this more I will
> mark it as dependent.

Yup, still works fine. Steps:

/* eslint no-unused-params:0 */
function f(a) {
    console.log('nope');
}

1. change the '0' to anything not 0, save, change back, save, rise, repeat
2. remove the comment, save, put it back, save, rise, repeat