diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 76d08ba..a09f998 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -35,7 +35,10 @@ jobs:
run: |
pip install --upgrade pip
pip install -r requirements.txt
- pip install pytest pytest-asyncio httpx
+ pip install pytest pytest-asyncio httpx ruff
+
+ - name: Lint
+ run: ruff check .
- name: Run tests
run: pytest tests/ -v
@@ -59,6 +62,12 @@ jobs:
- name: Install dependencies
run: npm ci
+ - name: Lint
+ run: npx eslint src/
+
+ - name: Type check
+ run: npm run type-check
+
- name: Run tests
run: npm run test:run
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 26921d3..5010328 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -48,13 +48,14 @@ ruff check . --fix # lint with auto-fix
ruff format . # format
```
-### Frontend — ESLint + Prettier
+### Frontend — TypeScript + ESLint + Prettier
```bash
cd frontend
-npx eslint src/ # lint
-npx prettier --check src/ # check formatting
-npx prettier --write src/ # auto-format
+npm run type-check # type check (vue-tsc)
+npx eslint src/ # lint
+npx prettier --check src/ # check formatting
+npx prettier --write src/ # auto-format
```
## Running Tests
@@ -64,7 +65,7 @@ npx prettier --write src/ # auto-format
cd document-parser
pytest tests/ -v
-# Frontend (87 tests)
+# Frontend (81 tests)
cd frontend
npm run test:run
```
diff --git a/README.md b/README.md
index 4993580..595ea02 100644
--- a/README.md
+++ b/README.md
@@ -38,7 +38,7 @@ Upload a PDF, configure the extraction pipeline, and visualize the results — t
| Service | Stack | Role |
|---------|-------|------|
-| **frontend** | Vue 3, Vite, Pinia | UI, PDF viewer, results display |
+| **frontend** | Vue 3, TypeScript, Vite, Pinia | UI, PDF viewer, results display |
| **document-parser** | FastAPI, Docling, SQLite, pdf2image | REST API, document parsing, storage |
### Backend structure (clean architecture)
@@ -80,7 +80,7 @@ frontend/src/
│ ├── document/ # Document store, API, upload, list
│ ├── history/ # History store, API, navigation
│ └── settings/ # Settings store
-└── shared/ # Shared utilities (i18n, http, format)
+└── shared/ # Shared utilities (types, i18n, http, format)
```
## Quick Start
@@ -128,7 +128,7 @@ cd document-parser
pip install pytest pytest-asyncio httpx
pytest tests/ -v
-# Frontend (87 tests)
+# Frontend (81 tests)
cd frontend
npm run test:run
```
@@ -167,7 +167,7 @@ GitHub Actions pipelines (see [`.github/workflows/`](.github/workflows/)):
| Workflow | Trigger | What it does |
|----------|---------|--------------|
-| **CI** | push to `main`, pull requests | Backend tests (99) + Frontend tests (87) + build |
+| **CI** | push to `main`, pull requests | Lint + type check + Backend tests (99) + Frontend tests (81) + build |
| **Release** | push tag `v*` | Build & push multi-arch Docker image to `ghcr.io` |
To publish a new version:
@@ -199,7 +199,7 @@ All Docker images are multi-arch (linux/amd64 + linux/arm64). No GPU required.
## Tech Stack
-- **Frontend**: Vue 3, Vite, Pinia, DOMPurify
+- **Frontend**: Vue 3, TypeScript, Vite, Pinia, DOMPurify
- **Backend**: FastAPI, Docling 2.x, SQLite (aiosqlite), pdf2image
- **CI**: GitHub Actions
- **Infra**: Docker Compose + Nginx
diff --git a/frontend/env.d.ts b/frontend/env.d.ts
new file mode 100644
index 0000000..8b53f84
--- /dev/null
+++ b/frontend/env.d.ts
@@ -0,0 +1,7 @@
+///
+
+declare module '*.vue' {
+ import type { DefineComponent } from 'vue'
+ const component: DefineComponent, Record, unknown>
+ export default component
+}
diff --git a/frontend/eslint.config.js b/frontend/eslint.config.js
index 51ba3b2..8ae252b 100644
--- a/frontend/eslint.config.js
+++ b/frontend/eslint.config.js
@@ -1,15 +1,24 @@
import js from '@eslint/js'
+import tseslint from 'typescript-eslint'
import pluginVue from 'eslint-plugin-vue'
export default [
js.configs.recommended,
+ ...tseslint.configs.recommended,
...pluginVue.configs['flat/recommended'],
{
- files: ['src/**/*.{js,vue}'],
+ files: ['src/**/*.{ts,js,vue}'],
+ languageOptions: {
+ parserOptions: {
+ parser: tseslint.parser,
+ },
+ },
rules: {
'no-console': ['warn', { allow: ['warn', 'error'] }],
'no-debugger': 'error',
- 'no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
+ 'no-unused-vars': 'off',
+ '@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
+ '@typescript-eslint/no-explicit-any': 'off',
'vue/multi-word-component-names': 'off',
'vue/require-default-prop': 'off',
// Formatting handled by Prettier
diff --git a/frontend/index.html b/frontend/index.html
index b5dfc1a..7e54f95 100644
--- a/frontend/index.html
+++ b/frontend/index.html
@@ -8,6 +8,6 @@
-
+