ROX-33794: Add no-PatternFly-utility-layout lint rule with ignores#19608
Open
pedrottimark wants to merge 2 commits intomasterfrom
Open
ROX-33794: Add no-PatternFly-utility-layout lint rule with ignores#19608pedrottimark wants to merge 2 commits intomasterfrom
pedrottimark wants to merge 2 commits intomasterfrom
Conversation
Contributor
|
Images are ready for the commit at fb51138. To use with deploy scripts, first |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #19608 +/- ##
=======================================
Coverage 49.28% 49.28%
=======================================
Files 2735 2735
Lines 206215 206215
=======================================
Hits 101630 101630
Misses 97043 97043
Partials 7542 7542
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Objectives
Problem
PatternFly upgrade:
Therefore, utility classes for layout that are equivalent to props of elements cause more changes files than needed.
Analysis
https://www.patternfly.org/utility-classes/spacing#margin-properties
margin =
m|mb|ml|mr|mt|mx|myin tablehttps://www.patternfly.org/utility-classes/spacing#padding-properties
padding =
p|pb|pl|pr|pt|px|pyin tablemargin_padding =
m|mb|ml|mr|mt|mx|my|p|pb|pl|pr|pt|px|pyin tablehttps://www.patternfly.org/utility-classes/spacing#size-values
Find in Files with regular expression enabled
pf-v6-u-(margin)-[^0]pf-v6-u-(padding)-[^0]pf-v6-u-(margin_padding)-[^0]pf-v6-u-(margin)-0pf-v6-u-(padding)-0pf-v6-u-(margin_padding)-0Omit
0value because fewer occurrences and in case it is more needed that word values like lg.Solution
Use typescript-eslint playground to understand string values of
classNameprop.https://typescript-eslint.io/play/#ts=5.9.3&showAST=es&fileType=.tsx
Edit pluginLimited.js file.
no-PatternFly-utility-layoutlint rule.Edit eslint.config.js file.
ignoresarray and comments.User-facing documentation
Testing and quality
Automated testing
How I validated my change
npm run tscin ui/apps/platform folder.npm run lint:fast-devin ui/apps/platform folder.With configuration object but without
ignoresproperty see 413 errors (and get the file paths)