Skip to content

Stylelint: Consolidate Lint rules for simplification - #71235

Open
im3dabasia wants to merge 3 commits into
WordPress:trunkfrom
im3dabasia:try/69590-follow-up
Open

im3dabasia wants to merge 3 commits into
WordPress:trunkfrom
im3dabasia:try/69590-follow-up

Conversation

@im3dabasia

@im3dabasia im3dabasia commented Aug 18, 2025 •

Copy link
Copy Markdown
Contributor

What?

Closes #69590 (comment)

Why?

Consolidate the rules.

How?

Use only declaration-property-value-disallowed-list

@im3dabasia
im3dabasia marked this pull request as ready for review August 25, 2025 03:59
@github-actions

github-actions Bot commented Aug 25, 2025 •

Copy link
Copy Markdown

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 props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: im3dabasia <im3dabasia1@git.wordpress.org>
Co-authored-by: jsnajdr <jsnajdr@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@im3dabasia im3dabasia added [Tool] stylelint config /packages/stylelint-config [Type] Code Quality Issues or PRs that relate to code quality labels Aug 25, 2025
@mirka
mirka requested review from a team and t-hamano October 16, 2025 21:13
Comment thread .stylelintrc.js
return `Avoid using "${ value }" in "${ property }". --wp-components-color-* variables are not ready to be used outside of the components package.`;
}
return `Avoid "${ value }" for "${ property }".`;
},

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the message function we don't need to perform the entire value test again, we only need to switch on the property name:

switch ( property ) {
  case 'flex-direction':
    return "Avoid -reverse";
  default:
    return "Avoid --wp-components-color-*";
}

@im3dabasia
im3dabasia requested a review from jsnajdr February 10, 2026 09:41

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Tool] stylelint config /packages/stylelint-config [Type] Code Quality Issues or PRs that relate to code quality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants