Skip to content

πŸ’  Linting, formatting, and type-safety presets for modern TypeScript applications.

License

Notifications You must be signed in to change notification settings

adelrodriguez/adamantite

Repository files navigation

πŸ’  Adamantite

Opinionated linting, formatting, type-safety and code quality presets for modern TypeScript applications.

npm version npm downloads license

Adamantite is a collection of presets for oxlint, oxfmt, tsgo and sherif that are designed to help humans and agents write maintainable and scalable type-safe code, both for individual projects and monorepos.


Quick Start

Run the following command on your project to get started:

npx adamantite init

Adamantite will automatically configure your project with linting, formatting, and type-safety rules.

adamantite check          # Check code for issues without fixing using oxlint
adamantite fix            # Fix code issues using oxlint
adamantite format         # Format code using oxfmt
adamantite typecheck      # Run TypeScript type checking using the strict preset
adamantite monorepo       # Check monorepo for dependency issues using Sherif
adamantite update         # Update Adamantite's dependencies to the latest compatible versions

Features

  • ⚑ Fast performance: Built on oxc's Rust-based architecture for 10-40x faster linting than ESLint
  • πŸ” Extensive linting: 500+ rules covering correctness, performance, security, and accessibility
  • 🎯 Zero configuration: Works out of the box with sensible defaults, no setup required
  • πŸ”§ Single tool solution: Leverages the oxc ecosystem for linting and formatting
  • πŸ›‘οΈ Strict type safety: Comes with a strict TypeScript preset to improve type safety across your codebase
  • πŸ—οΈ Monorepo support: Unified configuration and dependency management across workspace packages
  • βš™οΈ CI-friendly: Automatically configures GitHub Actions workflows to run checks in CI
  • πŸ€– AI-friendly patterns: Consistent code style designed for effective AI collaboration

Installation

Automatic Setup (Recommended)

npx adamantite init

This interactive command will:

  • Install Adamantite, oxlint, and oxfmt as dev dependencies
  • Create .oxlintrc.json with opinionated presets
  • Create .oxfmtrc.json with formatting configuration
  • Set up tsconfig.json with strict TypeScript rules
  • Add lint/format scripts to your package.json
    • Also adds monorepo-specific scripts if running a monorepo
  • Configure editor settings

πŸ“‹ Commands

adamantite check

Check your code for issues without automatically fixing them using oxlint:

# Check all files
adamantite check

# Check specific files
adamantite check src/components/**/*.ts

adamantite fix

Fix issues in your code with automatic formatting and safe fixes:

# Fix all files
adamantite fix

# Fix specific files
adamantite fix src/utils.ts

# Apply suggested fixes
adamantite fix --suggested

# Apply dangerous fixes
adamantite fix --dangerous

# Apply all fixes
adamantite fix --all

adamantite format

Format your code using oxfmt:

# Format all files
adamantite format

# Format specific files
adamantite format src/utils.ts

# Check if files are formatted without writing
adamantite format --check

adamantite monorepo

Special tooling for monorepo projects using Sherif:

# Check for monorepo-specific issues
adamantite monorepo

# Fix monorepo-specific issues
adamantite monorepo --fix

Automatically detects and fixes:

  • Inconsistent dependency versions across packages
  • Missing dependencies in package.json
  • Unused dependencies
  • Package.json formatting issues

adamantite typecheck

Run TypeScript type checking using tsgo (TypeScript Go) and the strict preset:

# Type check all files
adamantite typecheck

# Type check specific files
adamantite typecheck src/utils.ts

adamantite update

Keep your dependencies current:

# Update to latest compatible versions
adamantite update

Presets

Linting (presets/oxlint/)

Adamantite provides comprehensive linting rules for TypeScript and JavaScript:

Core (core.json)

Extensive ruleset covering:

  • Correctness: Bug prevention and code correctness enforcement
  • Performance: Optimization patterns and performance best practices
  • Restriction: Enforcing coding standards and preventing problematic patterns
  • Suspicious: Detecting code smells and potential bugs
  • Pedantic: Strict code quality and consistency enforcement
  • Style: Consistent code formatting and naming conventions
  • Nursery: Experimental rules under active development

Framework Presets

Framework-specific presets are available for:

Formatting (presets/oxfmt.json)

Opinionated code formatting with oxfmt, configured for consistency and readability. Includes automatic import sorting and organization.

Strict TypeScript configuration for maximum type safety. Catches errors at compile-time that would otherwise cause runtime failures.

πŸ› οΈ Development

This project uses Bun for all development tasks:

# Install dependencies
bun install

# Run tests
bun test

# Build CLI
bun run build

# Type checking
bun run typecheck

🀝 Contributing

Contributions are welcome! Please read our contributing guidelines first.

πŸ“„ License

MIT Β© Adel Rodriguez

About

πŸ’  Linting, formatting, and type-safety presets for modern TypeScript applications.

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published

Contributors 6