(
node: { type: string; lines: number[]; location?: Location },
error: ValidationError
)
| 318 | } |
| 319 | |
| 320 | function toValidateError( |
| 321 | node: { type: string; lines: number[]; location?: Location }, |
| 322 | error: ValidationError |
| 323 | ): ValidateError { |
| 324 | if (hasValidLocation(error)) { |
| 325 | return { |
| 326 | type: node.type, |
| 327 | lines: [error.location.start.line, error.location.end.line], |
| 328 | location: { file: node.location?.file, ...error.location }, |
| 329 | error, |
| 330 | }; |
| 331 | } |
| 332 | return { type: node.type, lines: node.lines, location: node.location, error }; |
| 333 | } |
| 334 | |
| 335 | export function validateTree(content: Node, config: Config) { |
| 336 | const output = [...walkWithParents(content)].map(([node, parents]) => { |
no test coverage detected
searching dependent graphs…