Global Coding Style

Enforce ESLint and Prettier style rules for NestJS TypeScript code in apps/api and packages/shared.

1|Updated Dec 4, 2024
One-click install
npx skills add https://github.com/imkdw/imkdw-dev --skill global-coding-style-imkdw
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Global Coding Style
Source: https://github.com/imkdw/imkdw-dev/tree/main/.claude/skills/global-coding-style
Command: npx skills add https://github.com/imkdw/imkdw-dev --skill global-coding-style-imkdw

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Inconsistent coding styles across a team or project lead to reduced readability, increased cognitive load, and frequent, often subjective, code review debates. This Skill enforces a unified coding style, promoting clarity and efficiency.

Core Features & Use Cases

  • TypeScript Strictness: Leverage strict TypeScript rules (e.g., no-explicit-any, prefer-nullish-coalescing) for robust, error-free, and maintainable code.
  • Naming Conventions: Apply consistent file, class, function, and variable naming (e.g., kebab-case for files, PascalCase for classes) for immediate understanding.
  • Automated Formatting: Utilize ESLint and Prettier for automatic code quality checks and formatting, reducing manual effort and ensuring consistency.
  • Use Case: When writing new TypeScript code, automatically ensure imports are sorted, variables are properly typed (no any), and the code adheres to the 120-character line width, significantly reducing manual review effort.

Quick Start

Review this TypeScript file and suggest improvements to its coding style, focusing on import organization, variable naming, and adherence to strict TypeScript rules as defined in our project.

Frequently Asked Questions about Global Coding Style

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

FAQPage Schema
How do I enforce consistent coding style across a TypeScript codebase?

Enforce consistent coding style by applying unified naming conventions (kebab-case for files, PascalCase for classes), strict TypeScript rules (no-explicit-any, prefer-nullish-coalescing), and automated formatting via ESLint and Prettier. This reduces code review friction and improves team readability.

What are strict TypeScript rules and why should I use them?

Strict TypeScript rules like no-explicit-any and prefer-nullish-coalescing catch type errors at compile time, eliminate unsafe type assumptions, and produce more maintainable code. They reduce runtime bugs and clarify intent across NestJS API codebases.

Can I use ESLint and Prettier together to automate code formatting?

Yes. ESLint enforces code quality rules and style guidelines while Prettier handles automatic formatting. Combined, they eliminate subjective formatting debates and ensure consistent 120-character line width and import ordering without manual effort.

How do I organize imports and set up file naming conventions in TypeScript projects?

Organize imports alphabetically and enforce file naming conventions like kebab-case for files and PascalCase for classes. ESLint rules automate this validation, ensuring consistency across apps/api/ and packages/shared/ without manual review.

What's the best way to reduce code review time and improve team collaboration?

Establish and enforce global coding style guidelines using ESLint and Prettier configurations. Automated style checks eliminate subjective debates, accelerate reviews, and let teams focus on logic rather than formatting inconsistencies.

Do I need to configure ESLint and Prettier separately for a NestJS project?

Both tools work together in NestJS projects: ESLint validates code quality rules and naming conventions while Prettier formats code to match your line-width and style settings. Configure both to enforce the same style across apps/api/ and packages/shared/.