Closed Bug 1979115 Opened 1 year ago Closed 1 year ago

Add a Stylelint rule to enforce using border-radius tokens

Categories

(Developer Infrastructure :: Lint and Formatting, task)

Tracking

(firefox144 fixed)

RESOLVED FIXED
144 Branch
Tracking Status
firefox144 --- fixed

People

(Reporter: hjones, Assigned: jooliver)

References

(Blocks 3 open bugs)

Details

(Whiteboard: [recomp][acorntractors])

Attachments

(11 files)

48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review

We should add a Stylelint rule to enforce only using --border-radius-* tokens for any border-radius properties in CSS and SCSS files. Since this property only uses relatively simple values, the rule should be autofixable. I have a POC of what this rule could look like here.

If we can make this rule autofixable, we should consider fixing all the low hanging fruit in a single patch following the implementation of this rule. That can be done in a stack of patches under this bug ID, or as a separate bug depending on implementer preference. I have an example of this as well here.

I don't think any of my POC patches took SCSS variables into account, which is likely something we'll need to correct for.

Depends on: 1979117
See Also: → 1979120

As part of this work we will want to expand the number of border-radius design tokens we support - see bug 1979120 for more details.

Assignee: nobody → jooliver
Status: NEW → ASSIGNED
Whiteboard: [recomp][acorntractors]
  • Adds a new stylelint rule to enforce the use of border-radius tokens.
  • Fixes border-radius errors in existing files that are autofixable.
  • Updates the rollout config to disable errors in existing files that are not autofixable.
  • Fixes border-radius errors in existing files that are autofixable.
  • Updates the rollout config to remove fixed files from the list.
Attachment #9505880 - Attachment description: Bug 1979115 - autofix border-radius linting errors r=#reusable-components-reviewers → Bug 1979115 - autofix desktop theme border-radius linting errors r=#desktop-theme-reviewers
  • Fixes border-radius errors that are autofixable in various files.
  • Updates the rollout config to remove fixed files from the list.
  • Fixes border-radius errors in aboutlogins files that are autofixable.
  • Updates the rollout config to remove fixed files from the list.
Attachment #9506127 - Attachment description: Bug 1979115 - autofix aboutlogins border-radius linting errors r=#fxview-reviewers → Bug 1979115 - autofix aboutlogins border-radius linting errors r=#fcredential-management-reviewers
  • Fixes border-radius errors in firefoxview files that are autofixable.
  • Updates the rollout config to remove fixed files from the list.
  • Fixes border-radius errors in ai-ml-related files that are autofixable.
  • Updates the rollout config to remove fixed files from the list.
  • Fixes border-radius errors in extension files that are autofixable.
  • Updates the rollout config to remove fixed files from the list.
  • Fixes border-radius errors in panel-list files that are autofixable.
  • Updates the rollout config to remove fixed files from the list.
  • Fixes border-radius errors in devtools files that are autofixable.
  • Updates the rollout config to apply use-border-radius-tokens linting for fixed files.
  • Fixes border-radius errors in newtab files that are autofixable.
  • Updates the rollout config to remove fixed files from the list.
  • Fixes border-radius errors that are autofixable.
  • Updates the rollout config to remove fixed files from the list.
Pushed by mkennedy@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/ab7cfe545f28 https://hg.mozilla.org/integration/autoland/rev/7863e94afd55 add stylelint rule to enforce border-radius tokens usage r=desktop-theme-reviewers,frontend-codestyle-reviewers,mstriemer,tgiles,Standard8
Pushed by agoloman@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/968c2e82cf8c https://hg.mozilla.org/integration/autoland/rev/7d76e9428ebd Revert "Bug 1979115 - add stylelint rule to enforce border-radius tokens usage r=desktop-theme-reviewers,frontend-codestyle-reviewers,mstriemer,tgiles,Standard8" for causing linting failures.

Backed out for causing linting failures.

