Skip to content

Development configuration files optimized for WordPress development

Notifications You must be signed in to change notification settings

jacobcassidy/wp-dev-config-files

Repository files navigation

WP Dev Config Files

These configuration files are for standardizing linting and formatting rules across your WordPress theme development projects.

Quick Start

  1. Clone this repo to your project's root directory with the command: git clone [email protected]:jacobcassidy/wp-dev-config-files.git
  2. Customize the script's configuration settings in: wp-dev-config-files/scripts/settings.sh
  3. Run the installation script in you project's root directory with the command: wp-dev-config-files/scripts/install.sh
  4. Delete the wp-dev-config-files directory after successfully running the installation script
  5. Update the package.json file details, such as name, description, author, homepage, and repository for your project.
  6. Reload VSCode for the new linting and formatting rules to take effect.

Note

If a file already exists, this script will do nothing with that file. If you want to replace the file, you'll need to delete the file you want replaced and rerun this script, or manually copy/paste the parts you want.

Features

All options can be turn on/off in the wp-dev-config-files/scripts/settings.sh file.

Adds:

  • .editorconfig
  • .gitignore
  • .markdownlint-cli2.jsonc
  • .markdownlint.jsonc
  • .prettierignore
  • CHANGELOG.md
  • composer.json
  • eslint.config.mjs
  • package.json
  • phpcs.xml
  • phpstan.neon
  • prettier.config.mjs
  • README.md
  • stylelint.config.mjs
  • webpack.config.mjs

Runs:

  • npm install
  • composer install
  • git init

Important

This script does not install any packages, only the configuration files the packages use. You will need to have the packages, e.g., Node, NPM, NPX, Git, Markdownlint, Prettier, Composer, ESLint, PHPCS, PHPStan, and Stylelint, installed before these configuration files can be used.

Note

This script uses the node module @wordpress/scripts, which doesn't currently support modern configuration file types such as eslint.config.mjs. The patches included in this script, which automatically install from wp-scripts-patches when the script is run, temporary fixes the issue so modern file formats can be used until @wordpress/scripts is updated to do so itself.

Found an Issue?

If you come across any issues, please report them here.

About

Development configuration files optimized for WordPress development

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published