ESLint, Prettier, Stylelint, Commitlint, Remarklint, and Semantic Release configs for LobeHub
Table of contents
- ESM-first - Modern ES Modules support
- ESLint 9 Flat Config - Latest ESLint configuration format
- TypeScript - Full TypeScript support with type-aware rules
- React/Next.js/Remix - React ecosystem support
- React Native - Mobile development support
- Monorepo - Modular packages for flexible usage
| Package | Version | Description |
|---|---|---|
| @lobehub/eslint-config | ESLint Flat Config | |
| @lobehub/prettier-config | Prettier config | |
| @lobehub/stylelint-config | Stylelint config | |
| @lobehub/commitlint-config | Commitlint config | |
| @lobehub/remarklint-config | Remarklint config | |
| @lobehub/semantic-release-config | Semantic release config | |
| @lobehub/lint | Meta package (all configs) | |
| create-lobe-lint | CLI setup tool |
Install the meta package for all configs:
bun add -D @lobehub/lintOr install individual packages as needed:
# ESLint only
bun add -D @lobehub/eslint-config eslint typescript
# Prettier only
bun add -D @lobehub/prettier-config prettierThe fastest way to set up LobeHub lint configs in your project is using the CLI tool:
npx create-lobe-lintThis will start an interactive setup that auto-detects your project configuration (package manager, TypeScript, React framework) and generates the appropriate config files.
# Quick setup with preset defaults
npx create-lobe-lint --preset -y
# Select specific tools with framework
npx create-lobe-lint --eslint --prettier --react next
# Manual selection mode
npx create-lobe-lint --manualThe CLI can generate .vscode/settings.json to suppress disruptive ESLint auto-fix rules (import sorting, object key sorting, etc.) that conflict with your editing workflow:
# Include VSCode settings in setup
npx create-lobe-lint --preset --vscode -y
# Skip VSCode settings
npx create-lobe-lint --preset --no-vscode -yGenerated settings disable auto-fix for rules like perfectionist/sort-enums, perfectionist/sort-interfaces, simple-import-sort/imports, react/jsx-sort-props, and optionally unused-imports/no-unused-imports, while keeping them as informational diagnostics.
See create-lobe-lint for full options and documentation.
Create eslint.config.mjs:
import { defineConfig } from '@lobehub/eslint-config';
export default defineConfig({
// Enable React with Next.js support
react: 'next',
// Enable TypeScript strict mode
typescript: 'strict',
});See @lobehub/eslint-config for full options.
Create prettier.config.mjs:
import { prettier } from '@lobehub/lint';
export default prettier;Create stylelint.config.mjs:
import { stylelint } from '@lobehub/lint';
export default stylelint;Create commitlint.config.mjs:
import { commitlint } from '@lobehub/lint';
export default commitlint;Create .remarkrc.mjs:
import { remarklint } from '@lobehub/lint';
export default remarklint;Create .releaserc.mjs:
import { semanticRelease } from '@lobehub/lint';
export default semanticRelease;- ESM only - CommonJS is no longer supported
- ESLint 9 - Requires ESLint 9+ with Flat Config
- Node.js 18 - Requires Node.js 18+
- Update your config files to use ESM syntax (
.mjsextension or"type": "module") - Replace
.eslintrc.jswitheslint.config.mjs - Update imports:
Before (v1):
module.exports = require('@lobehub/lint').eslint;After (v2):
import { defineConfig } from '@lobehub/eslint-config';
export default defineConfig({
react: true,
});You can use Github Codespaces for online development:
Or clone it for local development:
git clone https://github.com/lobehub/lobe-lint.git
cd lobe-lint
pnpm install
pnpm buildContributions of all types are more than welcome, if you are interested in contributing code, feel free to check out our GitHub Issues to get stuck in to show us what you're made of.