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

Bug 456935

Summary: Remove the extra config from validator.js
Product: [ECD] Orion Reporter: Michael Rennie <Michael_Rennie>
Component: JS ToolsAssignee: Michael Rennie <Michael_Rennie>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: curtis.windatt.public
Version: 8.0   
Target Milestone: 8.0   
Hardware: PC   
OS: Mac OS X   
Whiteboard:

Description Michael Rennie CLA 2015-01-07 11:03:43 EST
Currently we have some extra config bits in validator.js that track the state of the rules, etc. We also use that info to filter problems after the fact. 

We should move the state logic into the rules themselves and update the enablement logic to turn the rules off in eslint proper rather than filter rules after the fact. In theory this would be a performance improvement as less rules would run, less problem s created overall and less filtering happening.

We should also look at changing the preference id for each rule to be the rule id. For example 'curly' vs. 'validate_curly'
Comment 1 Curtis Windatt CLA 2015-01-07 11:40:31 EST
I did this for CSSLint in Bug 446546. Perhaps ESLint has a similar option to pass in a rule set?
Comment 2 Michael Rennie CLA 2015-01-08 11:25:11 EST
Fix:

http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=17a7e842451c3f38c9ea2245e9933239ca074cc6

Changes:

1. merged the missing-doc prefs into one preference - it didn't make sense to have two separate prefs for the same rule

2. simplified the setting of preference values in the validator going on the assumption that all JS prefs use the rule name as the pref key

3. for legacy prefs (not using the rule name as the pref id) I added a translation map (of sorts) that maps the old pref id to the new one for those affected prefs (so we don't forget ignore any existing 'old' prefs. In the future once we can have write access to the prefs we can properly migrate old prefs, for now we can just always double check for them