Skip to content

toReportNode

Bridges a Momoa node to the node type context.report() is typed against.

The two are structurally incompatible - ESLint’s rule types describe ESTree - but the json/json language’s source code adapter resolves a Momoa node’s position at report time, so they are compatible at runtime. This mirrors the bridge rule-tester-helper.ts makes over the same kind of type-level gap.

Import:

import { toReportNode } from 'obsidian-dev-utils/script-utils/linters/eslint-rules/manifest-helpers';

Signature:

function toReportNode(node: unknown): Rule.Node

Parameters:

ParameterTypeDescription
nodeunknownThe Momoa node to report on.

Returns: Rule.Node — The same node, typed for context.report().