lintmax 0.1.104 → 0.1.106

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.mjs CHANGED
@@ -1,13 +1,14 @@
1
1
  #!/usr/bin/env bun
2
- import { B as OXLINT_CLI_ALLOW, D as isRecord, H as PARSE_DIALECTS, R as DEFAULT_SHARED_IGNORE_PATTERNS, S as joinPath, _ as runCapture, a as cacheDir, b as fromFileUrl, c as ensureDirectory, d as pathExists, f as readJson, g as run, h as resolveBin, i as PRETTIER_MD_ARGS, l as envValue, m as readVersion, n as listProjectFiles, o as cwd, p as readRequiredJson, r as CliExitError, s as decodeText, t as escapeGlobPath, u as lintmaxRoot, v as usage, y as dirnamePath, z as ESLINT_TEST_FILE_PATTERNS } from "./project-files-DudveeQZ.mjs";
3
- import { r as sync } from "./src-8LKWIKXe.mjs";
2
+ import { B as OXLINT_CLI_ALLOW, D as isRecord, H as PARSE_DIALECTS, R as DEFAULT_SHARED_IGNORE_PATTERNS, S as joinPath, _ as runCapture, a as cacheDir, b as fromFileUrl, c as ensureDirectory, d as pathExists, f as readJson, g as run, h as resolveBin, i as PRETTIER_MD_ARGS, l as envValue, m as readVersion, n as listProjectFiles, o as cwd, p as readRequiredJson, r as CliExitError, s as decodeText, t as escapeGlobPath, u as lintmaxRoot, v as usage, y as dirnamePath, z as ESLINT_TEST_FILE_PATTERNS } from "./project-files-C4cvEhY7.mjs";
3
+ import { r as sync } from "./src-DDkinCyR.mjs";
4
4
  import { $, Glob, env, file, write } from "bun";
5
5
  import { lstat, unlink } from "node:fs/promises";
6
6
  import { join } from "node:path";
7
+ import { homedir, platform, tmpdir } from "node:os";
8
+ import { Buffer } from "node:buffer";
7
9
  import { parseSync } from "oxc-parser";
8
10
  import { ESLint } from "eslint";
9
11
  import { createHash } from "node:crypto";
10
- import { homedir, platform, tmpdir } from "node:os";
11
12
  //#region src/rule-equivalence.ts
12
13
  const equivalenceGroups = [
13
14
  [
@@ -1468,6 +1469,7 @@ const requireLintAnswer = ({ exitCode, label, stderr, stdout }) => {
1468
1469
  refuse("produced no parseable JSON");
1469
1470
  }
1470
1471
  if (!Array.isArray(parsed.diagnostics)) refuse("returned JSON carrying no diagnostics array");
1472
+ if (exitCode !== 0 && parsed.diagnostics.length === 0) refuse("failed with zero diagnostics");
1471
1473
  return json;
1472
1474
  };
1473
1475
  const firedOxlintByFile = async ({ configPath, files, oxlintBin }) => {
@@ -2039,13 +2041,28 @@ const captureAndParse = async ({ env, failures, label, opts, parser }) => {
2039
2041
  label
2040
2042
  });
2041
2043
  if (result.exitCode === 0) return [];
2042
- const diagnostics = parser(result);
2044
+ const byteCount = Buffer.byteLength(result.stdout);
2045
+ const stderrDetail = result.stderr ? `\n${result.stderr.trim()}` : "";
2046
+ let diagnostics;
2047
+ try {
2048
+ if (label === "eslint" || label === "biome" || label === "oxlint") readRequiredJson(result.stdout);
2049
+ diagnostics = parser(result);
2050
+ } catch (parseError) {
2051
+ const detail = parseError instanceof Error ? parseError.message : String(parseError);
2052
+ failures.push({
2053
+ code: result.exitCode,
2054
+ label,
2055
+ message: `Output parse error (${byteCount} bytes): ${detail}${stderrDetail}`
2056
+ });
2057
+ return [];
2058
+ }
2043
2059
  if (diagnostics.length > 0) return diagnostics;
2044
2060
  const stderr = result.stderr.trim();
2045
2061
  const stdout = result.stdout.trim();
2046
2062
  const stdoutFirst = stdout.split("\n", 1)[0]?.trimStart() ?? "";
2047
2063
  const stdoutMessage = stdoutFirst.startsWith("[") || stdoutFirst.startsWith("{") ? void 0 : stdout || void 0;
2048
- const message = stderr.length > 0 ? stderr : stdoutMessage;
2064
+ const detail = stderr.length > 0 ? stderr : stdoutMessage;
2065
+ const message = `Output parsed to zero diagnostics (${byteCount} bytes)${detail ? `\n${detail}` : ""}`;
2049
2066
  failures.push({
2050
2067
  code: result.exitCode,
2051
2068
  label,
@@ -2597,6 +2614,10 @@ const staleExceptions = {
2597
2614
  "eslint-plugin-react": {
2598
2615
  reason: "it is the sole dep still pinning eslint to ^9, and replacing it COSTS coverage: of its 83 active rules oxlint re-owns 49 and @eslint-react/perfectionist re-own 5, 20 are obsolete under the new JSX transform or the propTypes era, 7 belong to the formatter, and 6 have no home anywhere — destructuring-assignment, no-invalid-html-attribute, no-adjacent-inline-elements, plus the class-only no-arrow-function-lifecycle, static-property-placement and require-optimization. Strictness is monotonic-up, so the gate carries a stale dep rather than drop six enforced rules",
2599
2616
  revisitWhen: "a maintained plugin covers those 6 ids, or every class component is gone (retiring the 3 class-only ones) and the other 3 are re-homed — then drop this dep and take eslint 10"
2617
+ },
2618
+ "eslint-plugin-react-hooks": {
2619
+ reason: "its source in facebook/react under packages/eslint-plugin-react-hooks received commits on 2026-10-14 and its npm record changed on 2026-10-15 through prerelease publishes; stable latest 7.1.1 is older than 6 months because stable releases follow React own release cadence — the age means a slow stable cadence, not abandonment",
2620
+ revisitWhen: "a stable eslint-plugin-react-hooks past 7.1.1 is published, or packages/eslint-plugin-react-hooks in facebook/react stops receiving commits for 6 months"
2600
2621
  }
2601
2622
  };
2602
2623
  const toIssue = (name, publishedAt) => {
@@ -2613,7 +2634,7 @@ const scanStaleness = async (force = false) => {
2613
2634
  const ci = envValue("CI") === "true" || envValue("CI") === "1";
2614
2635
  const forced = force || ci || envValue(envForce) === "1";
2615
2636
  const state = await loadState();
2616
- if (!forced && state.lastCheck > 0 && Date.now() - state.lastCheck < cacheTtlMs) return state.staleIssues;
2637
+ if (!forced && state.lastCheck > 0 && Date.now() - state.lastCheck < cacheTtlMs) return state.staleIssues.filter((issue) => !Object.hasOwn(staleExceptions, issue.name));
2617
2638
  const names = await trackedPackages();
2618
2639
  const issues = (await Promise.all(names.map(async (name) => {
2619
2640
  const publishedAt = await fetchLatestPublish(name);
@@ -2628,7 +2649,7 @@ const scanStaleness = async (force = false) => {
2628
2649
  };
2629
2650
  const formatStaleness = (issues) => {
2630
2651
  if (issues.length === 0) return "";
2631
- return `lintmax: stale linter deps (advisory):\n${issues.map((issue) => ` ${issue.name} latest release ${issue.ageDays}d old (>6mo)`).join("\n")}`;
2652
+ return `lintmax: stale linter deps — FAILS the gate:\n${issues.map((issue) => ` ${issue.name} latest release ${issue.ageDays}d old (>6mo)`).join("\n")}\nClear by bumping the dependency, or adding a staleExceptions entry with a reason and a revisitWhen trigger.`;
2632
2653
  };
2633
2654
  //#endregion
2634
2655
  //#region src/gate.ts
@@ -2678,6 +2699,7 @@ const runGate = async ({ command, human, version }) => {
2678
2699
  });
2679
2700
  await persistGreen(await computeGreenKey(version));
2680
2701
  await stalePromise;
2702
+ if (process.exitCode !== void 0 && process.exitCode !== 0) return;
2681
2703
  process.stdout.write("ok\n");
2682
2704
  };
2683
2705
  //#endregion
package/dist/eslint.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { A as normalizePathListInput, D as isRecord, E as findUnknownRules, M as normalizeTailwindOption, P as warnToError, R as DEFAULT_SHARED_IGNORE_PATTERNS, S as joinPath, U as SHARED_OVERRIDE_SYMBOL_KEY, W as TAILWIND_ENTRY_CANDIDATES, j as normalizeRulesOffInput, k as normalizeObjectListInput, n as listProjectFiles, x as isAbsolutePath, z as ESLINT_TEST_FILE_PATTERNS } from "./project-files-DudveeQZ.mjs";
1
+ import { A as normalizePathListInput, D as isRecord, E as findUnknownRules, M as normalizeTailwindOption, P as warnToError, R as DEFAULT_SHARED_IGNORE_PATTERNS, S as joinPath, U as SHARED_OVERRIDE_SYMBOL_KEY, W as TAILWIND_ENTRY_CANDIDATES, j as normalizeRulesOffInput, k as normalizeObjectListInput, n as listProjectFiles, x as isAbsolutePath, z as ESLINT_TEST_FILE_PATTERNS } from "./project-files-C4cvEhY7.mjs";
2
2
  import { file } from "bun";
3
3
  import eslintReact from "@eslint-react/eslint-plugin";
4
4
  import { includeIgnoreFile } from "@eslint/compat";
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- export { t as defineConfig, n as eslintImport, r as sync } from "./src-8LKWIKXe.mjs";
1
+ export { t as defineConfig, n as eslintImport, r as sync } from "./src-DDkinCyR.mjs";
@@ -1,6 +1,7 @@
1
1
  import { $, Glob, env, env as bunEnv, file, spawn } from "bun";
2
- import { lstat, realpath } from "node:fs/promises";
2
+ import { lstat, mkdtemp, realpath, rm, writeFile } from "node:fs/promises";
3
3
  import { dirname, join, resolve } from "node:path";
4
+ import { tmpdir } from "node:os";
4
5
  //#region src/constants.ts
5
6
  const BIOME_RULES_OFF = [
6
7
  "noBarrelFile",
@@ -440,13 +441,43 @@ const run = async ({ args, command, env, label, silent = false }) => {
440
441
  }
441
442
  throw new CliExitError({ code: result.exitCode });
442
443
  };
443
- const runCapture = async ({ args, command, env }) => {
444
- const result = await $`${command} ${args}`.cwd(cwd).env(env).quiet().nothrow();
445
- return {
446
- exitCode: result.exitCode,
447
- stderr: result.stderr.toString(),
448
- stdout: result.stdout.toString()
449
- };
444
+ const runCapture = async ({ args, command, env, label }) => {
445
+ const directory = await mkdtemp(joinPath(tmpdir(), "lintmax-output-"));
446
+ try {
447
+ const stdoutPath = joinPath(directory, "stdout");
448
+ const stderrPath = joinPath(directory, "stderr");
449
+ const outputPath = joinPath(directory, "diagnostics");
450
+ const outputArgs = label === "eslint" ? ["--output-file", outputPath] : [];
451
+ const nativeOutput = outputArgs.length > 0;
452
+ const captureArgs = [...args, ...outputArgs];
453
+ if (nativeOutput) await writeFile(outputPath, "");
454
+ const windows = process.platform === "win32";
455
+ const commandArgs = windows ? [command, ...captureArgs] : [
456
+ "/bin/sh",
457
+ "-c",
458
+ "stdout=$1; stderr=$2; shift 2; exec \"$@\" > \"$stdout\" 2> \"$stderr\"",
459
+ "lintmax-capture",
460
+ stdoutPath,
461
+ stderrPath,
462
+ command,
463
+ ...captureArgs
464
+ ];
465
+ const exitCode = await spawn(commandArgs, {
466
+ cwd,
467
+ env,
468
+ stderr: windows ? file(stderrPath) : "ignore",
469
+ stdout: windows ? file(stdoutPath) : "ignore",
470
+ timeout: 6e5
471
+ }).exited;
472
+ const [stderr, stdout] = await Promise.all([file(stderrPath).text(), file(nativeOutput ? outputPath : stdoutPath).text()]);
473
+ return {
474
+ exitCode,
475
+ stderr,
476
+ stdout
477
+ };
478
+ } finally {
479
+ await rm(directory, { recursive: true });
480
+ }
450
481
  };
451
482
  const envValue = (name) => bunEnv[name] ?? "";
452
483
  const readVersion = async () => {
@@ -1,4 +1,4 @@
1
- import { A as normalizePathListInput, C as assertJsonSerializable, E as findUnknownRules, F as BIOME_IGNORE_PATTERNS, I as BIOME_PATTERN_RULE_OVERRIDES, L as BIOME_RULES_OFF, M as normalizeTailwindOption, N as stripPluginNamespace, O as normalizeIgnorePattern, R as DEFAULT_SHARED_IGNORE_PATTERNS, S as joinPath, T as assertOptionalString, U as SHARED_OVERRIDE_SYMBOL_KEY, V as OXLINT_PATTERN_RULE_OVERRIDES, a as cacheDir, b as fromFileUrl, c as ensureDirectory, j as normalizeRulesOffInput, k as normalizeObjectListInput, n as listProjectFiles, p as readRequiredJson, w as assertObject, y as dirnamePath } from "./project-files-DudveeQZ.mjs";
1
+ import { A as normalizePathListInput, C as assertJsonSerializable, E as findUnknownRules, F as BIOME_IGNORE_PATTERNS, I as BIOME_PATTERN_RULE_OVERRIDES, L as BIOME_RULES_OFF, M as normalizeTailwindOption, N as stripPluginNamespace, O as normalizeIgnorePattern, R as DEFAULT_SHARED_IGNORE_PATTERNS, S as joinPath, T as assertOptionalString, U as SHARED_OVERRIDE_SYMBOL_KEY, V as OXLINT_PATTERN_RULE_OVERRIDES, a as cacheDir, b as fromFileUrl, c as ensureDirectory, j as normalizeRulesOffInput, k as normalizeObjectListInput, n as listProjectFiles, p as readRequiredJson, w as assertObject, y as dirnamePath } from "./project-files-C4cvEhY7.mjs";
2
2
  import { file, write } from "bun";
3
3
  import { lstat } from "node:fs/promises";
4
4
  import { join, relative } from "node:path";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lintmax",
3
- "version": "0.1.104",
3
+ "version": "0.1.106",
4
4
  "description": "The #1 anti AI slop typescript tooling. Designed for coding agents, not humans.",
5
5
  "keywords": [
6
6
  "agent",
@@ -55,7 +55,7 @@
55
55
  "prepublishOnly": "bun run build",
56
56
  "postpublish": "bun ../../tools/prune-versions.ts",
57
57
  "smoke": "bun script/smoke.ts",
58
- "test": "bun script/test-magic.ts && bun script/test-coverage.ts"
58
+ "test": "bun test src && bun script/test-magic.ts && bun script/test-coverage.ts"
59
59
  },
60
60
  "dependencies": {
61
61
  "@biomejs/biome": "latest",