no-lint-suppression
A lint-suppression comment that silences SAFE-TS: one that names no rule (/* eslint-disable */, // oxlint-disable-next-line), or one that names a safe-ts/ rule (// oxlint-disable-next-line safe-ts/no-any). On by default, as an error.
Why: safe-ts check doesn't read these comments, but oxlint does: a project gated by the oxlint plugin never sees what they silence, and nothing counts it. A finding that must stay has a SAFE-TS form of its own, // safe-ts-ignore <rule>: <reason>, which says why, is counted, and is reported once there is nothing left to ignore.
❌ Rejected: a SAFE-TS rule named
✕ Rejectedno-lint-suppressionno-any
ts
// oxlint-disable-next-line safe-ts/no-any
export const config: any = { port: 8080 };❌ Rejected: every rule, for the rest of the file
✕ Rejectedno-lint-suppressionno-unchecked-cast
ts
/* eslint-disable */
export function title(value: unknown): string {
return value as string;
}✅ Accepted: the value is checked, so nothing needs silencing
✓ Accepted0 diagnostics
ts
import { type JsonError, parseJson } from "@evobug_com/safe-ts-std/json";
import type { Result } from "@evobug_com/safe-ts-std/result";
type Config = { readonly port: number };
export function readConfig(text: string): Result<Config, JsonError> {
return parseJson<Config>(text);
}ts
import { parseJsonWith as __jsonParse, validateWith as __jsonValidate, jsonFail as __jsonFail, isJsonErr as __jsonIsErr, isJsonObject as __jsonIsObject, type JsonResult as __JsonResult } from "@evobug_com/safe-ts-std/json"; import { type JsonError, parseJson } from "@evobug_com/safe-ts-std/json";
import type { Result } from "@evobug_com/safe-ts-std/result";
type Config = { readonly port: number };
export function readConfig(text: string): Result<Config, JsonError> {
return __jsonParse<Config>(text, __v0);
}
// ---- generated by safe-ts: JSON validators ----
type __T0 = { "port": number; };
function __v0(v: unknown, p: string): __JsonResult<__T0> {
if (!__jsonIsObject(v)) return __jsonFail(p, "object", v);
const __j1 = v["port"];
if (typeof __j1 !== "number") return __jsonFail(p + ".port", "number", __j1);
const __j2 = __j1;
const out: { "port": number; } = { "port": __j2 };
return out;
}✅ Also accepted: another linter's rule, named
✓ Accepted0 diagnostics
ts
export function report(lines: readonly string[]): void {
// eslint-disable-next-line no-console -- a command-line tool: its output is the console
for (const line of lines) console.log(line);
}Every eslint-disable* and oxlint-disable* comment is counted in safe-ts check's escape-hatch line (eslint-disable / oxlint-disable comment(s); lintSuppressions in --json --summary), the accepted ones too, and a baseline holds the count down.
A rule of oxlint itself that the SAFE-TS preset makes an error (no-eval, no-new-func, no-implied-eval, no-proto, no-extend-native, ...) is SAFE-TS's too: that is how it bans the construct, and safe-ts check doesn't report it itself. Turned off, it says why:
❌ Rejected: a rule of the preset, off without a reason
✕ Rejectedno-lint-suppression
ts
export function isPlain(value: object): boolean {
// oxlint-disable-next-line no-proto
return Object.getPrototypeOf(value) === Object.prototype;
}Any other named rule of another linter is not reported, with or without a -- reason: no-ts-suppression asks a @ts-expect-error for a reason because nothing else in it bounds what it hides, and here the rule's name does. SAFE-TS's guarantees don't rest on another linter's rule.
What counts
eslint-disable,eslint-disable-line,eslint-disable-next-lineand the same withoxlint-, in a//or/* */comment (after spaces and a JSDoc*), then the rules, separated by commas, then an optional-- description.eslint-enableturns nothing off and isn't counted.- In a
.ts,.tsxor.vuefile: in a component, the scripts and the template's HTML comments (<!-- eslint-disable-next-line -->, which eslint-plugin-vue reads). - Not in
// @safe-ts legacyand listed// @safe-ts stdfiles, which are counted whole.
The finding is on the directive's name, inside the comment: oxlint applies a block directive from the end of its comment and a -line one to the code before it, so the plugin reports the comment that would silence it, too.
What the rule can't see
- Whether the named rule is one SAFE-TS's checks rely on (
typescript/no-explicit-anyoverlapsno-any, which SAFE-TS reports itself). - Inline configuration other linters read (
/* global */,// biome-ignore,// deno-lint-ignore). - What the files an
.oxlintrc.jsonextendsturn off, nested configs in subdirectories, a config passed withoxlint -c, and one written in JavaScript. The.oxlintrc.jsonnext to the package.json is read: a config that doesn't extend the preset, or that turns one of its rules off or down ("rules","overrides") or leaves files out ("ignorePatterns"), is named under the escape-hatch line (weakened below the defaults: oxlint.rules no-eval off, ...), and a baseline fails on a new one.
Related: safe-ts-ignore, no-ts-suppression. Guide: Escape hatches.