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

Bug 482619

Summary: [eslint] Consume the quotes rule
Product: [ECD] Orion Reporter: Olivier Thomann <Olivier_Thomann>
Component: JS ToolsAssignee: Olivier Thomann <Olivier_Thomann>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: Michael_Rennie, steve_northover
Version: 10.0   
Target Milestone: 13.0   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Work in progress none

Description Olivier Thomann CLA 2015-11-19 13:10:42 EST
We should add a new rule to enforce quotes consistency through the code base.
Check http://eslint.org/docs/rules/quotes.html.
Comment 1 Olivier Thomann CLA 2015-11-19 13:16:48 EST
This one would require a way to specify an option for the rule like "single", "double" or "backtick". So it doesn't quite fit into the existing framework.
Silenio, is there a way to plug this into the existing framework?
Comment 2 Michael Rennie CLA 2015-11-19 13:24:23 EST
(In reply to Olivier Thomann from comment #1)
> This one would require a way to specify an option for the rule like
> "single", "double" or "backtick". So it doesn't quite fit into the existing
> framework.
> Silenio, is there a way to plug this into the existing framework?

If we have to create something new to accomplish this, perhaps it could be as simple as being able to specify a list of dependent prefs that the UI-client would draw as indented compared to their 'owning' pref.

For example, a plugin could provide:

{	
  id: "quotes",  //$NON-NLS-1$
  name: "Enforce quote style:",  //$NON-NLS-1$
  type: "number",  //$NON-NLS-1$
  defaultValue: error,
  options: severities,
  dependents: [
    { id: "quotes-options",  //$NON-NLS-1$
      name: "Quoting options:", //$NON-NLS-1$
      type: "string", //$NON-NLS-1$
      defaultValue: "double", //$NON-NLS-1$
      options: ["double", "single", "backtick"] //$NON-NLS-1$
    }]
}
Comment 3 Olivier Thomann CLA 2016-01-20 14:31:57 EST
Silenio proposed to add a dependsOn field that contains the id of the option the current option depends on.
I am looking at how this can be rendered in the UI so that it looks indented under the dependent option.
So an option can have multiple dependent options. They would all be rendered indented in the UI under the right option.
Comment 4 Olivier Thomann CLA 2016-02-02 14:29:17 EST
Created attachment 259498 [details]
Work in progress