Skip to content

Fix TypeScript and ESLint errors in SkeletonPlaceholder component #71

@VietTranDai

Description

@VietTranDai

Description

The SkeletonPlaceholder.tsx component has several TypeScript and ESLint errors that need to be resolved:

Current Errors:

  1. Line 81:24: @typescript-eslint/no-explicit-any - Unexpected any type usage
  2. Line 87:3: react/prop-types - 'children' is missing in props validation
  3. Line 88:3: react/prop-types - 'backgroundColor' is missing in props validation
  4. Line 89:3: react/prop-types - 'highlightColor' is missing in props validation
  5. Line 90:3: react/prop-types - 'speed' is missing in props validation

Proposed Solutions:

1. Fix the any type (Line 81)

Replace animatedStyle: {} as any, with properly typed animated style:

animatedStyle: {} as Animated.AnimateStyle<ViewStyle>,

2. Add PropTypes validation

Since this is a TypeScript React Native project, we have two options:

  • Option A: Add PropTypes (if the project requires them)
  • Option B: Disable the rule for this file (recommended for TypeScript projects)

3. Import Required Types

Add the missing import for animated styles:

import Animated, {
  useSharedValue,
  useAnimatedStyle,
  withRepeat,
  withTiming,
  withSequence,
  AnimateStyle, // Add this import
} from "react-native-reanimated";

Implementation Plan:

  1. Fix the explicit any type usage with proper TypeScript typing
  2. Either add PropTypes validation or disable the rule
  3. Add proper imports for animated style types
  4. Test the component to ensure animations still work correctly

Files to Modify:

  • components/ui/SkeletonPlaceholder.tsx

Priority: Medium

These are linting errors that should be resolved to maintain code quality and type safety.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions