Allow falsey, yet valid options for codeFrameColumns() (#7341)
Allow for overriding default linesAbove/linesBelow values.
This commit is contained in:
committed by
Henry Zhu
parent
493996e02a
commit
a01007a3d3
@@ -127,9 +127,7 @@ function getMarkerLines(
|
||||
loc.start,
|
||||
);
|
||||
const endLoc: Location = Object.assign({}, startLoc, loc.end);
|
||||
const linesAbove = opts.linesAbove || 2;
|
||||
const linesBelow = opts.linesBelow || 3;
|
||||
|
||||
const { linesAbove = 2, linesBelow = 3 } = opts || {};
|
||||
const startLine = startLoc.line;
|
||||
const startColumn = startLoc.column;
|
||||
const endLine = endLoc.line;
|
||||
|
||||
Reference in New Issue
Block a user