All diagnostic codes must be fully lowercase and use singular nouns (no plurals).
Format: <scope>.<sub-scope>.<descriptor>
resourcepack.entity.missing
molang.variable.invalid
molang.variable.missing
Dynamic values inside diagnostic messages are wrapped in single quotes:
Missing a resourcepack definition of the entity: 'minecraft:creeper'
- Follow the existing patterns in each package before introducing new patterns.
- Prefer
constoverlet; avoidvar. - Use explicit return types for public functions and class methods.
- Use
interfacefor object shapes andtypefor unions, intersections, and aliases. - Avoid non-null assertions (
!) unless unavoidable; use proper null checks instead.
| Construct | Convention | Example |
|---|---|---|
| Classes | PascalCase |
DiagnosticsBuilder |
| Interfaces | PascalCase |
ProjectData |
| Functions | camelCase |
getDiagnostics |
| Variables | camelCase |
blockCount |
| Constants | camelCase |
defaultTimeout |
| Enum members | PascalCase |
DiagnosticSeverity.Error |
| Files | kebab-case |
block-properties.ts |
| Test files | *.test.ts |
commands.test.ts |
- Source files live under
src/. - Test files mirror the source structure under
test/. - Each package has its own
package.jsonandtsconfig.json.
Use the Conventional Commits format:
<type>(<scope>): <short description>
Common types: feat, fix, docs, refactor, test, chore.
Examples:
feat(diagnoser): add block-property validation
fix(molang): correct variable scoping in nested expressions
docs: update Style Guide with naming conventions
- Keep the subject line under 72 characters.
- Use the imperative mood ("add", not "adds" or "added").
- Reference issues where relevant:
fix(commands): handle missing manifest (#123).