Skip to main content

Format

This command formats your Dart code using dart format to ensure consistent code style across your project. It can be applied globally or targeted to specific modules (apps, features, or pages).

morpheme format

Description

The format command automatically fixes style issues in your code, such as indentation, spacing, and line breaks. It helps maintain a clean and readable codebase. You can run it on:

  • Entire Project: Formats everything.
  • Specific App: Formats a specific app module.
  • Specific Feature: Formats a feature (standalone or within an app).
  • Specific Page: Formats just a single page within a feature.

Usage

Format Entire Project

morpheme format

Format Scoped Components

Format a specific app:

morpheme format -a driver

Format a specific feature:

morpheme format -f auth

Format a specific page:

# In a standalone feature
morpheme format -f auth -p login

# In an app-specific feature
morpheme format -a driver -f home -p dashboard

Options

morpheme format [options]

To see all available options and flags, run morpheme format --help.

Available Options

OptionAbbrDescription
--apps-name-aFormat specific app.
--feature-name-fFormat specific feature.
--page-name-pFormat specific page (requires -f).