home / skills / duc01226 / easyplatform / lint

lint skill

/.claude/skills/lint

This skill lint projects by running .NET analyzers and ESLint/Prettier, reporting issues and applying safe auto-fixes when requested.

npx playbooks add skill duc01226/easyplatform --skill lint

Review the files below or copy the command above to add this skill to your agents.

Files (1)
SKILL.md
1.3 KB
---
name: lint
description: "[DevOps & Infra] Run linters and fix issues for backend or frontend"
infer: true
---

Run linting: $ARGUMENTS

## Instructions

1. **Parse arguments**:
    - `backend` or `be` → Run .NET analyzers
    - `frontend` or `fe` → Run ESLint/Prettier
    - `fix` → Auto-fix issues where possible
    - No argument → Run both, report only

2. **For Backend (.NET)**:

    ```bash
    dotnet build EasyPlatform.sln /p:TreatWarningsAsErrors=false
    ```

    - Check for analyzer warnings (CA*, IDE*, etc.)
    - Report code style violations

3. **For Frontend (Angular/Nx)**:

    ```bash
    cd src/Frontend
    nx lint playground-text-snippet
    nx lint platform-core
    ```

    With auto-fix:

    ```bash
    nx lint playground-text-snippet --fix
    npx prettier --write "apps/**/*.{ts,html,scss}" "libs/**/*.{ts,html,scss}"
    ```

4. **Report format**:
    - Group issues by severity (error, warning, info)
    - Show file paths and line numbers
    - Suggest fixes for common issues

5. **Auto-fix behavior**:
    - If `fix` argument provided, apply safe auto-fixes
    - Report what was fixed vs what needs manual attention

## IMPORTANT Task Planning Notes

- Always plan and break many small todo tasks
- Always add a final review todo task to review the works done at the end to find any fix or enhancement needed

Overview

This skill runs linters and optionally auto-fixes issues for backend (.NET) and frontend (Angular/Nx) codebases. It parses concise arguments to target backend, frontend, or both and outputs a grouped, actionable report showing severity, file paths, and line numbers. The skill emphasizes safe auto-fixes and clear guidance for remaining manual work.

How this skill works

The skill parses input arguments: backend/be to run .NET analyzers, frontend/fe to run ESLint/Prettier for Angular/Nx, and fix to apply safe automatic fixes. For backend it builds the solution and extracts analyzer warnings and style violations. For frontend it runs Nx lint tasks and Prettier formatting; with fix it runs lint --fix and Prettier --write. Final output groups issues by severity, lists file paths and line numbers, suggests fixes, and separates items auto-fixed from those needing manual attention.

When to use it

  • Before opening or updating a pull request to catch style and analyzer issues early
  • As a local developer step to ensure code meets team linting rules
  • As a CI job to fail builds on errors and produce a linter report
  • When preparing a release or merging feature branches
  • When performing a code quality sweep across backend and frontend

Best practices

  • Run without the fix option first to review warnings and avoid unexpected changes
  • Commit or stash changes before applying --fix so fixes are easy to review or revert
  • Integrate the skill into CI to enforce errors as build failures and warnings as review items
  • Limit automated fixes to safe, non-destructive rules; manually review complex suggestions
  • Break work into small tasks and always add a final review todo to verify fixes and catch missed issues

Example use cases

  • Run lint with no args to scan both backend and frontend and generate a grouped report
  • Run lint backend (or be) locally to surface .NET analyzer warnings before a PR
  • Run lint frontend --fix (or fe fix) to apply ESLint and Prettier fixes, then review remaining issues
  • Add a CI step that executes lint backend and lint frontend and fails the build on error severity
  • Perform a nightly lint sweep to list warnings and plan focused remediation tasks

FAQ

What does the fix argument change?

fix applies safe automatic fixes (ESLint --fix and Prettier formatting) and records which files were modified; remaining items are flagged for manual attention.

Which linters are run for backend and frontend?

Backend runs .NET analyzers and builds the solution to collect CA*/IDE* warnings; frontend runs Nx lint for Angular projects and Prettier for formatting.