@rdjperron/lint 0.3.0 → 0.5.0

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.
@@ -1 +1 @@
1
- {"version":3,"file":"verify.mjs","names":[],"sources":["../src/verify.ts"],"sourcesContent":["#!/usr/bin/env node\n/**\n * Proof that every lint rule still fires.\n *\n * The linter lives inside the `vp` binary, so it moves independently of any\n * lockfile, and the JS-plugin bridge it loads these rules through is alpha. A\n * rule can stop firing with no diff anywhere, and a dead lint rule is silent:\n * \"reports nothing\" looks exactly like \"no violations\". This is the thing that\n * notices.\n *\n * A suite is a directory holding one deliberately-broken `<rule>.fixture.ts(x)`\n * per rule. The check asserts a positive: every rule fired, each on the file\n * named after it.\n *\n * Run the package's own suite from a consumer's repo root:\n *\n * npx rdjperron-lint-verify\n *\n * ---------------------------------------------------------------------------\n * Why the symlink dance\n * ---------------------------------------------------------------------------\n * The fixtures ship inside `node_modules`, which oxlint never walks, and a\n * consumer's own fixture directories are usually in `lint.ignorePatterns` so a\n * plain `vp check` stays quiet. Measured on Vite+ 0.2.9 / oxlint 1.77.0 and\n * again on 0.3.1 / oxlint 1.81.0: no flag re-includes an ignored path.\n * `--no-ignore`, `--ignore-pattern '!<dir>/**'`, an explicit file, an absolute\n * path, a cwd inside the directory and `-W <rule>` all answer \"No files found\n * to lint.\" `--no-ignore` only disables `.eslintignore`, `--ignore-path` and\n * `--ignore-pattern`; it does not touch the config's own `ignorePatterns`, and\n * `vp lint` has no `--config` flag.\n *\n * What does work: oxlint matches ignore patterns against the path it walked,\n * not the realpath. Linting through a symlink outside the ignored prefix\n * reaches the fixtures normally, plugin and all. This creates that view per\n * suite, lints through it, and removes it in a `finally`.\n *\n * The severities cannot come from the command line either: `-A`, `-W` and `-D`\n * reach built-in rules only and leave every JS plugin rule exactly as the config\n * left it (measured on vite-plus 0.3.1 / oxlint 1.81.0, with `vp lint` and with\n * the bare binary). That is why the consumer's config must carry the\n * `fixtures()` override from `@rdjperron/lint/config`.\n */\n\nimport { spawnSync } from \"node:child_process\";\nimport {\n cpSync,\n existsSync,\n mkdirSync,\n readdirSync,\n rmdirSync,\n readFileSync,\n realpathSync,\n rmSync,\n symlinkSync,\n} from \"node:fs\";\nimport { createRequire } from \"node:module\";\nimport { dirname, join, resolve } from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\n\nexport interface Suite {\n /** The plugin alias the diagnostics carry, e.g. `rdjperron` in `rdjperron(no-reflect-get)`. */\n plugin: string;\n /** The fixture directory, relative to `root`. */\n fixtureDir: string;\n /** Where the un-ignored view is created, relative to `root`. */\n viewDir: string;\n /** Fixture file endings; the part before one of them is the rule name. */\n suffixes?: string[];\n /** Skip the direct path and always lint through the view (fixtures under `node_modules`). */\n alwaysView?: boolean;\n /** Advisory: the rule names the plugin registers, so a new rule without a fixture is named. */\n registeredRules?: () => Promise<string[] | null>;\n /** Where the failure message sends the reader. */\n readme?: string;\n}\n\nexport interface VerifyOptions {\n /** The repo root the paths are relative to and `vp lint` runs from. Defaults to the cwd. */\n root?: string;\n}\n\nconst DEFAULT_SUFFIXES = [\".fixture.ts\", \".fixture.tsx\"];\n\n/** Deterministic, locale-independent ordering for the rule and file name lists. */\nfunction byName(left: string, right: string): number {\n return left < right ? -1 : left > right ? 1 : 0;\n}\n\nfunction basename(path: string): string {\n const parts = path.split(/[\\\\/]/u);\n return parts[parts.length - 1] ?? path;\n}\n\n/**\n * Locate the `vp` binary: PATH first, then the default install locations, the\n * XDG layout used since Vite+ 0.3.0 and the pre-0.3.0 single-root layout that\n * upgraded installs keep.\n */\nexport function resolveViteplusBinary(): string {\n const probe = spawnSync(\"vp\", [\"--version\"], { encoding: \"utf8\" });\n if (probe.status === 0) return \"vp\";\n const home = process.env.HOME ?? \"\";\n const fallbacks = [\n join(home, \".local\", \"share\", \"vite-plus\", \"bin\", \"vp\"),\n join(home, \".vite-plus\", \"bin\", \"vp\"),\n ];\n const found = fallbacks.find((candidate) => existsSync(candidate));\n if (found !== undefined) return found;\n throw new Error(\n \"Could not find the `vp` binary. Add it to PATH: \" +\n 'export PATH=\"$HOME/.local/share/vite-plus/bin:$PATH\" (or \"$HOME/.vite-plus/bin\" for a pre-0.3.0 install)',\n );\n}\n\ninterface LintDiagnostic {\n code: string;\n filename: string;\n}\n\ninterface LintReport {\n numberOfFiles: number;\n diagnostics: LintDiagnostic[];\n}\n\n/** The two fields of oxlint's JSON report this reads, before any of them is trusted. */\ninterface RawReport {\n number_of_files?: unknown;\n diagnostics?: unknown;\n}\n\n/** The two fields of one raw diagnostic, before either of them is trusted. */\ninterface RawDiagnostic {\n code?: unknown;\n filename?: unknown;\n}\n\n/**\n * `vp lint -f json` is an outside value, so this is the one place its shape is\n * checked. Anything that does not look like a diagnostic is dropped rather than\n * guessed at.\n */\nfunction decodeReport(json: string): LintReport {\n const parsed: unknown = JSON.parse(json);\n if (typeof parsed !== \"object\" || parsed === null) {\n throw new Error(\"`vp lint -f json` did not return an object.\");\n }\n // SAFETY: the check above makes it a non-null object, and every field of\n // `RawReport` is `unknown`, so nothing is claimed about its contents yet.\n const report = parsed as RawReport;\n const numberOfFiles = typeof report.number_of_files === \"number\" ? report.number_of_files : 0;\n const rows = Array.isArray(report.diagnostics) ? report.diagnostics : [];\n const diagnostics: LintDiagnostic[] = [];\n for (const row of rows) {\n if (typeof row !== \"object\" || row === null) continue;\n // SAFETY: same check, one level down; both fields of `RawDiagnostic` are\n // `unknown` and each is typed by its own test on the next lines.\n const entry = row as RawDiagnostic;\n diagnostics.push({\n code: typeof entry.code === \"string\" ? entry.code : \"\",\n filename: typeof entry.filename === \"string\" ? entry.filename : \"\",\n });\n }\n return { numberOfFiles, diagnostics };\n}\n\n/** Run `vp lint <target> -f json` from `root` and return the decoded report. */\nfunction lintAsJson(binary: string, root: string, target: string): LintReport {\n const result = spawnSync(\n binary,\n [\"lint\", target, \"-f\", \"json\", \"--no-error-on-unmatched-pattern\"],\n {\n cwd: root,\n encoding: \"utf8\",\n maxBuffer: 64 * 1024 * 1024,\n },\n );\n\n if (result.error !== undefined && result.error !== null) throw result.error;\n\n // `--no-error-on-unmatched-pattern` keeps the \"No files found to lint.\" banner\n // off stdout, so stdout is pure JSON even when nothing matched.\n const stdout = result.stdout ?? \"\";\n const start = stdout.indexOf(\"{\");\n if (start === -1) {\n throw new Error(\n `\\`vp lint ${target} -f json\\` produced no JSON.\\nstdout: ${stdout}\\nstderr: ${result.stderr ?? \"\"}`,\n );\n }\n\n try {\n return decodeReport(stdout.slice(start));\n } catch (cause) {\n const reason = cause instanceof Error ? cause.message : String(cause);\n throw new Error(`Could not read \\`vp lint\\` JSON output: ${reason}\\nstdout: ${stdout}`, {\n cause,\n });\n }\n}\n\n/**\n * Why a path is gitignored, or null. oxlint honours `.gitignore`, so a\n * gitignored view yields \"0 files\" instead of a useful diagnostic.\n */\nfunction gitIgnoreReason(root: string, relPath: string): string | null {\n const result = spawnSync(\"git\", [\"check-ignore\", \"-v\", relPath], { cwd: root, encoding: \"utf8\" });\n const output = result.status === 0 ? result.stdout.trim() : \"\";\n return output === \"\" ? null : (output.split(\"\\t\")[0] ?? null);\n}\n\n/** Rule name to fixture file name, taken from the files that exist on disk. */\nfunction fixtureFiles(root: string, suite: Suite): Map<string, string> {\n const dir = join(root, suite.fixtureDir);\n if (!existsSync(dir)) throw new Error(`Fixture directory is missing: ${dir}`);\n const suffixes = suite.suffixes ?? DEFAULT_SUFFIXES;\n const files = new Map<string, string>();\n for (const name of readdirSync(dir).toSorted(byName)) {\n const suffix = suffixes.find((candidate) => name.endsWith(candidate));\n if (suffix === undefined) continue;\n files.set(name.slice(0, -suffix.length), name);\n }\n return files;\n}\n\n/** Create the un-ignored view; prefer a symlink, fall back to a copy on Windows. */\nfunction createFixtureView(root: string, suite: Suite): string {\n removeFixtureView(root, suite);\n const viewPath = join(root, suite.viewDir);\n mkdirSync(dirname(viewPath), { recursive: true });\n try {\n symlinkSync(join(root, suite.fixtureDir), viewPath, \"junction\");\n return \"symlink\";\n } catch {\n cpSync(join(root, suite.fixtureDir), viewPath, { recursive: true });\n return \"copy\";\n }\n}\n\nfunction removeFixtureView(root: string, suite: Suite): void {\n const viewPath = join(root, suite.viewDir);\n rmSync(viewPath, { recursive: true, force: true });\n // The parents were created for the view alone when nothing else lives there, so they go too.\n const top = resolve(root);\n for (let dir = dirname(viewPath); dir !== top; dir = dirname(dir)) {\n if (!existsSync(dir) || readdirSync(dir).length > 0) break;\n rmdirSync(dir);\n }\n}\n\n/** `rdjperron(no-reflect-get)` -> `no-reflect-get` for this suite's plugin; anything else -> null. */\nfunction ruleIdFor(plugin: string, code: string): string | null {\n const match = new RegExp(`^${plugin}\\\\(([^)]+)\\\\)$`, \"u\").exec(code);\n return match === null ? null : (match[1] ?? null);\n}\n\ninterface Row {\n rule: string;\n fixture: string;\n firedOnOwnFixture: boolean;\n note: string;\n}\n\n/** Lint one suite and print its table. Returns the number of rules that did not fire. */\nasync function verifySuite(binary: string, root: string, suite: Suite): Promise<number> {\n const files = fixtureFiles(root, suite);\n const expectedRules = [...files.keys()];\n\n console.log(`${suite.plugin} rule verification`);\n console.log(` fixtures: ${suite.fixtureDir}`);\n\n if (expectedRules.length === 0) {\n console.error(` No fixture files found in ${suite.fixtureDir}. Nothing to verify.\\n`);\n return 1;\n }\n\n // 1. Try the fixture directory directly. Works only while it is un-ignored, so\n // a suite under node_modules skips it: oxlint never walks in there.\n let mechanism = \"direct path\";\n let report: LintReport =\n suite.alwaysView === true\n ? { numberOfFiles: 0, diagnostics: [] }\n : lintAsJson(binary, root, suite.fixtureDir);\n\n // 2. Ignored by the config or under node_modules: lint through an un-ignored view.\n if (report.numberOfFiles === 0) {\n const kind = createFixtureView(root, suite);\n try {\n mechanism = `${kind} at ${suite.viewDir} (\\`${suite.fixtureDir}\\` is not walked by \\`vp lint\\`)`;\n report = lintAsJson(binary, root, suite.viewDir);\n } finally {\n // Never leave the view behind: a stale one would show up in `vp check`.\n removeFixtureView(root, suite);\n }\n }\n\n console.log(` lint via: ${mechanism}`);\n console.log(` files: ${report.numberOfFiles}`);\n console.log(\"\");\n\n if (report.numberOfFiles === 0) {\n const ignoredBy = gitIgnoreReason(root, suite.viewDir);\n console.error(\n \"FAIL: `vp lint` matched 0 files through both the direct path and the un-ignored view.\\n\" +\n (ignoredBy === null\n ? \"Check that the config ignores the fixture directory itself and not a pattern such as\\n\" +\n `\"**/*.fixture.ts\", which would also hide the view at \"${suite.viewDir}\".\\n` +\n \"Check too that the config carries the `fixtures()` override from @rdjperron/lint/config,\\n\" +\n \"on the view path: no command-line flag can switch a JS plugin rule on.\\n\"\n : `CAUSE: \"${suite.viewDir}\" is gitignored (${ignoredBy}). oxlint skips gitignored paths,\\n` +\n \"so the view this lints through is invisible to it. Remove that ignore rule; the view is\\n\" +\n \"deleted in a `finally` block anyway.\\n\"),\n );\n return expectedRules.length;\n }\n\n const firedByRule = new Map<string, Set<string>>();\n const foreignDiagnostics: LintDiagnostic[] = [];\n\n for (const diagnostic of report.diagnostics) {\n const ruleId = ruleIdFor(suite.plugin, diagnostic.code);\n if (ruleId === null) {\n foreignDiagnostics.push(diagnostic);\n continue;\n }\n const seen = firedByRule.get(ruleId) ?? new Set<string>();\n seen.add(basename(diagnostic.filename));\n firedByRule.set(ruleId, seen);\n }\n\n const rows: Row[] = expectedRules.map((rule) => {\n const seen = firedByRule.get(rule) ?? new Set<string>();\n const fixture = files.get(rule) ?? rule;\n const firedOnOwnFixture = seen.has(fixture);\n return {\n rule,\n fixture,\n firedOnOwnFixture,\n note: firedOnOwnFixture\n ? \"\"\n : seen.size > 0\n ? `fired only on: ${[...seen].toSorted(byName).join(\", \")}`\n : \"rule did not fire on any fixture\",\n };\n });\n\n const width = Math.max(...rows.map((row) => row.rule.length), 4);\n console.log(`${\"RULE\".padEnd(width)} RESULT FIXTURE`);\n console.log(`${\"-\".repeat(width)} ------ -------`);\n for (const row of rows) {\n const verdict = row.firedOnOwnFixture ? \"PASS \" : \"FAIL \";\n const suffix = row.note === \"\" ? \"\" : ` <-- ${row.note}`;\n console.log(`${row.rule.padEnd(width)} ${verdict} ${row.fixture}${suffix}`);\n }\n console.log(\"\");\n\n const failures = rows.filter((row) => !row.firedOnOwnFixture);\n console.log(\n `${rows.length - failures.length}/${rows.length} ${suite.plugin} rules fired on their own fixture.`,\n );\n\n // Advisory: a plugin bump that adds a rule should also add a fixture.\n const registered = suite.registeredRules === undefined ? null : await suite.registeredRules();\n if (registered !== null) {\n const missingFixture = registered.filter((rule) => !expectedRules.includes(rule));\n const orphanFixture = expectedRules.filter((rule) => !registered.includes(rule));\n if (missingFixture.length > 0) {\n console.log(\n `\\nWARN: registered by the ${suite.plugin} plugin but has no fixture: ${missingFixture.join(\", \")}`,\n );\n }\n if (orphanFixture.length > 0) {\n console.log(\n `\\nWARN: fixture exists but the ${suite.plugin} plugin registers no such rule: ${orphanFixture.join(\", \")}`,\n );\n }\n }\n\n // Advisory: fixtures are meant to trip exactly one rule each.\n if (foreignDiagnostics.length > 0) {\n console.log(\n `\\nWARN: ${foreignDiagnostics.length} non-${suite.plugin} diagnostic(s) in the fixtures:`,\n );\n for (const diagnostic of foreignDiagnostics.slice(0, 20)) {\n console.log(` ${basename(diagnostic.filename)}: ${diagnostic.code}`);\n }\n }\n\n if (failures.length > 0) {\n const where = suite.readme === undefined ? \"\" : ` See ${suite.readme}.`;\n console.error(\n `\\nFAIL: ${failures.length} ${suite.plugin} rule(s) did not fire.${where}\\n` +\n `First thing to check: the config's override on \"${suite.viewDir}\" has to put every rule\\n` +\n \"at error. For this plugin that override is `fixtures()` from @rdjperron/lint/config; no\\n\" +\n \"command-line flag can switch a JS plugin rule on.\",\n );\n }\n console.log(\"\");\n return failures.length;\n}\n\n/**\n * Lint every suite and print one table each. Returns the number of rules that\n * did not fire, so zero means every rule of every suite is alive.\n */\nexport async function verifySuites(suites: Suite[], options: VerifyOptions = {}): Promise<number> {\n const root = resolve(options.root ?? process.cwd());\n const binary = resolveViteplusBinary();\n let failures = 0;\n try {\n for (const suite of suites) {\n failures += await verifySuite(binary, root, suite);\n }\n } finally {\n for (const suite of suites) removeFixtureView(root, suite);\n }\n if (failures > 0) {\n console.error(`FAIL: ${failures} rule(s) did not fire across ${suites.length} suite(s).`);\n return failures;\n }\n console.log(\n `OK: every rule of every suite (${suites.map((suite) => suite.plugin).join(\", \")}) still fires.`,\n );\n return 0;\n}\n\nconst PLUGINS_PACKAGE = \"@oxlint/plugins\";\n\n/** What this needs from a `package.json`: its version, and what it says about the plugin API. */\ninterface Manifest {\n version: string;\n /** The `@oxlint/plugins` spec in `dependencies`, or \"\". */\n declaredPlugins: string;\n /** The `@oxlint/plugins` spec in `peerDependencies`, or \"\". */\n peerPlugins: string;\n}\n\n/** npm's manifest schema: both tables map a package name to a version spec. */\ninterface DependencyTable {\n [name: string]: string | undefined;\n}\n\ninterface RawManifest {\n version?: unknown;\n dependencies?: DependencyTable;\n peerDependencies?: DependencyTable;\n}\n\nfunction readManifest(path: string): Manifest {\n const parsed: unknown = JSON.parse(readFileSync(path, \"utf8\"));\n if (typeof parsed !== \"object\" || parsed === null) throw new Error(`Not a manifest: ${path}`);\n // SAFETY: the check above makes it a non-null object, and npm's own schema makes\n // both dependency tables name-to-spec; a package.json that breaks that is not\n // installable, and a non-string spec reaching here simply fails the comparisons.\n const entry = parsed as RawManifest;\n return {\n version: typeof entry.version === \"string\" ? entry.version : \"\",\n declaredPlugins: entry.dependencies?.[PLUGINS_PACKAGE] ?? \"\",\n peerPlugins: entry.peerDependencies?.[PLUGINS_PACKAGE] ?? \"\",\n };\n}\n\n/** The nearest `package.json` at or above a resolved module file. */\nfunction manifestNear(modulePath: string): string | null {\n let dir = dirname(modulePath);\n for (;;) {\n const candidate = join(dir, \"package.json\");\n if (existsSync(candidate)) return candidate;\n const parent = dirname(dir);\n if (parent === dir) return null;\n dir = parent;\n }\n}\n\n/** `^x.y.z` is satisfied by the same major, at or above the base. */\nfunction caretAccepts(range: string, version: string): boolean {\n const match = /^\\^(\\d+)\\.(\\d+)\\.(\\d+)$/u.exec(range);\n if (match === null) throw new Error(`Expected a caret range, got \"${range}\"`);\n const [major, minor, patch] = match.slice(1).map(Number);\n const [candidateMajor, candidateMinor, candidatePatch] = version.split(\".\").map(Number);\n if (candidateMajor !== major) return false;\n if (candidateMinor !== minor) return (candidateMinor ?? 0) > (minor ?? 0);\n return (candidatePatch ?? 0) >= (patch ?? 0);\n}\n\n/**\n * Two promises about the plugin API, held here as a failure instead.\n *\n * - the installed `@oxlint/plugins` is the exact version `vite-plus` declares;\n * - this package's peer range accepts that version.\n *\n * The rules import `@oxlint/plugins`, so the installed one must be the one the\n * linter was built against, or the rules compile against one plugin API and run\n * under another with no error anywhere. Returns the failures, empty when the\n * pins agree or when `vite-plus` is not installed (a consumer on another\n * toolchain has nothing to pin against).\n */\nexport function verifyPluginApiPin(root = process.cwd()): string[] {\n const requireFromRoot = createRequire(join(resolve(root), \"package.json\"));\n const requireFromHere = createRequire(import.meta.url);\n\n let vitePlus: Manifest;\n try {\n vitePlus = readManifest(requireFromRoot.resolve(\"vite-plus/package.json\"));\n } catch {\n console.log(\"plugin API pin: skipped, `vite-plus` is not installed here.\");\n return [];\n }\n\n const declared = vitePlus.declaredPlugins.replace(/^=/u, \"\");\n if (!/^\\d+\\.\\d+\\.\\d+$/u.test(declared)) {\n return [`vite-plus ${vitePlus.version} no longer declares an exact @oxlint/plugins version.`];\n }\n\n let installed: Manifest;\n try {\n const entry = requireFromRoot.resolve(\"@oxlint/plugins\");\n const manifest = manifestNear(entry);\n if (manifest === null) throw new Error(\"no package.json above @oxlint/plugins\");\n installed = readManifest(manifest);\n } catch {\n return [\"`@oxlint/plugins` is not installed. It is a peer dependency of @rdjperron/lint.\"];\n }\n\n const self = readManifest(requireFromHere.resolve(\"../package.json\"));\n const peer = self.peerPlugins;\n const failures: string[] = [];\n\n if (installed.version !== declared) {\n failures.push(\n `@oxlint/plugins ${installed.version} is installed and vite-plus ${vitePlus.version} declares ` +\n `${declared}. Move the pin: install @oxlint/plugins@${declared} exactly.`,\n );\n }\n if (!caretAccepts(peer, declared)) {\n failures.push(\n `@rdjperron/lint ${self.version} wants @oxlint/plugins ${peer} and vite-plus ${vitePlus.version} ` +\n `declares ${declared}. Move one of the two pins.`,\n );\n }\n if (failures.length === 0) {\n console.log(\n `plugin API pin: @oxlint/plugins ${installed.version}, what vite-plus ${vitePlus.version} declares.`,\n );\n }\n return failures;\n}\n\n/** The suite for this package's own fixtures, as they sit in a consumer's `node_modules`. */\nexport function packageSuite(root = process.cwd()): Suite {\n const packageDir = \"node_modules/@rdjperron/lint\";\n return {\n plugin: \"rdjperron\",\n fixtureDir: `${packageDir}/fixtures`,\n viewDir: \"scripts/.lint-fixtures/rdjperron\",\n alwaysView: true,\n readme: `${packageDir}/fixtures/README.md`,\n registeredRules: async () => {\n try {\n const requireFromRoot = createRequire(join(resolve(root), \"package.json\"));\n const loaded: unknown = await import(requireFromRoot.resolve(\"@rdjperron/lint\"));\n // SAFETY: the plugin's default export is the object oxlint loads; `rules` is\n // still `unknown` here and is checked on the next line.\n const module_ = loaded as { default?: { rules?: unknown } };\n const rules = module_.default?.rules;\n return typeof rules === \"object\" && rules !== null\n ? Object.keys(rules).toSorted(byName)\n : null;\n } catch {\n return null;\n }\n },\n };\n}\n\n/** The bin: this package's suite, plus the plugin API pin, from the consumer's repo root. */\nexport async function main(root = process.cwd()): Promise<number> {\n const pinFailures = verifyPluginApiPin(root);\n for (const failure of pinFailures) console.error(`FAIL: ${failure}`);\n console.log(\"\");\n const ruleFailures = await verifySuites([packageSuite(root)], { root });\n return pinFailures.length + ruleFailures > 0 ? 1 : 0;\n}\n\nconst invoked = process.argv[1];\nconst isBin =\n invoked !== undefined &&\n existsSync(invoked) &&\n realpathSync(invoked) === fileURLToPath(import.meta.url);\n\nif (isBin) {\n let exitCode = 1;\n try {\n exitCode = await main();\n } catch (error) {\n console.error(`\\nFAIL: ${error instanceof Error ? error.message : String(error)}`);\n }\n process.exit(exitCode);\n}\n"],"mappings":";;;;;;;;;;;;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CAAC,GAAG,EAAE,KAAK,CAAC;CACtE,OAAO,YAAY,SAAS,eAAe,IAAI,IAAI;AACrD;AAEA,MAAM,UAAU,QAAQ,KAAK;AAM7B,IAJE,YAAY,KAAA,KACZ,WAAW,OAAO,KAClB,aAAa,OAAO,MAAM,cAAc,YAAY,GAAG,GAE9C;CACT,IAAI,WAAW;CACf,IAAI;EACF,WAAW,MAAM,KAAK;CACxB,SAAS,OAAO;EACd,QAAQ,MAAM,WAAW,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,GAAG;CACnF;CACA,QAAQ,KAAK,QAAQ;AACvB"}
1
+ {"version":3,"file":"verify.mjs","names":[],"sources":["../src/verify.ts"],"sourcesContent":["#!/usr/bin/env node\n/**\n * Proof that every rule of this plugin still fires.\n *\n * A dead lint rule is silent: \"reports nothing\" reads exactly like \"no\n * violations\", so nothing else in a repo notices when a linter upgrade, a\n * JS-plugin API change or an ignore pattern takes a rule out. This lints one\n * deliberately-broken fixture per rule and asserts a positive: every rule fired,\n * each on the file named after it.\n *\n * It runs in a throwaway project under the system temp directory: its own\n * generated config with every rule at error, the shipped fixtures copied in, and\n * the caller's `node_modules` symlinked beside them. The caller's own config\n * takes no part, so the answer is about the plugin and the linter alone and a\n * consumer has nothing to write.\n *\n * The linter is the oxlint the LOCAL `vite-plus` depends on, so it follows the\n * lockfile rather than the `vp` on PATH (measured 2026-09-19: a global `vp`\n * 0.3.1 over a local `vite-plus` 0.2.9 ran oxlint 1.77.0). The run that earns\n * this check its place is therefore the commit that moves `vite-plus`, and CI.\n *\n * npx rdjperron-lint-verify\n */\n\nimport { spawnSync } from \"node:child_process\";\nimport {\n cpSync,\n existsSync,\n mkdtempSync,\n readdirSync,\n rmSync,\n symlinkSync,\n writeFileSync,\n} from \"node:fs\";\nimport { createRequire } from \"node:module\";\nimport { tmpdir } from \"node:os\";\nimport { join, resolve } from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\n\nimport { plugin, RULE_IDS } from \"./config.ts\";\n\nconst FIXTURE_SUFFIXES = [\".fixture.ts\", \".fixture.tsx\"];\n\n/** Relative to this module, so it resolves from `dist/verify.mjs` and from `src/verify.ts` alike. */\nconst FIXTURES_DIR = fileURLToPath(new URL(\"../fixtures\", import.meta.url));\n\n/** Deterministic, locale-independent ordering for the rule and file name lists. */\nfunction byName(left: string, right: string): number {\n return left < right ? -1 : left > right ? 1 : 0;\n}\n\nfunction basename(path: string): string {\n const parts = path.split(/[\\\\/]/u);\n return parts[parts.length - 1] ?? path;\n}\n\n/**\n * Locate the `vp` binary: PATH first, then the default install locations, the\n * XDG layout used since Vite+ 0.3.0 and the pre-0.3.0 single-root layout that\n * upgraded installs keep.\n */\nfunction resolveViteplusBinary(): string {\n const probe = spawnSync(\"vp\", [\"--version\"], { encoding: \"utf8\" });\n if (probe.status === 0) return \"vp\";\n const home = process.env.HOME ?? \"\";\n const fallbacks = [\n join(home, \".local\", \"share\", \"vite-plus\", \"bin\", \"vp\"),\n join(home, \".vite-plus\", \"bin\", \"vp\"),\n ];\n const found = fallbacks.find((candidate) => existsSync(candidate));\n if (found !== undefined) return found;\n throw new Error(\n \"Could not find the `vp` binary. Add it to PATH: \" +\n 'export PATH=\"$HOME/.local/share/vite-plus/bin:$PATH\" (or \"$HOME/.vite-plus/bin\" for a pre-0.3.0 install)',\n );\n}\n\n/** The `vite-plus` whose oxlint will run, and the `node_modules` the project borrows. */\nfunction resolveConsumerModules(root: string): string {\n const modules = join(root, \"node_modules\");\n if (!existsSync(modules)) {\n throw new Error(`No node_modules in ${root}. Install the dependencies and run this again.`);\n }\n try {\n createRequire(join(root, \"package.json\")).resolve(\"vite-plus/package.json\");\n } catch {\n throw new Error(\n `\\`vite-plus\\` is not installed in ${root}. The linter this check runs is the oxlint the ` +\n \"local `vite-plus` depends on, so without it there is nothing to prove the rules against.\",\n );\n }\n return modules;\n}\n\ninterface LintDiagnostic {\n code: string;\n filename: string;\n}\n\ninterface LintReport {\n numberOfFiles: number;\n diagnostics: LintDiagnostic[];\n}\n\n/** The two fields of oxlint's JSON report this reads, before any of them is trusted. */\ninterface RawReport {\n number_of_files?: unknown;\n diagnostics?: unknown;\n}\n\n/** The two fields of one raw diagnostic, before either of them is trusted. */\ninterface RawDiagnostic {\n code?: unknown;\n filename?: unknown;\n}\n\n/**\n * `vp lint -f json` is an outside value, so this is the one place its shape is\n * checked. Anything that does not look like a diagnostic is dropped rather than\n * guessed at.\n */\nfunction decodeReport(json: string): LintReport {\n const parsed: unknown = JSON.parse(json);\n if (typeof parsed !== \"object\" || parsed === null) {\n throw new Error(\"`vp lint -f json` did not return an object.\");\n }\n // SAFETY: the check above makes it a non-null object, and every field of\n // `RawReport` is `unknown`, so nothing is claimed about its contents yet.\n const report = parsed as RawReport;\n const numberOfFiles = typeof report.number_of_files === \"number\" ? report.number_of_files : 0;\n const rows = Array.isArray(report.diagnostics) ? report.diagnostics : [];\n const diagnostics: LintDiagnostic[] = [];\n for (const row of rows) {\n if (typeof row !== \"object\" || row === null) continue;\n // SAFETY: same check, one level down; both fields of `RawDiagnostic` are\n // `unknown` and each is typed by its own test on the next lines.\n const entry = row as RawDiagnostic;\n diagnostics.push({\n code: typeof entry.code === \"string\" ? entry.code : \"\",\n filename: typeof entry.filename === \"string\" ? entry.filename : \"\",\n });\n }\n return { numberOfFiles, diagnostics };\n}\n\n/** Run `vp lint <target> -f json` from `cwd` and return the decoded report. */\nfunction lintAsJson(binary: string, cwd: string, target: string): LintReport {\n const result = spawnSync(\n binary,\n [\"lint\", target, \"-f\", \"json\", \"--no-error-on-unmatched-pattern\"],\n { cwd, encoding: \"utf8\", maxBuffer: 64 * 1024 * 1024 },\n );\n\n if (result.error !== undefined && result.error !== null) throw result.error;\n\n // `--no-error-on-unmatched-pattern` keeps the \"No files found to lint.\" banner\n // off stdout, so stdout is pure JSON even when nothing matched.\n const stdout = result.stdout ?? \"\";\n const start = stdout.indexOf(\"{\");\n if (start === -1) {\n throw new Error(\n `\\`vp lint ${target} -f json\\` produced no JSON.\\nstdout: ${stdout}\\nstderr: ${result.stderr ?? \"\"}`,\n );\n }\n\n try {\n return decodeReport(stdout.slice(start));\n } catch (cause) {\n const reason = cause instanceof Error ? cause.message : String(cause);\n throw new Error(`Could not read \\`vp lint\\` JSON output: ${reason}\\nstdout: ${stdout}`, {\n cause,\n });\n }\n}\n\n/** Rule name to fixture file name, taken from the files that ship with the package. */\nfunction fixtureFiles(): Map<string, string> {\n if (!existsSync(FIXTURES_DIR)) throw new Error(`Fixture directory is missing: ${FIXTURES_DIR}`);\n const files = new Map<string, string>();\n for (const name of readdirSync(FIXTURES_DIR).toSorted(byName)) {\n const suffix = FIXTURE_SUFFIXES.find((candidate) => name.endsWith(candidate));\n if (suffix === undefined) continue;\n files.set(name.slice(0, -suffix.length), name);\n }\n return files;\n}\n\n/** The throwaway project: a config naming every rule at error, the fixtures, and the modules. */\nfunction createProject(modules: string, specifier: string): string {\n const dir = mkdtempSync(join(tmpdir(), \"rdjperron-lint-verify-\"));\n const rules = Object.fromEntries(RULE_IDS.map((id) => [id, \"error\"]));\n writeFileSync(\n join(dir, \"package.json\"),\n `${JSON.stringify({ name: \"rdjperron-lint-verify\", private: true, type: \"module\" }, null, 2)}\\n`,\n );\n writeFileSync(\n join(dir, \"vite.config.ts\"),\n [\n `import { defineConfig } from \"vite-plus\";`,\n ``,\n `export default defineConfig({`,\n ` lint: {`,\n ` plugins: [],`,\n ` jsPlugins: [${JSON.stringify({ name: plugin.name, specifier })}],`,\n ` rules: ${JSON.stringify(rules, null, 2).replaceAll(\"\\n\", \"\\n \")},`,\n ` },`,\n `});`,\n ``,\n ].join(\"\\n\"),\n );\n cpSync(FIXTURES_DIR, join(dir, \"fixtures\"), { recursive: true });\n // A junction is the one link Windows takes for node_modules, and copying it is out of the question.\n symlinkSync(modules, join(dir, \"node_modules\"), \"junction\");\n return dir;\n}\n\n/** `rdjperron(no-reflect-get)` -> `no-reflect-get`; a diagnostic from anything else -> null. */\nfunction ruleIdFor(code: string): string | null {\n const match = new RegExp(`^${plugin.name}\\\\(([^)]+)\\\\)$`, \"u\").exec(code);\n return match === null ? null : (match[1] ?? null);\n}\n\n/** The rule names the loaded plugin registers, or null when it cannot be imported. */\nasync function registeredRules(specifier: string): Promise<string[] | null> {\n try {\n const loaded: unknown = await import(specifier);\n // SAFETY: the plugin's default export is the object oxlint loads; `rules` is\n // still `unknown` here and is checked on the next line.\n const module_ = loaded as { default?: { rules?: unknown } };\n const rules = module_.default?.rules;\n return typeof rules === \"object\" && rules !== null ? Object.keys(rules).toSorted(byName) : null;\n } catch {\n return null;\n }\n}\n\ninterface Row {\n rule: string;\n fixture: string;\n firedOnOwnFixture: boolean;\n note: string;\n}\n\n/** `--plugin <path>` points the run at a plugin on disk, which is how this repo checks its source. */\nfunction pluginSpecifier(argv: string[]): string {\n const index = argv.indexOf(\"--plugin\");\n if (index === -1) return plugin.specifier;\n const value = argv[index + 1];\n if (value === undefined) throw new Error(\"`--plugin` needs a path to the plugin module.\");\n return resolve(value);\n}\n\nasync function main(argv: string[]): Promise<number> {\n const specifier = pluginSpecifier(argv);\n const binary = resolveViteplusBinary();\n const modules = resolveConsumerModules(process.cwd());\n const files = fixtureFiles();\n const expectedRules = [...files.keys()];\n\n console.log(`${plugin.name} rule verification`);\n console.log(` plugin: ${specifier}`);\n console.log(` fixtures: ${FIXTURES_DIR}`);\n\n if (expectedRules.length === 0) {\n console.error(` No fixture files in ${FIXTURES_DIR}. Nothing to verify.\\n`);\n return 1;\n }\n\n const project = createProject(modules, specifier);\n let report: LintReport;\n try {\n console.log(` project: ${project}`);\n report = lintAsJson(binary, project, \"fixtures\");\n } finally {\n rmSync(project, { recursive: true, force: true });\n }\n\n console.log(` files: ${report.numberOfFiles}\\n`);\n\n if (report.numberOfFiles === 0) {\n console.error(\n \"FAIL: `vp lint` matched none of the fixtures in the throwaway project.\\n\" +\n \"Nothing there is ignored and the fixtures are copied in, so this is `vp lint` refusing\\n\" +\n \"the generated config rather than a rule going quiet.\\n\",\n );\n return expectedRules.length;\n }\n\n const firedByRule = new Map<string, Set<string>>();\n const foreignDiagnostics: LintDiagnostic[] = [];\n\n for (const diagnostic of report.diagnostics) {\n const ruleId = ruleIdFor(diagnostic.code);\n if (ruleId === null) {\n foreignDiagnostics.push(diagnostic);\n continue;\n }\n const seen = firedByRule.get(ruleId) ?? new Set<string>();\n seen.add(basename(diagnostic.filename));\n firedByRule.set(ruleId, seen);\n }\n\n const rows: Row[] = expectedRules.map((rule) => {\n const seen = firedByRule.get(rule) ?? new Set<string>();\n const fixture = files.get(rule) ?? rule;\n const firedOnOwnFixture = seen.has(fixture);\n return {\n rule,\n fixture,\n firedOnOwnFixture,\n note: firedOnOwnFixture\n ? \"\"\n : seen.size > 0\n ? `fired only on: ${[...seen].toSorted(byName).join(\", \")}`\n : \"rule did not fire on any fixture\",\n };\n });\n\n const width = Math.max(...rows.map((row) => row.rule.length), 4);\n console.log(`${\"RULE\".padEnd(width)} RESULT FIXTURE`);\n console.log(`${\"-\".repeat(width)} ------ -------`);\n for (const row of rows) {\n const verdict = row.firedOnOwnFixture ? \"PASS \" : \"FAIL \";\n const suffix = row.note === \"\" ? \"\" : ` <-- ${row.note}`;\n console.log(`${row.rule.padEnd(width)} ${verdict} ${row.fixture}${suffix}`);\n }\n console.log(\"\");\n\n const failures = rows.filter((row) => !row.firedOnOwnFixture);\n console.log(\n `${rows.length - failures.length}/${rows.length} ${plugin.name} rules fired on their own fixture.`,\n );\n\n // Advisory: a release that adds a rule should also add a fixture.\n const registered = await registeredRules(specifier);\n if (registered !== null) {\n const missingFixture = registered.filter((rule) => !expectedRules.includes(rule));\n const orphanFixture = expectedRules.filter((rule) => !registered.includes(rule));\n if (missingFixture.length > 0) {\n console.log(\n `\\nWARN: registered by the ${plugin.name} plugin but has no fixture: ${missingFixture.join(\", \")}`,\n );\n }\n if (orphanFixture.length > 0) {\n console.log(\n `\\nWARN: fixture exists but the ${plugin.name} plugin registers no such rule: ${orphanFixture.join(\", \")}`,\n );\n }\n }\n\n // Advisory: fixtures are meant to trip exactly one rule each.\n if (foreignDiagnostics.length > 0) {\n console.log(\n `\\nWARN: ${foreignDiagnostics.length} non-${plugin.name} diagnostic(s) in the fixtures:`,\n );\n for (const diagnostic of foreignDiagnostics.slice(0, 20)) {\n console.log(` ${basename(diagnostic.filename)}: ${diagnostic.code}`);\n }\n }\n\n if (failures.length > 0) {\n console.error(\n `\\nFAIL: ${failures.length} ${plugin.name} rule(s) did not fire. See ${join(FIXTURES_DIR, \"README.md\")}.\\n` +\n \"Every rule was at error in the generated config, so a rule that stayed quiet is one this\\n\" +\n \"linter did not run, not one this config left off.\",\n );\n return failures.length;\n }\n\n console.log(`\\nOK: every ${plugin.name} rule still fires.`);\n return 0;\n}\n\nlet exitCode = 1;\ntry {\n exitCode = await main(process.argv.slice(2));\n} catch (error) {\n console.error(`\\nFAIL: ${error instanceof Error ? error.message : String(error)}`);\n}\nprocess.exit(exitCode === 0 ? 0 : 1);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyCA,MAAM,mBAAmB,CAAC,eAAe,cAAc;;AAGvD,MAAM,eAAe,cAAc,IAAI,IAAI,eAAe,YAAY,GAAG,CAAC;;AAG1E,SAAS,OAAO,MAAc,OAAuB;CACnD,OAAO,OAAO,QAAQ,KAAK,OAAO,QAAQ,IAAI;AAChD;AAEA,SAAS,SAAS,MAAsB;CACtC,MAAM,QAAQ,KAAK,MAAM,QAAQ;CACjC,OAAO,MAAM,MAAM,SAAS,MAAM;AACpC;;;;;;AAOA,SAAS,wBAAgC;CAEvC,IADc,UAAU,MAAM,CAAC,WAAW,GAAG,EAAE,UAAU,OAAO,CACxD,CAAC,CAAC,WAAW,GAAG,OAAO;CAC/B,MAAM,OAAO,QAAQ,IAAI,QAAQ;CAKjC,MAAM,QAAQ,CAHZ,KAAK,MAAM,UAAU,SAAS,aAAa,OAAO,IAAI,GACtD,KAAK,MAAM,cAAc,OAAO,IAAI,CAEhB,CAAC,CAAC,MAAM,cAAc,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7C,SAAS,OAAO;CACd,QAAQ,MAAM,WAAW,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,GAAG;AACnF;AACA,QAAQ,KAAK,aAAa,IAAI,IAAI,CAAC"}
@@ -8,10 +8,9 @@ fire through its own linter, not ours.
8
8
 
9
9
  ## Why this exists
10
10
 
11
- The linter lives inside the consumer's toolchain (under Vite+, inside the `vp` binary) and moves
12
- independently of any lockfile. The rules run through oxlint's JS-plugin bridge. A rule can stop
13
- firing with no diff anywhere: after a linter upgrade, after a plugin API skew, after an ignore
14
- pattern swallows the wrong path.
11
+ The linter is the oxlint the consumer's local `vite-plus` depends on, so it moves with that
12
+ lockfile, and the rules run through oxlint's JS-plugin bridge. A rule can stop firing with no diff
13
+ anywhere, after a linter upgrade or a change in the bridge.
15
14
 
16
15
  And a dead lint rule is silent. "Rule reports nothing" looks identical to "code has no
17
16
  violations". Nothing else would notice.
@@ -25,8 +24,8 @@ Two layers, different questions:
25
24
 
26
25
  | Layer | Question it answers | Where |
27
26
  | --------------------------- | ------------------------------------------------------------------------------------------------ | -------------------------------------- |
28
- | This directory + the verify command | Does each rule fire through the real pipeline: the bundled oxlint, the `jsPlugins` wiring, the actual config? | `fixtures/`, `rdjperron-lint-verify` |
29
- | Unit tests (RuleTester) | Is each rule's logic right? Valid cases stay quiet, invalid cases report, with per-case precision. | `tests/` in the source repo (not published) |
27
+ | This directory + the verify command | Does each rule fire through the real pipeline: the oxlint this repo's `vite-plus` declares, and the `jsPlugins` wiring? | `fixtures/`, `rdjperron-lint-verify` |
28
+ | Unit tests (RuleTester) | Is each rule's logic right? Valid cases stay quiet, invalid cases report, with per-case precision. | `tests/` in this package's repo (not published) |
30
29
 
31
30
  The unit tests catch a locally edited rule that starts over- or under-firing. This layer catches
32
31
  the rule not running at all. Both are needed.
@@ -35,28 +34,22 @@ the rule not running at all. Both are needed.
35
34
 
36
35
  - Do not delete or "clean up" these files. They are the regression proof for rules nobody
37
36
  upstream maintains for us.
38
- - The consumer's config must carry the `fixtures()` override from `@rdjperron/lint/config`, which
39
- puts every rule at `error` on the view path. No command-line flag can do it: `-A`, `-W` and `-D`
40
- reach built-in rules only and leave a JS plugin rule exactly as the config left it.
41
- - The fixtures sit under `node_modules`, which oxlint never walks, so the check lints them through
42
- a transient symlink at `scripts/.lint-fixtures/rdjperron`. In the source repo they are also in
43
- `lint.ignorePatterns` and `fmt.ignorePatterns`, so a plain `vp check` stays quiet; no `vp lint`
44
- flag re-includes a config-ignored path.
45
- - Never gitignore that view. oxlint honours `.gitignore`, so gitignoring anything on the
46
- verification path silently disables the whole check (this happened once; the check now detects
47
- it with `git check-ignore` and says so).
37
+ - The check copies them into a throwaway project under the system temp directory, beside a config it
38
+ generates with every rule at `error`. That config is not optional: `-A`, `-W` and `-D` reach
39
+ built-in rules only and leave a JS plugin rule exactly as the config left it.
40
+ - Nothing about the consumer's repo takes part, so there is no path to keep un-ignored and no
41
+ override to write. In this package's repo the fixtures are in `lint.ignorePatterns` and
42
+ `fmt.ignorePatterns`, so a plain `vp check` stays quiet.
48
43
  - Name fixtures `*.fixture.ts` / `*.fixture.tsx`, never `*.test.ts`, or Vitest collects them and
49
44
  the deliberately broken code fails the test run.
50
45
  - One rule per file. A fixture that trips two rules makes the per-rule assertion ambiguous.
51
- - Expected advisory noise: a type-aware pass also reports `typescript(TS…)` on the view, because
52
- no tsconfig covers it (no React types, no `process` types, no `jsx` setting). Those are listed
53
- as non-plugin diagnostics rather than hidden; only a plugin rule that did not fire fails the run.
46
+ - The generated config sets `plugins: []` and no type checking, so a clean run prints no advisory
47
+ diagnostics at all. Anything under the non-plugin heading means a fixture picked up a second
48
+ finding.
54
49
 
55
50
  ## When a rule stops firing after a `vp` upgrade
56
51
 
57
- 1. `vp toolchain oxlint`: did the bundled oxlint move?
58
- 2. `vp why @oxlint/plugins`: if `vite-plus` now declares a different version, move the exact
59
- pin to it and reinstall. `rdjperron-lint-verify` fails on that skew before it reaches the rules.
60
- 3. Re-run the check.
61
- 4. Still dead? The rule's AST expectations may have changed under the new oxc version. Read the
52
+ 1. `vp toolchain oxlint`: did the oxlint your `vite-plus` declares move?
53
+ 2. Re-run the check, and read which rules failed rather than which one you noticed.
54
+ 3. Still dead? The rule's AST expectations may have changed under the new oxc version. Read the
62
55
  rule in `src/rules/` or `src/anti-slop/rules/`, fix it, add the case to `tests/`, and release.
package/package.json CHANGED
@@ -1,8 +1,12 @@
1
1
  {
2
2
  "name": "@rdjperron/lint",
3
- "version": "0.3.0",
3
+ "version": "0.5.0",
4
4
  "description": "One Oxlint JS plugin, `rdjperron`: 20 rules against low-evidence code, with the config data, the fixture that proves each rule fires, and the command that checks it.",
5
5
  "license": "MIT",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/rdjperron/lint.git"
9
+ },
6
10
  "bin": {
7
11
  "rdjperron-lint-verify": "dist/verify.mjs"
8
12
  },
@@ -22,29 +26,34 @@
22
26
  "types": "./dist/config.d.mts",
23
27
  "default": "./dist/config.mjs"
24
28
  },
