mirror of
https://github.com/zadam/trilium.git
synced 2025-12-10 09:24:23 +01:00
chore(scripts): add proper typechecking
This commit is contained in:
parent
3ee8eac635
commit
baee2cd6b2
@ -65,7 +65,7 @@ async function getFirstPageResults(context: BrowserContext) {
|
||||
for (const link of allDiscussionLinks) {
|
||||
const url = await link.getAttribute('href');
|
||||
const number = url?.match(/\/discussions\/(\d+)/)?.[1];
|
||||
ids.push(number);
|
||||
if (number) ids.push(number);
|
||||
}
|
||||
console.log(`Found ${ids.length} discussions.`);
|
||||
await page.close();
|
||||
|
||||
@ -34,5 +34,5 @@ function replaceTranslation(path: string, value: string) {
|
||||
cursor = cursor[current];
|
||||
}
|
||||
|
||||
cursor[lastSegment] = value;
|
||||
if (lastSegment) cursor[lastSegment] = value;
|
||||
}
|
||||
|
||||
@ -18,7 +18,7 @@ async function getLanguageStats() {
|
||||
return JSON.parse(await readFile(cacheFile, "utf-8"));
|
||||
}
|
||||
} catch (e) {
|
||||
if (e.code !== "ENOENT") {
|
||||
if (!(e && typeof e === "object" && "code" in e && e.code === "ENOENT")) {
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
18
scripts/tsconfig.json
Normal file
18
scripts/tsconfig.json
Normal file
@ -0,0 +1,18 @@
|
||||
{
|
||||
"extends": "../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "bundler",
|
||||
"target": "es2023",
|
||||
"outDir": "dist",
|
||||
"types": [
|
||||
"node",
|
||||
"express"
|
||||
],
|
||||
"tsBuildInfoFile": "dist/tsconfig.app.tsbuildinfo"
|
||||
},
|
||||
"include": [
|
||||
"**/*.ts"
|
||||
],
|
||||
"references": []
|
||||
}
|
||||
@ -62,6 +62,9 @@
|
||||
},
|
||||
{
|
||||
"path": "./packages/share-theme"
|
||||
},
|
||||
{
|
||||
"path": "./scripts"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user