A comprehensive ESLint and Prettier configuration for TypeScript projects, with support for monorepos and ESM. Optimized for Next.js and React applications.
🛠 A comprehensive ESLint and Prettier configuration for TypeScript projects, with support for monorepos and ESM. Optimized for Next.js and React applications. ⚡️
Features
🎯 TypeScript & JavaScript Linting: Latest standards-based linting for both TypeScript and JavaScript
🔧 Multiple Config Presets: Ready-to-use configurations for react, hooks, next, and more
📝 Shared TypeScript Config: Pre-configured tsconfig.json for consistent TypeScript settings
💅 Prettier Integration: Automatic code formatting with sensible defaults
♿️ Accessibility: Built-in rules for JSX accessibility
📦 Monorepo Support: Optimized for monorepo setups
🔄 Module Support: Full compatibility with both ESM and CommonJS
🎨 Tailwind CSS: Built-in support for Tailwind CSS class sorting
🔍 SonarJS: Optional integration for code quality rules
Installation & Configuration
Basic Setup
Initialize your project (if needed):
npm init
Install the ESLint config:
npm i -D @hyperse/eslint-config-hyperse
Create ESLint configuration:
Create eslint.config.js (or eslint.config.mjs for CommonJS) in your project root
Configure VS Code settings (.vscode/settings.json):
Additional Configuration
Prettier Configuration
Use definePrettierConfig() so Prettier CLI matches ESLint prettier/prettier (base options and prettier-plugin-tailwindcss, with the plugin always last when you add more plugins). The name mirrors this package’s defineConfig helper for ESLint.
Create prettier.config.mjs:
Optional slim import (no ESLint stack): @hyperse/eslint-config-hyperse/definePrettierConfig (the legacy path @hyperse/eslint-config-hyperse/getPrettierConfig still resolves to the same module).
The previous name getPrettierConfig remains exported but is deprecated; prefer definePrettierConfig.
Tailwind CSS Integration
Configure Tailwind via definePrettierConfig (paths are resolved relative to this config file):
Important Notes
TypeScript settings:
isolatedModules: true (default)
verbatimModuleSyntax: true (default)
JSON/JSONC files: VS Code formatting is disabled by default