Skip to content

Add stylelint to tooling setup - #87

Merged
MaggieCabrera merged 17 commits into
WordPress:trunkfrom
troychaplin:add/styleint
Sep 24, 2026
Merged

MaggieCabrera merged 17 commits into
WordPress:trunkfrom
troychaplin:add/styleint

Conversation

@troychaplin

Copy link
Copy Markdown
Member

Description

Adding styleline as per a suggestion from @MaggieCabrera — #33 (comment)

Testing Instructions

  1. Update dependencies: npm ci
  2. Test style lint: npm run lint:css

Use of AI Tools

AI assistance: Yes
Tool(s): Claude
Model(s): Opus 5
Used for: determining the cause and appropriate fix for this error when adding stylelint and updating dependencies:

npm warn allow-scripts Run npm approve-scripts --allow-scripts-pending to review, or npm approve-scripts <pkg> to allow.

@github-actions

github-actions Bot commented Sep 21, 2026 •

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: troychaplin <areziaal@git.wordpress.org>
Co-authored-by: MaggieCabrera <onemaggie@git.wordpress.org>

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

@github-actions github-actions Bot added documentation Improvements or additions to documentation [Type] Tooling Issues or PRs related to tooling [Area] Global Styles Issues or PRs that touch theme.json or the base stylesheet. [Area] Block Styles Issues or PRs that touch custom block style CSS (glossy button, animated gradient, editor style). labels Sep 21, 2026
@MaggieCabrera

Copy link
Copy Markdown
Contributor

Thanks for picking this up! A few things:

  • Use stylelint directly instead of @wordpress/scripts. The theme has no build step, so wp-scripts adds a lot of packages (and the new allowScripts and .prettierignore entries) just to get the stylelint binary. TT5 uses stylelint "**/*.css" with stylelint and @wordpress/stylelint-config as devDependencies.
  • Extend @wordpress/stylelint-config rather than /scss. Both stylesheets are plain CSS.
  • Set rule-empty-line-before and at-rule-empty-line-before to null like Gutenberg does. That removes all the blank-line edits in style.css (one of them is a line of four spaces).
  • Override selector-class-pattern with Gutenberg's pattern (^[a-z][a-z0-9]*(?:(?:__|--|-)[a-z0-9]+)*$) instead of the inline disables. Block classes are BEM, so this will come up constantly.
  • Add *.css to lint-staged.config.mjs and a CSS step to lint.yml, plus a lint:css bullet in the README. The $schema note in the README looks unrelated to this PR.

@github-actions github-actions Bot added GitHub Actions Pull requests that update GitHub Actions code and removed [Area] Global Styles Issues or PRs that touch theme.json or the base stylesheet. [Area] Block Styles Issues or PRs that touch custom block style CSS (glossy button, animated gradient, editor style). labels Sep 22, 2026
@troychaplin

Copy link
Copy Markdown
Member Author

Thanks for picking this up! A few things:

Thanks @MaggieCabrera, requested changes have been pushed.

@MaggieCabrera MaggieCabrera changed the title Add styleint to tooling setup Add stylelint to tooling setup Sep 24, 2026

@MaggieCabrera MaggieCabrera left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thank you! let's bring it in

@MaggieCabrera
MaggieCabrera merged commit c0684bc into WordPress:trunk Sep 24, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation GitHub Actions Pull requests that update GitHub Actions code [Type] Tooling Issues or PRs related to tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants