From 053cce7e2702f37886ec016a9002638f4cf3e50c Mon Sep 17 00:00:00 2001 From: Andy Edwards Date: Wed, 28 Sep 2022 11:50:55 -0500 Subject: [PATCH] fix(CodeFrameError): fix missing type declaration error --- src/util/CodeFrameError.ts | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/util/CodeFrameError.ts b/src/util/CodeFrameError.ts index c6bc25e..670fc95 100644 --- a/src/util/CodeFrameError.ts +++ b/src/util/CodeFrameError.ts @@ -1,10 +1,25 @@ import CompilePathError from './CompilePathError' import generate from '@babel/generator' import { NodePath } from '../types' -import { codeFrameColumns, BabelCodeFrameOptions } from '@babel/code-frame' +import { codeFrameColumns } from '@babel/code-frame' import chalk from 'chalk' import dedent from 'dedent-js' +interface BabelCodeFrameOptions { + /** Syntax highlight the code as JavaScript for terminals. default: false */ + highlightCode?: boolean | undefined + /** The number of lines to show above the error. default: 2 */ + linesAbove?: number | undefined + /** The number of lines to show below the error. default: 3 */ + linesBelow?: number | undefined + /** + * Forcibly syntax highlight the code as JavaScript (for non-terminals); + * overrides highlightCode. + * default: false + */ + forceColor?: boolean | undefined +} + export interface SourceLocation { start: { line: number