chore: adding design tokens eslint plugin color-no-hex rule #24089
chore: adding design tokens eslint plugin color-no-hex rule #24089georgewrmarshall merged 2 commits intodevelopfrom
color-no-hex rule #24089Conversation
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
.eslintrc.js
Outdated
There was a problem hiding this comment.
Adding plugin and color no hex rule to eslintrc.js file
.eslintrc.js
Outdated
There was a problem hiding this comment.
ignoring all test files
There was a problem hiding this comment.
There is a current issue with some false positives that need to be fixed issue here MetaMask/eslint-plugin-design-tokens#20
package.json
Outdated
There was a problem hiding this comment.
Adding eslint-plugin-design-tokens package
test/e2e/tests/metrics/mock-data.js
Outdated
There was a problem hiding this comment.
Ignoring this file
ui/components/multichain/notification-list-item/notification-list-item.stories.tsx
Outdated
Show resolved
Hide resolved
c863882 to
d8f2ce6
Compare
|
New dependencies detected. Learn more about Socket for GitHub ↗︎
|
d8f2ce6 to
93a0e05
Compare
color-no-hex rule color-no-hex rule
Builds ready [93a0e05]
Page Load Metrics (1446 ± 731 ms)
Bundle size diffs
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #24089 +/- ##
========================================
Coverage 67.46% 67.46%
========================================
Files 1258 1258
Lines 49259 49261 +2
Branches 12826 12826
========================================
+ Hits 33229 33231 +2
Misses 16030 16030 ☔ View full report in Codecov by Sentry. |
93a0e05 to
25bf40a
Compare
25bf40a to
d105e2c
Compare
Builds ready [d105e2c]
Page Load Metrics (994 ± 610 ms)
Bundle size diffs
|
| @@ -1,3 +1,4 @@ | |||
| /* eslint-disable @metamask/design-tokens/color-no-hex*/ | |||
There was a problem hiding this comment.
Ignoring image asset svg component
f7543dd
...firmations/components/edit-gas-fee-popover/network-statistics/status-slider/status-slider.js
Outdated
Show resolved
Hide resolved
| @@ -1,3 +1,4 @@ | |||
| /* eslint-disable @metamask/design-tokens/color-no-hex*/ | |||
| import React from 'react'; | |||
There was a problem hiding this comment.
Ignoring image asset svg component
| @@ -1,3 +1,4 @@ | |||
| /* eslint-disable @metamask/design-tokens/color-no-hex*/ | |||
There was a problem hiding this comment.
Ignoring image asset svg component
| @@ -1,3 +1,4 @@ | |||
| /* eslint-disable @metamask/design-tokens/color-no-hex*/ | |||
There was a problem hiding this comment.
Ignoring image asset svg component
| @@ -1,3 +1,4 @@ | |||
| /* eslint-disable @metamask/design-tokens/color-no-hex*/ | |||
There was a problem hiding this comment.
Ignoring image asset svg component
| @@ -1,3 +1,4 @@ | |||
| /* eslint-disable @metamask/design-tokens/color-no-hex*/ | |||
There was a problem hiding this comment.
Ignoring image asset svg component
dbrans
left a comment
There was a problem hiding this comment.
Thank you for adding this, George!
jpuri
left a comment
There was a problem hiding this comment.
Changes in files owned by confirmation ux team look good.
Builds ready [f7543dd]
Page Load Metrics (1305 ± 736 ms)
Bundle size diffs
|
Description
This PR introduces the @metamask/eslint-plugin-design-tokens library to the MetaMask extension codebase, along with the implementation of the color-no-hex rule. This rule aims to prevent the use of static hex color values in our
.js,.tsand.tsxfiles encouraging instead the adoption of design tokens. The motivation behind this change is to ensure our styling remains consistent with the MetaMask design system, enhancing themability, accessibility, and overall alignment with our design principles. Additionally, this update is a crucial step towards enabling the seamless rollout of future brand evolution within MetaMask, ensuring that our UI can adapt to new design standards with minimal effort.Related issues
Fixes: #24111
Manual testing steps
To ensure the successful integration of the
eslint-plugin-design-tokensand the effectiveness of thecolor-no-hexrule:yarn install.yarn lint:checkto identify any instances of static hex color values.Screenshots/Recordings
Before
before720.mov
After
after1080.mov
Pre-merge author checklist
Pre-merge reviewer checklist