A modern, interactive playground for testing HTMLHint rules and configurations. Built with Astro and the latest HTMLHint library.
- Real-time HTML validation using the latest HTMLHint library
- Interactive code editor powered by Ace Editor
- Comprehensive rule configuration with all HTMLHint rules
- Theme customization with multiple editor themes
- Configuration export - download your rule settings as
.htmlhintrc
- Keyboard shortcuts for navigating between hints
- Responsive design that works on desktop and mobile
- Modern tech stack built with Astro, TypeScript, and ES modules
- Rebuilt with Astro for better performance and developer experience
- Latest HTMLHint library (v1.1.4) with all current rules
- Removed CSSLint and JSHint dependencies for cleaner, focused HTML validation
- Modern JavaScript using ES modules and modern browser APIs
- TypeScript support for better development experience
- Improved responsive design with Bootstrap 5
- Better accessibility and modern web standards
- Node.js 18.0.0 or higher
- npm or yarn
-
Clone the repository:
git clone https://github.com/htmlhint/htmlhint-playground.git cd htmlhint-playground
-
Install dependencies:
npm install
-
Start the development server:
npm run dev
-
Open your browser and navigate to
http://localhost:4321
npm run build
The built files will be in the dist/
directory.
npm run preview
npm run dev
- Start development servernpm run build
- Build for productionnpm run preview
- Preview production buildnpm run lint
- Run ESLintnpm run lint:fix
- Fix ESLint issuesnpm run format
- Format code with Prettiernpm run htmlhint
- Run HTMLHint on the project
src/
├── components/ # Astro components
│ ├── Editor.astro # Code editor component
│ └── RulePanel.astro # Rules configuration panel
├── layouts/ # Layout components
│ └── Layout.astro # Main layout
├── pages/ # Astro pages
│ └── index.astro # Main page
└── scripts/ # JavaScript modules
└── app.js # Main application logic
public/ # Static assets
├── css/
│ └── index.css # Styles
└── img/ # Images
The playground supports all HTMLHint rules organized into categories:
- Standard: Basic HTML validation rules
- Performance: Rules for optimizing performance
- Accessibility: Rules for better accessibility
- Specification: Rules for HTML5 compliance
- Syntax highlighting for HTML
- Multiple themes (light and dark)
- Real-time validation with 500ms debounce
- Error annotations in the editor
- Keyboard navigation between hints (Ctrl+Left/Right)
- Persistent settings saved in localStorage
- Rule customization with checkboxes and dropdowns
- Configuration export as
.htmlhintrc
file - Theme persistence across sessions
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- HTMLHint - The static code analysis tool
- Astro - The web framework for content-driven websites
- Ace Editor - The code editor component
- Bootstrap - The CSS framework