Address new TypeScript warnings from VS Code.

This commit is contained in:
David Anson 2022-06-12 17:51:47 -07:00
parent 36adb5e4d2
commit 6934d24651
2 changed files with 6 additions and 6 deletions

View file

@ -392,7 +392,7 @@ module.exports.flattenLists = function flattenLists(tokens) {
nestingStack.push(nesting);
nesting = 0;
} else if (token.type === "blockquote_close") {
nesting = nestingStack.pop();
nesting = nestingStack.pop() || 0;
}
if (token.map) {
// Track last token with map
@ -578,7 +578,7 @@ module.exports.addErrorDetailIf = function addErrorDetailIf(
module.exports.addErrorContext = function addErrorContext(
onError, lineNumber, context, left, right, range, fixInfo) {
context = ellipsify(context, left, right);
addError(onError, lineNumber, null, context, range, fixInfo);
addError(onError, lineNumber, undefined, context, range, fixInfo);
};
/**
@ -1002,7 +1002,7 @@ function normalizeFixInfo(fixInfo, lineNumber) {
* @param {string} line Line of Markdown content.
* @param {Object} fixInfo RuleOnErrorFixInfo instance.
* @param {string} [lineEnding] Line ending to use.
* @returns {string} Fixed content.
* @returns {string | null} Fixed content.
*/
function applyFix(line, fixInfo, lineEnding) {
const { editColumn, deleteCount, insertText } = normalizeFixInfo(fixInfo);