Skip to content

Latest commit

 

History

44 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

vitest-config logo

@sebastienrousseau/vitest-config

Shareable Vitest testing configuration adhering to modern 2026 standards

Build Status npm package Documentation OpenSSF Scorecard OpenSSF Best Practices License: Apache-2.0 OR MIT Node >= 18.0.0


Contents

Getting started

The configuration ecosystem

Configuration reference

Operational


Install

Using a package manager

Install @sebastienrousseau/vitest-config as a development dependency:

# npm
npm install --save-dev @sebastienrousseau/vitest-config

# pnpm
pnpm add -D @sebastienrousseau/vitest-config

# yarn
yarn add -D @sebastienrousseau/vitest-config

# bun
bun add -d @sebastienrousseau/vitest-config

Build from source

git clone https://github.com/sebastienrousseau/vitest-config.git
cd vitest-config
make            # check + test

Requirements

  • Node.js 18.0.0 or newer. Every package manifest declares engines.node, and CI enforces the runtime floor on every push across macOS, Linux, and Windows.
  • npm 9.0.0 or newer (or modern pnpm / yarn / bun).
  • Module systems. Full native support for ECMAScript Modules (ESM) and CommonJS (CJS).
  • TypeScript 5.0 or newer (optional, recommended for type checking).

Quick Start

In package.json

{
  "vitest": "@sebastienrousseau/vitest-config"
}

In CommonJS Configuration

module.exports = require("@sebastienrousseau/vitest-config");

In ES Module Configuration

import config from "@sebastienrousseau/vitest-config";
export default config;

The configuration ecosystem

@sebastienrousseau/vitest-config is a focused satellite of the @sebastienrousseau/config suite — a unified ecosystem of 21 single-purpose, zero-overhead developer configurations designed to share a single design philosophy, strict typing, and zero runtime dependencies.

Configuration Target / Purpose Native Standard
@sebastienrousseau/biome-config Rust-powered linting & formatting Biome 1.9+

To adopt the complete suite with a single import, install the master meta-package:

npm install --save-dev @sebastienrousseau/config

Why this approach?

Configuration rot is one of the most common vectors for project decay. Ad-hoc tool configurations copied between repositories quickly drift, leaving security vulnerabilities unpatched, formatting rules inconsistent, and CI times bloated.

@sebastienrousseau/vitest-config solves this with three deliberate engineering choices:

  1. Zero Runtime Dependencies: The configuration contains only static, serialisable declarative definitions and clean programmatic adapters.
  2. Dual CJS/ESM Architecture: Ships dedicated CommonJS (index.cjs) and ES Module (index.mjs) entrypoints alongside comprehensive TypeScript declarations (index.d.ts).
  3. Deterministic Governance: Versioned strictly by +0.0.1 per release, cryptographically signed with published PGP keys, and audited continuously.

ESM Test Environment & V8 Coverage

High-performance Vitest configuration with V8 coverage provider and 100% threshold enforcement.

Before (Unstandardized)

// Custom vitest setup
export default { test: {} };

After (@sebastienrousseau/vitest-config Enforced)

import config from "@sebastienrousseau/vitest-config";
export default config;

Module Compatibility

This package exports dual module entrypoints via package.json exports:

"exports": {
  ".": {
    "types": "./index.d.ts",
    "import": "./index.mjs",
    "require": "./index.cjs"
  }
}

Full TypeScript declarations (index.d.ts) are included out of the box, providing rich IDE autocomplete and JSDoc documentation inline.


When not to use this configuration

When your test suite depends on Jest-specific global mocks or browser-less Node runners that do not use Vite's transform pipeline.


Development

Contributors use a standard POSIX Makefile as the convention-based task runner:

Task Command Purpose
Default gate make Runs full test and lint battery
Unit tests make test Executes native validation test suite
Lints make lint Runs syntax and code quality checks
Clean make clean Removes node_modules and temporary cache
git clone https://github.com/sebastienrousseau/vitest-config.git
cd vitest-config
make test

Security

  • Private Reporting: Report security vulnerabilities by emailing sebastian.rousseau@gmail.com. Expect an initial response within 48 hours and a mitigation plan within 7 days.
  • Commit Integrity: All commits on main and release tags are cryptographically signed.
  • Release Signing Key: The release-signing PGP key is published in KEYS.asc:
    4B7F16C909C7A8EE9BED338A4F047EDF5F90F638
    
    Signing key Sebastien Rousseau <sebastian.rousseau@gmail.com>, ed25519, expires 2028-08-16.
  • Supply Chain: Monitored continuously via Dependabot, CodeQL, and SLSA provenance. See SECURITY.md for details.

Documentation

  • Architecture — Architectural design, directory structure, and invariants.
  • Development Guide — Toolchain prerequisites, task reproduction, and CI gates.
  • Governance — Maintainer-led project model and decision-making framework.
  • Support Guide — Channels for help, bug reports, and feature requests.
  • Ecosystem Suite — The @sebastienrousseau/config family repository.

Stability guarantees

  • SemVer Discipline: Versioning increments strictly by +0.0.1 following the repository lifecycle standard.
  • Output Stability: A rule change that alters linting or formatting output in consumer code is treated as a notable breaking event, clearly documented in CHANGELOG.md.
  • Deprecation Window: Deprecated options or configurations remain supported for at least two release cycles before removal.

Minimum-toolchain policy

The minimum supported Node.js version is 18.0.0. The floor may raise only when:

  1. An upstream LTS version reaches official End-of-Life (EOL).
  2. The reason is explicitly recorded in CHANGELOG.md and DEVELOPMENT.md.

License

Dual-licensed under either:

at your option.

SPDX-License-Identifier: Apache-2.0 OR MIT

About

Shareable Vitest testing configuration adhering to modern ESM-first unit, benchmark, and coverage standards.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages