Skip to content

nbtStringQuote

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.

Whether to quote string arguments or not.

  • (false): only quotes when necessary.
  • (true): always quotes.

Examples

Default

{
    "nbtStringQuote": ["warning", true]
}

👍 Good

summon minecraft:armor_stand ~ ~ ~ {Tags: ["foo"]}
summon minecraft:armor_stand ~ ~ ~ {Tags: ["crazy tag"]}

👎 Bad

summon minecraft:armor_stand ~ ~ ~ {Tags: [foo]}

False

{
    "nbtStringQuote": ["warning", false]
}

👍 Good

summon minecraft:armor_stand ~ ~ ~ {Tags: [foo]}
summon minecraft:armor_stand ~ ~ ~ {Tags: ["crazy tag"]}

👎 Bad

summon minecraft:armor_stand ~ ~ ~ {Tags: ["foo"]}

Disabled

{
    "nbtStringQuote": null
}

👍 Good

summon minecraft:armor_stand ~ ~ ~ {Tags: [foo]}
summon minecraft:armor_stand ~ ~ ~ {Tags: ["foo"]}
summon minecraft:armor_stand ~ ~ ~ {Tags: ["crazy tag"]}

History

This rule was introduced in DHP 2.0.0.

Clone this wiki locally