Sebastien Rousseau lefthook-config Logo lefthook-config

@sebastienrousseau/lefthook-config

Shareable Lefthook configuration rules for fast, parallel Git hooks execution.

Get Started Usage Guide GitHub npm

Start with one command

Install with your favourite package manager and extend in seconds.

Install @sebastienrousseau/lefthook-config

npm install --save-dev @sebastienrousseau/lefthook-config

Key capabilities

Engineered for consistency, performance, and strict typing.

  • Zero Runtime Dependencies

    Pure configuration with no bloated runtime dependency trees, keeping builds fast and secure.

  • Dual Module Exports

    Full support for modern ECMAScript Modules (ESM) and CommonJS (CJS) environments.

  • Full TypeScript Definitions

    Includes complete index.d.ts declarations for rich IDE autocompletion and type checking.

  • Deterministic Quality Gates

    Audited continuously with SLSA provenance, CodeQL, and automated test suites.

What is @sebastienrousseau/lefthook-config?

@sebastienrousseau/lefthook-config is an enterprise-grade, shareable configuration for Lefthook—the blazingly fast, polyglot Git hooks manager written in Go. Designed to deliver vetted, deterministic defaults, this package eliminates manual setup boilerplate and establishes rigorous code quality standards across modern software development pipelines.

By adopting this configuration, engineering teams ensure unified consistency across local development, continuous integration, and automated deployments. The package adheres strictly to the OpenSSF Best Practices badge program (ID: 14511) and achieves top-tier security ratings via Scorecard audits.

Explore the complete Installation Guide, review the comprehensive Usage Documentation, inspect the API Reference, or discover AI integrations via the Model Context Protocol (MCP).


Why Developers Choose @sebastienrousseau/lefthook-config

Modern JavaScript and TypeScript repositories frequently suffer from configuration drift, fragmented standards, and maintenance overhead. @sebastienrousseau/lefthook-config directly solves these challenges:

  • Battle-Tested Standards: Curated rules engineered for high maintainability, deterministic builds, and defect prevention.
  • Zero Runtime Dependencies: The package adds exactly zero runtime dependencies to your production bundle, eliminating supply-chain attack vectors.
  • Dual Module Compatibility: Out-of-the-box support for both ECMAScript Modules (import) and CommonJS (require).
  • TypeScript Type Safety: Bundled TypeScript definitions ensure all configuration objects and functions validate under strict tsc checks.
  • Enterprise Security & Supply Chain Defense: Cryptographically signed commits and automated OpenSSF Scorecard auditing, SLSA Provenance generation, and continuous CodeQL security scanning.

How to Get Started in 3 Steps

Integrating @sebastienrousseau/lefthook-config into any new or existing repository requires only three simple steps.

Step 1: Install the Package

Install the configuration as a development dependency using your preferred package manager:

# Using npm
npm install --save-dev @sebastienrousseau/lefthook-config

# Using pnpm
pnpm add -D @sebastienrousseau/lefthook-config

# Using yarn
yarn add -D @sebastienrousseau/lefthook-config

For advanced package manager configurations and offline workflows, consult our Installation Guide.

Step 2: Configure lefthook.yml

Create or update your lefthook.yml file at the root of your project to extend the shared configuration:

pre-commit:
  parallel: true
  commands:
    lint:
      run: npm run lint

Learn how to customize specific rules and override settings in the Usage Guide.

Step 3: Run Lefthook in Your Workflow

Execute Lefthook directly or configure standard quality scripts in your package.json:

npx lefthook run pre-commit

Execute staged file linters and formatters concurrently before git commit.


Key Features & Architecture

FeatureDescriptionBenefit
Zero Runtime OverheadZero runtime dependenciesImmunity against upstream supply-chain vulnerabilities
Dual Module SupportFull ESM and CommonJS exportsSeamless integration across legacy and modern toolchains
Strict Type SafetyBundled TypeScript .d.ts definitionsInstant autocomplete and schema validation in modern IDEs
Production Proven100% test coverage with native Node test runnersGuaranteed reliability and predictable execution
OpenSSF CertifiedPassing OpenSSF Best Practices badge statusHigh-assurance security and supply chain defense

For a detailed breakdown of all exported configuration files and schema fields, visit the Reference Guide.


Frequently Asked Questions (FAQ)

Why choose Lefthook over Husky?

Lefthook executes hook commands in parallel with zero runtime Node overhead, completing pre-commit validation in a fraction of the time required by traditional hook runners.

Can I override individual rules in my project?

Yes. Every configuration allows local overrides directly within your lefthook.yml file or inline settings. Detailed override recipes are documented in the Usage Guide.

Is @sebastienrousseau/lefthook-config safe for production CI/CD?

Yes. The package complies with OpenSSF Best Practices criteria, carries an active OpenSSF Scorecard audit, and contains zero runtime dependencies. Every release undergoes continuous automated regression testing and CodeQL analysis.

How does this package support AI and agentic workflows?

The project includes a Model Context Protocol (MCP) configuration, enabling LLM coding assistants and AI agents to understand, validate, and execute repository configuration tasks autonomously.

Production Standards

Engineered for high-assurance developer platforms and open-source infrastructure.

100%
OpenSSF Best Practices passing status and automated scorecard audits.
0
Runtime dependencies for lightning-fast installs and minimal attack surface.
100%
TypeScript type coverage with comprehensive definitions.

Explore Installation Guide