Skip to main content

tombi

Run Tombi from ESLint and report upstream TOML lint and format results.

Rule catalog ID: R001

Targeted pattern scopeโ€‹

This rule is intended for TOML files that ESLint visits, normally through tombi.configs.recommended or another exported preset. The built-in presets target **/*.toml and **/Cargo.lock.

What this rule reportsโ€‹

The rule can report two kinds of findings:

  • Tombi lint diagnostics from tombi lint.
  • Format drift when tombi format would produce different text.

When formatting is enabled, the rule provides a full-file fixer powered by Tombi output.

Why this rule existsโ€‹

Tombi is the right source of truth for TOML parsing, linting, schema handling, and formatting. This rule exists so teams that already use ESLint as their editor and CI feedback channel can surface Tombi results in the same diagnostics stream.

โŒ Incorrectโ€‹

export default [
{
files: ["**/*.toml"],
rules: {
"tombi/tombi": "off",
},
},
];

โœ… Correctโ€‹

import tombi from "eslint-plugin-tombi";

export default [tombi.configs.recommended];

Behavior and migration notesโ€‹

The bridge invokes Tombi with --stdin-filename, so Tombi can still discover local configuration for the target file. Keep formatter, lint, schema, override, and extension settings in Tombi config files rather than copying them into ESLint.

For project formatting and linting policy, create tombi.toml, .tombi.toml, .config/tombi.toml, or [tool.tombi] in pyproject.toml:

[format.rules]
indent-width = 4
line-width = 100
string-quote-style = "double"

[lint.rules]
dotted-keys-out-of-order = "warn"
key-empty = "error"
tables-out-of-order = "warn"

Tombi's upstream docs are the source of truth for configuration lookup, format rules, and lint rules.

Optionsโ€‹

type Options = [
{
cache?: {
directory?: string;
noCache?: boolean;
ttlSeconds?: number;
};
check?: boolean;
errorOnWarnings?: boolean;
format?: boolean;
httpTimeoutSeconds?: number;
lint?: boolean;
noCache?: boolean;
offline?: boolean;
quiet?: boolean;
timeoutMs?: number;
tombiPath?: string;
verbose?: 0 | 1 | 2;
}?,
];
OptionDefaultEffect
linttrueRun tombi lint and report diagnostics.
checktrueReport when tombi format would change the file.
formattrueProvide an ESLint fixer using Tombi formatted output.
errorOnWarningsfalsePass --error-on-warnings to tombi lint.
quiettruePass --quiet unless set to false.
offlinefalseSet TOMBI_OFFLINE=true.
noCachefalseSet TOMBI_NO_CACHE=true.
cache.directorynode_modules/.cache/... with .cache fallbackSet TOMBI_CACHE_HOME.
cache.ttlSeconds2592000Set TOMBI_CACHE_TTL; default is 30 days.
cache.noCachefalseRule-scoped alias for noCache.
httpTimeoutSeconds5Set TOMBI_HTTP_TIMEOUT.
timeoutMs30000Kill a Tombi subprocess that runs too long.
tombiPathbundled native binaryUse a custom Tombi executable path.
verbose0Pass -v or -vv to Tombi.

By default, installed packages use node_modules/.cache/eslint-plugin-tombi/tombi. Source checkouts and unwritable package caches fall back to .cache/eslint-plugin-tombi/tombi under the ESLint working directory. Explicit cache.directory values are resolved from the ESLint working directory unless absolute, and creation failures are reported instead of silently falling back.

Additional examplesโ€‹

import tombi from "eslint-plugin-tombi";

export default [tombi.configs.recommended];

Lint onlyโ€‹

import tombi from "eslint-plugin-tombi";

export default [tombi.configs.lint];

Formatting with custom cache settingsโ€‹

import tombi from "eslint-plugin-tombi";

export default [
{
...tombi.configs.format,
rules: {
"tombi/tombi": [
"error",
{
cache: {
directory: ".cache/tombi",
ttlSeconds: 60 * 60 * 24 * 30,
},
httpTimeoutSeconds: 10,
},
],
},
},
];

ESLint flat config exampleโ€‹

import tombi from "eslint-plugin-tombi";

export default [
{
...tombi.configs.recommended,
rules: {
"tombi/tombi": [
"error",
{
errorOnWarnings: true,
timeoutMs: 30_000,
},
],
},
},
];

When not to use itโ€‹

Do not enable this rule when a repository intentionally runs Tombi separately and duplicate editor or CI diagnostics would be noisy or too slow.

Package documentationโ€‹

Further readingโ€‹

Adoption resourcesโ€‹

  • Start with tombi.configs.recommended.
  • Keep upstream TOML policy in Tombi config files.
  • Use cache.ttlSeconds, offline, and noCache only for bridge execution behavior.