MetaMask / MetaMask/metamask-design-system

Fix `@typescript-eslint/no-explicit-any` Errors in Design Tokens Tests

Open
#127 0 comments 0 reactions 0 assignees View on GitHub
team-design-system
Dominant language
TypeScript
Stars
37
Forks
14
Avg merge
1d 9h
Merged PRs (30d)
60

Description

### **Description**

This issue tracks fixing TypeScript ESLint errors related to `@typescript-eslint/no-explicit-any` in the `metamask-design-system` repository. Temporary ESLint disable comments will be added to suppress these errors, but they need to be removed, and the underlying issues resolved.

![Screenshot 2024-11-18 at 1 21 43 PM](https://github.com/user-attachments/assets/a38f8fb4-3819-41a9-a140-b8fbc994c7ec)

![Screenshot 2024-11-18 at 2 11 10 PM](https://github.com/user-attachments/assets/bc27e997-c9f7-45fb-a470-9f4842b51086)

### **Technical Details**

- Remove ESLint `@typescript-eslint/no-explicit-any` disable comments from the affected files.
- Replace `any` types with appropriate, specific types.
- Run `yarn lint` to verify that no new linting errors are introduced.

#### Affected Files
- `packages/design-tokens/src/js/themes/darkTheme/colors.test.ts`: Lines 19, 20, 21, and 55.
- `packages/design-tokens/src/js/themes/lightTheme/colors.test.ts`: Lines 19, 20, 21, and 55.
- `packages/design-tokens/src/js/typography/typography.test.ts`: Line 40.
- `packages/design-tokens/stories/test-utils/getJSColors.ts`: Line 9.
- `packages/design-tokens/stories/test-utils/useJsonColor.ts`: Line 50.

### **Acceptance Criteria**

- ESLint disable comments are removed from all affected files.
- Specific and appropriate types replace `any` in the identified lines.
- Running `yarn lint` passes without errors.

### **References**

- [TypeScript ESLint `no-explicit-any`](https://typescript-eslint.io/rules/no-explicit-any/)

Contributor guide

Open the contributing guide

Research direction

Start with the listed test and utility files under packages/design-tokens, especially the affected lines containing ESLint disable comments. Replace the any types with specific types, remove the disables, and run yarn lint. Done means all listed files are updated and lint passes without errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
eslint, typescript
Domain
design, testing, tooling
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.