lintmax 0.1.96 → 0.1.98
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,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
|
-
import { S as OXLINT_CLI_ALLOW, b as DEFAULT_SHARED_IGNORE_PATTERNS, i as joinPath, l as isRecord, n as fromFileUrl, t as dirnamePath, w as PARSE_DIALECTS, x as ESLINT_TEST_FILE_PATTERNS } from "./path-
|
|
3
|
-
import { _ as resolveBin, a as PRETTIER_MD_ARGS, b as usage, c as cwd, d as envValue, f as lintmaxRoot, g as readVersion, h as readRequiredJson, i as CliExitError, l as decodeText, m as readJson, o as bunEnv, p as pathExists, r as sync, s as cacheDir, u as ensureDirectory, v as run, y as runCapture } from "./src-
|
|
2
|
+
import { S as OXLINT_CLI_ALLOW, b as DEFAULT_SHARED_IGNORE_PATTERNS, i as joinPath, l as isRecord, n as fromFileUrl, t as dirnamePath, w as PARSE_DIALECTS, x as ESLINT_TEST_FILE_PATTERNS } from "./path-ylBxywIW.mjs";
|
|
3
|
+
import { _ as resolveBin, a as PRETTIER_MD_ARGS, b as usage, c as cwd, d as envValue, f as lintmaxRoot, g as readVersion, h as readRequiredJson, i as CliExitError, l as decodeText, m as readJson, o as bunEnv, p as pathExists, r as sync, s as cacheDir, u as ensureDirectory, v as run, y as runCapture } from "./src-wVKtpbf-.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";
|
|
@@ -625,13 +625,13 @@ const normalizeRule = (rule) => {
|
|
|
625
625
|
};
|
|
626
626
|
const loadOxlintOffRules = async () => {
|
|
627
627
|
const configPath = joinPath(process.cwd(), cacheDir, ".oxlintrc.json");
|
|
628
|
+
if (!await file(configPath).exists()) throw new Error(`clean-ignores: the generated config is absent at ${configPath}, so no rule reads as off and every directive for an off rule would be kept. The stage that writes it did not run.`);
|
|
628
629
|
let config;
|
|
629
630
|
try {
|
|
630
631
|
config = readRequiredJson(await file(configPath).text());
|
|
631
|
-
} catch {
|
|
632
|
-
config
|
|
632
|
+
} catch (error) {
|
|
633
|
+
throw new Error(`clean-ignores: the generated config at ${configPath} carries no parseable JSON. Refusing rather than reading it as "no rule is off", which would silently keep every directive.`, { cause: error });
|
|
633
634
|
}
|
|
634
|
-
if (!config) return /* @__PURE__ */ new Set();
|
|
635
635
|
const off = /* @__PURE__ */ new Set();
|
|
636
636
|
for (const [rule, val] of Object.entries(config.rules ?? {})) if ((Array.isArray(val) ? String(val[0]) : val) === "off") {
|
|
637
637
|
off.add(rule);
|
|
@@ -1443,11 +1443,24 @@ const rebuildBiomeLine = ({ line, rules }) => {
|
|
|
1443
1443
|
* `{"diagnostics": []}` and exit 0 when they find nothing, so requiring a parsed diagnostics array refuses a
|
|
1444
1444
|
* crash without ever refusing a clean tree.
|
|
1445
1445
|
*/
|
|
1446
|
+
const oxlintUnusedArgs = ({ configPath, files, oxlintBin }) => [
|
|
1447
|
+
oxlintBin,
|
|
1448
|
+
"-c",
|
|
1449
|
+
configPath,
|
|
1450
|
+
"-f",
|
|
1451
|
+
"json",
|
|
1452
|
+
...OXLINT_CLI_ALLOW.flatMap((rule) => ["--allow", rule]),
|
|
1453
|
+
...files
|
|
1454
|
+
];
|
|
1446
1455
|
const requireLintAnswer = ({ exitCode, label, stderr, stdout }) => {
|
|
1447
1456
|
const json = extractJson(stdout);
|
|
1448
1457
|
const refuse = (why) => {
|
|
1449
|
-
const
|
|
1450
|
-
|
|
1458
|
+
const out = stdout.trim();
|
|
1459
|
+
const shape = `[${String(out.length)} bytes]`;
|
|
1460
|
+
const head = out.slice(0, 400);
|
|
1461
|
+
const tail = out.length > 400 ? ` … TAIL ${out.slice(-200)}` : "";
|
|
1462
|
+
const said = [stderr.trim(), `${shape} ${head}${tail}`].filter((part) => part !== "").join(" | ");
|
|
1463
|
+
throw new Error(`${label}: ${why} (exit ${exitCode}). Refusing rather than reading it as "nothing fired", which would report every directive unused. ${said}`);
|
|
1451
1464
|
};
|
|
1452
1465
|
let parsed;
|
|
1453
1466
|
try {
|
|
@@ -1461,14 +1474,11 @@ const requireLintAnswer = ({ exitCode, label, stderr, stdout }) => {
|
|
|
1461
1474
|
const firedOxlintByFile = async ({ configPath, files, oxlintBin }) => {
|
|
1462
1475
|
if (!await file(configPath).exists()) throw new Error(`oxlint-unused: the generated config is absent at ${configPath}, so no rule can fire and every directive would read as unused. The stage that writes it did not run.`);
|
|
1463
1476
|
const result = await runCapture({
|
|
1464
|
-
args:
|
|
1465
|
-
oxlintBin,
|
|
1466
|
-
"-c",
|
|
1477
|
+
args: oxlintUnusedArgs({
|
|
1467
1478
|
configPath,
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
],
|
|
1479
|
+
files,
|
|
1480
|
+
oxlintBin
|
|
1481
|
+
}),
|
|
1472
1482
|
command: "bun",
|
|
1473
1483
|
env: buildEnv(),
|
|
1474
1484
|
label: "oxlint-unused"
|
package/dist/eslint.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { E as TAILWIND_ENTRY_CANDIDATES, T as SHARED_OVERRIDE_SYMBOL_KEY, b as DEFAULT_SHARED_IGNORE_PATTERNS, c as findUnknownRules, d as normalizeObjectListInput, f as normalizePathListInput, g as warnToError, i as joinPath, l as isRecord, m as normalizeTailwindOption, p as normalizeRulesOffInput, r as isAbsolutePath, x as ESLINT_TEST_FILE_PATTERNS } from "./path-
|
|
1
|
+
import { E as TAILWIND_ENTRY_CANDIDATES, T as SHARED_OVERRIDE_SYMBOL_KEY, b as DEFAULT_SHARED_IGNORE_PATTERNS, c as findUnknownRules, d as normalizeObjectListInput, f as normalizePathListInput, g as warnToError, i as joinPath, l as isRecord, m as normalizeTailwindOption, p as normalizeRulesOffInput, r as isAbsolutePath, x as ESLINT_TEST_FILE_PATTERNS } from "./path-ylBxywIW.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,2 +1,2 @@
|
|
|
1
|
-
import { n as eslintImport, r as sync, t as defineConfig } from "./src-
|
|
1
|
+
import { n as eslintImport, r as sync, t as defineConfig } from "./src-wVKtpbf-.mjs";
|
|
2
2
|
export { defineConfig, eslintImport, sync };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as OXLINT_PATTERN_RULE_OVERRIDES, T as SHARED_OVERRIDE_SYMBOL_KEY, _ as BIOME_IGNORE_PATTERNS, a as assertJsonSerializable, b as DEFAULT_SHARED_IGNORE_PATTERNS, c as findUnknownRules, d as normalizeObjectListInput, f as normalizePathListInput, h as stripPluginNamespace, i as joinPath, l as isRecord, m as normalizeTailwindOption, n as fromFileUrl, o as assertObject, p as normalizeRulesOffInput, s as assertOptionalString, t as dirnamePath, u as normalizeIgnorePattern, v as BIOME_PATTERN_RULE_OVERRIDES, y as BIOME_RULES_OFF } from "./path-
|
|
1
|
+
import { C as OXLINT_PATTERN_RULE_OVERRIDES, T as SHARED_OVERRIDE_SYMBOL_KEY, _ as BIOME_IGNORE_PATTERNS, a as assertJsonSerializable, b as DEFAULT_SHARED_IGNORE_PATTERNS, c as findUnknownRules, d as normalizeObjectListInput, f as normalizePathListInput, h as stripPluginNamespace, i as joinPath, l as isRecord, m as normalizeTailwindOption, n as fromFileUrl, o as assertObject, p as normalizeRulesOffInput, s as assertOptionalString, t as dirnamePath, u as normalizeIgnorePattern, v as BIOME_PATTERN_RULE_OVERRIDES, y as BIOME_RULES_OFF } from "./path-ylBxywIW.mjs";
|
|
2
2
|
import { $, env as bunEnv, file, write } from "bun";
|
|
3
3
|
import { lstat } from "node:fs/promises";
|
|
4
4
|
import { join, relative } from "node:path";
|