@noego/trust 0.5.0-dev.0 → 0.5.0-dev.2

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.
Files changed (142) hide show
  1. package/README.md +49 -9
  2. package/dist/{baseline-B0AplCuF.d.ts → baseline-Bkav9mS0.d.ts} +22 -4
  3. package/dist/{chunk-V72KWVWP.js → chunk-7PY2Q6OX.js} +212 -16
  4. package/dist/chunk-7PY2Q6OX.js.map +1 -0
  5. package/dist/{chunk-NG4KYWVW.js → chunk-UG6D3V4M.js} +877 -41
  6. package/dist/chunk-UG6D3V4M.js.map +1 -0
  7. package/dist/{chunk-OSSITT3R.js → chunk-XXLWC5DB.js} +17 -61
  8. package/dist/chunk-XXLWC5DB.js.map +1 -0
  9. package/dist/cli/index.js +341 -92
  10. package/dist/cli/index.js.map +1 -1
  11. package/dist/cli/wasm-worker.js +257 -0
  12. package/dist/cli/wasm-worker.js.map +1 -0
  13. package/dist/core/index.d.ts +5 -3
  14. package/dist/core/index.js +7 -7
  15. package/dist/eslint/index.d.ts +6 -2
  16. package/dist/eslint/index.js +2 -2
  17. package/dist/licenses/@jridgewell__resolve-uri/LICENSE +19 -0
  18. package/dist/licenses/@jridgewell__sourcemap-codec/LICENSE +19 -0
  19. package/dist/licenses/@jridgewell__trace-mapping/LICENSE +19 -0
  20. package/dist/licenses/JS-DEPENDENCIES.json +83 -0
  21. package/dist/licenses/balanced-match/LICENSE.md +23 -0
  22. package/dist/licenses/brace-expansion/LICENSE +23 -0
  23. package/dist/licenses/dedent-js/LICENSE +19 -0
  24. package/dist/licenses/minimatch/LICENSE.md +55 -0
  25. package/dist/licenses/scule/LICENSE +21 -0
  26. package/dist/licenses/svelte2tsx/LICENSE +21 -0
  27. package/dist/native/licenses/CARGO-DEPENDENCIES.json +479 -0
  28. package/dist/native/licenses/LICENSE-trust.txt +15 -0
  29. package/dist/native/licenses/cargo/adler2-2.0.1/LICENSE-0BSD +12 -0
  30. package/dist/native/licenses/cargo/adler2-2.0.1/LICENSE-APACHE +201 -0
  31. package/dist/native/licenses/cargo/adler2-2.0.1/LICENSE-MIT +23 -0
  32. package/dist/native/licenses/cargo/aho-corasick-1.1.5/COPYING +3 -0
  33. package/dist/native/licenses/cargo/aho-corasick-1.1.5/LICENSE-MIT +21 -0
  34. package/dist/native/licenses/cargo/autocfg-1.5.1/LICENSE-APACHE +201 -0
  35. package/dist/native/licenses/cargo/autocfg-1.5.1/LICENSE-MIT +25 -0
  36. package/dist/native/licenses/cargo/bitflags-1.3.2/LICENSE-APACHE +201 -0
  37. package/dist/native/licenses/cargo/bitflags-1.3.2/LICENSE-MIT +25 -0
  38. package/dist/native/licenses/cargo/bstr-1.13.1/COPYING +8 -0
  39. package/dist/native/licenses/cargo/bstr-1.13.1/LICENSE-APACHE +201 -0
  40. package/dist/native/licenses/cargo/bstr-1.13.1/LICENSE-MIT +21 -0
  41. package/dist/native/licenses/cargo/bumpalo-3.20.3/LICENSE-APACHE +201 -0
  42. package/dist/native/licenses/cargo/bumpalo-3.20.3/LICENSE-MIT +25 -0
  43. package/dist/native/licenses/cargo/cfg-if-1.0.5/LICENSE-APACHE +201 -0
  44. package/dist/native/licenses/cargo/cfg-if-1.0.5/LICENSE-MIT +25 -0
  45. package/dist/native/licenses/cargo/crc32fast-1.5.2/LICENSE-APACHE +202 -0
  46. package/dist/native/licenses/cargo/crc32fast-1.5.2/LICENSE-MIT +21 -0
  47. package/dist/native/licenses/cargo/defmt-1.1.1/LICENSE-APACHE +201 -0
  48. package/dist/native/licenses/cargo/defmt-1.1.1/LICENSE-MIT +25 -0
  49. package/dist/native/licenses/cargo/defmt-macros-1.1.1/LICENSE-APACHE +201 -0
  50. package/dist/native/licenses/cargo/defmt-macros-1.1.1/LICENSE-MIT +25 -0
  51. package/dist/native/licenses/cargo/equivalent-1.0.2/LICENSE-APACHE +201 -0
  52. package/dist/native/licenses/cargo/equivalent-1.0.2/LICENSE-MIT +25 -0
  53. package/dist/native/licenses/cargo/flate2-1.1.10/LICENSE-APACHE +201 -0
  54. package/dist/native/licenses/cargo/flate2-1.1.10/LICENSE-MIT +25 -0
  55. package/dist/native/licenses/cargo/globset-0.4.20/COPYING +3 -0
  56. package/dist/native/licenses/cargo/globset-0.4.20/LICENSE-MIT +21 -0
  57. package/dist/native/licenses/cargo/hashbrown-0.17.1/LICENSE-APACHE +201 -0
  58. package/dist/native/licenses/cargo/hashbrown-0.17.1/LICENSE-MIT +25 -0
  59. package/dist/native/licenses/cargo/indexmap-2.14.0/LICENSE-APACHE +201 -0
  60. package/dist/native/licenses/cargo/indexmap-2.14.0/LICENSE-MIT +25 -0
  61. package/dist/native/licenses/cargo/itoa-1.0.18/LICENSE-APACHE +176 -0
  62. package/dist/native/licenses/cargo/itoa-1.0.18/LICENSE-MIT +23 -0
  63. package/dist/native/licenses/cargo/jiff-0.2.37/COPYING +3 -0
  64. package/dist/native/licenses/cargo/jiff-0.2.37/LICENSE-MIT +21 -0
  65. package/dist/native/licenses/cargo/jiff-core-0.1.1/COPYING +3 -0
  66. package/dist/native/licenses/cargo/jiff-core-0.1.1/LICENSE-MIT +21 -0
  67. package/dist/native/licenses/cargo/jiff-tzdb-0.1.9/COPYING +3 -0
  68. package/dist/native/licenses/cargo/jiff-tzdb-0.1.9/LICENSE-MIT +21 -0
  69. package/dist/native/licenses/cargo/jiff-tzdb-platform-0.1.3/COPYING +3 -0
  70. package/dist/native/licenses/cargo/jiff-tzdb-platform-0.1.3/LICENSE-MIT +21 -0
  71. package/dist/native/licenses/cargo/log-0.4.34/LICENSE-APACHE +201 -0
  72. package/dist/native/licenses/cargo/log-0.4.34/LICENSE-MIT +25 -0
  73. package/dist/native/licenses/cargo/lzma-rust2-0.21.0/LICENSE +201 -0
  74. package/dist/native/licenses/cargo/memchr-2.8.2/COPYING +3 -0
  75. package/dist/native/licenses/cargo/memchr-2.8.2/LICENSE-MIT +21 -0
  76. package/dist/native/licenses/cargo/miniz_oxide-0.9.1/LICENSE +25 -0
  77. package/dist/native/licenses/cargo/miniz_oxide-0.9.1/LICENSE-APACHE.md +177 -0
  78. package/dist/native/licenses/cargo/miniz_oxide-0.9.1/LICENSE-MIT.md +24 -0
  79. package/dist/native/licenses/cargo/miniz_oxide-0.9.1/LICENSE-ZLIB.md +14 -0
  80. package/dist/native/licenses/cargo/num-bigint-0.4.6/LICENSE-APACHE +201 -0
  81. package/dist/native/licenses/cargo/num-bigint-0.4.6/LICENSE-MIT +25 -0
  82. package/dist/native/licenses/cargo/num-integer-0.1.47/LICENSE-APACHE +201 -0
  83. package/dist/native/licenses/cargo/num-integer-0.1.47/LICENSE-MIT +25 -0
  84. package/dist/native/licenses/cargo/num-traits-0.2.19/LICENSE-APACHE +201 -0
  85. package/dist/native/licenses/cargo/num-traits-0.2.19/LICENSE-MIT +25 -0
  86. package/dist/native/licenses/cargo/proc-macro2-1.0.107/LICENSE-APACHE +176 -0
  87. package/dist/native/licenses/cargo/proc-macro2-1.0.107/LICENSE-MIT +23 -0
  88. package/dist/native/licenses/cargo/quote-1.0.47/LICENSE-APACHE +176 -0
  89. package/dist/native/licenses/cargo/quote-1.0.47/LICENSE-MIT +23 -0
  90. package/dist/native/licenses/cargo/regex-automata-0.4.18/LICENSE-APACHE +201 -0
  91. package/dist/native/licenses/cargo/regex-automata-0.4.18/LICENSE-MIT +25 -0
  92. package/dist/native/licenses/cargo/regex-syntax-0.8.11/LICENSE-APACHE +201 -0
  93. package/dist/native/licenses/cargo/regex-syntax-0.8.11/LICENSE-MIT +25 -0
  94. package/dist/native/licenses/cargo/rustc-hash-2.1.2/LICENSE-APACHE +176 -0
  95. package/dist/native/licenses/cargo/rustc-hash-2.1.2/LICENSE-MIT +23 -0
  96. package/dist/native/licenses/cargo/ryu-js-1.0.2/LICENSE-APACHE +176 -0
  97. package/dist/native/licenses/cargo/ryu-js-1.0.2/LICENSE-BOOST +23 -0
  98. package/dist/native/licenses/cargo/serde-1.0.229/LICENSE-APACHE +176 -0
  99. package/dist/native/licenses/cargo/serde-1.0.229/LICENSE-MIT +23 -0
  100. package/dist/native/licenses/cargo/serde_core-1.0.229/LICENSE-APACHE +176 -0
  101. package/dist/native/licenses/cargo/serde_core-1.0.229/LICENSE-MIT +23 -0
  102. package/dist/native/licenses/cargo/serde_derive-1.0.229/LICENSE-APACHE +176 -0
  103. package/dist/native/licenses/cargo/serde_derive-1.0.229/LICENSE-MIT +23 -0
  104. package/dist/native/licenses/cargo/serde_json-1.0.152/LICENSE-APACHE +176 -0
  105. package/dist/native/licenses/cargo/serde_json-1.0.152/LICENSE-MIT +23 -0
  106. package/dist/native/licenses/cargo/simd-adler32-0.3.10/LICENSE.md +21 -0
  107. package/dist/native/licenses/cargo/smallvec-1.15.1/LICENSE-APACHE +201 -0
  108. package/dist/native/licenses/cargo/smallvec-1.15.1/LICENSE-MIT +25 -0
  109. package/dist/native/licenses/cargo/syn-2.0.119/LICENSE-APACHE +176 -0
  110. package/dist/native/licenses/cargo/syn-2.0.119/LICENSE-MIT +23 -0
  111. package/dist/native/licenses/cargo/syn-3.0.7/LICENSE-APACHE +176 -0
  112. package/dist/native/licenses/cargo/syn-3.0.7/LICENSE-MIT +23 -0
  113. package/dist/native/licenses/cargo/thiserror-2.0.21/LICENSE-APACHE +176 -0
  114. package/dist/native/licenses/cargo/thiserror-2.0.21/LICENSE-MIT +23 -0
  115. package/dist/native/licenses/cargo/thiserror-impl-2.0.21/LICENSE-APACHE +176 -0
  116. package/dist/native/licenses/cargo/thiserror-impl-2.0.21/LICENSE-MIT +23 -0
  117. package/dist/native/licenses/cargo/unicode-ident-1.0.26/LICENSE-APACHE +176 -0
  118. package/dist/native/licenses/cargo/unicode-ident-1.0.26/LICENSE-MIT +23 -0
  119. package/dist/native/licenses/cargo/unicode-ident-1.0.26/LICENSE-UNICODE +39 -0
  120. package/dist/native/licenses/cargo/xxhash-rust-0.8.15/LICENSE +23 -0
  121. package/dist/native/licenses/cargo/zlib-rs-0.6.8/LICENSE +19 -0
  122. package/dist/native/licenses/cargo/zmij-1.0.23/LICENSE-MIT +23 -0
  123. package/dist/native/licenses/ts-rust/LICENSE +21 -0
  124. package/dist/native/licenses/ts-rust/NOTICE.md +53 -0
  125. package/dist/native/licenses/ts-rust/licenses/Go-LICENSE.txt +27 -0
  126. package/dist/native/licenses/ts-rust/licenses/TypeScript-LICENSE.txt +55 -0
  127. package/dist/native/licenses/ts-rust/licenses/TypeScript-NOTICE.txt +405 -0
  128. package/dist/native/licenses/ts-rust/licenses/Unicode-LICENSE.txt +39 -0
  129. package/dist/native/licenses/ts-rust/licenses/vscode-languageserver-node-LICENSE.txt +18 -0
  130. package/dist/native/licenses/typescript/LICENSE.txt +55 -0
  131. package/dist/native/licenses/typescript/ThirdPartyNoticeText.txt +193 -0
  132. package/dist/native/licenses/typescript/manifest.json +105 -0
  133. package/dist/native/trust_native_wasm.wasm +0 -0
  134. package/dist/svelte2tsx/index.cjs +7064 -0
  135. package/dist/svelte2tsx/svelte-jsx-v4.d.ts +230 -0
  136. package/dist/svelte2tsx/svelte-jsx.d.ts +1492 -0
  137. package/dist/svelte2tsx/svelte-shims-v4.d.ts +290 -0
  138. package/dist/svelte2tsx/svelte-shims.d.ts +305 -0
  139. package/package.json +25 -5
  140. package/dist/chunk-NG4KYWVW.js.map +0 -1
  141. package/dist/chunk-OSSITT3R.js.map +0 -1
  142. package/dist/chunk-V72KWVWP.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/core/program.ts","../src/cli/source-files.ts","../src/core/report.ts"],"sourcesContent":["// TypeScript programs for the CLI: files grouped by the tsconfig that owns them (one `--tsconfig`\n// for all, else the trust config's first matching `tsconfig` entry, else the nearest tsconfig.json\n// above the file), one Program per group rooted at those files. Compiler options come from the\n// tsconfig; of its file list only the declaration files are added as roots, so ambient declarations\n// (`env.d.ts`, `/// <reference types>`) resolve exactly as under typed ESLint without loading the\n// rest of the project.\nimport { dirname, resolve } from 'node:path';\nimport type * as TS from 'typescript';\nimport type { TsconfigMapping } from '../eslint/config.js';\nimport type { TypeScript } from '../eslint/typescript.js';\nimport { groupMatches, realpathOrSelf } from '../eslint/zones.js';\n\nexport interface TsconfigSettings {\n readonly options: TS.CompilerOptions;\n /** `.d.ts` files of the tsconfig's own file list. */\n readonly declarationFiles: readonly string[];\n}\n\n/** Options and declaration files of `tsconfig` (strict + allowJs when there is none); throws on an unreadable tsconfig. */\nexport function readTsconfig(ts: TypeScript, tsconfig: string | undefined): TsconfigSettings {\n if (!tsconfig) return { options: { allowJs: true, strict: true, noEmit: true }, declarationFiles: [] };\n const parsed = ts.getParsedCommandLineOfConfigFile(tsconfig, {}, {\n ...ts.sys,\n onUnRecoverableConfigFileDiagnostic: (diagnostic) => {\n throw new Error(ts.flattenDiagnosticMessageText(diagnostic.messageText, '\\n'));\n },\n });\n return {\n options: { ...parsed?.options, noEmit: true },\n declarationFiles: (parsed?.fileNames ?? []).filter((name) => /\\.d\\.[cm]?ts$/.test(name)),\n };\n}\n\nexport interface ProgramGroup {\n /** Absolute tsconfig path, or undefined when no tsconfig owns the files. */\n readonly tsconfig: string | undefined;\n /** Absolute paths of the files to check, in input order. */\n readonly files: readonly string[];\n readonly program: TS.Program;\n}\n\n/** A file matched a trust config `tsconfig` entry whose tsconfig does not exist. */\nexport interface MissingMappedTsconfig {\n readonly kind: 'missing-mapped-tsconfig';\n /** Names the config file, the entry and the missing path. */\n readonly message: string;\n}\n\nexport type TsconfigGrouping = { readonly kind: 'grouped'; readonly groups: Map<string | undefined, string[]> } | MissingMappedTsconfig;\n\nexport type ProgramsCreation = { readonly kind: 'created'; readonly groups: ProgramGroup[] } | MissingMappedTsconfig;\n\nfunction missingMappedTsconfig(mapping: TsconfigMapping, file: string): MissingMappedTsconfig {\n const files = mapping.patterns.length === 1 ? JSON.stringify(mapping.patterns[0]) : JSON.stringify(mapping.patterns);\n return {\n kind: 'missing-mapped-tsconfig',\n message:\n `trust config ${mapping.source}: \"tsconfig[${mapping.index}]\" (files ${files}) maps ${file} ` +\n `to ${mapping.tsconfig}, which does not exist`,\n };\n}\n\n/**\n * Absolute files grouped by owning tsconfig: `tsconfig` (relative to cwd) for every file when given,\n * else the first `mappings` entry whose globs match the file, else the nearest tsconfig.json.\n */\nexport function groupByTsconfig(\n ts: TypeScript,\n cwd: string,\n files: readonly string[],\n tsconfig?: string,\n mappings: readonly TsconfigMapping[] = [],\n): TsconfigGrouping {\n const override = tsconfig ? resolve(cwd, tsconfig) : undefined;\n const groups = new Map<string | undefined, string[]>();\n for (const file of files) {\n const mapping = override === undefined ? mappings.find((entry) => groupMatches(entry, realpathOrSelf(file))) : undefined;\n if (mapping && !ts.sys.fileExists(mapping.tsconfig)) return missingMappedTsconfig(mapping, file);\n const owner = override ?? mapping?.tsconfig ?? ts.findConfigFile(dirname(file), ts.sys.fileExists);\n const list = groups.get(owner) ?? [];\n list.push(file);\n groups.set(owner, list);\n }\n return { kind: 'grouped', groups };\n}\n\n/**\n * One Program per owning tsconfig (see groupByTsconfig), rooted at the given files. A missing mapped\n * tsconfig is a returned failure; an unreadable tsconfig still throws (readTsconfig).\n */\nexport function createPrograms(\n ts: TypeScript,\n cwd: string,\n files: readonly string[],\n tsconfig?: string,\n mappings: readonly TsconfigMapping[] = [],\n): ProgramsCreation {\n const grouping = groupByTsconfig(ts, cwd, files, tsconfig, mappings);\n if (grouping.kind !== 'grouped') return grouping;\n const groups = [...grouping.groups].map(([owner, groupFiles]) => {\n const settings = readTsconfig(ts, owner);\n const rootNames = [...new Set([...groupFiles, ...settings.declarationFiles])];\n return { tsconfig: owner, files: groupFiles, program: ts.createProgram({ rootNames, options: settings.options }) };\n });\n return { kind: 'created', groups };\n}\n\n/** The program's source file for `file` (also tried by realpath, for symlinked paths). */\nexport function sourceFileOf(program: TS.Program, file: string): TS.SourceFile | undefined {\n return program.getSourceFile(file) ?? program.getSourceFile(realpathOrSelf(file));\n}\n","// Shared by `trust check` and `trust baseline`: which files to check (named files as-is, directories\n// walked for .ts/.tsx, node_modules/dist/.d.ts skipped), and one walk over their TypeScript programs\n// that stops when a file cannot be loaded or parsed. No ESLint.\nimport { existsSync, readdirSync, statSync } from 'node:fs';\nimport { join, resolve } from 'node:path';\nimport type * as TS from 'typescript';\nimport { createPrograms, sourceFileOf } from '../core/program.js';\nimport type { TsconfigMapping } from '../eslint/config.js';\nimport { loadTypeScript, type TypeScript } from '../eslint/typescript.js';\nimport { relativeInside, realpathOrSelf, toPosix } from '../eslint/zones.js';\n\nconst SKIPPED_DIRECTORIES = new Set(['node_modules', 'dist']);\nconst MAX_LOGGED_ERRORS = 50;\n\nfunction isSourceFile(name: string): boolean {\n return (name.endsWith('.ts') || name.endsWith('.tsx')) && !name.endsWith('.d.ts');\n}\n\nfunction walk(directory: string, files: string[]): void {\n for (const entry of readdirSync(directory, { withFileTypes: true })) {\n const full = join(directory, entry.name);\n if (entry.isDirectory()) {\n if (!SKIPPED_DIRECTORIES.has(entry.name)) walk(full, files);\n } else if (entry.isFile() && isSourceFile(entry.name)) {\n files.push(full);\n }\n }\n}\n\n/** Absolute paths, sorted and deduplicated: named files as-is, directories walked for .ts/.tsx. */\nexport function resolveFiles(cwd: string, paths: readonly string[]): { files: string[] } | { missing: string } {\n const files: string[] = [];\n for (const path of paths) {\n const absolute = resolve(cwd, path);\n if (!existsSync(absolute)) return { missing: path };\n if (statSync(absolute).isDirectory()) walk(absolute, files);\n else files.push(absolute);\n }\n return { files: [...new Set(files)].sort() };\n}\n\nexport function relativeTo(rootDir: string, file: string): string {\n const real = realpathOrSelf(file);\n return relativeInside(rootDir, real) ?? toPosix(real);\n}\n\nfunction syntaxErrors(ts: TypeScript, program: TS.Program, sourceFile: TS.SourceFile): string[] {\n return program.getSyntacticDiagnostics(sourceFile).map((diagnostic) => {\n const { line, character } = ts.getLineAndCharacterOfPosition(sourceFile, diagnostic.start ?? 0);\n return `${sourceFile.fileName}:${line + 1}:${character + 1} ${ts.flattenDiagnosticMessageText(diagnostic.messageText, '\\n')}`;\n });\n}\n\nexport interface LoadedFile {\n readonly ts: TypeScript;\n readonly program: TS.Program;\n readonly sourceFile: TS.SourceFile;\n /** Absolute path as resolved from the command line. */\n readonly file: string;\n}\n\nexport type ProgramWalk =\n | { readonly status: 'ok' }\n /** TypeScript could not be resolved, a tsconfig could not be read, or a mapped tsconfig is missing. */\n | { readonly status: 'setup-failed'; readonly message: string }\n /** Files no program could load, or with syntax errors. */\n | { readonly status: 'file-errors'; readonly errors: readonly string[] };\n\n/** Which tsconfig compiles each file: `tsconfig` (relative to cwd) for all, else `mappings`, else the nearest one. */\nexport interface ProgramOptions {\n readonly tsconfig: string | undefined;\n readonly mappings: readonly TsconfigMapping[];\n}\n\n/**\n * Builds one program per owning tsconfig and calls `visit` for every file that loads and parses.\n * Files with errors are collected instead; callers must not trust findings when the walk is not ok.\n */\nexport function forEachSourceFile(cwd: string, files: readonly string[], programs: ProgramOptions, visit: (loaded: LoadedFile) => void): ProgramWalk {\n if (files.length === 0) return { status: 'ok' };\n let ts: TypeScript;\n let creation: ReturnType<typeof createPrograms>;\n try {\n ts = loadTypeScript(cwd);\n creation = createPrograms(ts, cwd, files, programs.tsconfig, programs.mappings);\n } catch (error) {\n return { status: 'setup-failed', message: error instanceof Error ? error.message : String(error) };\n }\n if (creation.kind !== 'created') return { status: 'setup-failed', message: creation.message };\n const errors: string[] = [];\n for (const group of creation.groups) {\n for (const file of group.files) {\n const sourceFile = sourceFileOf(group.program, file);\n if (!sourceFile) {\n errors.push(`${file}: could not be loaded into a TypeScript program (tsconfig: ${group.tsconfig ?? 'none'})`);\n continue;\n }\n const syntax = syntaxErrors(ts, group.program, sourceFile);\n if (syntax.length > 0) {\n errors.push(...syntax);\n continue;\n }\n visit({ ts, program: group.program, sourceFile, file });\n }\n }\n return errors.length > 0 ? { status: 'file-errors', errors } : { status: 'ok' };\n}\n\n/** Why the walk failed, as lines headed by `label` (`trust check`, `ioc check`); at most 50 file errors. */\nexport function formatWalkFailure(label: string, walk: Exclude<ProgramWalk, { status: 'ok' }>): string[] {\n if (walk.status === 'setup-failed') return [`${label}: could not set up TypeScript: ${walk.message}`];\n const header = `${label} could not check ${walk.errors.length === 1 ? 'a file' : 'some files'}; fix these first:`;\n return [header, ...walk.errors.slice(0, MAX_LOGGED_ERRORS).map((line) => ` ${line}`)];\n}\n\n/** Logs why the walk failed, under `trust <command>`. */\nexport function logWalkFailure(log: (line: string) => void, command: string, walk: Exclude<ProgramWalk, { status: 'ok' }>): void {\n for (const line of formatWalkFailure(`trust ${command}`, walk)) log(line);\n}\n","// How a finding is printed by `trust check` (and by sibling checkers built on `@noego/trust/core`):\n// one line `file:line:col rule message`, files in path order, then line and column.\nimport type { Finding } from './messages.js';\n\n/** What a printed finding needs. */\nexport type ReportFinding = Pick<Finding, 'file' | 'line' | 'column' | 'rule' | 'message'>;\n\n/** Sort order of printed findings: file, then line, then column. */\nexport function compareFindings(a: ReportFinding, b: ReportFinding): number {\n if (a.file !== b.file) return a.file < b.file ? -1 : 1;\n return a.line - b.line || a.column - b.column;\n}\n\n/** `file:line:col rule message`. */\nexport function formatFinding(finding: ReportFinding): string {\n return `${finding.file}:${finding.line}:${finding.column} ${finding.rule} ${finding.message}`;\n}\n"],"mappings":";;;;;;;;;AAMA,SAAS,SAAS,eAAe;AAa1B,SAAS,aAAa,IAAgB,UAAgD;AAC3F,MAAI,CAAC,SAAU,QAAO,EAAE,SAAS,EAAE,SAAS,MAAM,QAAQ,MAAM,QAAQ,KAAK,GAAG,kBAAkB,CAAC,EAAE;AACrG,QAAM,SAAS,GAAG,iCAAiC,UAAU,CAAC,GAAG;AAAA,IAC/D,GAAG,GAAG;AAAA,IACN,qCAAqC,CAAC,eAAe;AACnD,YAAM,IAAI,MAAM,GAAG,6BAA6B,WAAW,aAAa,IAAI,CAAC;AAAA,IAC/E;AAAA,EACF,CAAC;AACD,SAAO;AAAA,IACL,SAAS,EAAE,GAAG,QAAQ,SAAS,QAAQ,KAAK;AAAA,IAC5C,mBAAmB,QAAQ,aAAa,CAAC,GAAG,OAAO,CAAC,SAAS,gBAA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