@noego/trust 0.5.1-dev.3 → 0.5.1-dev.5

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,5 +1,5 @@
1
- import { T as TypeScript, a as TsconfigMapping, Z as ZoneGroup, F as Finding } from '../baseline-DMNO7IAl.js';
2
- export { B as BaselineCounts, b as BaselineDelta, c as BaselineFinding, d as BaselineScope, e as LineDirective, W as WHOLE_BASELINE, f as Zone, g as Zones, h as compareToBaseline, i as countFindings, j as describeBaselineDelta, k as directiveDirectlyAbove, l as directiveReason, m as groupMatches, n as isNamedDirective, o as lineDirectivesIn, p as loadTypeScript, q as matchesPatterns, r as nearestPackageName, s as nodeBelow, t as normalizePattern, u as parseBaseline, v as readBaseline, w as realpathOrSelf, x as relativeInside, y as serializeBaseline, z as toPosix, A as updateBaseline } from '../baseline-DMNO7IAl.js';
1
+ import { T as TypeScript, a as TsconfigMapping, Z as ZoneGroup, F as Finding } from '../baseline-DsqHPLAg.js';
2
+ export { B as BaselineCounts, b as BaselineDelta, c as BaselineFinding, d as BaselineScope, e as LineDirective, W as WHOLE_BASELINE, f as Zone, g as Zones, h as compareToBaseline, i as countFindings, j as describeBaselineDelta, k as directiveDirectlyAbove, l as directiveReason, m as groupMatches, n as isNamedDirective, o as lineDirectivesIn, p as loadTypeScript, q as matchesPatterns, r as nearestPackageName, s as nodeBelow, t as normalizePattern, u as parseBaseline, v as readBaseline, w as realpathOrSelf, x as relativeInside, y as serializeBaseline, z as toPosix, A as updateBaseline } from '../baseline-DsqHPLAg.js';
3
3
  import * as TS from 'typescript';
4
4
 
5
5
  /** Absolute paths, sorted and deduplicated: named files as-is, directories walked for .ts/.tsx. */
@@ -5,7 +5,7 @@ import {
5
5
  formatWalkFailure,
6
6
  relativeTo,
7
7
  resolveFiles
8
- } from "../chunk-2MSSO67W.js";
8
+ } from "../chunk-6K5I3ZRI.js";
9
9
  import {
10
10
  WHOLE_BASELINE,
11
11
  Zones,
@@ -34,7 +34,7 @@ import {
34
34
  sourceFileOf,
35
35
  toPosix,
36
36
  updateBaseline
37
- } from "../chunk-VJGGEY4G.js";
37
+ } from "../chunk-4XGOH7JE.js";
38
38
 
39
39
  // src/core/tool-config.ts
40
40
  import { existsSync, readFileSync } from "fs";
@@ -1,7 +1,7 @@
1
1
  import * as eslint from 'eslint';
2
2
  import { Linter, ESLint } from 'eslint';
3
- import { g as Zones, O as OriginResolver, C as TrustRuleSettings, T as TypeScript, D as TrustConfig, E as OriginInfo, G as CatchProblem } from '../baseline-DMNO7IAl.js';
4
- export { H as ACCEPT_DIRECTIVE, I as ACCEPT_DIRECTIVE_MESSAGES, J as BOUNDARY_MESSAGES, K as BOUNDARY_RULE, B as BaselineCounts, b as BaselineDelta, d as BaselineScope, L as BoundaryGroup, M as BoundaryOrigin, N as CATCH_ORIGIN, P as DEFAULT_RULE_SETTINGS, Q as DIRECTIVE_ORIGIN, R as DROPPED_RESULT_MESSAGES, S as DROPPED_RESULT_RULE, U as DroppedResultOrigin, F as Finding, V as LoadTrustConfigOptions, X as OptInRule, Y as REDUNDANT_GUARD_MESSAGES, _ as REDUNDANT_GUARD_ORIGIN, $ as REDUNDANT_GUARD_RULE, a0 as RuleSwitch, a1 as THROW_MESSAGES, a2 as THROW_RULE, a3 as TRUSTED_STATE_MESSAGES, a4 as TRUSTED_STATE_RULE, a5 as TYPE_CLAIM_KINDS, a6 as TYPE_CLAIM_MESSAGES, a7 as TYPE_CLAIM_RULE, a8 as TrustConfigError, a9 as TrustEntry, aa as TrustLevel, ab as TrustedStateOrigin, a as TsconfigMapping, ac as TypeClaimOrigin, ad as UNANALYZABLE_ORIGIN, ae as UNTRUSTED_CALL_MESSAGES, af as UNTRUSTED_CALL_RULE, ag as UNTRUSTED_VALUE_MESSAGES, ah as UNTRUSTED_VALUE_RULE, ai as UntrustedCallbacks, aj as UntrustedEntry, ak as VALIDATOR_DIRECTIVE, W as WHOLE_BASELINE, f as Zone, Z as ZoneGroup, h as compareToBaseline, i as countFindings, al as effectiveTrustList, am as effectiveTypeTrustList, an as isInsideValidator, ao as isMarkedValidator, ap as isRuleEnabled, aq as loadTrustConfig, ar as normalizeOrigin, u as parseBaseline, y as serializeBaseline, A as updateBaseline } from '../baseline-DMNO7IAl.js';
3
+ import { g as Zones, O as OriginResolver, C as TrustRuleSettings, T as TypeScript, D as TrustConfig, E as OriginInfo, G as CatchProblem } from '../baseline-DsqHPLAg.js';
4
+ export { H as ACCEPT_DIRECTIVE, I as ACCEPT_DIRECTIVE_MESSAGES, J as BOUNDARY_MESSAGES, K as BOUNDARY_RULE, B as BaselineCounts, b as BaselineDelta, d as BaselineScope, L as BoundaryGroup, M as BoundaryOrigin, N as CATCH_ORIGIN, P as DEFAULT_RULE_SETTINGS, Q as DIRECTIVE_ORIGIN, R as DROPPED_RESULT_MESSAGES, S as DROPPED_RESULT_RULE, U as DroppedResultOrigin, V as FINALLY_RETURN_MESSAGES, X as FINALLY_RETURN_ORIGIN, Y as FINALLY_RETURN_RULE, F as Finding, _ as LoadTrustConfigOptions, $ as OptInRule, a0 as REDUNDANT_GUARD_MESSAGES, a1 as REDUNDANT_GUARD_ORIGIN, a2 as REDUNDANT_GUARD_RULE, a3 as RuleSwitch, a4 as THROW_MESSAGES, a5 as THROW_RULE, a6 as TRUSTED_STATE_MESSAGES, a7 as TRUSTED_STATE_RULE, a8 as TYPE_CLAIM_KINDS, a9 as TYPE_CLAIM_MESSAGES, aa as TYPE_CLAIM_RULE, ab as TrustConfigError, ac as TrustEntry, ad as TrustLevel, ae as TrustedStateOrigin, a as TsconfigMapping, af as TypeClaimOrigin, ag as UNANALYZABLE_ORIGIN, ah as UNTRUSTED_CALL_MESSAGES, ai as UNTRUSTED_CALL_RULE, aj as UNTRUSTED_VALUE_MESSAGES, ak as UNTRUSTED_VALUE_RULE, al as UntrustedCallbacks, am as UntrustedEntry, an as VALIDATOR_DIRECTIVE, W as WHOLE_BASELINE, f as Zone, Z as ZoneGroup, h as compareToBaseline, i as countFindings, ao as effectiveTrustList, ap as effectiveTypeTrustList, aq as isInsideValidator, ar as isMarkedValidator, as as isRuleEnabled, at as loadTrustConfig, au as normalizeOrigin, u as parseBaseline, y as serializeBaseline, A as updateBaseline } from '../baseline-DsqHPLAg.js';
5
5
  import * as TS from 'typescript';
6
6
 
