Skip to content

The @vibator/gate package

This document is the reference of the @vibator/gate package: the shared tool presets of the gate and the way projects extend them.

Reference


What the package is

A pure preset package. It ships one base configuration per tool and exports each under a stable subpath. It carries no code, no vibator configuration, and no dependencies.

Projects do not extend the gate at the vibator level. The @vibator/create-gate wizard generates the project's .vibator.json and a .vibator/ folder with one thin configuration per chosen tool, each extending the matching preset here. A project can write the same files by hand.

Layout and exports

FileExportPurpose
biome.base.json./biomeThe Biome preset the biome rule runs with; editors extend it too.
depcruise.cjs./depcruiseThe universal dependency ruleset the depcruise rule runs with.
tsconfig.json./tsconfigCompiler strictness preset a project tsconfig.json extends.

There is no Knip preset file: Knip's zero-config discovery is the preset, and its own configuration has no extends mechanism. A project that needs Knip settings writes a plain knip.json, which Knip discovers.

The tool presets

biome.base.json:

SettingValue
vcsgit, useIgnoreFile on
formatterspaces, width 2
linter presetrecommended
noExcessiveCognitiveComplexityerror, max 8
noExcessiveLinesPerFunctionerror, max 25, blank lines skipped
noExcessiveLinesPerFileerror, max 400
noConsoleerror, warn and error allowed
assistorganizeImports on
overridesthe three size caps off in *.test.* and *.spec.*

depcruise.cjs. Layer boundaries stay project-specific; these are the universal rules:

RuleSeverityEnforces
no-circularerrorNo dependency cycles.
no-test-deps-in-srcerrorProduction code does not import test files.
not-to-unresolvableerrorEvery import resolves.
no-non-package-jsonerrorNo dependency outside package.json.
not-to-dev-deperrorsrc/ does not rely on devDependencies; type-only imports allowed.
no-orphanswarnA module nothing imports is dead or missing its wiring.

tsconfig.json: strict, noUncheckedIndexedAccess, noImplicitOverride, noFallthroughCasesInSwitch, isolatedModules, forceConsistentCasingInFileNames, skipLibCheck.

Using the presets

A project extends each preset with a thin file in the tool's own language and points the matching rule at it.

json
// .vibator/biome.json
{
  "extends": ["@vibator/gate/biome"]
}
js
// .vibator/depcruise.cjs
module.exports = {
  extends: "@vibator/gate/depcruise",
};
json
// .vibator.json, the rules entries
{
  "rules": {
    "biome": { "options": { "configPath": ".vibator/biome.json" } },
    "depcruise": { "options": { "configPath": ".vibator/depcruise.cjs" } }
  }
}
json
// tsconfig.json
{
  "extends": "@vibator/gate/tsconfig"
}

Project rules go in the thin files, in the tool's language: Biome rules under linter.rules, dependency-cruiser layer boundaries under forbidden. The biome rule flattens the extends chain itself, so the run and the editor enforce the same configuration; dependency-cruiser resolves its own extends natively.

The vibator rule loader imports only .ts, .js, and .mjs modules from the .vibator/ folder, so the configuration files live there without being loaded as rules. The depcruise file stays .cjs for that reason.

A project that wants a preset with no local file points configPath straight into the package: "@vibator/gate:biome.base.json" or "@vibator/gate:depcruise.cjs".

Dependency policy

The package has no dependencies. Nothing imports it as code: the plugins read its files, and the tools resolve its exports.

  • The @vibator/create-gate wizard installs vibator and the chosen plugins as devDependencies of the project, so a project carries only the tools it enabled.
  • Each plugin carries its tool as a regular dependency. The tool's JavaScript API is not a stable contract, so only the pair the plugin was tested against is known to work; a project that must run a different tool version forces it with npm overrides.

Released under the MIT License.