Skip to content

adelrodriguez/adamantite

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

244 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

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, TypeScript 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 and type errors using oxlint
adamantite fix            # Fix code issues using oxlint
adamantite format         # Format code using oxfmt
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 oxlint.config.ts with opinionated presets
  • Create oxfmt.config.ts 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 and type errors 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/index.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/index.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 update

Run applicable migrations and update Adamantite-managed dependencies:

# Run migrations and update managed dependencies
adamantite update

This also migrates legacy .oxfmtrc.json(c) configs to oxfmt.config.ts and knip.json(c) configs to knip.config.ts.

Presets

Linting (presets/lint/)

Adamantite provides comprehensive linting rules for TypeScript and JavaScript:

Core (core.ts)

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:

  • React (react.ts) - React, React-perf, and JSX-a11y rules
  • Next.js (nextjs.ts) - Next.js-specific rules
  • Vue (vue.ts) - Vue.js rules
  • Node.js (node.ts) - Node.js-specific rules
  • Jest (jest.ts) - Jest testing rules
  • Vitest (vitest.ts) - Vitest testing rules

Formatting (format.ts)

Opinionated code formatting with oxfmt, configured for consistency and readability. The published formatter preset is available as adamantite/format and is designed to be used from oxfmt.config.ts.

Analyze (analyze.ts)

Opinionated Knip configuration for dependency and unused-file analysis. The published analyze preset is available as adamantite/analyze and is designed to be used from knip.config.ts.

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

# Linting and type checking
bun run check

🀝 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

 
 
 

Contributors