Vérification TypeScript et ESLint

VérifiéSûr

Exécute la vérification de types TypeScript et ESLint, puis corrige les erreurs détectées. À utiliser pour valider la qualité du code ou résoudre des problèmes de linting.

Spar Skills Guide Bot
DeveloppementIntermédiaire
15002/06/2026
Claude CodeCursorWindsurfCopilotCodex
#typescript#eslint#code-quality#linting#type-check

Recommandé pour

Notre avis

Exécute la vérification de type TypeScript et ESLint, puis corrige automatiquement les erreurs détectées en suivant des consignes strictes de suppression du code inutilisé.

Points forts

  • Automatise la correction des erreurs de type et de linting
  • Impose la suppression du code inutilisé (pas de préfixe souligné)
  • Cycle de correction et de vérification jusqu'à succès
  • Respecte l'architecture du projet et la sécurité des types

Limites

  • Nécessite une commande npm run check préconfigurée
  • Peut introduire des changements non désirés si les analyses sont mal interprétées
  • Ne gère pas les erreurs de logique métier ou de tests
Quand l'utiliser

Lorsque vous avez besoin de nettoyer et valider la qualité du code TypeScript avant un commit, une PR ou un déploiement.

Quand l'éviter

Lorsque le projet n'a pas de script check configuré ou que vous voulez préserver délibérément du code inutilisé.

Analyse de sécurité

Sûr
Score qualité90/100

The skill instructs running 'npm run check' (a local development script) and using the Edit tool to fix found errors. No destructive or exfiltrating actions are involved, and no network requests or external scripts are executed. It is a standard code-quality maintenance task.

Aucun point d'attention détecté

Exemples

Fix all TS and ESLint errors
Run the check command to find and fix all TypeScript and ESLint errors in the project. Make sure to delete any unused imports, variables, or parameters instead of prefixing them with underscores.
Check and fix a specific file
Run TypeScript type-check and ESLint on src/components/Button.tsx, then fix any errors found.

name: check description: Run TypeScript type-check and ESLint, then fix any errors found. Use when you need to validate code quality or fix linting issues.

TypeScript and ESLint Check & Fix

Run TypeScript type-check and ESLint, then fix any errors found.

Instructions

  1. Run the check command:

    • Execute npm run check to run both TypeScript type-check and ESLint
    • Capture and analyze all errors and warnings
  2. If errors are found:

    • Analyze each error carefully before making changes
    • Fix TypeScript errors:
      • Resolve type mismatches
      • Add missing type annotations
      • Fix import/export issues
      • Ensure proper null/undefined handling
    • Fix ESLint errors:
      • CRITICAL: For no-unused-vars errors, DELETE unused code completely
      • DO NOT prefix variables with underscores - remove them instead
      • Fix import order and formatting issues
      • Resolve any other ESLint rule violations
    • Use appropriate tools:
      • Use Edit tool for file changes (not bash sed/awk)
      • Use Read tool to examine files before editing
      • Make targeted, precise fixes
  3. Re-run the check:

    • After fixing errors, run npm run check again
    • Verify all errors are resolved
  4. Repeat until clean:

    • Continue the fix-and-check cycle until npm run check passes without errors
    • Report the final status

Project-Specific Guidelines

  • Unused Code Policy: DELETE unused imports, variables, and parameters - don't prefix with underscores
  • Architecture: Follow /src/ directory structure with features, components, lib separation
  • Type Safety: Maintain proper TypeScript types throughout
  • Code Quality: Ensure all fixes improve code quality, don't just silence errors

Success Criteria

  • npm run check completes with exit code 0
  • ✅ No TypeScript errors
  • ✅ No ESLint errors or warnings
  • ✅ All unused code removed (not just prefixed)
  • ✅ Code remains functional after fixes
Skills similaires