Testing: Add initial CSS logical properties enforcement (CSS modules)#72758
Testing: Add initial CSS logical properties enforcement (CSS modules)#72758
Conversation
|
Size Change: 0 B Total Size: 2.38 MB ℹ️ View Unchanged
|
.stylelintrc.js
Outdated
| { | ||
| files: [ '**/*.module.css' ], | ||
| rules: { | ||
| 'plugin/use-logical-properties-and-values': true, |
There was a problem hiding this comment.
Here's the full setup we adopted when we tried this before elsewhere.
I think 'plugin/use-logical-properties-and-values': true alone would be a bit too broad for our purposes, while also not preventing issues with common shorthand notation.
There was a problem hiding this comment.
Ah, thanks for the pointer! I had looked around for some prior art around Gutenberg, but didn't think to look in that project.
There was a problem hiding this comment.
I updated to adapt that approach in db3526e. PTAL!
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Co-Authored-By: Lena Morita <555336+mirka@users.noreply.github.com>
|
Flaky tests detected in 2b71e4f. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/18941185393
|
What?
Adds an initial pass of lint enforcement for using CSS logical properties, currently applying to CSS module files (
*.module.css), since these are more limited in scope and easy to fix in tandem with getting the testing setup in place.In the process, this also effectively opts-in said CSS modules for Stylelint linting, which was previously limited to checking
*.scssfiles.Related:
Follow-up to #72747 (comment)
How?
To get the ball rolling, this applies enforcement to a limited set of files which are currently being expanded through e.g. the
@wordpress/themepackage and new build tooling supporting CSS modules.As a follow-up, consider:
@wordpress/stylelint-configWhy?
See rationale in linked issues. This works toward eliminating the need for separate LTR and RTL stylesheets.
Testing Instructions
npm run lint:cssshould pass.Optionally, introduce a violation (or revert one of the proposed fixes) and verify that
npm run lint:cssfails as expected.