Flags: needinfo?(jooliver)
Blocks: 1983938
Pushed by mkennedy@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/8d470fafb426 https://hg.mozilla.org/integration/autoland/rev/de9020c7be53 add stylelint rule to enforce border-radius tokens usage r=desktop-theme-reviewers,frontend-codestyle-reviewers,mstriemer,tgiles,Standard8
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 144 Branch
Attachment #9506127 - Attachment description: Bug 1979115 - autofix aboutlogins border-radius linting errors r=#fcredential-management-reviewers → Bug 1979115 - autofix aboutlogins border-radius linting errors r=#fxview-reviewers
Pushed by mkennedy@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/bd6a7fc93dd0 https://hg.mozilla.org/integration/autoland/rev/180624a360da autofix aboutlogins border-radius linting errors r=mtigley,desktop-theme-reviewers,credential-management-reviewers,frontend-codestyle-reviewers,dao https://github.com/mozilla-firefox/firefox/commit/a9efbc54d814 https://hg.mozilla.org/integration/autoland/rev/aa2d32780359 autofix desktop theme border-radius linting errors r=tabbrowser-reviewers,desktop-theme-reviewers,frontend-codestyle-reviewers,urlbar-reviewers,dao https://github.com/mozilla-firefox/firefox/commit/f0b1dafddcdd https://hg.mozilla.org/integration/autoland/rev/024484999839 autofix devtools border-radius linting errors r=devtools-reviewers,Standard8,nchevobbe https://github.com/mozilla-firefox/firefox/commit/af20cd3c964c https://hg.mozilla.org/integration/autoland/rev/8bff834fea16 autofix extension border-radius linting errors r=extension-reviewers,frontend-codestyle-reviewers,zombie https://github.com/mozilla-firefox/firefox/commit/902209b8eeda https://hg.mozilla.org/integration/autoland/rev/41063d844fcf autofix firefoxview border-radius linting errors r=fxview-reviewers,frontend-codestyle-reviewers,nsharpley
Pushed by amarc@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/8434baeffd67 https://hg.mozilla.org/integration/autoland/rev/397cc3a5b7e6 Revert "Bug 1979115 - autofix firefoxview border-radius linting errors r=fxview-reviewers,frontend-codestyle-reviewers,nsharpley" for causing bc failures @ browser_ext_popup_corners.js

Backed out for causing bc failures @ browser_ext_popup_corners

Pushed by mkennedy@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/9f9a4d250d50 https://hg.mozilla.org/integration/autoland/rev/d0af41b0d600 autofix aboutlogins border-radius linting errors r=mtigley,desktop-theme-reviewers,credential-management-reviewers,frontend-codestyle-reviewers,dao https://github.com/mozilla-firefox/firefox/commit/1778e883259f https://hg.mozilla.org/integration/autoland/rev/9e80c0d0e4ac autofix devtools border-radius linting errors r=devtools-reviewers,Standard8,nchevobbe https://github.com/mozilla-firefox/firefox/commit/248375c50169 https://hg.mozilla.org/integration/autoland/rev/3126ac158fd2 autofix extension border-radius linting errors r=extension-reviewers,frontend-codestyle-reviewers,zombie https://github.com/mozilla-firefox/firefox/commit/061f133b02d4 https://hg.mozilla.org/integration/autoland/rev/e94c68012b3a autofix newtab border-radius linting errors r=home-newtab-reviewers,frontend-codestyle-reviewers,amy

Is this bug meant to be open still for the landing of the last patches? If so, you can re-open it and add the leave-open keyword and then remove it just before landing the last ones.

Pushed by mstriemer@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/aa2443cd1a91 https://hg.mozilla.org/integration/autoland/rev/ac0db5e77435 autofix panel-list border-radius linting errors r=desktop-theme-reviewers,frontend-codestyle-reviewers,hjones https://github.com/mozilla-firefox/firefox/commit/a79a59e959bd https://hg.mozilla.org/integration/autoland/rev/f0b323d20269 autofix border-radius linting errors r=desktop-theme-reviewers,frontend-codestyle-reviewers,hjones https://github.com/mozilla-firefox/firefox/commit/f34496d6cb45 https://hg.mozilla.org/integration/autoland/rev/d4342ba5f8ee autofix ai-ml border-radius linting errors r=firefox-ai-ml-reviewers,desktop-theme-reviewers,frontend-codestyle-reviewers,tgiles https://github.com/mozilla-firefox/firefox/commit/45563cb6983b https://hg.mozilla.org/integration/autoland/rev/fefc79bf43d0 autofix firefoxview border-radius linting errors r=fxview-reviewers,frontend-codestyle-reviewers,nsharpley
Status: RESOLVED → REOPENED
Keywords: leave-open
Resolution: FIXED → ---
Pushed by mkennedy@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/b4fe83bbb0b8 https://hg.mozilla.org/integration/autoland/rev/3b131f68b0a0 autofix desktop theme border-radius linting errors r=profiles-reviewers,translations-reviewers,desktop-theme-reviewers,frontend-codestyle-reviewers,timhuang,dao,tbersentes,kpatenio https://github.com/mozilla-firefox/firefox/commit/6a14c828454a https://hg.mozilla.org/integration/autoland/rev/d0ca0402ff20 autofix desktop theme border-radius linting errors r=tabbrowser-reviewers,desktop-theme-reviewers,frontend-codestyle-reviewers,urlbar-reviewers,dao,mstriemer
Flags: needinfo?(jooliver)
Keywords: leave-open
Status: REOPENED → RESOLVED
Closed: 1 year ago → 1 year ago
Resolution: --- → FIXED
Regressions: 1988541
No longer regressions: 1988541
Blocks: 1996683
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: