prettier

Format TypeScript and NestJS files automatically with Prettier.

1|Updated Jun 20, 2022
One-click install
npx skills add https://github.com/avvale/aurora-front --skill prettier
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: prettier
Source: https://github.com/avvale/aurora-front/tree/main/.claude/skills/prettier
Command: npx skills add https://github.com/avvale/aurora-front --skill prettier

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Prettier standardizes code formatting across TypeScript and NestJS projects, reducing formatting disputes and manual formatting effort.

Core Features & Use Cases

  • Automatic formatting after edits: formats a file immediately after changes to keep code consistent.
  • Project-wide formatting: formats entire directories or the whole project to enforce a uniform style.
  • Git integration: can be used with pre-commit hooks and CI to ensure all commits adhere to formatting standards.

Quick Start

Run the formatter on a specific file or directory:

  • npm run format -- path/to/file.ts
  • npm run format -- src/app/**/*.ts
  • npm run format -- src/**

Frequently Asked Questions about prettier

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I format TypeScript code automatically after edits?

You can format TypeScript code automatically by running Prettier via npm scripts after editing files. This applies consistent formatting instantly, ensuring code style remains uniform across your project without manual adjustments.

Can I run Prettier formatting on an entire NestJS project directory?

Yes, you can format an entire NestJS project directory by running the formatter with glob patterns like 'src/**'. This applies Prettier formatting across all matching TypeScript files to enforce a uniform code style throughout the project.

How do I enforce code formatting standards before commits using git hooks?

To enforce code formatting before commits, integrate Prettier with pre-commit hooks and CI checks. This ensures all committed code adheres to formatting standards automatically, preventing unformatted TypeScript files from entering the repository.

Do I need Prettier installed as a dependency to format my code?

Yes, Prettier must be installed in your project as a dev dependency and configured before formatting. The tool requires this setup to apply consistent code style across your TypeScript and NestJS files during edits or CI checks.

What is the best way to standardize code style across a TypeScript project?

The best way to standardize code style across a TypeScript project is using Prettier to automate formatting. It eliminates formatting disputes by applying uniform style rules after edits, across directories, and through pre-commit hooks.

Why format code during CI checks instead of manually?

Formatting code during CI checks ensures all commits automatically adhere to Prettier standards without manual effort. This maintains consistent code quality across TypeScript and NestJS files by catching formatting issues before they merge into the repository.