Skip to content

selectorKeyQuoteType

SPGoding edited this page Apr 26, 2020 · 1 revision

Rule Details

⚠️ Diagnostic: this is a diagnostic rule used by the diagnostic feature.

🔧 Fixable: violations of this rule can be fixed by Code Actions.

Enforce the type of entity selector key quotation marks.

  • ("always single"): always uses single quotation marks (').
  • ("always double"): always uses double quotation marks (").
  • ("prefer single"): always uses single quotation marks (') unless there are single quotation marks in the string. Well, this works exactly the same as "always single" in this case.
  • ("prefer double"): always uses double quotation marks (") unless there are double quotation marks in the string. Well, this works exactly the same as "always double" in this case.

Examples

Default

{
    "selectorKeyQuoteType": null
}

👍 Good

kill @a["tag"=foo]
kill @a['tag'=foo]

Always Double

{
    "selectorKeyQuoteType": ["warning", "always double"]
}

👍 Good

kill @a["tag"=foo]

👎 Bad

kill @a['tag'=foo]

History

This rule was introduced in DHP 2.0.0.

Clone this wiki locally