7
7
  interface PresetDefinition {
@@ -161,6 +161,7 @@ declare const rules: {
161
161
  'dropped-result': eslint.Rule.RuleModule;
162
162
  'trusted-state': eslint.Rule.RuleModule;
163
163
  'redundant-guard': eslint.Rule.RuleModule;
164
+ 'finally-return': eslint.Rule.RuleModule;
164
165
  'boundary-result': eslint.Rule.RuleModule;
165
166
  };
166
167
  interface TypedConfigOptions {
@@ -12,6 +12,7 @@ import {
12
12
  droppedResultsIn,
13
13
  emptyTrustConfig,
14
14
  entryMatches,
15
+ finallyReturnsIn,
15
16
  guardOf,
16
17
  isStrictByConfig,
17
18
  nameBasedGuardContext,
@@ -31,7 +32,7 @@ import {
31
32
  untrustedValueData,
32
33
  untrustedValueMessageId,
33
34
  untrustedValuesIn
34
- } from "../chunk-3IIEQHH2.js";
35
+ } from "../chunk-QTS55J43.js";
35
36
  import {
36
37
  ACCEPT_DIRECTIVE,
37
38
  ACCEPT_DIRECTIVE_MESSAGES,
@@ -42,6 +43,9 @@ import {
42
43
  DIRECTIVE_ORIGIN,
43
44
  DROPPED_RESULT_MESSAGES,
44
45
  DROPPED_RESULT_RULE,
46
+ FINALLY_RETURN_MESSAGES,
47
+ FINALLY_RETURN_ORIGIN,
48
+ FINALLY_RETURN_RULE,
45
49
  OriginResolver,
46
50
  PRESETS,
47
51
  REDUNDANT_GUARD_MESSAGES,
@@ -77,7 +81,7 @@ import {
77
81
  parseBaseline,
78
82
  serializeBaseline,
79
83
  updateBaseline
80
- } from "../chunk-VJGGEY4G.js";
84
+ } from "../chunk-4XGOH7JE.js";
81
85
 
82
86
  // src/eslint/rule-setup.ts
83
87
  import { resolve } from "path";
@@ -204,8 +208,34 @@ var rule2 = {
204
208
  };
205
209
  var dropped_result_default = rule2;
206
210
 
207
- // src/eslint/rules/trusted-state.ts
211
+ // src/eslint/rules/finally-return.ts
208
212
  var rule3 = {
213
+ meta: {
214
+ type: "problem",
215
+ docs: { description: "Disallow `return` inside `finally` blocks so cleanup never overwrites a returned Result." },
216
+ schema: OPTIONS_SCHEMA,
217
+ messages: FINALLY_RETURN_MESSAGES
218
+ },
219
+ create(context) {
220
+ const setup = setupRule(context);
221
+ if (!isRuleEnabled(setup, FINALLY_RETURN_RULE)) return {};
222
+ if (setup.zone !== "checked") return {};
223
+ const { ts } = setup;
224
+ const { sourceCode } = context;
225
+ return {
226
+ Program() {
227
+ const sourceFile = setup.sourceFile();
228
+ for (const found of finallyReturnsIn(ts, sourceFile)) {
229
+ context.report({ loc: sourceCode.getLocFromIndex(found.start), messageId: FINALLY_RETURN_ORIGIN });
230
+ }
231
+ }
232
+ };
233
+ }
234
+ };
235
+ var finally_return_default = rule3;
236
+
237
+ // src/eslint/rules/trusted-state.ts
238
+ var rule4 = {
209
239
  meta: {
210
240
  type: "problem",
211
241
  docs: { description: "Require distinct success outcomes to use literal states." },
@@ -231,10 +261,10 @@ var rule3 = {
231
261
  };
232
262
  }
233
263
  };
234
- var trusted_state_default = rule3;
264
+ var trusted_state_default = rule4;
235
265
 
236
266
  // src/eslint/rules/redundant-guard.ts
237
- var rule4 = {
267
+ var rule5 = {
238
268
  meta: {
239
269
  type: "problem",
240
270
  docs: { description: "Report every guard (Trust.try / Trust.tryAsync / try-catch) around code that cannot fail." },
@@ -261,10 +291,10 @@ var rule4 = {
261
291
  };
262
292
  }
263
293
  };
264
- var redundant_guard_default = rule4;
294
+ var redundant_guard_default = rule5;
265
295
 
266
296
  // src/eslint/rules/throw-must-return-result.ts
267
- var rule5 = {
297
+ var rule6 = {
268
298
  meta: {
269
299
  type: "problem",
270
300
  docs: { description: "Require every throw to be caught locally and returned as Result.err." },
@@ -293,10 +323,10 @@ var rule5 = {
293
323
  };
294
324
  }
295
325
  };
296
- var throw_must_return_result_default = rule5;
326
+ var throw_must_return_result_default = rule6;
297
327
 
298
328
  // src/eslint/rules/type-claim.ts
299
- var rule6 = {
329
+ var rule7 = {
300
330
  meta: {
301
331
  type: "problem",
302
332
  docs: { description: "Report every place a type is claimed instead of proven." },
@@ -324,10 +354,10 @@ var rule6 = {
324
354
  };
325
355
  }
326
356
  };
327
- var type_claim_default = rule6;
357
+ var type_claim_default = rule7;
328
358
 
329
359
  // src/eslint/rules/untrusted-call-must-return-result.ts
330
- var rule7 = {
360
+ var rule8 = {
331
361
  meta: {
332
362
  type: "problem",
333
363
  docs: { description: "Require calls into untrusted code to be handled locally and returned as Result.err." },
@@ -350,10 +380,10 @@ var rule7 = {
350
380
  return { CallExpression: check, NewExpression: check };
351
381
  }
352
382
  };
353
- var untrusted_call_must_return_result_default = rule7;
383
+ var untrusted_call_must_return_result_default = rule8;
354
384
 
355
385
  // src/eslint/rules/untrusted-value.ts
356
- var rule8 = {
386
+ var rule9 = {
357
387
  meta: {
358
388
  type: "problem",
359
389
  docs: { description: "Report every use of a value whose type was declared by an origin that is not type-trusted." },
@@ -385,7 +415,7 @@ var rule8 = {
385
415
  };
386
416
  }
387
417
  };
388
- var untrusted_value_default = rule8;
418
+ var untrusted_value_default = rule9;
389
419
 
390
420
  // src/eslint/index.ts
391
421
  var rules = {
@@ -396,6 +426,7 @@ var rules = {
396
426
  "dropped-result": dropped_result_default,
397
427
  "trusted-state": trusted_state_default,
398
428
  "redundant-guard": redundant_guard_default,
429
+ "finally-return": finally_return_default,
399
430
  "boundary-result": boundary_result_default
400
431
  };
401
432
  var plugin = {
@@ -420,6 +451,7 @@ function typedConfig(options) {
420
451
  "trust/dropped-result": [severity, ruleOptions],
421
452
  "trust/trusted-state": [severity, ruleOptions],
422
453
  "trust/redundant-guard": [severity, ruleOptions],
454
+ "trust/finally-return": [severity, ruleOptions],
423
455
  "trust/boundary-result": [severity, ruleOptions]
424
456
  }
425
457
  }
@@ -435,6 +467,9 @@ export {
435
467
  DIRECTIVE_ORIGIN,
436
468
  DROPPED_RESULT_MESSAGES,
437
469
  DROPPED_RESULT_RULE,
470
+ FINALLY_RETURN_MESSAGES,
471
+ FINALLY_RETURN_ORIGIN,
472
+ FINALLY_RETURN_RULE,
438
473
  OriginResolver,
439
474
  PRESETS,
440
475
  REDUNDANT_GUARD_MESSAGES,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/eslint/rule-setup.ts","../../src/eslint/rules/boundary-result.ts","../../src/eslint/rules/dropped-result.ts","../../src/eslint/rules/trusted-state.ts","../../src/eslint/rules/redundant-guard.ts","../../src/eslint/rules/throw-must-return-result.ts","../../src/eslint/rules/type-claim.ts","../../src/eslint/rules/untrusted-call-must-return-result.ts","../../src/eslint/rules/untrusted-value.ts","../../src/eslint/index.ts"],"sourcesContent":["// Shared per-file setup for both rules: trust config, file zone, guard context, and the mapping from\n// ESLint's ESTree nodes to the TypeScript nodes the shared rule logic (../core/rules.ts) works on.\nimport { resolve } from 'node:path';\nimport type { Rule } from 'eslint';\nimport type * as TS from 'typescript';\nimport { emptyTrustConfig, policyFor } from '../core/check-file.js';\nimport type { GuardContext } from '../core/guard.js';\nimport { nameBasedGuardContext, typedGuardContext } from '../core/rules.js';\nimport { loadTrustConfigCached, normalizeOrigin, type TrustConfig, type TrustRuleSettings } from './config.js';\nimport type { TrustPolicy } from './policy.js';\nimport { loadTypeScript, type TypeScript } from './typescript.js';\nimport { Zones, type Zone } from './zones.js';\n\nexport interface TrustRuleOptions {\n /** trust.config.json path, relative to the ESLint cwd. */\n readonly configFile?: string;\n /** Extra trusted origins (applied before the config chain). */\n readonly trust?: readonly string[];\n}\n\nexport const OPTIONS_SCHEMA = [\n {\n type: 'object',\n properties: {\n configFile: { type: 'string' },\n trust: { type: 'array', items: { type: 'string' } },\n },\n additionalProperties: false,\n },\n] as const;\n\ninterface ParserServices {\n readonly program?: TS.Program | null;\n readonly esTreeNodeToTSNodeMap?: { get(node: unknown): TS.Node };\n}\n\n/** ESTree node as ESLint hands it to a rule (ranges are always present). */\ntype EsNode = Rule.Node | { readonly range?: [number, number] };\n\nexport interface RuleSetup {\n readonly ts: TypeScript;\n readonly zone: Zone;\n readonly policy: TrustPolicy | null;\n readonly guardContext: GuardContext;\n /** Maps an ESTree node to its TypeScript node of the given kind. */\n readonly tsNode: <T extends TS.Node>(node: EsNode, is: (node: TS.Node) => node is T) => T;\n readonly checker: TS.TypeChecker | null;\n /** The program of typed linting (null without parser services). */\n readonly program: TS.Program | null;\n /** The loaded trust config (`boundaries`, `strict` globs, …). */\n readonly config: TrustConfig;\n /** The trust config's per-rule settings: an opt-in rule that is not on reports nothing. */\n readonly rules: TrustRuleSettings;\n /** The TypeScript source file of the linted file (its comments are read from it). */\n readonly sourceFile: () => TS.SourceFile;\n}\n\n/**\n * Without parser services (e.g. ESLint's default parser) the file is parsed once with TypeScript and\n * nodes are found by their source range, which ESTree and TypeScript agree on.\n */\nfunction rangeLocator(ts: TypeScript, context: Rule.RuleContext): Pick<RuleSetup, 'tsNode' | 'sourceFile'> {\n let parsed: TS.SourceFile | undefined;\n const sourceFile = (): TS.SourceFile => (parsed ??= ts.createSourceFile(context.filename, context.sourceCode.text, ts.ScriptTarget.Latest, true));\n return { tsNode: locate, sourceFile };\n function locate<T extends TS.Node>(node: EsNode, is: (node: TS.Node) => node is T): T {\n const file = sourceFile();\n const [start, end] = (node as { range: [number, number] }).range;\n let found: T | undefined;\n const visit = (candidate: TS.Node): void => {\n if (found || candidate.pos > start || candidate.end < end) return;\n if (candidate.end === end && candidate.getStart(file) === start && is(candidate)) found = candidate;\n else ts.forEachChild(candidate, visit);\n };\n visit(file);\n if (!found) throw new Error(`@noego/trust: no TypeScript node at ${context.filename}:${start}-${end}`);\n return found;\n }\n}\n\nfunction mapLocator(ts: TypeScript, context: Rule.RuleContext, map: NonNullable<ParserServices['esTreeNodeToTSNodeMap']>): Pick<RuleSetup, 'tsNode' | 'sourceFile'> {\n const tsNode = function mapped<T extends TS.Node>(node: EsNode, is: (node: TS.Node) => node is T): T {\n const target = map.get(node);\n if (!target || !is(target)) throw new Error(`@noego/trust: unexpected TypeScript node in ${context.filename}`);\n return target;\n };\n return { tsNode, sourceFile: () => tsNode(context.sourceCode.ast, ts.isSourceFile) };\n}\n\nexport function setupRule(context: Rule.RuleContext): RuleSetup {\n const options = (context.options[0] ?? {}) as TrustRuleOptions;\n const ts = loadTypeScript(context.cwd);\n const config = options.configFile ? loadTrustConfigCached(resolve(context.cwd, options.configFile)) : emptyTrustConfig(context.cwd);\n const services = context.sourceCode.parserServices as ParserServices | undefined;\n const program = services?.program ?? null;\n const map = services?.esTreeNodeToTSNodeMap;\n const { tsNode, sourceFile } = map ? mapLocator(ts, context, map) : rangeLocator(ts, context);\n if (!program || !map) {\n const zones = new Zones(config.rootDir, config.passthrough, config.ignore);\n return { ts, zone: zones.zoneOf(context.filename), policy: null, guardContext: nameBasedGuardContext(ts), tsNode, checker: null, program: null, config, rules: config.rules, sourceFile };\n }\n const checker = program.getTypeChecker();\n const policy = policyFor(ts, checker, config, (options.trust ?? []).map(normalizeOrigin));\n return {\n ts,\n zone: policy.zones.zoneOf(context.filename),\n policy,\n guardContext: typedGuardContext(ts, checker, policy),\n tsNode,\n checker,\n program,\n config,\n rules: config.rules,\n sourceFile,\n };\n}\n","// ESLint adapter for boundary-result: in a file the trust config names as a boundary (`boundaries`), every\n// exported function and public member whose return value can fail is reported, with the origin as messageId\n// (`returns-result`, `unproven-return`, `stale-exclude`, `overlapping-items`).\n// The decisions are the shared core rule (../../core/boundaries.ts), run once over the file's TypeScript\n// source; this file only reports them at their source positions. A stale-exclude finding belongs to the config\n// file, which ESLint cannot report into: it is reported at the start of the file the core attributes it to.\n// ESLint has no per-finding severity, so an unproven return is reported like the rest (`trust check` warns).\n// Off unless the trust config has `boundaries`, the same setting `trust check` honours. When on, it requires\n// typed linting (parserOptions.projectService or project).\nimport type { Rule } from 'eslint';\nimport { boundaryContext, boundaryFindingsIn } from '../../core/boundaries.js';\nimport { isStrictByConfig } from '../../core/check-file.js';\nimport { BOUNDARY_MESSAGES } from '../../core/messages.js';\nimport { OPTIONS_SCHEMA, setupRule } from '../rule-setup.js';\n\nexport { BOUNDARY_MESSAGES };\n\nconst rule: Rule.RuleModule = {\n meta: {\n type: 'problem',\n docs: { description: 'Report every boundary (exported function or public member of a configured boundary file) whose return value can fail.' },\n schema: OPTIONS_SCHEMA as unknown as Rule.RuleMetaData['schema'],\n messages: BOUNDARY_MESSAGES,\n },\n create(context) {\n const setup = setupRule(context);\n if (setup.config.boundaries.length === 0) return {};\n if (!setup.policy || !setup.checker || !setup.program) {\n throw new Error('boundary-result requires typed linting (parserOptions.projectService or project).');\n }\n if (setup.zone !== 'checked') return {};\n const { ts, tsNode, checker, policy, program, config } = setup;\n const { sourceCode } = context;\n\n return {\n Program(node) {\n const sourceFile = tsNode(node, ts.isSourceFile);\n const strict = isStrictByConfig(config, sourceFile.fileName);\n for (const found of boundaryFindingsIn(sourceFile, boundaryContext(ts, checker, program, policy, config), strict)) {\n context.report({ loc: sourceCode.getLocFromIndex(found.start), messageId: found.origin, data: { ...found.data } });\n }\n },\n };\n },\n};\n\nexport default rule;\n","// ESLint adapter for dropped-result: a Result that can still fail must be passed up (returned) or handled\n// (Trust.decide / Trust.translate, a branch naming its kind); every place a failure is dropped instead is\n// reported, with the origin as messageId (`discarded`, `argument`, `stored`, `callback`, `return`, `end`,\n// `overwritten`).\n// The decisions are the shared core rule (../../core/dropped-results.ts), run once over the file's\n// TypeScript source; this file only reports them at their source positions.\n// Opt-in: it reports nothing unless the trust config turns it on (`\"rules\": { \"dropped-result\": \"on\" }`), the\n// same setting `trust check` honours. When on, it requires typed linting (parserOptions.projectService or project).\nimport type { Rule } from 'eslint';\nimport { droppedResultContext, droppedResultData, droppedResultsIn } from '../../core/dropped-results.js';\nimport { DROPPED_RESULT_MESSAGES, DROPPED_RESULT_RULE } from '../../core/messages.js';\nimport { isRuleEnabled } from '../config.js';\nimport { OPTIONS_SCHEMA, setupRule } from '../rule-setup.js';\n\nexport { DROPPED_RESULT_MESSAGES };\n\nconst rule: Rule.RuleModule = {\n meta: {\n type: 'problem',\n docs: { description: 'Report every place a Result that can still fail is dropped instead of returned or handled.' },\n schema: OPTIONS_SCHEMA as unknown as Rule.RuleMetaData['schema'],\n messages: DROPPED_RESULT_MESSAGES,\n },\n create(context) {\n const setup = setupRule(context);\n if (!isRuleEnabled(setup, DROPPED_RESULT_RULE)) return {};\n if (!setup.policy || !setup.checker) {\n throw new Error('dropped-result requires typed linting (parserOptions.projectService or project).');\n }\n if (setup.zone !== 'checked') return {};\n const { ts, tsNode, checker, policy } = setup;\n const { sourceCode } = context;\n\n return {\n Program(node) {\n const sourceFile = tsNode(node, ts.isSourceFile);\n for (const dropped of droppedResultsIn(sourceFile, droppedResultContext(ts, checker, policy))) {\n context.report({ loc: sourceCode.getLocFromIndex(dropped.start), messageId: dropped.origin, data: droppedResultData(dropped) });\n }\n },\n };\n },\n};\n\nexport default rule;\n","// ESLint controls severity per rule, not per finding; the core marks single-state as a warning.\nimport type { Rule } from 'eslint';\nimport { trustedStateContext, trustedStatesIn } from '../../core/trusted-state.js';\nimport { TRUSTED_STATE_MESSAGES, TRUSTED_STATE_RULE } from '../../core/messages.js';\nimport { isRuleEnabled } from '../config.js';\nimport { OPTIONS_SCHEMA, setupRule } from '../rule-setup.js';\n\nexport { TRUSTED_STATE_MESSAGES };\n\nconst rule: Rule.RuleModule = {\n meta: {\n type: 'problem',\n docs: { description: 'Require distinct success outcomes to use literal states.' },\n schema: OPTIONS_SCHEMA as unknown as Rule.RuleMetaData['schema'],\n messages: TRUSTED_STATE_MESSAGES,\n },\n create(context) {\n const setup = setupRule(context);\n if (!isRuleEnabled(setup, TRUSTED_STATE_RULE)) return {};\n if (!setup.policy || !setup.checker) {\n throw new Error('trusted-state requires typed linting (parserOptions.projectService or project).');\n }\n if (setup.zone !== 'checked') return {};\n const { ts, tsNode, checker, policy } = setup;\n const { sourceCode } = context;\n\n return {\n Program(node) {\n const sourceFile = tsNode(node, ts.isSourceFile);\n for (const dropped of trustedStatesIn(sourceFile, trustedStateContext(ts, checker, policy))) {\n context.report({ loc: sourceCode.getLocFromIndex(dropped.start), messageId: dropped.origin, data: dropped.data });\n }\n },\n };\n },\n};\n\nexport default rule;\n","// ESLint adapter for redundant-guard: a Trust.try / Trust.tryAsync (or a `try` whose `catch` returns\n// Result.err) around code that cannot fail — every call inside is trusted, first-party, or declared to return\n// a Result — invents a failure path; it is reported at the guard (messageId `redundant`).\n// The decisions are the shared core rule (../../core/redundant-guards.ts), run once over the file's TypeScript\n// source; this file only reports them at their source positions.\n// Opt-in: it reports nothing unless the trust config turns it on (`\"rules\": { \"redundant-guard\": \"on\" }`), the\n// same setting `trust check` honours. When on, it requires typed linting (parserOptions.projectService or project).\nimport type { Rule } from 'eslint';\nimport { REDUNDANT_GUARD_MESSAGES, REDUNDANT_GUARD_RULE } from '../../core/messages.js';\nimport { redundantGuardData, redundantGuardsIn } from '../../core/redundant-guards.js';\nimport { typedGuardContext } from '../../core/rules.js';\nimport { isRuleEnabled } from '../config.js';\nimport { OPTIONS_SCHEMA, setupRule } from '../rule-setup.js';\n\nexport { REDUNDANT_GUARD_MESSAGES };\n\nconst rule: Rule.RuleModule = {\n meta: {\n type: 'problem',\n docs: { description: 'Report every guard (Trust.try / Trust.tryAsync / try-catch) around code that cannot fail.' },\n schema: OPTIONS_SCHEMA as unknown as Rule.RuleMetaData['schema'],\n messages: REDUNDANT_GUARD_MESSAGES,\n },\n create(context) {\n const setup = setupRule(context);\n if (!isRuleEnabled(setup, REDUNDANT_GUARD_RULE)) return {};\n if (!setup.policy || !setup.checker) {\n throw new Error('redundant-guard requires typed linting (parserOptions.projectService or project).');\n }\n if (setup.zone !== 'checked') return {};\n const { ts, tsNode, checker, policy } = setup;\n const { sourceCode } = context;\n\n return {\n Program(node) {\n const sourceFile = tsNode(node, ts.isSourceFile);\n const guardContext = typedGuardContext(ts, checker, policy);\n for (const guard of redundantGuardsIn(sourceFile, { ts, checker, policy, guardContext })) {\n context.report({ loc: sourceCode.getLocFromIndex(guard.start), messageId: 'redundant', data: redundantGuardData(guard) });\n }\n },\n };\n },\n};\n\nexport default rule;\n","// ESLint adapter for throw-must-return-result: every `throw` in checked code must be guarded —\n// inside a `try` (same function) whose `catch` returns Result.err(...) on every path, or inside a\n// Trust.try / Trust.tryAsync callback. The decision is the shared core rule (../../core/rules.ts);\n// this file only maps ESTree nodes to TypeScript nodes and reports.\n// Works with or without type information; with it, Result.err is recognised by declaration.\n// A `throw` in a statement marked `//trust:accept <reason>` is accepted, and every `//trust:accept` that\n// accepts nothing is reported here, at the comment (`directive`, ../../core/accept.ts). Without type\n// information an accept above a statement with nothing to accept (stale) cannot be told, so it is not reported.\nimport type { Rule } from 'eslint';\nimport { acceptanceOf, acceptDirectiveFindings } from '../../core/accept.js';\nimport { ACCEPT_DIRECTIVE_MESSAGES, THROW_MESSAGES } from '../../core/messages.js';\nimport { throwProblem } from '../../core/rules.js';\nimport { OPTIONS_SCHEMA, setupRule } from '../rule-setup.js';\n\nexport { THROW_MESSAGES };\n\nconst rule: Rule.RuleModule = {\n meta: {\n type: 'problem',\n docs: { description: 'Require every throw to be caught locally and returned as Result.err.' },\n schema: OPTIONS_SCHEMA as unknown as Rule.RuleMetaData['schema'],\n messages: { ...THROW_MESSAGES, ...ACCEPT_DIRECTIVE_MESSAGES },\n },\n create(context) {\n const setup = setupRule(context);\n if (setup.zone !== 'checked') return {};\n const { ts, tsNode, guardContext, policy, checker } = setup;\n const { sourceCode } = context;\n return {\n Program() {\n const failureContext = policy && checker ? { ts, checker, policy, guardContext } : null;\n const sourceFile = setup.sourceFile();\n for (const found of acceptDirectiveFindings(ts, sourceFile, failureContext)) {\n const loc = { start: sourceCode.getLocFromIndex(found.directive.pos), end: sourceCode.getLocFromIndex(found.directive.end) };\n context.report({ loc, messageId: found.messageId, data: found.data });\n }\n },\n ThrowStatement(node) {\n const statement = tsNode(node, ts.isThrowStatement);\n const messageId = throwProblem(statement, guardContext);\n if (messageId && !acceptanceOf(ts, statement)) context.report({ node, messageId });\n },\n };\n },\n};\n\nexport default rule;\n","// ESLint adapter for type-claim: every place a type is claimed instead of proven — a narrowing\n// `as`, `x!`, `any` in a typed position, a written type predicate, a caller-chosen generic return —\n// is reported, with the claim kind as messageId (`claim:as`, `claim:non-null`, `claim:any`,\n// `claim:predicate`, `claim:generic-return`; `unanalyzable` for a node whose type does not resolve;\n// `directive` for a `//trust:` comment that marks nothing). Claims inside a validator (a function marked\n// `//trust:validator_function`) are not reported.\n// The decisions are the shared core rule (../../core/type-claims.ts), run once over the file's\n// TypeScript source; this file only reports them at their source positions.\n// Opt-in: it reports nothing unless the trust config turns it on (`\"rules\": { \"type-claim\": \"on\" }`), the\n// same setting `trust check` honours. When on, it requires typed linting (parserOptions.projectService or project).\nimport type { Rule } from 'eslint';\nimport { TYPE_CLAIM_MESSAGES, TYPE_CLAIM_RULE } from '../../core/messages.js';\nimport { claimSpan, typeClaimContext, typeClaimsIn } from '../../core/type-claims.js';\nimport { isRuleEnabled } from '../config.js';\nimport { OPTIONS_SCHEMA, setupRule } from '../rule-setup.js';\n\nexport { TYPE_CLAIM_MESSAGES };\n\nconst rule: Rule.RuleModule = {\n meta: {\n type: 'problem',\n docs: { description: 'Report every place a type is claimed instead of proven.' },\n schema: OPTIONS_SCHEMA as unknown as Rule.RuleMetaData['schema'],\n messages: TYPE_CLAIM_MESSAGES,\n },\n create(context) {\n const setup = setupRule(context);\n if (!isRuleEnabled(setup, TYPE_CLAIM_RULE)) return {};\n if (!setup.policy || !setup.checker) {\n throw new Error('type-claim requires typed linting (parserOptions.projectService or project).');\n }\n if (setup.zone !== 'checked') return {};\n const { ts, tsNode, checker, policy } = setup;\n const { sourceCode } = context;\n\n return {\n Program(node) {\n const sourceFile = tsNode(node, ts.isSourceFile);\n for (const claim of typeClaimsIn(sourceFile, typeClaimContext(ts, checker, undefined, policy))) {\n const span = claimSpan(claim, sourceFile);\n const loc = { start: sourceCode.getLocFromIndex(span.start), end: sourceCode.getLocFromIndex(span.end) };\n context.report({ loc, messageId: claim.origin, data: claim.data });\n }\n },\n };\n },\n};\n\nexport default rule;\n","// ESLint adapter for untrusted-call-must-return-result: every call or `new` whose callee is\n// untrusted must be guarded — inside a `try` (same function) whose `catch` returns Result.err(...)\n// on every path, or inside a Trust.try / Trust.tryAsync callback. Trust comes from\n// trust.config.json (see ../config.ts), from first-party checked code, or from a declared return\n// type of Result / Promise<Result> from @noego/trust. The decision is the shared core rule\n// (../../core/rules.ts); this file only maps ESTree nodes to TypeScript nodes and reports.\n// Requires typed linting (parserOptions.projectService or project). A call in a statement marked\n// `//trust:accept <reason>` is accepted (../../core/accept.ts).\nimport type { Rule } from 'eslint';\nimport type * as TS from 'typescript';\nimport { acceptanceOf } from '../../core/accept.js';\nimport { UNTRUSTED_CALL_MESSAGES } from '../../core/messages.js';\nimport { untrustedCallProblem } from '../../core/rules.js';\nimport { OPTIONS_SCHEMA, setupRule } from '../rule-setup.js';\n\nexport { UNTRUSTED_CALL_MESSAGES };\n\nconst rule: Rule.RuleModule = {\n meta: {\n type: 'problem',\n docs: { description: 'Require calls into untrusted code to be handled locally and returned as Result.err.' },\n schema: OPTIONS_SCHEMA as unknown as Rule.RuleMetaData['schema'],\n messages: UNTRUSTED_CALL_MESSAGES,\n },\n create(context) {\n const setup = setupRule(context);\n if (!setup.policy || !setup.checker) {\n throw new Error('untrusted-call-must-return-result requires typed linting (parserOptions.projectService or project).');\n }\n if (setup.zone !== 'checked') return {};\n const { ts, policy, tsNode, checker, guardContext } = setup;\n const isCallOrNew = (node: TS.Node): node is TS.CallExpression | TS.NewExpression => ts.isCallExpression(node) || ts.isNewExpression(node);\n\n function check(node: Rule.Node): void {\n const call = tsNode(node, isCallOrNew);\n const problem = untrustedCallProblem(call, policy, checker, guardContext);\n if (problem && !acceptanceOf(ts, call)) context.report({ node, messageId: problem.messageId, data: { origin: problem.origin } });\n }\n\n return { CallExpression: check, NewExpression: check };\n },\n};\n\nexport default rule;\n","// ESLint adapter for untrusted-value: type trust is opt-in. A value whose type was declared by an origin\n// that is not on the type-trust list (`trust_type` in trust.config.json) — a call's return, a parameter of\n// a callback the outside calls, a property or global it declares — may only be passed to a validator, kept\n// as `unknown`, or tested by a built-in check; any other use is reported with the origin named.\n// The decisions are the shared core rule (../../core/untrusted-values.ts), run once over the file's\n// TypeScript source; this file only reports them at their source positions.\n// Opt-in: it reports nothing unless the trust config turns it on (`\"rules\": { \"untrusted-value\": \"on\" }`), the\n// same setting `trust check` honours. When on, it requires typed linting (parserOptions.projectService or project).\nimport type { Rule } from 'eslint';\nimport type * as TS from 'typescript';\nimport { UNTRUSTED_VALUE_MESSAGES, UNTRUSTED_VALUE_RULE } from '../../core/messages.js';\nimport {\n untrustedHandoffData,\n untrustedHandoffsIn,\n untrustedValueContext,\n untrustedValueData,\n untrustedValueMessageId,\n untrustedValuesIn,\n} from '../../core/untrusted-values.js';\nimport { isRuleEnabled } from '../config.js';\nimport { OPTIONS_SCHEMA, setupRule } from '../rule-setup.js';\n\nexport { UNTRUSTED_VALUE_MESSAGES };\n\nconst rule: Rule.RuleModule = {\n meta: {\n type: 'problem',\n docs: { description: 'Report every use of a value whose type was declared by an origin that is not type-trusted.' },\n schema: OPTIONS_SCHEMA as unknown as Rule.RuleMetaData['schema'],\n messages: UNTRUSTED_VALUE_MESSAGES,\n },\n create(context) {\n const setup = setupRule(context);\n if (!isRuleEnabled(setup, UNTRUSTED_VALUE_RULE)) return {};\n if (!setup.policy || !setup.checker) {\n throw new Error('untrusted-value requires typed linting (parserOptions.projectService or project).');\n }\n if (setup.zone !== 'checked') return {};\n const { ts, tsNode, checker, policy } = setup;\n const { sourceCode } = context;\n\n return {\n Program(node) {\n const sourceFile = tsNode(node, ts.isSourceFile);\n const valueContext = untrustedValueContext(ts, checker, policy);\n const locOf = (at: TS.Node) => ({ start: sourceCode.getLocFromIndex(at.getStart(sourceFile)), end: sourceCode.getLocFromIndex(at.getEnd()) });\n for (const value of untrustedValuesIn(sourceFile, valueContext)) {\n if (value.outcome !== 'finding') continue;\n context.report({ loc: locOf(value.node), messageId: untrustedValueMessageId(value), data: untrustedValueData(value) });\n }\n // `untrustedCallbacks: \"all\"`: functions handed to an origin that is not type-trusted, at the hand-off.\n for (const handoff of untrustedHandoffsIn(sourceFile, valueContext)) {\n context.report({ loc: locOf(handoff.node), messageId: 'handoff', data: untrustedHandoffData(handoff) });\n }\n },\n };\n },\n};\n\nexport default rule;\n","// @noego/trust/eslint — ESLint plugin, trust config loader, and policy.\n//\n// import { typedConfig } from '@noego/trust/eslint';\n// export default [\n// ...typedConfig({ files: ['server/**/*.ts'], configFile: 'trust.config.json' }),\n// ];\nimport type { ESLint, Linter } from 'eslint';\nimport boundaryResult from './rules/boundary-result.js';\nimport droppedResult from './rules/dropped-result.js';\nimport trustedState from './rules/trusted-state.js';\nimport redundantGuard from './rules/redundant-guard.js';\nimport throwMustReturnResult from './rules/throw-must-return-result.js';\nimport typeClaim from './rules/type-claim.js';\nimport untrustedCallMustReturnResult from './rules/untrusted-call-must-return-result.js';\nimport untrustedValue from './rules/untrusted-value.js';\n\nexport const rules = {\n 'untrusted-call-must-return-result': untrustedCallMustReturnResult,\n 'throw-must-return-result': throwMustReturnResult,\n 'type-claim': typeClaim,\n 'untrusted-value': untrustedValue,\n 'dropped-result': droppedResult,\n 'trusted-state': trustedState,\n 'redundant-guard': redundantGuard,\n 'boundary-result': boundaryResult,\n};\n\nexport interface TypedConfigOptions {\n /** Files to check (flat-config globs). They must be in a tsconfig the project service can find. */\n readonly files: readonly string[];\n readonly ignores?: readonly string[];\n /** trust.config.json path relative to the ESLint cwd (default \"trust.config.json\"). */\n readonly configFile?: string;\n readonly severity?: Linter.RuleSeverity;\n}\n\nconst plugin: ESLint.Plugin = {\n meta: { name: '@noego/trust' },\n rules,\n};\n\nexport default plugin;\n\n/**\n * Flat config that registers the plugin as `trust` and enables its rules (the two trust rules, `type-claim`,\n * `untrusted-value` and `dropped-result`) for `files`. Needs typed linting. `type-claim`, `untrusted-value` and\n * `dropped-result` are opt-in: they report only when the trust config turns them on\n * (`\"rules\": { \"type-claim\": \"on\", \"untrusted-value\": \"on\", \"dropped-result\": \"on\" }`), the same settings\n * `trust check` / `trust baseline` honour, so ESLint and the CLI always agree.\n */\nexport function typedConfig(options: TypedConfigOptions): Linter.Config[] {\n const severity = options.severity ?? 'warn';\n const ruleOptions = { configFile: options.configFile ?? 'trust.config.json' };\n return [\n {\n name: '@noego/trust/typed',\n files: [...options.files],\n ignores: [...(options.ignores ?? [])],\n plugins: { trust: plugin },\n rules: {\n 'trust/untrusted-call-must-return-result': [severity, ruleOptions],\n 'trust/throw-must-return-result': [severity, ruleOptions],\n 'trust/type-claim': [severity, ruleOptions],\n 'trust/untrusted-value': [severity, ruleOptions],\n 'trust/dropped-result': [severity, ruleOptions],\n 'trust/trusted-state': [severity, ruleOptions],\n 'trust/redundant-guard': [severity, ruleOptions],\n 'trust/boundary-result': [severity, ruleOptions],\n },\n },\n ];\n}\n\nexport {\n DEFAULT_RULE_SETTINGS,\n effectiveTrustList,\n effectiveTypeTrustList,\n isRuleEnabled,\n loadTrustConfig,\n normalizeOrigin,\n TrustConfigError,\n type BoundaryGroup,\n type LoadTrustConfigOptions,\n type OptInRule,\n type RuleSwitch,\n type TrustConfig,\n type TrustEntry,\n type TrustLevel,\n type TrustRuleSettings,\n type TsconfigMapping,\n type UntrustedCallbacks,\n} from './config.js';\nexport { PRESETS, type PresetDefinition } from './presets.js';\nexport { entryMatches, TrustPolicy, type MatchedEntry, type TypeVerdict, type Verdict } from './policy.js';\nexport { OriginResolver, type OriginInfo } from './origin.js';\nexport { Zones, type Zone, type ZoneGroup } from './zones.js';\nexport { alwaysExits, catchProblem, guardOf, type Guard, type GuardContext } from '../core/guard.js';\nexport type { CatchProblem } from '../core/messages.js';\nexport {\n compareToBaseline,\n countFindings,\n parseBaseline,\n serializeBaseline,\n THROW_RULE,\n UNTRUSTED_CALL_RULE,\n updateBaseline,\n WHOLE_BASELINE,\n type BaselineCounts,\n type BaselineDelta,\n type BaselineScope,\n type Finding,\n} from '../core/baseline.js';\nexport { DIRECTIVE_ORIGIN, TYPE_CLAIM_KINDS, TYPE_CLAIM_RULE, UNANALYZABLE_ORIGIN, type TypeClaimOrigin } from '../core/messages.js';\nexport { CATCH_ORIGIN, UNTRUSTED_VALUE_RULE, type UntrustedEntry } from '../core/messages.js';\nexport { DROPPED_RESULT_RULE, type DroppedResultOrigin } from '../core/messages.js';\nexport { DROPPED_RESULT_MESSAGES } from './rules/dropped-result.js';\nexport { REDUNDANT_GUARD_ORIGIN, REDUNDANT_GUARD_RULE } from '../core/messages.js';\nexport { REDUNDANT_GUARD_MESSAGES } from './rules/redundant-guard.js';\nexport { BOUNDARY_RULE, type BoundaryOrigin } from '../core/messages.js';\nexport { BOUNDARY_MESSAGES } from './rules/boundary-result.js';\nexport { ACCEPT_DIRECTIVE, isInsideValidator, isMarkedValidator, VALIDATOR_DIRECTIVE } from '../core/validator.js';\nexport { ACCEPT_DIRECTIVE_MESSAGES } from '../core/messages.js';\nexport { THROW_MESSAGES } from './rules/throw-must-return-result.js';\nexport { TYPE_CLAIM_MESSAGES } from './rules/type-claim.js';\nexport { UNTRUSTED_CALL_MESSAGES } from './rules/untrusted-call-must-return-result.js';\nexport { UNTRUSTED_VALUE_MESSAGES } from './rules/untrusted-value.js';\nexport type { TrustRuleOptions } from './rule-setup.js';\n\nexport { TRUSTED_STATE_RULE, TRUSTED_STATE_MESSAGES, type TrustedStateOrigin } from '../core/messages.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,SAAS,eAAe;AAkBjB,IAAM,iBAAiB;AAAA,EAC5B;AAAA,IACE,MAAM;AAAA,IACN,YAAY;AAAA,MACV,YAAY,EAAE,MAAM,SAAS;AAAA,MAC7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AG,QAAQ,KAAK;AAAA,MACxB,SAAS,CAAC,GAAI,QAAQ,WAAW,CAAC,CAAE;AAAA,MACpC,SAAS,EAAE,OAAO,OAAO;AAAA,MACzB,OAAO;AAAA,QACL,2CAA2C,CAAC,UAAU,WAAW;AAAA,QACjE,kCAAkC,CAAC,UAAU,WAAW;AAAA,QACxD,oBAAoB,CAAC,UAAU,WAAW;AAAA,QAC1C,yBAAyB,CAAC,UAAU,WAAW;AAAA,QAC/C,wBAAwB,CAAC,UAAU,WAAW;AAAA,QAC9C,uBAAuB,CAAC,UAAU,WAAW;AAAA,QAC7C,yBAAyB,CAAC,UAAU,WAAW;AAAA,QAC/C,yBAAyB,CAAC,UAAU,WAAW;AAAA,MACjD;AAAA,IACF;AAAA,EACF;AACF;","names":["rule","rule","rule","rule","rule","rule","rule"]}
1
+ {"version":3,"sources":["../../src/eslint/rule-setup.ts","../../src/eslint/rules/boundary-result.ts","../../src/eslint/rules/dropped-result.ts","../../src/eslint/rules/finally-return.ts","../../src/eslint/rules/trusted-state.ts","../../src/eslint/rules/redundant-guard.ts","../../src/eslint/rules/throw-must-return-result.ts","../../src/eslint/rules/type-claim.ts","../../src/eslint/rules/untrusted-call-must-return-result.ts","../../src/eslint/rules/untrusted-value.ts","../../src/eslint/index.ts"],"sourcesContent":["// Shared per-file setup for both rules: trust config, file zone, guard context, and the mapping from\n// ESLint's ESTree nodes to the TypeScript nodes the shared rule logic (../core/rules.ts) works on.\nimport { resolve } from 'node:path';\nimport type { Rule } from 'eslint';\nimport type * as TS from 'typescript';\nimport { emptyTrustConfig, policyFor } from '../core/check-file.js';\nimport type { GuardContext } from '../core/guard.js';\nimport { nameBasedGuardContext, typedGuardContext } from '../core/rules.js';\nimport { loadTrustConfigCached, normalizeOrigin, type TrustConfig, type TrustRuleSettings } from './config.js';\nimport type { TrustPolicy } from './policy.js';\nimport { loadTypeScript, type TypeScript } from './typescript.js';\nimport { Zones, type Zone } from './zones.js';\n\nexport interface TrustRuleOptions {\n /** trust.config.json path, relative to the ESLint cwd. */\n readonly configFile?: string;\n /** Extra trusted origins (applied before the config chain). */\n readonly trust?: readonly string[];\n}\n\nexport const OPTIONS_SCHEMA = [\n {\n type: 'object',\n properties: {\n configFile: { type: 'string' },\n trust: { type: 'array', items: { type: 'string' } },\n },\n additionalProperties: false,\n },\n] as const;\n\ninterface ParserServices {\n readonly program?: TS.Program | null;\n readonly esTreeNodeToTSNodeMap?: { get(node: unknown): TS.Node };\n}\n\n/** ESTree node as ESLint hands it to a rule (ranges are always present). */\ntype EsNode = Rule.Node | { readonly range?: [number, number] };\n\nexport interface RuleSetup {\n readonly ts: TypeScript;\n readonly zone: Zone;\n readonly policy: TrustPolicy | null;\n readonly guardContext: GuardContext;\n /** Maps an ESTree node to its TypeScript node of the given kind. */\n readonly tsNode: <T extends TS.Node>(node: EsNode, is: (node: TS.Node) => node is T) => T;\n readonly checker: TS.TypeChecker | null;\n /** The program of typed linting (null without parser services). */\n readonly program: TS.Program | null;\n /** The loaded trust config (`boundaries`, `strict` globs, …). */\n readonly config: TrustConfig;\n /** The trust config's per-rule settings: an opt-in rule that is not on reports nothing. */\n readonly rules: TrustRuleSettings;\n /** The TypeScript source file of the linted file (its comments are read from it). */\n readonly sourceFile: () => TS.SourceFile;\n}\n\n/**\n * Without parser services (e.g. ESLint's default parser) the file is parsed once with TypeScript and\n * nodes are found by their source range, which ESTree and TypeScript agree on.\n */\nfunction rangeLocator(ts: TypeScript, context: Rule.RuleContext): Pick<RuleSetup, 'tsNode' | 'sourceFile'> {\n let parsed: TS.SourceFile | undefined;\n const sourceFile = (): TS.SourceFile => (parsed ??= ts.createSourceFile(context.filename, context.sourceCode.text, ts.ScriptTarget.Latest, true));\n return { tsNode: locate, sourceFile };\n function locate<T extends TS.Node>(node: EsNode, is: (node: TS.Node) => node is T): T {\n const file = sourceFile();\n const [start, end] = (node as { range: [number, number] }).range;\n let found: T | undefined;\n const visit = (candidate: TS.Node): void => {\n if (found || candidate.pos > start || candidate.end < end) return;\n if (candidate.end === end && candidate.getStart(file) === start && is(candidate)) found = candidate;\n else ts.forEachChild(candidate, visit);\n };\n visit(file);\n if (!found) throw new Error(`@noego/trust: no TypeScript node at ${context.filename}:${start}-${end}`);\n return found;\n }\n}\n\nfunction mapLocator(ts: TypeScript, context: Rule.RuleContext, map: NonNullable<ParserServices['esTreeNodeToTSNodeMap']>): Pick<RuleSetup, 'tsNode' | 'sourceFile'> {\n const tsNode = function mapped<T extends TS.Node>(node: EsNode, is: (node: TS.Node) => node is T): T {\n const target = map.get(node);\n if (!target || !is(target)) throw new Error(`@noego/trust: unexpected TypeScript node in ${context.filename}`);\n return target;\n };\n return { tsNode, sourceFile: () => tsNode(context.sourceCode.ast, ts.isSourceFile) };\n}\n\nexport function setupRule(context: Rule.RuleContext): RuleSetup {\n const options = (context.options[0] ?? {}) as TrustRuleOptions;\n const ts = loadTypeScript(context.cwd);\n const config = options.configFile ? loadTrustConfigCached(resolve(context.cwd, options.configFile)) : emptyTrustConfig(context.cwd);\n const services = context.sourceCode.parserServices as ParserServices | undefined;\n const program = services?.program ?? null;\n const map = services?.esTreeNodeToTSNodeMap;\n const { tsNode, sourceFile } = map ? mapLocator(ts, context, map) : rangeLocator(ts, context);\n if (!program || !map) {\n const zones = new Zones(config.rootDir, config.passthrough, config.ignore);\n return { ts, zone: zones.zoneOf(context.filename), policy: null, guardContext: nameBasedGuardContext(ts), tsNode, checker: null, program: null, config, rules: config.rules, sourceFile };\n }\n const checker = program.getTypeChecker();\n const policy = policyFor(ts, checker, config, (options.trust ?? []).map(normalizeOrigin));\n return {\n ts,\n zone: policy.zones.zoneOf(context.filename),\n policy,\n guardContext: typedGuardContext(ts, checker, policy),\n tsNode,\n checker,\n program,\n config,\n rules: config.rules,\n sourceFile,\n };\n}\n","// ESLint adapter for boundary-result: in a file the trust config names as a boundary (`boundaries`), every\n// exported function and public member whose return value can fail is reported, with the origin as messageId\n// (`returns-result`, `unproven-return`, `stale-exclude`, `overlapping-items`).\n// The decisions are the shared core rule (../../core/boundaries.ts), run once over the file's TypeScript\n// source; this file only reports them at their source positions. A stale-exclude finding belongs to the config\n// file, which ESLint cannot report into: it is reported at the start of the file the core attributes it to.\n// ESLint has no per-finding severity, so an unproven return is reported like the rest (`trust check` warns).\n// Off unless the trust config has `boundaries`, the same setting `trust check` honours. When on, it requires\n// typed linting (parserOptions.projectService or project).\nimport type { Rule } from 'eslint';\nimport { boundaryContext, boundaryFindingsIn } from '../../core/boundaries.js';\nimport { isStrictByConfig } from '../../core/check-file.js';\nimport { BOUNDARY_MESSAGES } from '../../core/messages.js';\nimport { OPTIONS_SCHEMA, setupRule } from '../rule-setup.js';\n\nexport { BOUNDARY_MESSAGES };\n\nconst rule: Rule.RuleModule = {\n meta: {\n type: 'problem',\n docs: { description: 'Report every boundary (exported function or public member of a configured boundary file) whose return value can fail.' },\n schema: OPTIONS_SCHEMA as unknown as Rule.RuleMetaData['schema'],\n messages: BOUNDARY_MESSAGES,\n },\n create(context) {\n const setup = setupRule(context);\n if (setup.config.boundaries.length === 0) return {};\n if (!setup.policy || !setup.checker || !setup.program) {\n throw new Error('boundary-result requires typed linting (parserOptions.projectService or project).');\n }\n if (setup.zone !== 'checked') return {};\n const { ts, tsNode, checker, policy, program, config } = setup;\n const { sourceCode } = context;\n\n return {\n Program(node) {\n const sourceFile = tsNode(node, ts.isSourceFile);\n const strict = isStrictByConfig(config, sourceFile.fileName);\n for (const found of boundaryFindingsIn(sourceFile, boundaryContext(ts, checker, program, policy, config), strict)) {\n context.report({ loc: sourceCode.getLocFromIndex(found.start), messageId: found.origin, data: { ...found.data } });\n }\n },\n };\n },\n};\n\nexport default rule;\n","// ESLint adapter for dropped-result: a Result that can still fail must be passed up (returned) or handled\n// (Trust.decide / Trust.translate, a branch naming its kind); every place a failure is dropped instead is\n// reported, with the origin as messageId (`discarded`, `argument`, `stored`, `callback`, `return`, `end`,\n// `overwritten`).\n// The decisions are the shared core rule (../../core/dropped-results.ts), run once over the file's\n// TypeScript source; this file only reports them at their source positions.\n// Opt-in: it reports nothing unless the trust config turns it on (`\"rules\": { \"dropped-result\": \"on\" }`), the\n// same setting `trust check` honours. When on, it requires typed linting (parserOptions.projectService or project).\nimport type { Rule } from 'eslint';\nimport { droppedResultContext, droppedResultData, droppedResultsIn } from '../../core/dropped-results.js';\nimport { DROPPED_RESULT_MESSAGES, DROPPED_RESULT_RULE } from '../../core/messages.js';\nimport { isRuleEnabled } from '../config.js';\nimport { OPTIONS_SCHEMA, setupRule } from '../rule-setup.js';\n\nexport { DROPPED_RESULT_MESSAGES };\n\nconst rule: Rule.RuleModule = {\n meta: {\n type: 'problem',\n docs: { description: 'Report every place a Result that can still fail is dropped instead of returned or handled.' },\n schema: OPTIONS_SCHEMA as unknown as Rule.RuleMetaData['schema'],\n messages: DROPPED_RESULT_MESSAGES,\n },\n create(context) {\n const setup = setupRule(context);\n if (!isRuleEnabled(setup, DROPPED_RESULT_RULE)) return {};\n if (!setup.policy || !setup.checker) {\n throw new Error('dropped-result requires typed linting (parserOptions.projectService or project).');\n }\n if (setup.zone !== 'checked') return {};\n const { ts, tsNode, checker, policy } = setup;\n const { sourceCode } = context;\n\n return {\n Program(node) {\n const sourceFile = tsNode(node, ts.isSourceFile);\n for (const dropped of droppedResultsIn(sourceFile, droppedResultContext(ts, checker, policy))) {\n context.report({ loc: sourceCode.getLocFromIndex(dropped.start), messageId: dropped.origin, data: droppedResultData(dropped) });\n }\n },\n };\n },\n};\n\nexport default rule;\n","// ESLint adapter for finally-return: every `return` inside a `finally` block (same function) in checked code\n// is reported (messageId `return`), so a `finally` block cannot overwrite an `Err` or `StatedOk` returned from `try`.\n// Opt-in: it reports nothing unless the trust config turns it on (`\"rules\": { \"finally-return\": \"on\" }`), the\n// same setting `trust check` honours.\nimport type { Rule } from 'eslint';\nimport { finallyReturnsIn } from '../../core/finally-returns.js';\nimport { FINALLY_RETURN_MESSAGES, FINALLY_RETURN_ORIGIN, FINALLY_RETURN_RULE } from '../../core/messages.js';\nimport { isRuleEnabled } from '../config.js';\nimport { OPTIONS_SCHEMA, setupRule } from '../rule-setup.js';\n\nexport { FINALLY_RETURN_MESSAGES };\n\nconst rule: Rule.RuleModule = {\n meta: {\n type: 'problem',\n docs: { description: 'Disallow `return` inside `finally` blocks so cleanup never overwrites a returned Result.' },\n schema: OPTIONS_SCHEMA as unknown as Rule.RuleMetaData['schema'],\n messages: FINALLY_RETURN_MESSAGES,\n },\n create(context) {\n const setup = setupRule(context);\n if (!isRuleEnabled(setup, FINALLY_RETURN_RULE)) return {};\n if (setup.zone !== 'checked') return {};\n const { ts } = setup;\n const { sourceCode } = context;\n\n return {\n Program() {\n const sourceFile = setup.sourceFile();\n for (const found of finallyReturnsIn(ts, sourceFile)) {\n context.report({ loc: sourceCode.getLocFromIndex(found.start), messageId: FINALLY_RETURN_ORIGIN });\n }\n },\n };\n },\n};\n\nexport default rule;\n","// ESLint controls severity per rule, not per finding; the core marks single-state as a warning.\nimport type { Rule } from 'eslint';\nimport { trustedStateContext, trustedStatesIn } from '../../core/trusted-state.js';\nimport { TRUSTED_STATE_MESSAGES, TRUSTED_STATE_RULE } from '../../core/messages.js';\nimport { isRuleEnabled } from '../config.js';\nimport { OPTIONS_SCHEMA, setupRule } from '../rule-setup.js';\n\nexport { TRUSTED_STATE_MESSAGES };\n\nconst rule: Rule.RuleModule = {\n meta: {\n type: 'problem',\n docs: { description: 'Require distinct success outcomes to use literal states.' },\n schema: OPTIONS_SCHEMA as unknown as Rule.RuleMetaData['schema'],\n messages: TRUSTED_STATE_MESSAGES,\n },\n create(context) {\n const setup = setupRule(context);\n if (!isRuleEnabled(setup, TRUSTED_STATE_RULE)) return {};\n if (!setup.policy || !setup.checker) {\n throw new Error('trusted-state requires typed linting (parserOptions.projectService or project).');\n }\n if (setup.zone !== 'checked') return {};\n const { ts, tsNode, checker, policy } = setup;\n const { sourceCode } = context;\n\n return {\n Program(node) {\n const sourceFile = tsNode(node, ts.isSourceFile);\n for (const dropped of trustedStatesIn(sourceFile, trustedStateContext(ts, checker, policy))) {\n context.report({ loc: sourceCode.getLocFromIndex(dropped.start), messageId: dropped.origin, data: dropped.data });\n }\n },\n };\n },\n};\n\nexport default rule;\n","// ESLint adapter for redundant-guard: a Trust.try / Trust.tryAsync (or a `try` whose `catch` returns\n// Result.err) around code that cannot fail — every call inside is trusted, first-party, or declared to return\n// a Result — invents a failure path; it is reported at the guard (messageId `redundant`).\n// The decisions are the shared core rule (../../core/redundant-guards.ts), run once over the file's TypeScript\n// source; this file only reports them at their source positions.\n// Opt-in: it reports nothing unless the trust config turns it on (`\"rules\": { \"redundant-guard\": \"on\" }`), the\n// same setting `trust check` honours. When on, it requires typed linting (parserOptions.projectService or project).\nimport type { Rule } from 'eslint';\nimport { REDUNDANT_GUARD_MESSAGES, REDUNDANT_GUARD_RULE } from '../../core/messages.js';\nimport { redundantGuardData, redundantGuardsIn } from '../../core/redundant-guards.js';\nimport { typedGuardContext } from '../../core/rules.js';\nimport { isRuleEnabled } from '../config.js';\nimport { OPTIONS_SCHEMA, setupRule } from '../rule-setup.js';\n\nexport { REDUNDANT_GUARD_MESSAGES };\n\nconst rule: Rule.RuleModule = {\n meta: {\n type: 'problem',\n docs: { description: 'Report every guard (Trust.try / Trust.tryAsync / try-catch) around code that cannot fail.' },\n schema: OPTIONS_SCHEMA as unknown as Rule.RuleMetaData['schema'],\n messages: REDUNDANT_GUARD_MESSAGES,\n },\n create(context) {\n const setup = setupRule(context);\n if (!isRuleEnabled(setup, REDUNDANT_GUARD_RULE)) return {};\n if (!setup.policy || !setup.checker) {\n throw new Error('redundant-guard requires typed linting (parserOptions.projectService or project).');\n }\n if (setup.zone !== 'checked') return {};\n const { ts, tsNode, checker, policy } = setup;\n const { sourceCode } = context;\n\n return {\n Program(node) {\n const sourceFile = tsNode(node, ts.isSourceFile);\n const guardContext = typedGuardContext(ts, checker, policy);\n for (const guard of redundantGuardsIn(sourceFile, { ts, checker, policy, guardContext })) {\n context.report({ loc: sourceCode.getLocFromIndex(guard.start), messageId: 'redundant', data: redundantGuardData(guard) });\n }\n },\n };\n },\n};\n\nexport default rule;\n","// ESLint adapter for throw-must-return-result: every `throw` in checked code must be guarded —\n// inside a `try` (same function) whose `catch` returns Result.err(...) on every path, or inside a\n// Trust.try / Trust.tryAsync callback. The decision is the shared core rule (../../core/rules.ts);\n// this file only maps ESTree nodes to TypeScript nodes and reports.\n// Works with or without type information; with it, Result.err is recognised by declaration.\n// A `throw` in a statement marked `//trust:accept <reason>` is accepted, and every `//trust:accept` that\n// accepts nothing is reported here, at the comment (`directive`, ../../core/accept.ts). Without type\n// information an accept above a statement with nothing to accept (stale) cannot be told, so it is not reported.\nimport type { Rule } from 'eslint';\nimport { acceptanceOf, acceptDirectiveFindings } from '../../core/accept.js';\nimport { ACCEPT_DIRECTIVE_MESSAGES, THROW_MESSAGES } from '../../core/messages.js';\nimport { throwProblem } from '../../core/rules.js';\nimport { OPTIONS_SCHEMA, setupRule } from '../rule-setup.js';\n\nexport { THROW_MESSAGES };\n\nconst rule: Rule.RuleModule = {\n meta: {\n type: 'problem',\n docs: { description: 'Require every throw to be caught locally and returned as Result.err.' },\n schema: OPTIONS_SCHEMA as unknown as Rule.RuleMetaData['schema'],\n messages: { ...THROW_MESSAGES, ...ACCEPT_DIRECTIVE_MESSAGES },\n },\n create(context) {\n const setup = setupRule(context);\n if (setup.zone !== 'checked') return {};\n const { ts, tsNode, guardContext, policy, checker } = setup;\n const { sourceCode } = context;\n return {\n Program() {\n const failureContext = policy && checker ? { ts, checker, policy, guardContext } : null;\n const sourceFile = setup.sourceFile();\n for (const found of acceptDirectiveFindings(ts, sourceFile, failureContext)) {\n const loc = { start: sourceCode.getLocFromIndex(found.directive.pos), end: sourceCode.getLocFromIndex(found.directive.end) };\n context.report({ loc, messageId: found.messageId, data: found.data });\n }\n },\n ThrowStatement(node) {\n const statement = tsNode(node, ts.isThrowStatement);\n const messageId = throwProblem(statement, guardContext);\n if (messageId && !acceptanceOf(ts, statement)) context.report({ node, messageId });\n },\n };\n },\n};\n\nexport default rule;\n","// ESLint adapter for type-claim: every place a type is claimed instead of proven — a narrowing\n// `as`, `x!`, `any` in a typed position, a written type predicate, a caller-chosen generic return —\n// is reported, with the claim kind as messageId (`claim:as`, `claim:non-null`, `claim:any`,\n// `claim:predicate`, `claim:generic-return`; `unanalyzable` for a node whose type does not resolve;\n// `directive` for a `//trust:` comment that marks nothing). Claims inside a validator (a function marked\n// `//trust:validator_function`) are not reported.\n// The decisions are the shared core rule (../../core/type-claims.ts), run once over the file's\n// TypeScript source; this file only reports them at their source positions.\n// Opt-in: it reports nothing unless the trust config turns it on (`\"rules\": { \"type-claim\": \"on\" }`), the\n// same setting `trust check` honours. When on, it requires typed linting (parserOptions.projectService or project).\nimport type { Rule } from 'eslint';\nimport { TYPE_CLAIM_MESSAGES, TYPE_CLAIM_RULE } from '../../core/messages.js';\nimport { claimSpan, typeClaimContext, typeClaimsIn } from '../../core/type-claims.js';\nimport { isRuleEnabled } from '../config.js';\nimport { OPTIONS_SCHEMA, setupRule } from '../rule-setup.js';\n\nexport { TYPE_CLAIM_MESSAGES };\n\nconst rule: Rule.RuleModule = {\n meta: {\n type: 'problem',\n docs: { description: 'Report every place a type is claimed instead of proven.' },\n schema: OPTIONS_SCHEMA as unknown as Rule.RuleMetaData['schema'],\n messages: TYPE_CLAIM_MESSAGES,\n },\n create(context) {\n const setup = setupRule(context);\n if (!isRuleEnabled(setup, TYPE_CLAIM_RULE)) return {};\n if (!setup.policy || !setup.checker) {\n throw new Error('type-claim requires typed linting (parserOptions.projectService or project).');\n }\n if (setup.zone !== 'checked') return {};\n const { ts, tsNode, checker, policy } = setup;\n const { sourceCode } = context;\n\n return {\n Program(node) {\n const sourceFile = tsNode(node, ts.isSourceFile);\n for (const claim of typeClaimsIn(sourceFile, typeClaimContext(ts, checker, undefined, policy))) {\n const span = claimSpan(claim, sourceFile);\n const loc = { start: sourceCode.getLocFromIndex(span.start), end: sourceCode.getLocFromIndex(span.end) };\n context.report({ loc, messageId: claim.origin, data: claim.data });\n }\n },\n };\n },\n};\n\nexport default rule;\n","// ESLint adapter for untrusted-call-must-return-result: every call or `new` whose callee is\n// untrusted must be guarded — inside a `try` (same function) whose `catch` returns Result.err(...)\n// on every path, or inside a Trust.try / Trust.tryAsync callback. Trust comes from\n// trust.config.json (see ../config.ts), from first-party checked code, or from a declared return\n// type of Result / Promise<Result> from @noego/trust. The decision is the shared core rule\n// (../../core/rules.ts); this file only maps ESTree nodes to TypeScript nodes and reports.\n// Requires typed linting (parserOptions.projectService or project). A call in a statement marked\n// `//trust:accept <reason>` is accepted (../../core/accept.ts).\nimport type { Rule } from 'eslint';\nimport type * as TS from 'typescript';\nimport { acceptanceOf } from '../../core/accept.js';\nimport { UNTRUSTED_CALL_MESSAGES } from '../../core/messages.js';\nimport { untrustedCallProblem } from '../../core/rules.js';\nimport { OPTIONS_SCHEMA, setupRule } from '../rule-setup.js';\n\nexport { UNTRUSTED_CALL_MESSAGES };\n\nconst rule: Rule.RuleModule = {\n meta: {\n type: 'problem',\n docs: { description: 'Require calls into untrusted code to be handled locally and returned as Result.err.' },\n schema: OPTIONS_SCHEMA as unknown as Rule.RuleMetaData['schema'],\n messages: UNTRUSTED_CALL_MESSAGES,\n },\n create(context) {\n const setup = setupRule(context);\n if (!setup.policy || !setup.checker) {\n throw new Error('untrusted-call-must-return-result requires typed linting (parserOptions.projectService or project).');\n }\n if (setup.zone !== 'checked') return {};\n const { ts, policy, tsNode, checker, guardContext } = setup;\n const isCallOrNew = (node: TS.Node): node is TS.CallExpression | TS.NewExpression => ts.isCallExpression(node) || ts.isNewExpression(node);\n\n function check(node: Rule.Node): void {\n const call = tsNode(node, isCallOrNew);\n const problem = untrustedCallProblem(call, policy, checker, guardContext);\n if (problem && !acceptanceOf(ts, call)) context.report({ node, messageId: problem.messageId, data: { origin: problem.origin } });\n }\n\n return { CallExpression: check, NewExpression: check };\n },\n};\n\nexport default rule;\n","// ESLint adapter for untrusted-value: type trust is opt-in. A value whose type was declared by an origin\n// that is not on the type-trust list (`trust_type` in trust.config.json) — a call's return, a parameter of\n// a callback the outside calls, a property or global it declares — may only be passed to a validator, kept\n// as `unknown`, or tested by a built-in check; any other use is reported with the origin named.\n// The decisions are the shared core rule (../../core/untrusted-values.ts), run once over the file's\n// TypeScript source; this file only reports them at their source positions.\n// Opt-in: it reports nothing unless the trust config turns it on (`\"rules\": { \"untrusted-value\": \"on\" }`), the\n// same setting `trust check` honours. When on, it requires typed linting (parserOptions.projectService or project).\nimport type { Rule } from 'eslint';\nimport type * as TS from 'typescript';\nimport { UNTRUSTED_VALUE_MESSAGES, UNTRUSTED_VALUE_RULE } from '../../core/messages.js';\nimport {\n untrustedHandoffData,\n untrustedHandoffsIn,\n untrustedValueContext,\n untrustedValueData,\n untrustedValueMessageId,\n untrustedValuesIn,\n} from '../../core/untrusted-values.js';\nimport { isRuleEnabled } from '../config.js';\nimport { OPTIONS_SCHEMA, setupRule } from '../rule-setup.js';\n\nexport { UNTRUSTED_VALUE_MESSAGES };\n\nconst rule: Rule.RuleModule = {\n meta: {\n type: 'problem',\n docs: { description: 'Report every use of a value whose type was declared by an origin that is not type-trusted.' },\n schema: OPTIONS_SCHEMA as unknown as Rule.RuleMetaData['schema'],\n messages: UNTRUSTED_VALUE_MESSAGES,\n },\n create(context) {\n const setup = setupRule(context);\n if (!isRuleEnabled(setup, UNTRUSTED_VALUE_RULE)) return {};\n if (!setup.policy || !setup.checker) {\n throw new Error('untrusted-value requires typed linting (parserOptions.projectService or project).');\n }\n if (setup.zone !== 'checked') return {};\n const { ts, tsNode, checker, policy } = setup;\n const { sourceCode } = context;\n\n return {\n Program(node) {\n const sourceFile = tsNode(node, ts.isSourceFile);\n const valueContext = untrustedValueContext(ts, checker, policy);\n const locOf = (at: TS.Node) => ({ start: sourceCode.getLocFromIndex(at.getStart(sourceFile)), end: sourceCode.getLocFromIndex(at.getEnd()) });\n for (const value of untrustedValuesIn(sourceFile, valueContext)) {\n if (value.outcome !== 'finding') continue;\n context.report({ loc: locOf(value.node), messageId: untrustedValueMessageId(value), data: untrustedValueData(value) });\n }\n // `untrustedCallbacks: \"all\"`: functions handed to an origin that is not type-trusted, at the hand-off.\n for (const handoff of untrustedHandoffsIn(sourceFile, valueContext)) {\n context.report({ loc: locOf(handoff.node), messageId: 'handoff', data: untrustedHandoffData(handoff) });\n }\n },\n };\n },\n};\n\nexport default rule;\n","// @noego/trust/eslint — ESLint plugin, trust config loader, and policy.\n//\n// import { typedConfig } from '@noego/trust/eslint';\n// export default [\n// ...typedConfig({ files: ['server/**/*.ts'], configFile: 'trust.config.json' }),\n// ];\nimport type { ESLint, Linter } from 'eslint';\nimport boundaryResult from './rules/boundary-result.js';\nimport droppedResult from './rules/dropped-result.js';\nimport finallyReturn from './rules/finally-return.js';\nimport trustedState from './rules/trusted-state.js';\nimport redundantGuard from './rules/redundant-guard.js';\nimport throwMustReturnResult from './rules/throw-must-return-result.js';\nimport typeClaim from './rules/type-claim.js';\nimport untrustedCallMustReturnResult from './rules/untrusted-call-must-return-result.js';\nimport untrustedValue from './rules/untrusted-value.js';\n\nexport const rules = {\n 'untrusted-call-must-return-result': untrustedCallMustReturnResult,\n 'throw-must-return-result': throwMustReturnResult,\n 'type-claim': typeClaim,\n 'untrusted-value': untrustedValue,\n 'dropped-result': droppedResult,\n 'trusted-state': trustedState,\n 'redundant-guard': redundantGuard,\n 'finally-return': finallyReturn,\n 'boundary-result': boundaryResult,\n};\n\nexport interface TypedConfigOptions {\n /** Files to check (flat-config globs). They must be in a tsconfig the project service can find. */\n readonly files: readonly string[];\n readonly ignores?: readonly string[];\n /** trust.config.json path relative to the ESLint cwd (default \"trust.config.json\"). */\n readonly configFile?: string;\n readonly severity?: Linter.RuleSeverity;\n}\n\nconst plugin: ESLint.Plugin = {\n meta: { name: '@noego/trust' },\n rules,\n};\n\nexport default plugin;\n\n/**\n * Flat config that registers the plugin as `trust` and enables its rules (the two trust rules, `type-claim`,\n * `untrusted-value` and `dropped-result`) for `files`. Needs typed linting. `type-claim`, `untrusted-value` and\n * `dropped-result` are opt-in: they report only when the trust config turns them on\n * (`\"rules\": { \"type-claim\": \"on\", \"untrusted-value\": \"on\", \"dropped-result\": \"on\" }`), the same settings\n * `trust check` / `trust baseline` honour, so ESLint and the CLI always agree.\n */\nexport function typedConfig(options: TypedConfigOptions): Linter.Config[] {\n const severity = options.severity ?? 'warn';\n const ruleOptions = { configFile: options.configFile ?? 'trust.config.json' };\n return [\n {\n name: '@noego/trust/typed',\n files: [...options.files],\n ignores: [...(options.ignores ?? [])],\n plugins: { trust: plugin },\n rules: {\n 'trust/untrusted-call-must-return-result': [severity, ruleOptions],\n 'trust/throw-must-return-result': [severity, ruleOptions],\n 'trust/type-claim': [severity, ruleOptions],\n 'trust/untrusted-value': [severity, ruleOptions],\n 'trust/dropped-result': [severity, ruleOptions],\n 'trust/trusted-state': [severity, ruleOptions],\n 'trust/redundant-guard': [severity, ruleOptions],\n 'trust/finally-return': [severity, ruleOptions],\n 'trust/boundary-result': [severity, ruleOptions],\n },\n },\n ];\n}\n\nexport {\n DEFAULT_RULE_SETTINGS,\n effectiveTrustList,\n effectiveTypeTrustList,\n isRuleEnabled,\n loadTrustConfig,\n normalizeOrigin,\n TrustConfigError,\n type BoundaryGroup,\n type LoadTrustConfigOptions,\n type OptInRule,\n type RuleSwitch,\n type TrustConfig,\n type TrustEntry,\n type TrustLevel,\n type TrustRuleSettings,\n type TsconfigMapping,\n type UntrustedCallbacks,\n} from './config.js';\nexport { PRESETS, type PresetDefinition } from './presets.js';\nexport { entryMatches, TrustPolicy, type MatchedEntry, type TypeVerdict, type Verdict } from './policy.js';\nexport { OriginResolver, type OriginInfo } from './origin.js';\nexport { Zones, type Zone, type ZoneGroup } from './zones.js';\nexport { alwaysExits, catchProblem, guardOf, type Guard, type GuardContext } from '../core/guard.js';\nexport type { CatchProblem } from '../core/messages.js';\nexport {\n compareToBaseline,\n countFindings,\n parseBaseline,\n serializeBaseline,\n THROW_RULE,\n UNTRUSTED_CALL_RULE,\n updateBaseline,\n WHOLE_BASELINE,\n type BaselineCounts,\n type BaselineDelta,\n type BaselineScope,\n type Finding,\n} from '../core/baseline.js';\nexport { DIRECTIVE_ORIGIN, TYPE_CLAIM_KINDS, TYPE_CLAIM_RULE, UNANALYZABLE_ORIGIN, type TypeClaimOrigin } from '../core/messages.js';\nexport { CATCH_ORIGIN, UNTRUSTED_VALUE_RULE, type UntrustedEntry } from '../core/messages.js';\nexport { DROPPED_RESULT_RULE, type DroppedResultOrigin } from '../core/messages.js';\nexport { DROPPED_RESULT_MESSAGES } from './rules/dropped-result.js';\nexport { REDUNDANT_GUARD_ORIGIN, REDUNDANT_GUARD_RULE } from '../core/messages.js';\nexport { REDUNDANT_GUARD_MESSAGES } from './rules/redundant-guard.js';\nexport { FINALLY_RETURN_ORIGIN, FINALLY_RETURN_RULE } from '../core/messages.js';\nexport { FINALLY_RETURN_MESSAGES } from './rules/finally-return.js';\nexport { BOUNDARY_RULE, type BoundaryOrigin } from '../core/messages.js';\nexport { BOUNDARY_MESSAGES } from './rules/boundary-result.js';\nexport { ACCEPT_DIRECTIVE, isInsideValidator, isMarkedValidator, VALIDATOR_DIRECTIVE } from '../core/validator.js';\nexport { ACCEPT_DIRECTIVE_MESSAGES } from '../core/messages.js';\nexport { THROW_MESSAGES } from './rules/throw-must-return-result.js';\nexport { TYPE_CLAIM_MESSAGES } from './rules/type-claim.js';\nexport { UNTRUSTED_CALL_MESSAGES } from './rules/untrusted-call-must-return-result.js';\nexport { UNTRUSTED_VALUE_MESSAGES } from './rules/untrusted-value.js';\nexport type { TrustRuleOptions } from './rule-setup.js';\n\nexport { TRUSTED_STATE_RULE, TRUSTED_STATE_MESSAGES, type TrustedStateOrigin } from '../core/messages.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,SAAS,eAAe;AAkBjB,IAAM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