import { Node } from '@humanwhocodes/momoa' ; import { HintIssue } from './types' ; export function makeIssue ( message , node ) { return { message , severity : 'error' , from : node . loc . start . offset , to : node . loc . end . offset , } ; } export class HintError extends Error { issues : HintIssue [ ] = [ ] ; constructor ( issues ) { super ( ) ; const actualProto = new . target . prototype ; Object . setPrototypeOf ( this , actualProto ) ; this . issues = issues ; } get message ( ) { return JSON . stringify ( this . issues , null , 2 ) ; } }