safeword 0.4.4 → 0.4.5

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": "safeword",
3
- "version": "0.4.4",
3
+ "version": "0.4.5",
4
4
  "description": "CLI for setting up and managing safeword development environments",
5
5
  "type": "module",
6
6
  "bin": {
@@ -2,6 +2,9 @@
2
2
  # Safeword: Auto-lint changed files (PostToolUse)
3
3
  # Silently auto-fixes, only outputs unfixable errors
4
4
 
5
+ # Require jq for JSON parsing
6
+ command -v jq &> /dev/null || exit 0
7
+
5
8
  input=$(cat)
6
9
  file=$(echo "$input" | jq -r '.tool_input.file_path // .tool_input.notebook_path // empty' 2>/dev/null)
7
10
 
@@ -13,7 +16,7 @@ file=$(echo "$input" | jq -r '.tool_input.file_path // .tool_input.notebook_path
13
16
 
14
17
  # Determine linters based on file extension
15
18
  case "$file" in
16
- *.js|*.jsx|*.ts|*.tsx|*.mjs|*.cjs|*.astro|*.vue|*.svelte)
19
+ *.js|*.jsx|*.ts|*.tsx|*.mjs|*.cjs|*.astro)
17
20
  # Prettier (silent, ignore errors)
18
21
  npx prettier --write "$file" 2>/dev/null
19
22
 
@@ -25,6 +28,11 @@ case "$file" in
25
28
  fi
26
29
  ;;
27
30
 
31
+ *.vue|*.svelte)
32
+ # Vue/Svelte: Prettier only (ESLint requires project-specific plugins)
33
+ npx prettier --write "$file" 2>/dev/null
34
+ ;;
35
+
28
36
  *.md)
29
37
  # Markdownlint (capture unfixable errors)
30
38
  errors=$(npx markdownlint-cli2 --fix "$file" 2>&1)