Prettier

Paradime provides native integration with Prettier, enabling automatic formatting of YAML files in your dbt™ project directly from the IDE. This integration helps maintain consistent code style and catch potential YAML errors early.

Integration Features

  • One-click YAML formatting through the Lint button

  • Built-in error detection

  • Native IDE integration

  • Customizable formatting rules


Using the Integration

  1. Open a .sql file in your editor

  2. Click the Lint button in the Command Panel

  3. Review the changes made in Git Lite

    • Syntax errors

    • Style violations

    • Formatting suggestions

  4. If satisfied with Lint updates, Commit and Push your changes to your remote branch.

Configuration

While the integration works out of the box, you can customize Prettier's behavior:

  1. Create a .prettierrc.yaml file in your dbt™ project root directory (same location as your dbt_project.yml)

  2. Add your configuration:

.prettierrc.yaml example file
# .prettierrc.yaml example file
yamlCopyparser: yaml
trailingComma: es5
tabWidth: 4
semi: false
singleQuote: true
printWidth: 100

Visit prettier documentation a complete list of configuration options.

Error Detection

When the integration runs Prettier on a .yml file, it automatically:

  • Validates YAML syntax

  • Flags potential errors

  • Shows formatting issues

  • Provides error details in the output tab


Want to automate YAML formatting? Learn how to set up Prettier pre-commit hooks to format files before each commit.

Last updated

Was this helpful?