Install command
Provided
Lints Vue 3 components for Composition API best practices and common issues.
Open the source and read safety notes before installing.
Source-backed facts for citing this resource, derived directly from the registry — also available as plain text for AI assistants.
Decision playbook
Signals are present but mixed. Use the checklist below to confirm the source and operational safety for your environment.
0
78
—
No baseline selected
No major trust-signal divergence detected in the current selection.
Confirm ownership and provenance before trusting install instructions.
Source link availableRequired
Open the canonical repository and verify ownership.
Source provenance statusRequired
Marked as source-backed.
Metadata reviewed
Registry metadata indicates a reviewed listing.
Validate risk disclosures before installation or API wiring.
Safety notes presentRequired
Review the listed safety guidance before running commands.
Privacy notes presentRequired
Review data handling notes before connecting accounts or secrets.
Trust level risk gateRequired
Trust level does not block evaluation.
Check package metadata and artifact integrity signals.
Install payload available
Install or copy payload is available for review.
Package verification flag
No package verification flag provided.
Checksum metadata
No checksum provided for downloaded artifact.
Use compare context to validate trade-offs before adoption.
Compare tray has multiple entries
Add at least one more entry to compare trust differences.
Baseline comparison available
No baseline peer selected yet.
Diverging trust signals identified
No major trust-signal divergence found.
Setup at a glance
Copy-ready — paste the snippet to get started.
Install command
Provided
Config snippet
Provided
Copy snippet
Provided
Prerequisites
None
Platforms
1 listed
Difficulty
0/100
Adoption plan
Current risk score 16/100. Use staged verification before broader rollout.
Validate source and review signals before any execution.
Confirm source provenanceRequired
Source URL/provenance metadata is present.
Confirm metadata review state
Listing has review metadata.
Verify install payload
Install/config payload exists and can be inspected.
Confirm safety, privacy, and package integrity signals.
Review safety notesRequired
Safety notes are present.
Review privacy notesRequired
Privacy notes are present.
Verify package integrity metadata
No package verification/checksum metadata.
Adopt in controlled steps based on the selected plan.
Run in isolated sandbox firstRequired
Use a constrained sandbox and observe behavior across multiple tasks.
Roll out graduallyRequired
Roll out to a small cohort before wider usage.
Set monitoring and fallback
Define rollback path and monitor errors after adoption.
Evidence readiness
Required evidence gates are covered (5/6 signals complete).
Source repository/provenance is listed.
Required in this preset
Review metadata is present.
Required in this preset
Safety notes are present.
Required in this preset
Privacy notes are present.
Optional in this preset
Package integrity metadata is missing.
Optional in this preset
Install payload is available.
Required in this preset
Required evidence gates are covered for this preset.
Decision timeline
5/6 steps complete with no blocking gaps for this preset.
triage
Source/provenance metadata is available.
triage
Review metadata is available.
verify
Safety notes are available.
verify
Privacy notes are available.
verify
Package integrity metadata is missing.
rollout
Install payload is available.
No required blockers for this timeline preset.
Safety & privacy surface
1 safety and 1 privacy notes across 2 risk areas. Review closely: credentials & tokens, permissions & scopes.
#!/bin/bash
# Read the tool input from stdin
INPUT=$(cat)
TOOL_NAME=$(echo "$INPUT" | jq -r '.tool_name')
FILE_PATH=$(echo "$INPUT" | jq -r '.tool_input.file_path // .tool_input.path // ""')
if [ -z "$FILE_PATH" ]; then
exit 0
fi
# Check if this is a Vue component file
if [[ "$FILE_PATH" == *.vue ]]; then
echo "✨ Vue Composition API Linter - Analyzing Vue component..."
echo "📄 Component: $FILE_PATH"
# Check if file exists
if [ ! -f "$FILE_PATH" ]; then
echo "⚠️ Vue component file not found: $FILE_PATH"
exit 1
fi
# Detect Vue version and project setup
VUE_VERSION="unknown"
PROJECT_TYPE="vue"
if [ -f "package.json" ]; then
if grep -q '"vue".*"^3\.' package.json 2>/dev/null; then
VUE_VERSION="3"
echo "🎯 Vue 3 project detected"
elif grep -q '"vue".*"^2\.' package.json 2>/dev/null; then
VUE_VERSION="2"
echo "⚠️ Vue 2 project detected - Composition API available with @vue/composition-api"
fi
# Check for Nuxt
if grep -q '"nuxt"' package.json 2>/dev/null; then
PROJECT_TYPE="nuxt"
echo "🚀 Nuxt project detected"
fi
# Check for Vite
if grep -q '"vite"' package.json 2>/dev/null; then
echo "⚡ Vite build system detected"
fi
fi
# Component structure analysis
echo ""
echo "🔍 Analyzing component structure..."
# Check for script setup
SCRIPT_SETUP=false
if grep -q '<script setup' "$FILE_PATH" 2>/dev/null; then
SCRIPT_SETUP=true
echo "✅ Script setup syntax detected"
# Check for TypeScript
if grep -q '<script setup lang="ts">' "$FILE_PATH" 2>/dev/null; then
echo "📘 TypeScript script setup detected"
fi
elif grep -q '<script>' "$FILE_PATH" 2>/dev/null; then
echo "ℹ️ Traditional script syntax detected"
echo "💡 Consider migrating to <script setup> for better performance"
fi
# Check for template
if grep -q '<template>' "$FILE_PATH" 2>/dev/null; then
echo "✅ Template block found"
fi
# Check for styles
if grep -q '<style' "$FILE_PATH" 2>/dev/null; then
echo "✅ Style block found"
if grep -q '<style scoped' "$FILE_PATH" 2>/dev/null; then
echo "🎯 Scoped styles detected"
fi
if grep -q 'lang="scss"\|lang="sass"\|lang="less"' "$FILE_PATH" 2>/dev/null; then
echo "🎨 CSS preprocessor detected"
fi
fi
# Composition API analysis
echo ""
echo "🔍 Composition API Analysis:"
# Check for Composition API imports and usage
COMPOSABLES_USED=()
if grep -q 'ref(' "$FILE_PATH" 2>/dev/null; then
REF_COUNT=$(grep -c 'ref(' "$FILE_PATH" 2>/dev/null || echo 0)
echo " • ref() usage: $REF_COUNT instances"
COMPOSABLES_USED+=("ref")
fi
if grep -q 'reactive(' "$FILE_PATH" 2>/dev/null; then
REACTIVE_COUNT=$(grep -c 'reactive(' "$FILE_PATH" 2>/dev/null || echo 0)
echo " • reactive() usage: $REACTIVE_COUNT instances"
COMPOSABLES_USED+=("reactive")
fi
if grep -q 'computed(' "$FILE_PATH" 2>/dev/null; then
COMPUTED_COUNT=$(grep -c 'computed(' "$FILE_PATH" 2>/dev/null || echo 0)
echo " • computed() usage: $COMPUTED_COUNT instances"
COMPOSABLES_USED+=("computed")
fi
if grep -q 'watch(' "$FILE_PATH" 2>/dev/null; then
WATCH_COUNT=$(grep -c 'watch(' "$FILE_PATH" 2>/dev/null || echo 0)
echo " • watch() usage: $WATCH_COUNT instances"
COMPOSABLES_USED+=("watch")
fi
if grep -q 'watchEffect(' "$FILE_PATH" 2>/dev/null; then
WATCH_EFFECT_COUNT=$(grep -c 'watchEffect(' "$FILE_PATH" 2>/dev/null || echo 0)
echo " • watchEffect() usage: $WATCH_EFFECT_COUNT instances"
COMPOSABLES_USED+=("watchEffect")
fi
# Lifecycle hooks
LIFECYCLE_HOOKS=("onMounted" "onUpdated" "onUnmounted" "onBeforeMount" "onBeforeUpdate" "onBeforeUnmount")
for hook in "${LIFECYCLE_HOOKS[@]}"; do
if grep -q "$hook(" "$FILE_PATH" 2>/dev/null; then
echo " • 🔄 $hook lifecycle hook detected"
fi
done
# Props and emits analysis
if grep -q 'defineProps' "$FILE_PATH" 2>/dev/null; then
echo " • 📥 defineProps() detected"
fi
if grep -q 'defineEmits' "$FILE_PATH" 2>/dev/null; then
echo " • 📤 defineEmits() detected"
fi
if grep -q 'defineExpose' "$FILE_PATH" 2>/dev/null; then
echo " • 🔗 defineExpose() detected"
fi
# ESLint analysis
echo ""
echo "🔍 Running ESLint analysis..."
ESLINT_AVAILABLE=false
if command -v npx >/dev/null 2>&1 && npx eslint --version >/dev/null 2>&1; then
ESLINT_AVAILABLE=true
# Try Vue-specific ESLint config first
if [ -f ".eslintrc.vue.js" ] || [ -f ".eslintrc.js" ] && grep -q 'vue' .eslintrc.js 2>/dev/null; then
echo "📋 Running ESLint with Vue configuration..."
if npx eslint "$FILE_PATH" --ext .vue 2>/dev/null; then
echo "✅ ESLint analysis passed"
else
echo "⚠️ ESLint found issues - review output above"
fi
else
echo "⚠️ No Vue-specific ESLint configuration found"
echo "💡 Install: npm install --save-dev eslint @vue/eslint-config-typescript"
fi
else
echo "⚠️ ESLint not available - install with: npm install --save-dev eslint"
fi
# Type checking with vue-tsc
echo ""
echo "📘 TypeScript Analysis:"
if grep -q 'lang="ts"' "$FILE_PATH" 2>/dev/null; then
echo "🔍 TypeScript component detected"
if command -v npx >/dev/null 2>&1 && npx vue-tsc --version >/dev/null 2>&1; then
echo "🔍 Running vue-tsc type checking..."
if npx vue-tsc --noEmit 2>/dev/null; then
echo "✅ TypeScript type checking passed"
else
echo "⚠️ TypeScript type errors detected"
fi
else
echo "⚠️ vue-tsc not available - install with: npm install --save-dev vue-tsc"
fi
else
echo "ℹ️ JavaScript component - consider TypeScript for better type safety"
fi
# Best practices analysis
echo ""
echo "💡 Best Practices Analysis:"
# Check for common issues
ISSUES_FOUND=0
if grep -q 'this\.' "$FILE_PATH" 2>/dev/null && [ "$SCRIPT_SETUP" = true ]; then
echo " • ⚠️ 'this' usage detected in script setup - use direct variable access"
ISSUES_FOUND=$((ISSUES_FOUND + 1))
fi
if grep -q 'reactive(' "$FILE_PATH" 2>/dev/null && grep -q 'ref(' "$FILE_PATH" 2>/dev/null; then
echo " • 💡 Both ref() and reactive() used - ensure consistent patterns"
fi
if ! grep -q 'const.*=' "$FILE_PATH" 2>/dev/null && [ "${#COMPOSABLES_USED[@]}" -gt 0 ]; then
echo " • 💡 Consider using const for reactive declarations"
fi
if grep -q 'v-for.*:key' "$FILE_PATH" 2>/dev/null; then
echo " • ✅ v-for with :key detected - good practice"
elif grep -q 'v-for' "$FILE_PATH" 2>/dev/null; then
echo " • ⚠️ v-for without :key detected - add unique keys"
ISSUES_FOUND=$((ISSUES_FOUND + 1))
fi
if [ "$ISSUES_FOUND" -eq 0 ]; then
echo " • ✅ No common issues detected"
fi
echo ""
echo "💡 Vue 3 Composition API Best Practices:"
echo " • Use <script setup> for better performance and DX"
echo " • Prefer ref() for primitive values, reactive() for objects"
echo " • Use computed() for derived state"
echo " • Implement proper TypeScript typing for better IntelliSense"
echo " • Use defineProps/defineEmits for component interface"
echo " • Organize composables into separate files for reusability"
echo " • Use shallowRef/shallowReactive for performance optimization"
echo ""
echo "🎯 Vue component analysis complete!"
else
echo "ℹ️ File is not a Vue component: $FILE_PATH"
fi
exit 0{
"hooks": {
"postToolUse": {
"script": "./.claude/hooks/vue-composition-api-linter.sh",
"matchers": [
"write",
"edit"
]
}
}
}.claude/settings.local.json~/.claude/settings.json.claude/settings.json{
"hooks": {
"postToolUse": {
"script": "./.claude/hooks/vue-composition-api-linter.sh",
"matchers": ["write", "edit"]
}
}
}
#!/bin/bash
# Read the tool input from stdin
INPUT=$(cat)
TOOL_NAME=$(echo "$INPUT" | jq -r '.tool_name')
FILE_PATH=$(echo "$INPUT" | jq -r '.tool_input.file_path // .tool_input.path // ""')
if [ -z "$FILE_PATH" ]; then
exit 0
fi
# Check if this is a Vue component file
if [[ "$FILE_PATH" == *.vue ]]; then
echo "✨ Vue Composition API Linter - Analyzing Vue component..."
echo "📄 Component: $FILE_PATH"
# Check if file exists
if [ ! -f "$FILE_PATH" ]; then
echo "⚠️ Vue component file not found: $FILE_PATH"
exit 1
fi
# Detect Vue version and project setup
VUE_VERSION="unknown"
PROJECT_TYPE="vue"
if [ -f "package.json" ]; then
if grep -q '"vue".*"^3\.' package.json 2>/dev/null; then
VUE_VERSION="3"
echo "🎯 Vue 3 project detected"
elif grep -q '"vue".*"^2\.' package.json 2>/dev/null; then
VUE_VERSION="2"
echo "⚠️ Vue 2 project detected - Composition API available with @vue/composition-api"
fi
# Check for Nuxt
if grep -q '"nuxt"' package.json 2>/dev/null; then
PROJECT_TYPE="nuxt"
echo "🚀 Nuxt project detected"
fi
# Check for Vite
if grep -q '"vite"' package.json 2>/dev/null; then
echo "⚡ Vite build system detected"
fi
fi
# Component structure analysis
echo ""
echo "🔍 Analyzing component structure..."
# Check for script setup
SCRIPT_SETUP=false
if grep -q '<script setup' "$FILE_PATH" 2>/dev/null; then
SCRIPT_SETUP=true
echo "✅ Script setup syntax detected"
# Check for TypeScript
if grep -q '<script setup lang="ts">' "$FILE_PATH" 2>/dev/null; then
echo "📘 TypeScript script setup detected"
fi
elif grep -q '<script>' "$FILE_PATH" 2>/dev/null; then
echo "ℹ️ Traditional script syntax detected"
echo "💡 Consider migrating to <script setup> for better performance"
fi
# Check for template
if grep -q '<template>' "$FILE_PATH" 2>/dev/null; then
echo "✅ Template block found"
fi
# Check for styles
if grep -q '<style' "$FILE_PATH" 2>/dev/null; then
echo "✅ Style block found"
if grep -q '<style scoped' "$FILE_PATH" 2>/dev/null; then
echo "🎯 Scoped styles detected"
fi
if grep -q 'lang="scss"\|lang="sass"\|lang="less"' "$FILE_PATH" 2>/dev/null; then
echo "🎨 CSS preprocessor detected"
fi
fi
# Composition API analysis
echo ""
echo "🔍 Composition API Analysis:"
# Check for Composition API imports and usage
COMPOSABLES_USED=()
if grep -q 'ref(' "$FILE_PATH" 2>/dev/null; then
REF_COUNT=$(grep -c 'ref(' "$FILE_PATH" 2>/dev/null || echo 0)
echo " • ref() usage: $REF_COUNT instances"
COMPOSABLES_USED+=("ref")
fi
if grep -q 'reactive(' "$FILE_PATH" 2>/dev/null; then
REACTIVE_COUNT=$(grep -c 'reactive(' "$FILE_PATH" 2>/dev/null || echo 0)
echo " • reactive() usage: $REACTIVE_COUNT instances"
COMPOSABLES_USED+=("reactive")
fi
if grep -q 'computed(' "$FILE_PATH" 2>/dev/null; then
COMPUTED_COUNT=$(grep -c 'computed(' "$FILE_PATH" 2>/dev/null || echo 0)
echo " • computed() usage: $COMPUTED_COUNT instances"
COMPOSABLES_USED+=("computed")
fi
if grep -q 'watch(' "$FILE_PATH" 2>/dev/null; then
WATCH_COUNT=$(grep -c 'watch(' "$FILE_PATH" 2>/dev/null || echo 0)
echo " • watch() usage: $WATCH_COUNT instances"
COMPOSABLES_USED+=("watch")
fi
if grep -q 'watchEffect(' "$FILE_PATH" 2>/dev/null; then
WATCH_EFFECT_COUNT=$(grep -c 'watchEffect(' "$FILE_PATH" 2>/dev/null || echo 0)
echo " • watchEffect() usage: $WATCH_EFFECT_COUNT instances"
COMPOSABLES_USED+=("watchEffect")
fi
# Lifecycle hooks
LIFECYCLE_HOOKS=("onMounted" "onUpdated" "onUnmounted" "onBeforeMount" "onBeforeUpdate" "onBeforeUnmount")
for hook in "${LIFECYCLE_HOOKS[@]}"; do
if grep -q "$hook(" "$FILE_PATH" 2>/dev/null; then
echo " • 🔄 $hook lifecycle hook detected"
fi
done
# Props and emits analysis
if grep -q 'defineProps' "$FILE_PATH" 2>/dev/null; then
echo " • 📥 defineProps() detected"
fi
if grep -q 'defineEmits' "$FILE_PATH" 2>/dev/null; then
echo " • 📤 defineEmits() detected"
fi
if grep -q 'defineExpose' "$FILE_PATH" 2>/dev/null; then
echo " • 🔗 defineExpose() detected"
fi
# ESLint analysis
echo ""
echo "🔍 Running ESLint analysis..."
ESLINT_AVAILABLE=false
if command -v npx >/dev/null 2>&1 && npx eslint --version >/dev/null 2>&1; then
ESLINT_AVAILABLE=true
# Try Vue-specific ESLint config first
if [ -f ".eslintrc.vue.js" ] || [ -f ".eslintrc.js" ] && grep -q 'vue' .eslintrc.js 2>/dev/null; then
echo "📋 Running ESLint with Vue configuration..."
if npx eslint "$FILE_PATH" --ext .vue 2>/dev/null; then
echo "✅ ESLint analysis passed"
else
echo "⚠️ ESLint found issues - review output above"
fi
else
echo "⚠️ No Vue-specific ESLint configuration found"
echo "💡 Install: npm install --save-dev eslint @vue/eslint-config-typescript"
fi
else
echo "⚠️ ESLint not available - install with: npm install --save-dev eslint"
fi
# Type checking with vue-tsc
echo ""
echo "📘 TypeScript Analysis:"
if grep -q 'lang="ts"' "$FILE_PATH" 2>/dev/null; then
echo "🔍 TypeScript component detected"
if command -v npx >/dev/null 2>&1 && npx vue-tsc --version >/dev/null 2>&1; then
echo "🔍 Running vue-tsc type checking..."
if npx vue-tsc --noEmit 2>/dev/null; then
echo "✅ TypeScript type checking passed"
else
echo "⚠️ TypeScript type errors detected"
fi
else
echo "⚠️ vue-tsc not available - install with: npm install --save-dev vue-tsc"
fi
else
echo "ℹ️ JavaScript component - consider TypeScript for better type safety"
fi
# Best practices analysis
echo ""
echo "💡 Best Practices Analysis:"
# Check for common issues
ISSUES_FOUND=0
if grep -q 'this\.' "$FILE_PATH" 2>/dev/null && [ "$SCRIPT_SETUP" = true ]; then
echo " • ⚠️ 'this' usage detected in script setup - use direct variable access"
ISSUES_FOUND=$((ISSUES_FOUND + 1))
fi
if grep -q 'reactive(' "$FILE_PATH" 2>/dev/null && grep -q 'ref(' "$FILE_PATH" 2>/dev/null; then
echo " • 💡 Both ref() and reactive() used - ensure consistent patterns"
fi
if ! grep -q 'const.*=' "$FILE_PATH" 2>/dev/null && [ "${#COMPOSABLES_USED[@]}" -gt 0 ]; then
echo " • 💡 Consider using const for reactive declarations"
fi
if grep -q 'v-for.*:key' "$FILE_PATH" 2>/dev/null; then
echo " • ✅ v-for with :key detected - good practice"
elif grep -q 'v-for' "$FILE_PATH" 2>/dev/null; then
echo " • ⚠️ v-for without :key detected - add unique keys"
ISSUES_FOUND=$((ISSUES_FOUND + 1))
fi
if [ "$ISSUES_FOUND" -eq 0 ]; then
echo " • ✅ No common issues detected"
fi
echo ""
echo "💡 Vue 3 Composition API Best Practices:"
echo " • Use <script setup> for better performance and DX"
echo " • Prefer ref() for primitive values, reactive() for objects"
echo " • Use computed() for derived state"
echo " • Implement proper TypeScript typing for better IntelliSense"
echo " • Use defineProps/defineEmits for component interface"
echo " • Organize composables into separate files for reusability"
echo " • Use shallowRef/shallowReactive for performance optimization"
echo ""
echo "🎯 Vue component analysis complete!"
else
echo "ℹ️ File is not a Vue component: $FILE_PATH"
fi
exit 0
Complete hook script that automatically lints Vue 3 components for Composition API best practices
#!/bin/bash
INPUT=$(cat)
FILE_PATH=$(echo "$INPUT" | jq -r '.tool_input.file_path // .tool_input.path // ""')
if [ -z "$FILE_PATH" ]; then
exit 0
fi
if [[ "$FILE_PATH" == *.vue ]]; then
echo "✨ Vue Composition API Linter - Analyzing Vue component..."
echo "📄 Component: $FILE_PATH"
if [ ! -f "$FILE_PATH" ]; then
echo "⚠️ Vue component file not found: $FILE_PATH"
exit 1
fi
if [ -f "package.json" ]; then
if grep -q '"vue".*"^3\.' package.json 2>/dev/null; then
echo "🎯 Vue 3 project detected"
fi
fi
SCRIPT_SETUP=false
if grep -q '<script setup' "$FILE_PATH" 2>/dev/null; then
SCRIPT_SETUP=true
echo "✅ Script setup syntax detected"
fi
if grep -q 'ref(' "$FILE_PATH" 2>/dev/null; then
REF_COUNT=$(grep -c 'ref(' "$FILE_PATH" 2>/dev/null || echo 0)
echo " • ref() usage: $REF_COUNT instances"
fi
if grep -q 'computed(' "$FILE_PATH" 2>/dev/null; then
COMPUTED_COUNT=$(grep -c 'computed(' "$FILE_PATH" 2>/dev/null || echo 0)
echo " • computed() usage: $COMPUTED_COUNT instances"
fi
if command -v npx >/dev/null 2>&1 && npx eslint --version >/dev/null 2>&1; then
if [ -f ".eslintrc.js" ] && grep -q 'vue' .eslintrc.js 2>/dev/null; then
if npx eslint "$FILE_PATH" 2>/dev/null; then
echo "✅ ESLint analysis passed"
else
echo "⚠️ ESLint found issues"
fi
fi
fi
if grep -q 'lang="ts"' "$FILE_PATH" 2>/dev/null; then
if command -v npx >/dev/null 2>&1 && npx vue-tsc --version >/dev/null 2>&1; then
if npx vue-tsc --noEmit 2>/dev/null; then
echo "✅ TypeScript type checking passed"
else
echo "⚠️ TypeScript type errors detected"
fi
fi
fi
echo "🎯 Vue component analysis complete!"
else
echo "ℹ️ File is not a Vue component: $FILE_PATH"
fi
exit 0
Complete hook configuration for .claude/settings.json to enable automatic Vue Composition API linting
{
"hooks": {
"postToolUse": {
"script": "./.claude/hooks/vue-composition-api-linter.sh",
"matchers": ["write", "edit"]
}
}
}
Enhanced hook script with comprehensive Composition API analysis, lifecycle hooks, and best practices validation
#!/bin/bash
INPUT=$(cat)
FILE_PATH=$(echo "$INPUT" | jq -r '.tool_input.file_path // .tool_input.path // ""')
if [ -z "$FILE_PATH" ]; then
exit 0
fi
if [[ "$FILE_PATH" == *.vue ]]; then
echo "✨ Vue Composition API Linter - Analyzing Vue component..."
SCRIPT_SETUP=false
if grep -q '<script setup' "$FILE_PATH" 2>/dev/null; then
SCRIPT_SETUP=true
echo "✅ Script setup syntax detected"
if grep -q '<script setup lang="ts">' "$FILE_PATH" 2>/dev/null; then
echo "📘 TypeScript script setup detected"
fi
else
echo "💡 Consider migrating to <script setup> for better performance"
fi
if grep -q 'ref(' "$FILE_PATH" 2>/dev/null; then
REF_COUNT=$(grep -c 'ref(' "$FILE_PATH" 2>/dev/null || echo 0)
echo " • ref() usage: $REF_COUNT instances"
fi
if grep -q 'reactive(' "$FILE_PATH" 2>/dev/null; then
REACTIVE_COUNT=$(grep -c 'reactive(' "$FILE_PATH" 2>/dev/null || echo 0)
echo " • reactive() usage: $REACTIVE_COUNT instances"
fi
if grep -q 'computed(' "$FILE_PATH" 2>/dev/null; then
COMPUTED_COUNT=$(grep -c 'computed(' "$FILE_PATH" 2>/dev/null || echo 0)
echo " • computed() usage: $COMPUTED_COUNT instances"
fi
LIFECYCLE_HOOKS=("onMounted" "onUpdated" "onUnmounted")
for hook in "${LIFECYCLE_HOOKS[@]}"; do
if grep -q "$hook(" "$FILE_PATH" 2>/dev/null; then
echo " • 🔄 $hook lifecycle hook detected"
fi
done
if grep -q 'defineProps' "$FILE_PATH" 2>/dev/null; then
echo " • 📥 defineProps() detected"
fi
if grep -q 'defineEmits' "$FILE_PATH" 2>/dev/null; then
echo " • 📤 defineEmits() detected"
fi
ISSUES_FOUND=0
if grep -q 'this\.' "$FILE_PATH" 2>/dev/null && [ "$SCRIPT_SETUP" = true ]; then
echo " • ⚠️ 'this' usage detected in script setup - use direct variable access"
ISSUES_FOUND=$((ISSUES_FOUND + 1))
fi
if grep -q 'v-for' "$FILE_PATH" 2>/dev/null && ! grep -q 'v-for.*:key' "$FILE_PATH" 2>/dev/null; then
echo " • ⚠️ v-for without :key detected - add unique keys"
ISSUES_FOUND=$((ISSUES_FOUND + 1))
fi
if [ "$ISSUES_FOUND" -eq 0 ]; then
echo " • ✅ No common issues detected"
fi
echo "🎯 Vue component analysis complete!"
fi
exit 0
Enhanced hook script with ESLint and vue-tsc integration for comprehensive Vue component validation
#!/bin/bash
INPUT=$(cat)
FILE_PATH=$(echo "$INPUT" | jq -r '.tool_input.file_path // .tool_input.path // ""')
if [ -z "$FILE_PATH" ]; then
exit 0
fi
if [[ "$FILE_PATH" == *.vue ]]; then
echo "✨ Vue Composition API Linter - Analyzing Vue component..."
if command -v npx >/dev/null 2>&1 && npx eslint --version >/dev/null 2>&1; then
if [ -f ".eslintrc.js" ] && grep -q 'vue' .eslintrc.js 2>/dev/null; then
echo "🔍 Running ESLint with Vue configuration..."
if npx eslint "$FILE_PATH" --ext .vue 2>/dev/null; then
echo "✅ ESLint analysis passed"
else
echo "⚠️ ESLint found issues - review output above"
fi
else
echo "⚠️ No Vue-specific ESLint configuration found"
echo "💡 Install: npm install --save-dev eslint @vue/eslint-config-typescript"
fi
fi
if grep -q 'lang="ts"' "$FILE_PATH" 2>/dev/null; then
echo "📘 TypeScript component detected"
if command -v npx >/dev/null 2>&1 && npx vue-tsc --version >/dev/null 2>&1; then
echo "🔍 Running vue-tsc type checking..."
if npx vue-tsc --noEmit --skipLibCheck 2>/dev/null; then
echo "✅ TypeScript type checking passed"
else
echo "⚠️ TypeScript type errors detected"
fi
else
echo "⚠️ vue-tsc not available - install with: npm install --save-dev vue-tsc"
fi
fi
echo "🎯 Vue component analysis complete!"
fi
exit 0
Example Vue Composition API linter configuration for customizing linting behavior
{
"vue_composition_api_linter": {
"enabled": true,
"script_setup_analysis": true,
"reactivity_pattern_checking": true,
"lifecycle_hook_validation": true,
"typescript_support": true,
"eslint_integration": true,
"performance_suggestions": true,
"frameworks": {
"vue": {
"version": "3.x",
"composition_api": true,
"script_setup": true
},
"nuxt": {
"detection": true,
"composition_api": true
}
},
"tools": {
"eslint": {
"plugin": "@vue/eslint-config-typescript",
"rules": [
"vue/component-api-style",
"vue/define-macros-order",
"vue/no-ref-as-operand"
]
},
"vue-tsc": {
"command": "vue-tsc --noEmit",
"skip_lib_check": true
}
},
"file_extensions": [".vue"],
"exclude_patterns": ["**/node_modules/**", "**/dist/**", "**/build/**"]
}
}
Remove --ext .vue flag scanning all components. Replace: 'npx eslint "$FILE_PATH"' targeting single file. Or add: '--no-eslintrc --rule "vue/no-unused-vars": error' for quick checks only. Verify ESLint configuration. Check file path.
Missing tsconfig exclude pattern. Add: 'npx vue-tsc --noEmit --skipLibCheck' ignoring external types. Or create: 'tsconfig.vue.json' with '"exclude": ["node_modules"]'. Verify vue-tsc configuration. Check TypeScript version compatibility.
grep matches template expressions not just script. Refine: 'grep "<script" -A 200 "$FILE_PATH" | grep "this."' limiting to script blocks. Or exclude: 'grep -v "" before checking. Verify script block detection. Check Vue component structure.
Pattern 'defineProps(' misses generic form 'defineProps()'. Add: 'grep -E "defineProps(<|\(" matching both. Or use: 'grep "defineProps" ignoring parentheses for broader match. Verify TypeScript syntax. Check Vue 3 Composition API version.
grep matches 'import { ref }' and '// ref()' comments. Filter: 'grep -v "^\s*//" | grep -v "import" | grep -c "ref("' excluding non-usage. Or limit: 'grep "
Show that Vue Composition API Linter - Hooks is listed on HeyClaude. Paste this Markdown into your README — it renders the badge and links back to this page.
[](https://heyclau.de/entry/hooks/vue-composition-api-linter)Vue Composition API Linter - Hooks side by side with 3 alternatives on trust, install, platform support, and disclosed safety notes — all from reviewed registry metadata.
| Field | Lints Vue 3 components for Composition API best practices and common issues. Open dossier | Automated documentation coverage analysis with missing docstring detection, API documentation validation, and completeness scoring. This PostToolUse hook automatically checks documentation coverage when code files are modified, providing real-time documentation quality validation during development. Open dossier | Validates GraphQL schema files and checks for breaking changes when modified. Open dossier | Validates JSON files against their schemas when modified to ensure data integrity. Open dossier |
|---|---|---|---|---|
| Next steps | ||||
| Trust | ||||
| Review status | ReviewedMaintainer reviewed | ReviewedMaintainer reviewed | ReviewedMaintainer reviewed | ReviewedMaintainer reviewed |
| Package trust | Package not verified | Package not verified | Package not verified | Package not verified |
| Source provenance | Source-backed | Source-backed | Source-backed | Source-backed |
| Submitter | — | — | — | — |
| Install risk | Review first | Review first | Review first | Review first |
| Notes | Safety ✓ Privacy ✓ | Safety ✓ Privacy ✓ | Safety ✓ Privacy ✓ | Safety ✓ Privacy ✓ |
| Brand | — | — | — | — |
| Category | hooks | hooks | hooks | hooks |
| Source | source-backed | source-backed | source-backed | source-backed |
| Author | JSONbored | JSONbored | JSONbored | JSONbored |
| Added | 2025-09-19 | 2025-10-19 | 2025-09-19 | 2025-09-19 |
| Platforms | Claude Code | Claude Code | Claude Code | Claude Code |
| Source repo | — | — | — | — |
| Safety notes | ✓Runs automatically on its configured Claude Code hook event and executes shell logic that can read, modify, or delete files in your project (and may run builds, installs, or network calls); review the script and scope it to expected paths before enabling. | ✓Runs automatically on its configured Claude Code hook event and executes shell logic that can read, modify, or delete files in your project (and may run builds, installs, or network calls); review the script and scope it to expected paths before enabling. | ✓Runs automatically on its configured Claude Code hook event and executes shell logic that can read, modify, or delete files in your project (and may run builds, installs, or network calls); review the script and scope it to expected paths before enabling. | ✓Runs automatically on its configured Claude Code hook event and executes shell logic that can read, modify, or delete files in your project (and may run builds, installs, or network calls); review the script and scope it to expected paths before enabling. |
| Privacy notes | ✓Receives Claude Code hook input (session metadata, file paths, and tool output) and reads local project files; review what the script logs or forwards to external services and keep credentials out of its output. | ✓Receives Claude Code hook input (session metadata, file paths, and tool output) and reads local project files; review what the script logs or forwards to external services and keep credentials out of its output. | ✓Receives Claude Code hook input (session metadata, file paths, and tool output) and reads local project files; review what the script logs or forwards to external services and keep credentials out of its output. | ✓Receives Claude Code hook input (session metadata, file paths, and tool output) and reads local project files; review what the script logs or forwards to external services and keep credentials out of its output. |
| Prerequisites | — none listed | — none listed | — none listed | — none listed |
| Install | | | | |
| Config | | | | |
| Citations | ||||
| Claim | Unclaimed | Unclaimed | Unclaimed | Unclaimed |
Loading live community signals…
A short, calm digest of reviewed Claude resources. Unsubscribe any time.