automation-workshop

View the Project on GitHub craftcms/automation-workshop

Code Quality

Bug Fixing

Transformers & Parsers

Formatters & Linters

Craft Code Style

4 Noble Truths of Code Style

  1. 😧 Suffering is an innate characteristic of writing code
  2. 👩‍💻 The cause of this suffering is caring more about your code formatting than the code itself
  3. 👐 The end of suffering can be achieved letting go of your code style preferences and focus on what your code is doing
  4. 🧘 By embracing automated linters and formatters, you can finally transcend the superficial grip code style. You are an enlightened developer.

Install Prettier

ddev exec npm install --save-dev --save-exact prettier
echo '{"singleQuote": true}'> .prettierrc.json
echo '*.php
composer.lock
web/cpresources/*
storage/*
templates/*
vendor/*
vendor-local/*'> .prettierignore

# Try it out
ddev exec npx prettier --check .

No useful output for CI, yet.