@zairakai/js-dev-tools 3.21.0 → 3.22.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.
@@ -8,7 +8,7 @@
8
8
  # - type: feat, fix, docs, style, refactor, perf, test, chore, ci or build
9
9
  # - scope: optional, in lowercase
10
10
  # - #TICKET: the number of the issue
11
- # - the first line has 72 characters at most, and the second line is blank
11
+ # - the subject (the text after the ticket) has 50 characters at most (Pro Git), and the second line is blank
12
12
  #
13
13
  # A work in progress follows the same format. The messages that Git writes itself
14
14
  # (Merge, Revert, fixup!, squash!) are accepted as they are.
@@ -24,7 +24,7 @@ case "$first_line" in
24
24
  "Merge "* | "Revert \""* | "fixup! "* | "squash! "* | "amend! "*) exit 0 ;;
25
25
  esac
26
26
 
27
- PATTERN='^(feat|fix|docs|style|refactor|perf|test|chore|ci|build)(\([a-z0-9][a-z0-9._/-]*\))?: #[0-9]+ [^[:space:]].*$'
27
+ PATTERN='^(feat|fix|docs|style|refactor|perf|test|chore|ci|build)(\([a-z0-9][a-z0-9._/-]*\))?: #[0-9]+ ([^[:space:]].*)$'
28
28
 
29
29
  fail() {
30
30
  echo ""
@@ -47,8 +47,11 @@ if ! [[ $first_line =~ $PATTERN ]]; then
47
47
  fail "Invalid commit message format"
48
48
  fi
49
49
 
50
- if [[ ${#first_line} -gt 72 ]]; then
51
- fail "The first line has ${#first_line} characters: the limit is 72"
50
+ # The limit counts the subject only: the type, the scope and the ticket do not use its 50 characters
51
+ subject="${BASH_REMATCH[3]}"
52
+
53
+ if [[ ${#subject} -gt 50 ]]; then
54
+ fail "The subject has ${#subject} characters: the limit is 50"
52
55
  fi
53
56
 
54
57
  if [[ -n $second_line ]]; then
@@ -10,6 +10,13 @@
10
10
  * 'color-no-invalid-hex': true,
11
11
  * },
12
12
  * }
13
+ *
14
+ * Example of changing the order of the properties (each option receives a copy of the list and returns the new one):
15
+ * import { createStylelintConfig } from '@zairakai/js-dev-tools/config/stylelint.config.js'
16
+ *
17
+ * export default createStylelintConfig({
18
+ * properties: (list) => list.filter((property) => property !== 'float'),
19
+ * })
13
20
  */
14
21
 
15
22
  import baseConfig from '@zairakai/js-dev-tools/config/stylelint.config.js'
@@ -10,7 +10,7 @@ bats:: ## Run shell script tests (BATS)
10
10
  fi; \
11
11
  FILES=$$(find tests/bats -name "*.bats" 2>/dev/null); \
12
12
  if [ -z "$$FILES" ]; then \
13
- echo "ℹ️ No BATS tests found — skipping"; \
13
+ echo "ℹ️ No BATS tests found, skipping"; \
14
14
  else \
15
15
  bats $$FILES; \
16
16
  fi
@@ -22,7 +22,7 @@ bats-unit:: ## Run BATS unit tests
22
22
  exit 1; \
23
23
  fi; \
24
24
  if [ ! -d tests/bats/unit ] || [ -z "$$(find tests/bats/unit -name "*.bats" 2>/dev/null)" ]; then \
25
- echo "ℹ️ No BATS unit tests found — skipping"; \
25
+ echo "ℹ️ No BATS unit tests found, skipping"; \
26
26
  else \
27
27
  bats tests/bats/unit/*.bats; \
28
28
  fi
@@ -34,7 +34,7 @@ bats-integration:: ## Run BATS integration tests
34
34
  exit 1; \
35
35
  fi; \
36
36
  if [ ! -d tests/bats/integration ] || [ -z "$$(find tests/bats/integration -name "*.bats" 2>/dev/null)" ]; then \
37
- echo "ℹ️ No BATS integration tests found — skipping"; \
37
+ echo "ℹ️ No BATS integration tests found, skipping"; \
38
38
  else \
39
39
  bats tests/bats/integration/*.bats; \
40
40
  fi
@@ -1,4 +1,4 @@
1
- # Core Makefile — Zairakai NPM Dev Tools
1
+ # Core Makefile: Zairakai NPM Dev Tools
2
2
  # Aggregates all modular targets for JavaScript/TypeScript/Vue projects.
3
3
  #
4
4
  # Usage in a consumer project (Makefile):
@@ -31,10 +31,10 @@ include $(NPM_DIRECTORY_TOOLS_MAKE_DIR)markdownlint.mk
31
31
  # 3. ShellCheck validation
32
32
  include $(NPM_DIRECTORY_TOOLS_MAKE_DIR)shellcheck.mk
33
33
 
34
- # 4. Code style — ESLint + Prettier
34
+ # 4. Code style: ESLint + Prettier
35
35
  include $(NPM_DIRECTORY_TOOLS_MAKE_DIR)code-style.mk
36
36
 
37
- # 5. CSS/SCSS — Stylelint (optional)
37
+ # 5. CSS/SCSS: Stylelint (optional)
38
38
  include $(NPM_DIRECTORY_TOOLS_MAKE_DIR)stylelint.mk
39
39
 
40
40
  # 6. Dead code detection (Knip)
@@ -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
@@ -1,7 +1,7 @@
1
1
  # Variables - Zairakai NPM Dev Tools
2
2
  # Shared configuration and styling
3
3
 
4
- # Critical path detection — works from any inclusion depth
4
+ # Critical path detection: works from any inclusion depth
5
5
  NPM_DIRECTORY_TOOLS_MAKE_DIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
6
6
  NPM_DIRECTORY_TOOLS_PACKAGE_ROOT := $(abspath $(NPM_DIRECTORY_TOOLS_MAKE_DIR)../../)/
7
7
  NPM_DIRECTORY_TOOLS_SCRIPTS_DIR := $(NPM_DIRECTORY_TOOLS_PACKAGE_ROOT)scripts/