-
Notifications
You must be signed in to change notification settings - Fork 34
Lint Rules
SPGoding edited this page Nov 12, 2020
·
4 revisions
There are many lint rules provided by DHP for mcfunction
files,
which are put under the datapack.lint.*
config section.
These rules are used when you are formatting your functions to enforce a consistent style.
- 🎨
blockStateBracketSpacing
- 🎨
blockStateCommaSpacing
- 🎨
blockStateEqualSpacing
- 🎨
blockStateTrailingComma
- 🎨
eol
- 🎨
nbtArrayBracketSpacing
- 🎨
nbtArrayCommaSpacing
- 🎨
nbtArraySemicolonSpacing
- 🎨
nbtArrayTrailingComma
- 🎨
nbtByteSuffix
- 🎨
nbtCompoundBracketSpacing
- 🎨
nbtCompoundColonSpacing
- 🎨
nbtCompoundCommaSpacing
- 🎨
nbtCompoundTrailingComma
- 🎨
nbtDoubleOmitSuffix
- 🎨
nbtDoubleSuffix
- 🎨
nbtFloatSuffix
- 🎨
nbtListBracketSpacing
- 🎨
nbtListCommaSpacing
- 🎨
nbtListTrailingComma
- 🎨
nbtLongSuffix
- 🎨
nbtShortSuffix
- 🎨
selectorBracketSpacing
- 🎨
selectorCommaSpacing
- 🎨
selectorEqualSpacing
- 🎨
selectorTrailingComma
- 🎨
timeOmitTickUnit
These rules are used for computing diagnostics. Some violations of these rules can be fixed by Code Actions automatically.
All the values of diagnostic rules should be put in an array where the first element represents the severity and the second element represents the value.
{
"datapack.lint.<Name Of The Diagnostic Rule>": ["<Severity>", <Value>]
}
The severity could be one of the following values:
-
hint
: displayed as gray dash lines in VSCode. -
information
: displayed as blue lines in VSCode. -
warning
: displayed as yellow lines in VSCode. -
error
: displayed as red lines in VSCode.
Alternatively, you can set the whole rule to null
to disable it.
{
"datapack.lint.<Name Of The Diagnostic Rule>": null
}
⚠️ blockStateSortKeys
🛠️⚠️ idOmitDefaultNamespace
🛠️⚠️ nameOfNbtCompoundTagKeys
⚠️ nameOfObjectives
⚠️ nameOfTags
⚠️ nameOfTeams
⚠️ nbtArrayLengthCheck
⚠️ nbtBoolean
🛠️⚠️ nbtCompoundKeyQuote
🛠️⚠️ nbtCompoundKeyQuoteType
🛠️⚠️ nbtCompoundSortKeys
🛠️⚠️ nbtListLengthCheck
⚠️ nbtPathQuote
🛠️⚠️ nbtPathQuoteType
🛠️⚠️ nbtStringQuote
🛠️⚠️ nbtStringQuoteType
🛠️⚠️ nbtTypeCheck
🛠️⚠️ selectorKeyQuote
🛠️⚠️ selectorKeyQuoteType
🛠️⚠️ selectorSortKeys
🛠️⚠️ strictAdvancementCheck
🛠️⚠️ strictAttributeCheck
⚠️ strictBlockCheck
⚠️ strictBlockTagCheck
🛠️⚠️ strictBossbarCheck
⚠️ strictDimensionTypeCheck
⚠️ strictEnchantmentCheck
⚠️ strictEntityTypeCheck
⚠️ strictEntityTypeTagCheck
🛠️⚠️ strictFluidCheck
⚠️ strictFluidTagCheck
🛠️⚠️ strictFunctionCheck
🛠️⚠️ strictFunctionTagCheck
🛠️⚠️ strictItemCheck
⚠️ strictItemTagCheck
🛠️⚠️ strictLootTableCheck
🛠️⚠️ strictMobEffectCheck
⚠️ strictMotiveCheck
⚠️ strictObjectiveCheck
⚠️ strictParticleTypeCheck
⚠️ strictPotionCheck
⚠️ strictPredicateCheck
🛠️⚠️ strictRecipeCheck
🛠️⚠️ strictScoreHolderCheck
⚠️ strictSoundEventCheck
⚠️ strictStorageCheck
⚠️ strictTagCheck
⚠️ strictTeamCheck
⚠️ stringQuote
🛠️⚠️ stringQuoteType
🛠️