Coding Standards

Maintain consistency and excellence in Dialectss code contributions. Follow these guidelines to ensure your work aligns with our quality expectations.

Formatting & Style

1. Code Layout

  • Use 2 spaces for indentation (no tabs).
  • 40 character line length limit with automatic breaks.
  • Consistent trailing commas in multi-line arrays/objects.

2. Type Definitions

  • PascalCase for type names.
  • snake_case for variable names.
  • Leading underscore for private members.

Correct Code Example


// Valid type definition
type Expression = {
    identifier: string;
    value: Number;
    context: CompilationContext;
}

// Valid function declaration
function evaluate(expr: Expression): Number {
    return expr.value * expr.context.weight;
}

                

Documentation Standards

Comment Style

Use multi-line JSDoc-style comments for public API documentation.

/**\n * Calculates expression value in compile-time context\n * @param {Expression} expr - Input expression\n * @returns {Number} - Final computed value\n */

Contribution Process

1

Preparation

Fork the repo → Checkout branch → Write code + tests

2

Validation

Run linter + type checks → Ensure all tests pass

3

Submission

Create PR with changelog entry + issue links

Code Standards Enforcement

GitHub Actions

Our CI pipeline will automatically verify code style, type compliance, and documentation completeness for all PRs.

Ready to Follow Standards?

Your clean, documented code helps us maintain a high-quality language ecosystem that's easy to use for all developers.

🛠️ Start Contributing