Tweak source maps and implicit any in tsconfig

This commit is contained in:
Andre Perunicic 2022-09-17 01:07:00 -04:00
parent cd8413561c
commit 822e2daad0
2 changed files with 9 additions and 8 deletions

View file

@ -16,12 +16,13 @@ export type Bounds = [number, number] | null;
export function determineFrontmatterBounds(content: string): Bounds {
// metadataCache's frontmatter only gets populated if *document* starts
// with ---<newline>, even though the editor allows newlines before ---.
let open = /---\r?\n/gm;
let openRegex = /---\r?\n/gm;
// The editor sometimes highlights past the first close, but any fields
// there are not saved into metadataCache, so we ignore them.
let close = /---(\s|$)/gm;
// It also looks like more than three dashes close the frontmatter, too.
let closeRegex = /-{3,}(\s|$)/gm;
const openResult = open.exec(content);
const openResult = openRegex.exec(content);
// Opening must be at the start of the file.
if (openResult?.index !== 0) {
return null;
@ -34,8 +35,8 @@ export function determineFrontmatterBounds(content: string): Bounds {
}
// Find the closing delimiter after the frontmatter starts.
close.lastIndex = startIndex;
const closeResult = close.exec(content);
closeRegex.lastIndex = startIndex;
const closeResult = closeRegex.exec(content);
if (!closeResult) {
return null;
}

View file

@ -1,13 +1,13 @@
{
"compilerOptions": {
"baseUrl": ".",
"inlineSourceMap": false,
"inlineSources": false,
"inlineSourceMap": true,
"inlineSources": true,
"rootDir": "./src",
"module": "ESNext",
"target": "ES6",
"allowJs": true,
"noImplicitAny": true,
"noImplicitAny": false,
"moduleResolution": "node",
"importHelpers": true,
"isolatedModules": true,