This Bugzilla instance is deprecated, and most Eclipse projects now use GitHub or Eclipse GitLab. Please see the deprecation plan for details.
Bug 482619 - [eslint] Consume the quotes rule
Summary: [eslint] Consume the quotes rule
Status: RESOLVED FIXED
Alias: None
Product: Orion (Archived)
Classification: ECD
Component: JS Tools (show other bugs)
Version: 10.0   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 13.0   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-11-19 13:10 EST by Olivier Thomann CLA
Modified: 2016-08-03 10:28 EDT (History)
2 users (show)

See Also:


Attachments
Work in progress (45.14 KB, patch)
2016-02-02 14:29 EST, Olivier Thomann CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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