chore: add husky pre-commit hook and auto-fix lint warnings

- Install husky for git hooks
- Add pre-commit hook to run 'npm run lint -- --fix' before each commit
- Auto-fix 6 additional warnings (attribute order, escape chars)
- 0 errors, 208 warnings (down from 214)

This ensures code quality checks run automatically before commits.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
sanbuphy
2026-02-20 01:19:00 +08:00
parent 66b2ba6e45
commit 4aca9df44e
6 changed files with 28 additions and 8 deletions
@@ -4,10 +4,10 @@
v-if="showProgress"
class="reading-progress"
:class="{ 'is-dragging': isDragging }"
:title="isDragging ? '拖动调整位置' : '阅读进度 ' + progress + '%'"
@mousedown="startDrag"
@touchstart="startDrag"
@click="handleClick"
:title="isDragging ? '拖动调整位置' : '阅读进度 ' + progress + '%'"
>
<svg class="progress-ring" viewBox="0 0 56 56">
<circle
@@ -24,7 +24,7 @@
</div>
<!-- 当前方法详情 -->
<div class="method-detail" v-if="currentMethod">
<div v-if="currentMethod" class="method-detail">
<div class="detail-header">
<span class="http-badge" :class="currentMethod.name">{{ currentMethod.name }}</span>
<span class="method-desc">{{ currentMethod.description }}</span>
@@ -51,13 +51,13 @@
<div class="example-section">
<div class="example-title">📝 使用示例</div>
<div class="example-content">
<div class="example-item" v-for="(example, idx) in currentMethod.examples" :key="idx">
<div v-for="(example, idx) in currentMethod.examples" :key="idx" class="example-item">
<div class="example-scenario">{{ example.scenario }}</div>
<div class="example-request">
<span class="http-method" :class="currentMethod.name">{{ currentMethod.name }}</span>
<span class="request-url">{{ example.url }}</span>
</div>
<div class="example-body" v-if="example.body">
<div v-if="example.body" class="example-body">
<pre><code>{{ JSON.stringify(example.body, null, 2) }}</code></pre>
</div>
</div>
@@ -214,7 +214,7 @@
</div>
</div>
</div>
</template>
</div></template>
<script setup>
import { ref, computed, watch } from 'vue'