@zairakai/js-dev-tools 4.0.0 → 4.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zairakai/js-dev-tools",
3
- "version": "4.0.0",
3
+ "version": "4.1.0",
4
4
  "description": "The development toolkit of the JavaScript and TypeScript projects for the web: shared ESLint, Prettier, Stylelint, Vitest, TypeScript and markdownlint rules, Knip, Makefile targets, Git hooks and GitLab CI pipeline templates",
5
5
  "keywords": [
6
6
  "dev-tools",
@@ -108,12 +108,12 @@
108
108
  "smol-toml": "1.9.0"
109
109
  },
110
110
  "dependencies": {
111
- "@stanislas-poisson/js-dev-tools": "^3.0.0",
111
+ "@stanislas-poisson/js-dev-tools": "^3.1.0",
112
112
  "eslint": "^10.14.0",
113
113
  "markdownlint-cli2": "^0.24.0",
114
114
  "prettier": "^3.9.10",
115
115
  "semver": "^7.8.6",
116
- "stylelint": "^17.16.0"
116
+ "stylelint": "^18.0.0"
117
117
  },
118
118
  "devDependencies": {
119
119
  "@vitest/coverage-v8": "^5.1.0",
@@ -24,16 +24,23 @@ if [[ -n "$STYLELINT_CONFIG" ]]; then
24
24
  fi
25
25
 
26
26
  if [[ "$PROJECT_TYPE" == "laravel-app" ]]; then
27
- STYLELINT_TARGET="${STYLELINT_TARGET:-resources/**/*.scss}"
27
+ STYLELINT_TARGET="${STYLELINT_TARGET:-resources/**/*.scss resources/**/*.css resources/**/*.vue}"
28
28
  else
29
- STYLELINT_TARGET="${STYLELINT_TARGET:-src/**/*.scss}"
29
+ STYLELINT_TARGET="${STYLELINT_TARGET:-src/**/*.scss src/**/*.css src/**/*.vue}"
30
30
  fi
31
31
 
32
+ # STYLELINT_TARGET is a list of globs separated by spaces (one per file type: stylelint lints the style blocks of .vue)
33
+ read -r -a STYLELINT_PATTERNS <<< "$STYLELINT_TARGET"
34
+ STYLELINT_ABSOLUTE=()
35
+ for _pattern in "${STYLELINT_PATTERNS[@]}"; do
36
+ STYLELINT_ABSOLUTE+=("${PROJECT_ROOT}/${_pattern}")
37
+ done
38
+
32
39
  log_step "Fixing: $STYLELINT_TARGET"
33
40
 
34
41
  # Skip gracefully if no matching files exist
35
- if ! has_files "${PROJECT_ROOT}/${STYLELINT_TARGET}"; then
36
- log_info "No SCSS/CSS files found matching ${STYLELINT_TARGET} - skipping"
42
+ if ! has_files "${STYLELINT_ABSOLUTE[@]}"; then
43
+ log_info "No SCSS, CSS or Vue files found matching ${STYLELINT_TARGET} - skipping"
37
44
  exit 0
38
45
  fi
39
46
 
@@ -60,6 +67,6 @@ if [[ ${#EXTRA_IGNORES[@]} -gt 0 ]]; then
60
67
  STYLELINT_ARGS+=(--ignore-path "$_TMP_IGNORE")
61
68
  fi
62
69
 
63
- "$STYLELINT_BIN" "${STYLELINT_ARGS[@]}" "$STYLELINT_TARGET"
70
+ "$STYLELINT_BIN" "${STYLELINT_ARGS[@]}" "${STYLELINT_PATTERNS[@]}"
64
71
 
65
72
  log_success "Stylelint fix applied"
@@ -26,16 +26,23 @@ fi
26
26
 
27
27
  # Lint target depends on project type (overridable via env)
28
28
  if [[ "$PROJECT_TYPE" == "laravel-app" ]]; then
29
- STYLELINT_TARGET="${STYLELINT_TARGET:-resources/**/*.scss}"
29
+ STYLELINT_TARGET="${STYLELINT_TARGET:-resources/**/*.scss resources/**/*.css resources/**/*.vue}"
30
30
  else
31
- STYLELINT_TARGET="${STYLELINT_TARGET:-src/**/*.scss}"
31
+ STYLELINT_TARGET="${STYLELINT_TARGET:-src/**/*.scss src/**/*.css src/**/*.vue}"
32
32
  fi
33
33
 
34
+ # STYLELINT_TARGET is a list of globs separated by spaces (one per file type: stylelint lints the style blocks of .vue)
35
+ read -r -a STYLELINT_PATTERNS <<< "$STYLELINT_TARGET"
36
+ STYLELINT_ABSOLUTE=()
37
+ for _pattern in "${STYLELINT_PATTERNS[@]}"; do
38
+ STYLELINT_ABSOLUTE+=("${PROJECT_ROOT}/${_pattern}")
39
+ done
40
+
34
41
  log_step "Checking: $STYLELINT_TARGET"
35
42
 
36
43
  # Skip gracefully if no matching files exist (stylelint v16 errors on empty glob)
37
- if ! has_files "${PROJECT_ROOT}/${STYLELINT_TARGET}"; then
38
- log_info "No SCSS/CSS files found matching ${STYLELINT_TARGET} - skipping"
44
+ if ! has_files "${STYLELINT_ABSOLUTE[@]}"; then
45
+ log_info "No SCSS, CSS or Vue files found matching ${STYLELINT_TARGET} - skipping"
39
46
  exit 0
40
47
  fi
41
48
 
@@ -62,6 +69,6 @@ if [[ ${#EXTRA_IGNORES[@]} -gt 0 ]]; then
62
69
  STYLELINT_ARGS+=(--ignore-path "$_TMP_IGNORE")
63
70
  fi
64
71
 
65
- "$STYLELINT_BIN" "${STYLELINT_ARGS[@]}" "$STYLELINT_TARGET"
72
+ "$STYLELINT_BIN" "${STYLELINT_ARGS[@]}" "${STYLELINT_PATTERNS[@]}"
66
73
 
67
74
  log_success "Stylelint check passed"
@@ -6,7 +6,8 @@ quality:: markdownlint shellcheck eslint prettier stylelint knip ## Run all qual
6
6
  @echo "✅ All quality checks passed"
7
7
 
8
8
  .PHONY: quality-fix
9
- quality-fix:: eslint-fix prettier-fix stylelint-fix markdownlint-fix ## Auto-fix all fixable issues
9
+ # Stylelint before Prettier: the fix of a style attribute leaves it badly spaced, and Prettier formats it again
10
+ quality-fix:: eslint-fix stylelint-fix prettier-fix markdownlint-fix ## Auto-fix all fixable issues
10
11
  @echo "✅ All auto-fixes applied"
11
12
 
12
13
  .PHONY: quality-fast