Add ESLint TypeScript rules and translation validation

Summary

  • Add ESLint rules for TypeScript strict typing (no-explicit-any, consistent-type-assertions)
  • Add translation validation scripts to ensure translation consistency across locales
  • Fix invalid translation key search.no_resultssearch_page.no_results
  • Document all new rules and scripts in CLAUDE.md

Changes

ESLint TypeScript Rules

  • @typescript-eslint/no-explicit-any (warn) - discourages any type usage
  • @typescript-eslint/consistent-type-assertions (warn) - discourages type assertions while allowing as const and object literals as parameters

Translation Validation Scripts

Two new scripts in scripts/ folder:

  1. check-blog-translations.js - Cross-locale key sync

    • Compares all locales against English reference
    • Reports missing/extra keys per locale
  2. check-blog-translation-usage.js - Code usage validation

    • Scans for t('key') and <Trans i18nKey="key">
    • Reports keys used in code that don't exist
    • Optional --unused flag for unused keys

Usage

pnpm --filter @hive/blog lint                      # ESLint with new rules
pnpm --filter @hive/blog lint:translations         # Cross-locale validation
pnpm --filter @hive/blog lint:translations:usage   # Code usage validation

Test plan

  • ESLint rules work and show warnings for any types
  • lint:translations detects missing keys across locales
  • lint:translations:usage passes after fixing search.no_results
  • Scripts handle edge cases (nested keys, dynamic keys, Trans component)

🤖 Generated with Claude Code

Merge request reports

Loading