Skip to content

Conversation

@medchelios
Copy link
Contributor

@medchelios medchelios commented Jun 22, 2025

Fix TypeScript ESLint Warning - Replace any type

🐛 Problem

The useLang hook contains a TypeScript any type that triggers ESLint warning:

@typescript-eslint/no-explicit-any: Unexpected any. Specify a different type.

✅ Solution

  • Replace any type with proper LangValue | undefined type
  • Add type casting for safe array access
  • Maintain backward compatibility and functionality

📝 Changes Made

  • Before: let current: any = lang
  • After: let current: LangValue | undefined = lang
  • Added proper type casting: current[segment] as LangValue | undefined

📦 Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature
  • Breaking change
  • Documentation update

🔍 Checklist

  • Code follows the project's style guidelines
  • Self-review completed
  • No breaking changes introduced
  • TypeScript types are properly defined
  • ESLint warning resolved
  • Hook functionality preserved
  • Type safety maintained

…t warning

- Replace 'any' type with 'LangValue | undefined' in getValueFromKey function
- Add proper type casting for array access
- Resolves @typescript-eslint/no-explicit-any warning
- Maintains type safety while preserving functionality
@eramitgupta eramitgupta merged commit d18e782 into eramitgupta:main Jun 26, 2025
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants