generated from MetaMask/metamask-module-template
-
-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Labels
Description
Description
Fix ESLint violations in the currently ignored files for the design-system-react-native package and remove them from the ignore list. This will improve code quality, type safety, and maintainability across the entire codebase.
Technical Details
Several files in the design-system-react-native package are currently ignored in the ESLint configuration. These files contain violations that need to be addressed, particularly in components like:
- Avatar components (AvatarFavicon, AvatarGroup, AvatarNetwork, AvatarToken)
- Badge components
- Utility components like Jazzicon and Maskicon
Common violations include:
no-bitwise
: Using bitwise operators like<<
,&
, and>>
@typescript-eslint/no-non-null-assertion
: Using non-null assertion operator (!
)- Import ordering issues
- Type safety concerns
Approach
- Work through each ignored file in the design-system-react-native package, addressing its specific ESLint violations
- Prioritize files with fewer or simpler violations first
- For components with bitwise operations (like Maskicon.utilities.ts), consider:
- Replacing with standard arithmetic operations where possible
- Adding proper documentation where bitwise operations are necessary
- Using ESLint exceptions with clear explanations only when absolutely needed
- For TypeScript non-null assertions, replace with proper null checking
- Remove each file from the ignore list as violations are fixed
- Ensure all tests continue to pass
Acceptance Criteria
- All design-system-react-native files are removed from the ignore list in the ESLint configuration
- All ESLint violations are fixed or have proper exceptions with explanations
- No new ESLint warnings are introduced
- All tests continue to pass
- Code functionality remains unchanged
References
- Current ESLint configuration
- Similar violations in the react-native package (e.g., Maskicon.utilities.ts with bitwise operations and non-null assertions)