Skip to content
| Marketplace
Sign in
Visual Studio Code>Linters>AL Coding GuidelinesNew to Visual Studio Code? Get it now.
AL Coding Guidelines

AL Coding Guidelines

Sandeep Choudhary

|
15 installs
| (0) | Free
Enforce coding guidelines for AL language on save
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

AL Coding Guidelines Extension

This VS Code extension enforces coding guidelines for Business Central AL language development. It checks files upon saving and reports issues.

Prerequisites

  • Node.js: You must have Node.js installed to build this extension. Download it from https://nodejs.org/.
  • VS Code: Visual Studio Code editor.

Setup Instructions

  1. Install Node.js: If you haven't already, download and install Node.js.
  2. Open Terminal: Open a terminal in this directory (al-guidelines-extension).
  3. Install Dependencies: Run the following command:
    npm install
    
  4. Compile the Extension:
    npm run compile
    
  5. Run/Debug:
    • Open this folder in VS Code.
    • Press F5 to start debugging.
    • A new "Extension Development Host" window will open.
    • Open an .al file in that window to test the guidelines.

Features

  • Formatting & Whitespace:
    • Operators: Enforces spaces around binary operators (e.g., a + b).
    • Keywords: Checks for space after NOT.
    • Control Structures: Ensures if, while, repeat, and case start on a new line.
  • File Structure & Naming:
    • Files: Warns on empty files or files containing multiple objects.
    • Naming: Enforces alphanumeric filenames (snake_case/kebab-case recommended).
    • Object Definition: Validates that files start with a proper AL object type.
  • Naming Conventions:
    • Variables: Enforces Temp prefix for temporary record variables.
  • Control Flow:
    • Deprecation: Warns about nested WITH statements (deprecated).
  • Performance:
    • Data Access: Recommends FindSet() over Find('-') or Find('+').
  • UI & Accessibility:
    • Page Properties: Enforces ApplicationArea and ToolTip properties on field and action blocks in Page and PageExtension objects.
    • UsageCategory: Enforces UsageCategory property on Page objects.
    • Page ApplicationArea: Enforces ApplicationArea property on Page objects (in addition to fields/actions).
  • Security & Internationalization:
    • Data Security: Enforces DataClassification property on fields in Table and TableExtension objects.
    • Localization: Warns against using CaptionML (suggests XLIFF).
    • Hardcoding: Warns on hardcoded strings in Error, Message, Confirm, and StrSubstNo, suggesting the use of Labels.
  • Error Handling:
    • Best Practices: Warns against using AssertError in production code.
  • Project Structure:
    • Permissions: Scans the workspace to ensure at least one permissionset or permissionsetextension object exists.

Customization

You can add more rules in src/extension.ts inside the validateALFile function.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft