developer-blog-content icon indicating copy to clipboard operation
developer-blog-content copied to clipboard

Overview of the coding standards tooling available to WordPress developers

Open bph opened this issue 2 years ago • 5 comments

Discussed in https://github.com/WordPress/developer-blog-content/discussions/160

Originally posted by ryanwelcher August 28, 2023 It would be great to go over the coding standard tools that are available to WP developers to be able to keep their code standards compliant and consistent.

The article will cover setting up locally to use:

  • WordPress Coding Standards for PHP
  • The tools provided by the @wordpress/scripts package
  • Some IDE configuration - probably focus on VSCode and PHP Storm but open other or maybe it's better to be editor agnostic?

bph avatar Sep 07 '23 14:09 bph

Ooo I might be keen to work on this one, perhaps after the initial developer learning pathways launch in July...

jonathanbossenger avatar Jun 06 '24 13:06 jonathanbossenger

I'll defer to @jonathanbossenger on this one - happy to help if I can.

ryanwelcher avatar Jun 11 '24 14:06 ryanwelcher

Some IDE configuration - probably focus on VSCode and PHP Storm but open other or maybe it's better to be editor agnostic?

I think we could focus on VS Code, as it's used by the majority of WordPress developers, but also cover PhpStorm because it has the next largest user base (stats: https://jonathanbossenger.com/2023/07/the-state-of-wordpress-developer-tools-survey-results/).

jonathanbossenger avatar Jun 11 '24 14:06 jonathanbossenger

Wanted to add this template I created as a reference. It's got all of the "plumbing" in place to add the best practices/standards stuff to a project - https://github.com/ryanwelcher/wordpress-project-template

ryanwelcher avatar Jun 11 '24 16:06 ryanwelcher

@ryanwelcher I'd love to get your opinion on including something about the underlying tools behind the @wordpress/scripts terminal scripts.

AFAIK (based on a quick review of the scripts package) these are:

  • https://stylelint.io/ and https://eslint.org/ for CSS and JS linting
  • https://prettier.io/ for CSS and JS formatting

One way would be to do a deep dive into setting each of those three up individually, then show how it's magically doable via @wordpress/scripts.

Another way is to only show how to configure @wordpress/scripts (either for a new project or an existing one) and explain what tools it uses underneath.

I can see the pros and cons of both approaches.

jonathanbossenger avatar Jun 11 '24 16:06 jonathanbossenger