Skip to content

chore: resolving jazzicon lint violations#747

Closed
georgewrmarshall wants to merge 1 commit intomainfrom
fix/jazzicon-eslint-violations
Closed

chore: resolving jazzicon lint violations#747
georgewrmarshall wants to merge 1 commit intomainfrom
fix/jazzicon-eslint-violations

Conversation

@georgewrmarshall
Copy link
Contributor

Description

Related issues

Fixes:

Manual testing steps

  1. Go to this page...

Screenshots/Recordings

Before

After

Pre-merge author checklist

  • I've followed MetaMask Contributor Docs
  • I've completed the PR template to the best of my ability
  • I’ve included tests if applicable
  • I’ve documented my code using JSDoc format if applicable
  • I’ve applied the right labels on the PR (see labeling guidelines). Not required for external contributors.

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

georgewrmarshall added a commit that referenced this pull request Jul 16, 2025
## **Description**

This PR significantly enhances the React Native developer experience by
adding comprehensive Tailwind IntelliSense and ESLint support to the
`@metamask/design-system-twrnc-preset` package. This bridges the gap
between TWRNC usage and standard Tailwind tooling, providing React
Native developers with the same excellent developer experience as React
Web developers.

**What is the reason for the change?**
React Native developers using TWRNC were missing critical developer
experience features:
- No IntelliSense/autocomplete for design system classes
- No ESLint validation of Tailwind classnames  
- No detection of invalid classes, ordering issues, or shorthand
suggestions
- Difficult discovery of available design system tokens
- Manual enforcement of design system color usage

**What is the improvement/solution?**
We've implemented a comprehensive Tailwind configuration system that:
- Generates static `tailwind.config.js` files compatible with standard
Tailwind tooling
- Provides full IntelliSense support with autocomplete for all design
system classes
- Enables ESLint integration with `eslint-plugin-tailwindcss` for React
Native projects
- Enforces design system token usage (eliminates default Tailwind colors
like `red-500`)
- Supports both template literals (`tw\`classnames\``) and function
calls (`tw('classnames')`)
- Maintains theme-agnostic classnames that work with both light and dark
themes

## **Related issues**

Fixes: #747

## **Manual testing steps**

1. **IntelliSense Testing**:
- Open a React Native file in VS Code (e.g.,
`packages/design-system-react-native/src/components/Button/Button.tsx`)
- Start typing `tw\`bg-` and verify IntelliSense shows design system
colors like `bg-default`, `bg-primary-default`
   - Try typing `tw\`text-` and verify design system text colors appear
- Confirm no default Tailwind colors like `bg-red-500` appear in
suggestions

2. **ESLint Validation Testing**:
- Try typing an invalid class like `tw\`bg-red-500` and verify ESLint
flags it as invalid
- Test class ordering suggestions (e.g., `tw\`p-4 flex` suggests
reordering to `tw\`flex p-4`)
- Verify shorthand suggestions work (e.g., `tw\`h-4 w-4` suggests
`tw\`size-4`)

3. **Build and Test**:
- Run `yarn workspace @metamask/design-system-react-native test` -
should pass
- Run `yarn lint` - should pass with only expected template literal
warnings
- Run `yarn workspace @metamask/design-system-twrnc-preset build` -
should build successfully

## **Screenshots/Recordings**

### **Before**
- No IntelliSense for design system classes in React Native
- No ESLint validation of Tailwind classnames
- Manual discovery of available design tokens
- Potential usage of non-design-system colors
- String concatenation patterns with `.trim()`

### **After**
- Full IntelliSense with autocomplete for all design system classes
- ESLint catches invalid classnames and ordering issues
- Automatic enforcement of design system token usage
- Direct `tw` template literal usage for better tooling support
- Improved developer productivity with instant feedback


https://github.com/user-attachments/assets/665954e7-d38b-4c29-9a41-23ebfc6c4635

Mobile storybook and components still render as expected


https://github.com/user-attachments/assets/44327e03-23e0-4ee7-bb42-149283e04a49
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.

1 participant