Documentation Index
Fetch the complete documentation index at: https://mintlify.com/eslint/eslint/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Theeslint/universal export provides a browser-compatible version of the ESLint Linter. This build is designed for client-side JavaScript environments where Node.js-specific features are not available.
Import Path
What’s Included
The universal build exports only the Linter class, which is the core linting engine without file system or configuration file dependencies.Core linting engine that works in browser environments
Differences from Node.js Build
The universal build differs from the main ESLint package:| Feature | Main Package | Universal Build |
|---|---|---|
| ESLint class | ✅ Yes | ❌ No |
| Linter class | ✅ Yes | ✅ Yes |
| File system access | ✅ Yes | ❌ No |
| Config file loading | ✅ Yes | ❌ No |
| RuleTester | ✅ Yes | ❌ No |
| SourceCode | ✅ Yes | ❌ No |
| Browser compatible | ❌ No | ✅ Yes |
Usage Example
Browser Integration
Include the bundle
Use a bundler (webpack, rollup, esbuild) to include
eslint/universal in your browser bundle:Online Code Editor Example
Use Cases
The universal build is ideal for:- Online code editors (like CodeSandbox, StackBlitz)
- Browser-based IDEs
- Educational platforms teaching JavaScript
- Static site generators with client-side linting
- Progressive web apps with code editing features
Limitations
API Documentation
For detailed Linter API documentation, see:Linter Class API
Complete Linter class reference with all methods and options
Bundle Size Considerations
The universal build is optimized for browser use but still includes all core ESLint functionality:- Core linting engine: AST parsing, rule execution, message generation
- Built-in rules: All 294+ ESLint rules are included
- Traversal and scope analysis: Full AST traversal and scope management
Related
Linter Class
Full Linter API reference
Core Concepts
Understand how ESLint works
Rule Configuration
Configure linting rules
Custom Rules
Create custom rules