Skip to main content

Contributing to WordPress Core

Back to Blog

Celebrating our WordPress contributors

Mikey’s WordPress fix

Shout out to Mikey Binns, Developer at Atomic Smash, who’s been busy bug fixing. He contributed to WordPress Core by helping fix a bug that had been unresolved for 19 months after it was flagged. 

WordPress core is the foundation of WordPress websites, which means anyone with a WordPress site or working with WordPress can benefit from his fix. 

Fixing issues with an outdated Stylelint dependency

“The Stylelint dependency in @wordpress/stylelint-config was outdated and, despite five separate pull requests, no-one had figured out how to update it due to a large number of deprecated rules,” said Mikey. “I’d posted a comment on the issue to get a progress update, with no response. I ended up tagging a maintainer and asking to fix it myself.”

Why it matters

Stylelint is a code linter for CSS. It picks out problems in CSS code before it becomes a problem in production. For instance, setting the text colour to 2px would be invalid, and Stylelint would flag that.

There are many different rules in Stylelint and many ways to configure those rules for what you want to achieve. WordPress provides its own configuration for others to use. This is presented in the form of a package, which allows others to use it and skip configuring it themselves, or let others make the decisions around configuration.

This package is called @wordpress/stylelint-config. It only works with a specified Stylelint version, because Stylelint contains the rules WordPress is configuring, so if the Stylelint version is wrong, the rules in the config might be missing or broken.

@wordpress/stylelint-config depended on v14 of Stylelint, but in v15, Stylelint decided to deprecate a lot of rules around formatting. These deprecated rules meant that WordPress couldn’t just update to v15 and keep all the same rules in its config, a problem for such a large codebase which depended on those rules.

Fixing the config was the easy part, fixing the tests took a bit longer. WordPress Jest only supports CommonJS and Stylelint v16 converted to ESM and deprecated their CommonJS API, so I had to rebuild the test wrapper for those to instead do the same call via the CLI instead.

Mikey standing with arms folded and looking at the camera in front of street art
Mikey Binns Developer, Atomic Smash

Mikey’s fix was approved and merged into the Gutenberg 19.3 update.

WordPress powers millions of websites, and it’s the most widely used Content Management System. It is open source software that is written, maintained, and supported by thousands of independent contributors worldwide – often developers working at a WordPress agency like Atomic Smash.

Fixing issues on WordPress Core can help people and businesses all over the world, and we’re proud that our team contributes to making WordPress better. Nice one, Mikey!

Work with WordPress experts

Looking for a new WordPress agency? We’re here to help.

Piers looking at camera in front of an industrial backdrop

Piers Tincknell Co-founder & Managing Director

Tuesday 1st October 2024