Ultra-strict Biome + TypeScript + Husky + Commitlint configuration for React/Next.js projects
A comprehensive, enterprise-grade configuration package that provides ultra-strict code quality standards for TypeScript/JavaScript projects. Zero-config setup with an interactive CLI.
- Ultra-strict Biome configuration - 100+ linting rules with maximum strictness
- TypeScript strict mode - All strict flags enabled including
noUncheckedIndexedAccess - Conventional Commits - Commitlint integration with automatic validation
- Git hooks - Husky + lint-staged for pre-commit checks
- Dead code detection - Knip integration to find unused exports
- VS Code configuration - Optimized settings and recommended extensions
- AI assistant ready - CLAUDE.md generation for Claude Code integration
- Multi-project support - Next.js, React, and Node.js/TypeScript configurations
- Package manager agnostic - Works with npm, yarn, pnpm, and bun
- Node.js >= 18.0.0
- Git (for Husky hooks)
# Run directly with npx (recommended)
npx @neosianexus/quality
# Or install as a dev dependency
npm install --save-dev @neosianexus/qualityThese are required and will be installed automatically:
npm install --save-dev @biomejs/biome typescriptnpx @neosianexus/qualityThe CLI will guide you through:
- Project type detection - Automatically detects Next.js, React, or Node.js
- Package manager detection - Detects bun, pnpm, yarn, or npm
- Feature selection - Choose which tools to enable:
- Conventional Commits (commitlint)
- Git hooks (Husky + lint-staged)
- VS Code configuration
- Dead code detection (Knip)
- CLAUDE.md for AI assistants
# Use all detected defaults
npx @neosianexus/quality init --yes
# Preview changes without writing
npx @neosianexus/quality init --dry-runThe CLI provides two main commands: init for initial setup and upgrade for updating existing configurations.
# Method 1: Run directly with npx (no installation required)
npx @neosianexus/quality
# Method 2: Run after installing the package
npx quality
# Method 3: If installed globally
qualityNote: Running
qualitywithout any subcommand automatically executes theinitcommand.
Initialize quality configuration in your project. This is the main command for setting up code quality tools.
quality init [options]| Option | Short | Description |
|---|---|---|
--yes |
-y |
Skip all prompts and use detected defaults |
--force |
-f |
Overwrite existing configuration files |
--commitlint |
-c |
Enable Conventional Commits validation |
--skip-husky |
Skip Husky and lint-staged setup | |
--skip-vscode |
Skip VS Code configuration | |
--knip |
-k |
Enable Knip for dead code detection |
--claude-md |
Generate CLAUDE.md for AI assistants | |
--skip-claude-md |
Skip CLAUDE.md generation | |
--dry-run |
-d |
Preview changes without writing files |
When you run quality init without flags, you'll see an interactive wizard:
┌ @neosianexus/quality v1.0.0
│
◇ Project type?
│ ● Next.js (detected)
│ ○ React
│ ○ Node.js / TypeScript
│
◇ Package manager?
│ ● bun (detected)
│ ○ pnpm
│ ○ yarn
│ ○ npm
│
◇ Enable Conventional Commits (commitlint)?
│ Yes / No
│
◇ Set up git hooks (Husky + lint-staged)?
│ Yes / No
│
◇ Add VS Code configuration?
│ Yes / No
│
◇ Add Knip (dead code detection)?
│ Yes / No
│
◇ Create CLAUDE.md (instructions for Claude Code)?
│ Yes / No
│
◆ Configuring...
# Interactive setup (recommended for first-time users)
npx @neosianexus/quality
# Quick setup with all defaults (CI/CD friendly)
npx @neosianexus/quality init --yes
# Setup with specific features
npx @neosianexus/quality init --commitlint --knip --claude-md
# Setup without git hooks (useful for monorepos)
npx @neosianexus/quality init --skip-husky
# Preview what would be created
npx @neosianexus/quality init --dry-run
# Force overwrite existing configs
npx @neosianexus/quality init --force
# Minimal setup: just Biome + TypeScript
npx @neosianexus/quality init --yes --skip-husky --skip-vscode-
Detection Phase
- Reads
package.jsonto detect project type (Next.js, React, or Node.js) - Checks for lock files to detect package manager
- Verifies if Git is initialized
- Reads
-
Configuration Generation
- Creates
biome.jsonextending the strict preset - Creates
tsconfig.jsonwith path aliases (@/*→src/*) - Optionally creates commitlint, Knip, VS Code configs
- Creates
-
Dependency Installation
- Installs required peer dependencies (
@biomejs/biome,typescript) - Installs optional dependencies based on selections (husky, lint-staged, commitlint, knip)
- Installs required peer dependencies (
-
Git Hooks Setup (if not skipped)
- Initializes Husky
- Creates
pre-commithook running lint-staged - Creates
commit-msghook running commitlint (if enabled)
-
Package.json Updates
- Adds quality scripts (
check,lint,format,typecheck) - Adds lint-staged configuration
- Adds
preparescript for Husky
- Adds quality scripts (
Upgrade existing configuration to the latest version with intelligent merging.
quality upgrade [options]| Option | Short | Description |
|---|---|---|
--yes |
-y |
Skip confirmation prompts |
--force |
-f |
Replace configs entirely instead of merging |
--no-backup |
Don't create backup files before modifying | |
--dry-run |
-d |
Preview changes without writing files |
The upgrade command uses intelligent merging to preserve your customizations:
Your Config + New Defaults = Merged Result
─────────────────────────────────────────────────────────────────
{ { {
"rules": { "rules": { "rules": {
"myRule": "off" ←── "newRule": "error" "myRule": "off", ← preserved
} "myRule": "error" "newRule": "error" ← added
} } }
}
- Your custom rules are preserved - If you disabled a rule, it stays disabled
- New rules are added - Latest recommended rules are merged in
- Arrays are replaced, not concatenated - Avoids duplicate entries
# Interactive upgrade with confirmation
npx @neosianexus/quality upgrade
# Automatic upgrade (CI/CD friendly)
npx @neosianexus/quality upgrade --yes
# Preview changes before applying
npx @neosianexus/quality upgrade --dry-run
# Full replacement (discard customizations)
npx @neosianexus/quality upgrade --force
# Upgrade without creating backups
npx @neosianexus/quality upgrade --yes --no-backup┌ @neosianexus/quality upgrade
│
◇ Files to update:
│
│ biome.json
│ + linter.rules.nursery.noSecrets: "error"
│ + linter.rules.nursery.useImportRestrictions: "error"
│ ~ formatter.lineWidth: 80 → 100
│
│ tsconfig.json
│ + compilerOptions.noUncheckedSideEffectImports: true
│
◇ Continue? (files will be backed up)
│ Yes / No
│
◆ Backup created: biome.backup.2026-02-01T14-30-45.json
◆ Configuration updated!
The CLI is built with the citty framework and follows this structure:
quality [command] [options]
│
├── (no command) → runs "init" by default
│
├── init
│ ├── Interactive prompts (via @clack/prompts)
│ ├── Project detection
│ ├── Config generation
│ ├── Dependency installation
│ └── Git hooks setup
│
└── upgrade
├── Config analysis
├── Smart merge (via deepmerge)
├── Backup creation
└── File updates
| File | Description |
|---|---|
biome.json |
Ultra-strict linting and formatting rules |
tsconfig.json |
TypeScript configuration with path aliases |
commitlint.config.js |
Conventional Commits validation (optional) |
.vscode/settings.json |
VS Code editor settings (optional) |
.vscode/extensions.json |
Recommended extensions (optional) |
knip.json |
Dead code detection config (optional) |
.husky/pre-commit |
Git pre-commit hook |
.husky/commit-msg |
Git commit message hook (optional) |
CLAUDE.md |
AI assistant instructions (optional) |
src/types/css.d.ts |
CSS module type declarations (React/Next.js) |
The following scripts are added to your package.json:
{
"scripts": {
"check": "biome check .",
"check:fix": "biome check --write --unsafe .",
"lint": "biome lint .",
"lint:fix": "biome lint --write --unsafe .",
"format": "biome format --write .",
"typecheck": "tsc --noEmit",
"knip": "knip",
"prepare": "husky"
}
}The CLI auto-detects your project type and applies the appropriate configuration:
- TypeScript: Extends
@neosianexus/quality/tsconfig.nextjs - Biome: Allows default exports for pages/routes
- Knip: Configured for App Router entry points
- TypeScript: Extends
@neosianexus/quality/tsconfig.react - Biome: Named exports only (no default exports)
- Knip: Configured for typical React entry points
- TypeScript: Extends
@neosianexus/quality/tsconfig.base - Biome: Full strictness, no default exports
- Knip: Minimal configuration
Auto-detected from lock files in this priority order:
| Package Manager | Lock File |
|---|---|
| bun | bun.lockb or bun.lock |
| pnpm | pnpm-lock.yaml |
| yarn | yarn.lock |
| npm | package-lock.json |
You can import and extend the provided configurations directly:
{
"extends": ["@neosianexus/quality"]
}{
"extends": "@neosianexus/quality/tsconfig.base"
}Available TypeScript configurations:
@neosianexus/quality/tsconfig.base- Base strict configuration@neosianexus/quality/tsconfig.react- React with JSX support@neosianexus/quality/tsconfig.nextjs- Next.js optimized
// commitlint.config.js
import config from "@neosianexus/quality/commitlint";
export default config;{
"extends": ["@neosianexus/quality/knip"]
}The Biome configuration includes 100+ rules with maximum strictness:
- Formatting: Tabs (2-space width), double quotes, semicolons always, 100-char line width
- Accessibility: All a11y rules set to
error - Complexity: Max cognitive complexity of 15
- Security: All security rules enabled
- Import organization: Auto-sorted imports enabled
All strict flags are enabled:
{
"strict": true,
"noImplicitAny": true,
"exactOptionalPropertyTypes": true,
"noUncheckedIndexedAccess": true,
"noImplicitReturns": true,
"verbatimModuleSyntax": true
}When enabled, commit messages must follow this format:
type(scope): description
[optional body]
[optional footer]
Allowed types: feat, fix, docs, style, refactor, perf, test, build, ci, chore, revert
git clone https://github.com/neosianexus/quality.git
cd quality
bun install| Script | Description |
|---|---|
bun run build |
Build the CLI |
bun run validate |
Run lint + typecheck + knip |
bun run check |
Lint and format check |
bun run check:fix |
Auto-fix lint/format issues |
bun run typecheck |
TypeScript type checking |
bun run knip |
Find unused code |
bun run dev |
Run CLI directly from TypeScript |
quality/
├── bin/
│ ├── cli.ts # CLI entry point (citty framework)
│ ├── commands/
│ │ ├── init.ts # Init command implementation
│ │ └── upgrade.ts # Upgrade command implementation
│ └── utils/
│ ├── constants.ts # Package metadata and types
│ ├── detect.ts # Project/PM detection logic
│ ├── exec.ts # Shell command execution
│ ├── fs.ts # File system utilities
│ └── generators.ts # Config file generators
├── vscode/ # VS Code configuration templates
├── biome.json # Exported Biome config
├── tsconfig.*.json # Exported TypeScript configs
├── commitlint.config.js # Exported Commitlint config
└── knip.config.json # Exported Knip config
Biome not found
npm install --save-dev @biomejs/biomeTypeScript not found
npm install --save-dev typescriptHusky hooks not running
npx husky installPermission denied on hooks
chmod +x .husky/pre-commit .husky/commit-msgContributions are welcome! Please read our contributing guidelines and submit pull requests to the main branch.
- Fork the repository
- Create your feature branch (
git checkout -b feat/amazing-feature) - Commit your changes (
git commit -m 'feat: add amazing feature') - Push to the branch (
git push origin feat/amazing-feature) - Open a Pull Request
- GitHub Issues - Bug reports and feature requests
- GitHub Sponsors - Support the project
MIT - Made with care by neosianexus