Skip to content

Commit 6a3df41

Browse files
committed
Add xb-stylelint command.
1 parent 4b786ac commit 6a3df41

File tree

4 files changed

+34
-0
lines changed

4 files changed

+34
-0
lines changed

commands/host/xb-setup

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@ ddev start
8282
printf '\n# Allow test modules and themes to be installed.\n$settings["extension_discovery_scan_tests"] = TRUE;' \
8383
>> web/sites/default/settings.ddev.php
8484

85+
# Install Drupal core NPM packages.
86+
ddev exec --dir /var/www/html/web/core -- npm install
87+
8588
# Build front-end assets.
8689
ddev xb-npm-build
8790

commands/web/xb-stylelint

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash
2+
3+
## #ddev-generated
4+
## Description: Check Experience Builder code for standards compliance with PHPCS.
5+
## Example: ddev xb-stylelint
6+
## Aliases: stylelint,css
7+
8+
UI_DIR="$DDEV_COMPOSER_ROOT/$DDEV_DOCROOT/modules/contrib/experience_builder/ui"
9+
cd "$UI_DIR" || exit 1
10+
11+
npx stylelint \
12+
--config "$DDEV_COMPOSER_ROOT/$DDEV_DOCROOT/core/.stylelintrc.json" \
13+
--ignore-pattern "dist/**/*" \
14+
"$UI_DIR/**/*.css"

commands/web/xb-stylelint-fix

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
2+
3+
## #ddev-generated
4+
## Description: Check Experience Builder code for standards compliance with PHPCS.
5+
## Example: ddev xb-stylelint-fix
6+
## Aliases: stylelint-fix,stylelint:fix,css-fix,css:fix
7+
8+
UI_DIR="$DDEV_COMPOSER_ROOT/$DDEV_DOCROOT/modules/contrib/experience_builder/ui"
9+
cd "$UI_DIR" || exit 1
10+
11+
npx stylelint \
12+
--config "$DDEV_COMPOSER_ROOT/$DDEV_DOCROOT/core/.stylelintrc.json" \
13+
--ignore-pattern "dist/**/*" \
14+
"$UI_DIR/**/*.css" \
15+
--fix

install.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ project_files:
1717
- commands/web/xb-phpcs
1818
- commands/web/xb-phpstan
1919
- commands/web/xb-phpunit
20+
- commands/web/xb-stylelint
21+
- commands/web/xb-stylelint-fix
2022
- config.drupal-xb-dev.yaml
2123

2224
post_install_actions:

0 commit comments

Comments
 (0)