Skip to content

stringQuote

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

{
    "stringQuote": null
}

👍 Good

datapack enable vanilla
datapack enable "vanilla"
datapack enable "file/xxx.zip"

False

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

👍 Good

datapack enable vanilla
datapack enable "file/xxx.zip"

👎 Bad

datapack enable "vanilla"

True

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

👍 Good

datapack enable "vanilla"
datapack enable "file/xxx.zip"

👎 Bad

datapack enable vanilla

History

This rule was introduced in DHP 2.0.0.

Clone this wiki locally