25
- "./verify": {
26
- "types": "./dist/verify.d.mts",
27
- "default": "./dist/verify.mjs"
28
- },
29
- "./fixtures/*": "./fixtures/*",
30
29
  "./package.json": "./package.json"
31
30
  },
32
- "scripts": {
33
- "build": "vp pack",
34
- "test": "vp test",
35
- "check": "vp check"
31
+ "dependencies": {
32
+ "@oxlint/plugins": "^1.79.0"
36
33
  },
37
34
  "devDependencies": {
38
- "@oxlint/plugins": "catalog:",
39
- "@types/node": "catalog:",
40
- "typescript": "catalog:",
41
- "vite": "catalog:",
42
- "vite-plus": "catalog:"
35
+ "@types/node": "^24",
36
+ "typescript": "^7.0.2",
37
+ "vite": "npm:@voidzero-dev/vite-plus-core@0.3.1",
38
+ "vite-plus": "0.3.1"
43
39
  },
44
40
  "peerDependencies": {
45
- "@oxlint/plugins": "^1.79.0"
41
+ "vite-plus": ">=0.3.0"
42
+ },
43
+ "peerDependenciesMeta": {
44
+ "vite-plus": {
45
+ "optional": true
46
+ }
46
47
  },
47
48
  "engines": {
48
49
  "node": ">=24"
50
+ },
51
+ "scripts": {
52
+ "build": "vp pack",
53
+ "test": "vp test",
54
+ "check": "vp check",
55
+ "typecheck": "tsc --noEmit",
56
+ "verify:lint-fixtures": "node src/verify.ts --plugin ./src/index.ts",
57
+ "ready": "vp check && vp test && vp run typecheck && vp run build && vp run verify:lint-fixtures && vp pm pack -- --dry-run"
49
58
  }
50
- }
59
+ }
@@ -1 +0,0 @@
1
- {"version":3,"file":"config.mjs","names":[],"sources":["../src/config.ts"],"sourcesContent":["/**\n * Config data for a consumer's `vite.config.ts` (or `.oxlintrc.ts`).\n *\n * The types below are declared locally rather than imported from `oxlint`:\n * `oxlint` is never a dependency of this package (`vp migrate` strips one, and a\n * direct dependency installs a second linter beside the Vite+ IDE stub), and a\n * consumer that installs only `vite-plus` and `@oxlint/plugins` has no\n * guaranteed path to oxlint's own `.d.ts`. They are structurally compatible with\n * `OxlintConfig` and `OxlintOverride`, checked by a consumer-shaped config in\n * `tests/config.test.ts`: arrays are mutable (oxlint's are), and `plugins` is\n * oxlint's own literal union, because a bare `string[]` is not assignable to it.\n */\n\n/** A severity as oxlint spells it in a config; the numeric forms are not used here. */\ntype Severity = \"off\" | \"warn\" | \"error\";\n\n/** A rule entry: a severity, or a severity followed by the rule's own options. */\ntype RuleEntry = Severity | [Severity, ...unknown[]];\n\ninterface Rules {\n [ruleId: string]: RuleEntry;\n}\n\n/** oxlint's built-in plugins, the values its `plugins` field accepts. */\ntype BuiltinPlugin =\n | \"eslint\"\n | \"import\"\n | \"jest\"\n | \"jsdoc\"\n | \"jsx-a11y\"\n | \"nextjs\"\n | \"node\"\n | \"oxc\"\n | \"promise\"\n | \"react\"\n | \"react-perf\"\n | \"typescript\"\n | \"unicorn\"\n | \"vitest\"\n | \"vue\";\n\ninterface JsPlugin {\n name: string;\n specifier: string;\n}\n\nexport interface Override {\n files: string[];\n excludeFiles?: string[];\n plugins?: BuiltinPlugin[];\n env?: { [name: string]: boolean };\n jsPlugins?: JsPlugin[];\n rules?: Rules;\n}\n\nexport interface Config {\n jsPlugins?: JsPlugin[];\n rules?: Rules;\n overrides?: Override[];\n}\n\n/**\n * The plugin entry. The alias is `rdjperron`, which is also the prefix in every\n * diagnostic and every disable comment, so a consumer that renames it renames\n * its own rule keys too.\n */\nexport const plugin: JsPlugin = { name: \"rdjperron\", specifier: \"@rdjperron/lint\" };\n\n/** Every rule the plugin registers, prefixed. `fixtures()` and the verify bin read this list. */\nexport const RULE_IDS = [\n \"rdjperron/no-array-filter-map\",\n \"rdjperron/no-chained-type-assertions\",\n \"rdjperron/no-conditional-empty-object-spread\",\n \"rdjperron/no-hardcoded-jsx-text\",\n \"rdjperron/no-known-value-widening\",\n \"rdjperron/no-module-mocking\",\n \"rdjperron/no-object-parameters\",\n \"rdjperron/no-reduce-accumulator-copy\",\n \"rdjperron/no-reflect-apply\",\n \"rdjperron/no-reflect-get\",\n \"rdjperron/no-runtime-typeof\",\n \"rdjperron/no-shape-in-symbol-names\",\n \"rdjperron/no-unknown-parameters\",\n \"rdjperron/no-unknown-returns\",\n \"rdjperron/no-unknown-type-aliases\",\n \"rdjperron/no-unsafe-dictionary-type\",\n \"rdjperron/no-use-effect\",\n \"rdjperron/no-widen-then-assert\",\n \"rdjperron/require-safety-comment-for-type-assertion\",\n \"rdjperron/static-public-env\",\n] as const;\n\nexport type RuleId = (typeof RULE_IDS)[number];\n\n/**\n * The base config, for `lint: { extends: [recommended] }`.\n *\n * Measured through `extends` on vite-plus 0.3.1 / oxlint 1.81.0 (2026-09-17):\n * `jsPlugins`, `rules`, `overrides`, `plugins`, `categories` and `options` are\n * inherited by the consumer's config, and the consumer's own entries win.\n * `env`, `settings` and `ignorePatterns` are not inherited, which is why this\n * object carries none of them and the consumer keeps writing its own.\n */\nexport const recommended: Config = {\n jsPlugins: [plugin],\n rules: {\n // The anti-slop rules. Measured on stack-lab 2026-08-20 and 2026-09-13, and\n // on rummy 2026-09-16 (vite-plus 0.3.1, oxlint 1.81.0): on real hand-written\n // code they fire only on the patterns they exist to reject, so a hit is the\n // finding. Land a new one at `warn` in the consumer, fix or scope what\n // fires, then let this default take over.\n \"rdjperron/no-array-filter-map\": \"error\",\n \"rdjperron/no-chained-type-assertions\": \"error\",\n \"rdjperron/no-conditional-empty-object-spread\": \"error\",\n \"rdjperron/no-known-value-widening\": \"error\",\n \"rdjperron/no-module-mocking\": \"error\",\n \"rdjperron/no-object-parameters\": \"error\",\n \"rdjperron/no-reduce-accumulator-copy\": \"error\",\n \"rdjperron/no-reflect-apply\": \"error\",\n \"rdjperron/no-reflect-get\": \"error\",\n // A `typeof` inside a type predicate is the decode the rule asks for, named\n // and reusable, and the pack already exempts a predicate's subject from\n // `no-unknown-parameters` (rummy, 2026-09-16).\n \"rdjperron/no-runtime-typeof\": [\"error\", { allowInTypeGuards: true }],\n \"rdjperron/no-shape-in-symbol-names\": \"error\",\n \"rdjperron/no-unknown-parameters\": \"error\",\n \"rdjperron/no-unknown-returns\": \"error\",\n \"rdjperron/no-unknown-type-aliases\": \"error\",\n \"rdjperron/no-unsafe-dictionary-type\": \"error\",\n \"rdjperron/no-widen-then-assert\": \"error\",\n \"rdjperron/require-safety-comment-for-type-assertion\": \"error\",\n // Derived state, event handlers and a reactive query cover every case; the\n // one sanctioned wrapper is named through `react(files, { useEffectAllowedIn })`.\n \"rdjperron/no-use-effect\": \"error\",\n\n // `no-hardcoded-jsx-text` and `static-public-env` are absent on purpose:\n // they belong to a translated app and to an Expo app. `i18n()` and `expo()`\n // switch them on for the files that want them.\n\n // Type-aware rules; they need `options.typeAware` in the consumer's config.\n \"typescript/no-floating-promises\": \"error\",\n \"typescript/no-misused-promises\": \"error\",\n \"typescript/await-thenable\": \"error\",\n // Measured on rummy 2026-09-16 before the cleanup: 5, 5 and 1 hits, zero after.\n \"typescript/no-unnecessary-type-assertion\": \"error\",\n \"typescript/no-misused-spread\": \"error\",\n \"typescript/require-array-sort-compare\": \"error\",\n \"typescript/no-explicit-any\": \"warn\",\n\n \"prefer-const\": [\"error\", { destructuring: \"all\" }],\n \"no-unused-vars\": [\"error\", { argsIgnorePattern: \"^_\", varsIgnorePattern: \"^_\" }],\n // oxlint 1.77 moved this into `suspicious`, where it contradicts the `^_`\n // convention above. The prefix wins.\n \"no-underscore-dangle\": \"off\",\n eqeqeq: [\"error\", \"always\", { null: \"ignore\" }],\n\n // Deliberate off-switches, held by both consumers since the 2026-08-20 setup.\n \"typescript/no-unsafe-type-assertion\": \"off\",\n \"no-await-in-loop\": \"off\",\n \"unicorn/consistent-function-scoping\": \"off\",\n \"promise/always-return\": \"off\",\n },\n};\n\nexport interface ReactOptions {\n /**\n * The globals these files run with, as oxlint's `env`, defaulting to\n * `{ browser: true }`. A React Native app has no DOM: oxlint ships no\n * `react-native` environment, and `{ \"shared-node-browser\": true }` is the\n * closest one, the timers and the console both runtimes agree on.\n */\n env?: { [name: string]: boolean };\n /**\n * The one file allowed to call `useEffect`, as a path. Its name goes into the\n * `no-use-effect` hint for every React file, and the rule is off for it.\n */\n useEffectAllowedIn?: string;\n}\n\n/**\n * The React file set: the globals, the hooks rules, and the compiler's own\n * judgement. A consumer appends its own entries after these, because an override\n * that changes a `react/*` rule must repeat `plugins: [\"react\"]` or oxlint\n * silently drops the entry.\n */\nexport function react(files: string[], options: ReactOptions = {}): Override[] {\n const { env = { browser: true }, useEffectAllowedIn } = options;\n const rules: Rules = {\n \"react/rules-of-hooks\": \"error\",\n \"react/exhaustive-deps\": \"warn\",\n // React 19 and the automatic JSX runtime: nothing has to be in scope.\n \"react/react-in-jsx-scope\": \"off\",\n // The React Compiler's own rules: a component it silently skips is a\n // component that never memoizes.\n \"react/immutability\": \"error\",\n \"react/refs\": \"error\",\n \"react/purity\": \"error\",\n // A module that exports only components refreshes in place; any other\n // export re-runs every importer.\n \"react/only-export-components\": \"error\",\n };\n const overrides: Override[] = [{ files, plugins: [\"react\"], env, rules }];\n\n if (useEffectAllowedIn !== undefined) {\n rules[\"rdjperron/no-use-effect\"] = [\n \"error\",\n { hint: `The one sanctioned wrapper is ${useEffectAllowedIn}.` },\n ];\n overrides.push({\n // The sanctioned wrapper exists precisely so every other file can be clean.\n files: [useEffectAllowedIn],\n rules: { \"rdjperron/no-use-effect\": \"off\" },\n });\n }\n\n return overrides;\n}\n\nexport interface I18nOptions {\n /**\n * The word pattern, a regex source compiled with `u`. The rule's default,\n * `\\p{L}{3,}`, reads three letters in a row as a word.\n */\n pattern?: string;\n}\n\n/** Files whose JSX text belongs in a catalogue rather than in the source. */\nexport function i18n(files: string[], options: I18nOptions = {}): Override[] {\n const { pattern } = options;\n return [\n {\n files,\n rules: {\n \"rdjperron/no-hardcoded-jsx-text\": pattern === undefined ? \"error\" : [\"error\", { pattern }],\n },\n },\n ];\n}\n\n/** Files Expo's bundler inlines `process.env` into, where only the reads it replaces survive. */\nexport function expo(files: string[]): Override[] {\n return [{ files, rules: { \"rdjperron/static-public-env\": \"error\" } }];\n}\n\n/** Test files: four rules whose premise a test does not hold. */\nexport function tests(files: string[]): Override[] {\n return [\n {\n files,\n rules: {\n // A fixture is allowed to be the wrong type on purpose.\n \"typescript/no-explicit-any\": \"off\",\n \"typescript/no-non-null-assertion\": \"off\",\n // `expect(typeof x).toBe(\"function\")` reads as an unparsed boundary, but\n // asserting the shape of your own public API is the point of the assertion.\n \"rdjperron/no-runtime-typeof\": \"off\",\n // A justification on every assertion in a test is noise (53 measured on\n // rummy, 2026-09-16).\n \"rdjperron/require-safety-comment-for-type-assertion\": \"off\",\n },\n },\n ];\n}\n\n/** Every rule of the plugin at `error`, so none of them can be missing from the list. */\nconst FIXTURE_RULES = {\n \"rdjperron/no-array-filter-map\": \"error\",\n \"rdjperron/no-chained-type-assertions\": \"error\",\n \"rdjperron/no-conditional-empty-object-spread\": \"error\",\n \"rdjperron/no-hardcoded-jsx-text\": \"error\",\n \"rdjperron/no-known-value-widening\": \"error\",\n \"rdjperron/no-module-mocking\": \"error\",\n \"rdjperron/no-object-parameters\": \"error\",\n \"rdjperron/no-reduce-accumulator-copy\": \"error\",\n \"rdjperron/no-reflect-apply\": \"error\",\n \"rdjperron/no-reflect-get\": \"error\",\n \"rdjperron/no-runtime-typeof\": \"error\",\n \"rdjperron/no-shape-in-symbol-names\": \"error\",\n \"rdjperron/no-unknown-parameters\": \"error\",\n \"rdjperron/no-unknown-returns\": \"error\",\n \"rdjperron/no-unknown-type-aliases\": \"error\",\n \"rdjperron/no-unsafe-dictionary-type\": \"error\",\n \"rdjperron/no-use-effect\": \"error\",\n \"rdjperron/no-widen-then-assert\": \"error\",\n \"rdjperron/require-safety-comment-for-type-assertion\": \"error\",\n \"rdjperron/static-public-env\": \"error\",\n} satisfies Record<RuleId, \"error\">;\n\n/**\n * The view the verify command lints the shipped fixtures through. Without this\n * override every rule the consumer leaves off reports nothing there, and \"no\n * findings\" is exactly what a dead rule looks like.\n */\nexport function fixtures(view = \"scripts/.lint-fixtures/**\"): Override[] {\n return [{ files: [view], rules: { ...FIXTURE_RULES } }];\n}\n\n/** The formatting both consumers settled on. Spread it and add what is yours. */\nexport const fmt = {\n printWidth: 100,\n singleQuote: false,\n semi: true,\n tabWidth: 2,\n useTabs: false,\n};\n\n/**\n * Paths no linter and no formatter should walk: build output, dependencies, the\n * directories AI coding agents scribble in, and the Vitest JSON report. Spread\n * it into `ignorePatterns` and append the repo's own.\n */\nexport const ignore: string[] = [\n \"node_modules/**\",\n \"**/node_modules/**\",\n \"dist/**\",\n \"**/dist/**\",\n ...[\n \".agents\",\n \".claude\",\n \".codex\",\n \".continue\",\n \".cursor\",\n \".gemini\",\n \".opencode\",\n \".pi\",\n \".roo\",\n \".windsurf\",\n ].flatMap((dir) => [`${dir}/**`, `**/${dir}/**`]),\n \"**/test-results.json\",\n];\n\n/** The pre-commit entry: `vp check --fix` is defined for JS and TS sources, nothing else. */\nexport const staged = {\n \"*.{js,jsx,mjs,cjs,ts,tsx,mts,cts}\": \"vp check --fix\",\n};\n"],"mappings":";;;;;;AAkEA,MAAa,SAAmB;CAAE,MAAM;CAA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