Skip to content

fix: replace 'any' type with proper TypeScript types to resolve ESLin… #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

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