Skip to content

Commit

Permalink
Add xb-stylelint command.
Browse files Browse the repository at this point in the history
  • Loading branch information
TravisCarden committed Oct 28, 2024
1 parent 4b786ac commit 6a3df41
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 0 deletions.
3 changes: 3 additions & 0 deletions commands/host/xb-setup
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ ddev start
printf '\n# Allow test modules and themes to be installed.\n$settings["extension_discovery_scan_tests"] = TRUE;' \
>> web/sites/default/settings.ddev.php

# Install Drupal core NPM packages.
ddev exec --dir /var/www/html/web/core -- npm install

# Build front-end assets.
ddev xb-npm-build

Expand Down
14 changes: 14 additions & 0 deletions commands/web/xb-stylelint
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash

## #ddev-generated
## Description: Check Experience Builder code for standards compliance with PHPCS.
## Example: ddev xb-stylelint
## Aliases: stylelint,css

UI_DIR="$DDEV_COMPOSER_ROOT/$DDEV_DOCROOT/modules/contrib/experience_builder/ui"
cd "$UI_DIR" || exit 1

npx stylelint \
--config "$DDEV_COMPOSER_ROOT/$DDEV_DOCROOT/core/.stylelintrc.json" \
--ignore-pattern "dist/**/*" \
"$UI_DIR/**/*.css"
15 changes: 15 additions & 0 deletions commands/web/xb-stylelint-fix
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

## #ddev-generated
## Description: Check Experience Builder code for standards compliance with PHPCS.
## Example: ddev xb-stylelint-fix
## Aliases: stylelint-fix,stylelint:fix,css-fix,css:fix

UI_DIR="$DDEV_COMPOSER_ROOT/$DDEV_DOCROOT/modules/contrib/experience_builder/ui"
cd "$UI_DIR" || exit 1

npx stylelint \
--config "$DDEV_COMPOSER_ROOT/$DDEV_DOCROOT/core/.stylelintrc.json" \
--ignore-pattern "dist/**/*" \
"$UI_DIR/**/*.css" \
--fix
2 changes: 2 additions & 0 deletions install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ project_files:
- commands/web/xb-phpcs
- commands/web/xb-phpstan
- commands/web/xb-phpunit
- commands/web/xb-stylelint
- commands/web/xb-stylelint-fix
- config.drupal-xb-dev.yaml

post_install_actions:
Expand Down

0 comments on commit 6a3df41

Please sign in to comment.