Skip to content

Commit 7ff5478

Browse files
M00N7682claude
andcommitted
chore: add ESLint + Prettier, GitHub templates, Playwright install docs
- Add ESLint (typescript-eslint + prettier) and Prettier configuration - Fix all 22 lint errors: unused imports, dead code, missing error causes - Add lint/format/format:check scripts to package.json - Add lint step to CI workflow - Add GitHub Issue templates (bug report, feature request) and PR template - Add Playwright install step to README Quick Start and CONTRIBUTING.md - Update CONTRIBUTING.md with lint/format workflow Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 0f3da16 commit 7ff5478

20 files changed

Lines changed: 1251 additions & 48 deletions
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
name: Bug Report
3+
about: Report a bug to help improve imugi
4+
title: ''
5+
labels: bug
6+
assignees: ''
7+
---
8+
9+
## Description
10+
11+
A clear description of the bug.
12+
13+
## Steps to Reproduce
14+
15+
1.
16+
2.
17+
3.
18+
19+
## Expected Behavior
20+
21+
What you expected to happen.
22+
23+
## Actual Behavior
24+
25+
What actually happened.
26+
27+
## Environment
28+
29+
- **OS**: (e.g., macOS 14.2, Ubuntu 22.04)
30+
- **Node.js**: (e.g., 20.11.0)
31+
- **imugi version**: (e.g., 1.0.1)
32+
- **Framework**: (e.g., Next.js 14, Vite + React)
33+
34+
## Logs / Screenshots
35+
36+
```
37+
Paste any relevant error output here
38+
```
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
name: Feature Request
3+
about: Suggest a new feature or improvement
4+
title: ''
5+
labels: enhancement
6+
assignees: ''
7+
---
8+
9+
## Problem
10+
11+
What problem does this feature solve?
12+
13+
## Proposed Solution
14+
15+
Describe the solution you'd like.
16+
17+
## Alternatives Considered
18+
19+
Any alternative approaches you've thought about.
20+
21+
## Additional Context
22+
23+
Any other context, screenshots, or examples.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
## What
2+
3+
Brief description of the change.
4+
5+
## Why
6+
7+
Why is this change needed?
8+
9+
## How
10+
11+
How was this implemented? Any notable design decisions?
12+
13+
## Testing
14+
15+
- [ ] `npm run lint` passes
16+
- [ ] `npm run typecheck` passes
17+
- [ ] `npm test` passes
18+
- [ ] Tested manually (if applicable)
19+
20+
## Screenshots (if UI change)
21+
22+
Before | After
23+
--- | ---

.github/workflows/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ jobs:
2424

2525
- run: npx playwright install chromium --with-deps
2626

27+
- run: npm run lint
28+
2729
- run: npm run typecheck
2830

2931
- run: npm run build

.prettierignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
dist/
2+
node_modules/
3+
*.tgz

.prettierrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"singleQuote": true,
3+
"trailingComma": "all",
4+
"printWidth": 120,
5+
"tabWidth": 2,
6+
"semi": true
7+
}

CONTRIBUTING.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ Thanks for your interest in contributing!
88
git clone https://github.com/M00N7682/imugi.git
99
cd imugi
1010
npm install
11+
12+
# Playwright requires a browser binary for screenshot capture:
13+
npx playwright install chromium
14+
1115
npm run build
1216
npm test
1317
```
@@ -16,14 +20,16 @@ npm test
1620

1721
1. Fork the repo and create a feature branch
1822
2. Make your changes
19-
3. Run `npm run typecheck` and `npm test` to verify
23+
3. Run the checks: `npm run lint && npm run typecheck && npm test`
2024
4. Submit a pull request
2125

2226
## Code style
2327

2428
- TypeScript strict mode
2529
- ESM modules
2630
- No default exports (except CLI entry)
31+
- Formatting enforced by Prettier (`npm run format`)
32+
- Linting enforced by ESLint (`npm run lint`)
2733

2834
## Running tests
2935

@@ -34,6 +40,12 @@ npm test
3440
# Watch mode
3541
npm run test:watch
3642

43+
# Lint
44+
npm run lint
45+
46+
# Format
47+
npm run format
48+
3749
# Type check
3850
npm run typecheck
3951
```

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ imugi uses **SSIM** (Structural Similarity) + **pixelmatch** + **Claude Vision**
5555

5656
```bash
5757
npm install -g imugi-ai
58+
59+
# Playwright requires a browser binary — install Chromium:
60+
npx playwright install chromium
5861
```
5962

6063
### Step 2: Add to your AI tool

eslint.config.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import eslint from '@eslint/js';
2+
import tseslint from 'typescript-eslint';
3+
import prettierConfig from 'eslint-config-prettier';
4+
5+
export default tseslint.config(
6+
eslint.configs.recommended,
7+
...tseslint.configs.recommended,
8+
prettierConfig,
9+
{
10+
languageOptions: {
11+
parserOptions: {
12+
projectService: true,
13+
tsconfigRootDir: import.meta.dirname,
14+
},
15+
},
16+
rules: {
17+
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
18+
'@typescript-eslint/no-explicit-any': 'warn',
19+
},
20+
},
21+
{
22+
ignores: ['dist/', 'node_modules/', '*.config.*'],
23+
},
24+
);

0 commit comments

Comments
 (0)