- HTMLHint - Fast HTML linter
- html-validate - Comprehensive HTML validator
- ESLint - JavaScript/HTML linting with Alpine.js support
- Prettier - Code formatter
- validate.js - Custom SnapCode-specific checks
pnpm run check:mainRuns custom validation + HTML linting + main JS linting
# Custom validation (SnapCode-specific checks)
pnpm run validate:custom
# HTML validation
pnpm run lint:html # HTMLHint (fast)
pnpm run validate # html-validate (comprehensive)
# JavaScript linting
pnpm run lint:js:main # Main files only
pnpm run lint:js # All files (includes celebration/)
# Code formatting
pnpm run format:main # Format main files
pnpm run format # Format all files🔍 SnapCode Validation Report
✅ DOCTYPE declaration
✅ HTML lang attribute
✅ Meta charset
✅ Meta viewport
✅ Title tag
✅ Alpine.js x-data
✅ No x-if templates (should use x-show)
✅ Service Worker registration
📊 File size: 80KB
✅ File size is optimal
📋 Summary: 8 passed, 0 failed
🎉 All checks passed!
✅ No HTML structure errors found
✅ Tailwind CSS classes allowed (id-class-value: false)
Main Issues to Fix:
- Missing browser globals (btoa, atob, location, alert, etc.)
- Unused variables and empty catch blocks
- Missing function definitions (loadKatex)
- Tailwind CSS friendly (allows utility classes)
- Standard HTML validation rules
- ES modules support
- Alpine.js globals defined
- Browser environment configured
- External library globals (marked, DOMPurify, etc.)
- 2-space indentation
- Single quotes
- 100 character line width
- Custom SnapCode-specific checks
- File size monitoring
- Alpine.js template validation
- Fix ESLint Issues - Add missing browser globals
- Setup Pre-commit Hooks - Auto-run linting before commits
- CI/CD Integration - Add linting to GitHub Actions
- Code Coverage - Add testing and coverage reports
- Main file:
index.html(80KB) ✅ Optimal size - Architecture: Single-file buildless app
- Dependencies: All from CDN (no node_modules)
- Framework: Alpine.js + Tailwind CSS
- Code Quality - Consistent formatting and error detection
- Bug Prevention - Catch issues before deployment
- Maintainability - Easier to read and modify code
- Team Collaboration - Consistent code style
- Performance - Detect potential performance issues