@babel/code-frame
- Version 8.0.0
- Published
- 32.6 kB
- 2 dependencies
- MIT license
Install
npm i @babel/code-frameyarn add @babel/code-framepnpm add @babel/code-frameOverview
Generate errors that contain a code frame that point to source locations.
Index
Functions
function codeFrameColumns
codeFrameColumns: ( rawLines: string, loc: NodeLocation, opts?: Options) => string;function highlight
highlight: (text: string) => string;Interfaces
interface Options
interface Options {}property forceColor
forceColor?: boolean;Forcibly syntax highlight the code as JavaScript (for non-terminals); overrides highlightCode. default: false
property highlightCode
highlightCode?: boolean;Syntax highlight the code as JavaScript for terminals. default: false
property linesAbove
linesAbove?: number;The number of lines to show above the error. default: 2
property linesBelow
linesBelow?: number;The number of lines to show below the error. default: 3
property message
message?: string;Pass in a string to be displayed inline (if possible) next to the highlighted location in the code. If it can't be positioned inline, it will be placed above the code frame. default: nothing
property startLine
startLine?: number;Package Files (1)
Dependencies (2)
Dev Dependencies (1)
Peer Dependencies (0)
No peer dependencies.
Badge
To add a badge like this oneto your package's README, use the codes available below.
You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@babel/code-frame.
- Markdown[](https://www.jsdocs.io/package/@babel/code-frame)
- HTML<a href="https://www.jsdocs.io/package/@babel/code-frame"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>
- Updated .
Package analyzed in 2005 ms. - Missing or incorrect documentation? Open an issue for this package.
