chore(hooks): drop apps/portal scope from post-edit-eslint.sh
Three pre-WS-3 references purged: regex (apps/(app|portal)), grep (apps/(app|portal)), and the now-obsolete "apps/portal/ is planned but not present" defensive comment. The $spa variable becomes redundant with only one SPA — collapsed to direct apps/app/ references. Net: simpler script, no behavioural change for actual files in apps/app/ (still runs pnpm eslint --fix). Files outside apps/app/ were already a no-op.
This commit is contained in:
@@ -12,18 +12,14 @@ if [[ "$path" = /* ]]; then
|
|||||||
rel="${path#$CLAUDE_PROJECT_DIR/}"
|
rel="${path#$CLAUDE_PROJECT_DIR/}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Match apps/app/** or apps/portal/** for .vue/.ts/.tsx/.js files.
|
# Match apps/app/** for .vue/.ts/.tsx/.js files.
|
||||||
if ! echo "$rel" | grep -Eq '^apps/(app|portal)/.+\.(vue|ts|tsx|js)$'; then
|
if ! echo "$rel" | grep -Eq '^apps/app/.+\.(vue|ts|tsx|js)$'; then
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Extract SPA dir and the path relative to it.
|
# Path inside apps/app/.
|
||||||
spa="$(echo "$rel" | grep -oE '^apps/(app|portal)')"
|
inside="${rel#apps/app/}"
|
||||||
inside="${rel#$spa/}"
|
|
||||||
|
|
||||||
# SPA may not exist yet (apps/portal/ is planned but not present in tree).
|
cd "$CLAUDE_PROJECT_DIR/apps/app" 2>/dev/null || exit 0
|
||||||
[ -d "$CLAUDE_PROJECT_DIR/$spa" ] || exit 0
|
|
||||||
|
|
||||||
cd "$CLAUDE_PROJECT_DIR/$spa" 2>/dev/null || exit 0
|
|
||||||
pnpm eslint --fix "$inside" >/dev/null 2>&1 || true
|
pnpm eslint --fix "$inside" >/dev/null 2>&1 || true
|
||||||
exit 0
|
exit 0
|
||||||
Reference in New Issue
Block a user