Refs #95: bumping versions of test and lint dependancies and on too latest typscript for less linting warnings

This commit is contained in:
Roland 2026-06-01 21:18:55 +02:00
parent 3739de2777
commit a115688eee
10 changed files with 2820 additions and 6247 deletions

8984
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -24,17 +24,17 @@
"@types/node": "^22.15.29",
"@types/react": "^18.0.26",
"@types/react-dom": "^18.0.9",
"@typescript-eslint/eslint-plugin": "5.29.0",
"@typescript-eslint/parser": "5.29.0",
"@vitest/coverage-istanbul": "^3.2.1",
"@typescript-eslint/eslint-plugin": "8.60.0",
"@typescript-eslint/parser": "8.60.0",
"@vitest/coverage-istanbul": "^4.1.8",
"builtin-modules": "3.3.0",
"esbuild": "^0.25.2",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-simple-import-sort": "^12.1.1",
"eslint-plugin-simple-import-sort": "^13.0.0",
"obsidian": "^1.8.7",
"tslib": "2.4.0",
"typescript": "4.7.4",
"vitest": "^3.2.1"
"typescript": "6.0.3",
"vitest": "^4.1.8"
},
"dependencies": {
"@preact/signals-core": "^1.11.0",

View file

@ -88,7 +88,8 @@ export async function toString(contactFiles: TFile[]): Promise<VCardToStringRepl
const singleVcard = generateVCard(file)
vCards.push(singleVcard)
} catch (err) {
vCardsErrors.push({"status": "error", "file": file.basename, "message": err.message})
const message = err instanceof Error ? err.message : String(err);
vCardsErrors.push({"status": "error", "file": file.basename, "message": message})
}
})

View file

@ -7,12 +7,12 @@ import { ContactsView } from "src/ui/sidebar/sidebarView";
import { CONTACTS_VIEW_CONFIG } from "src/util/constants";
import myScrollTo from "src/util/myScrollTo";
import { ContactsPluginSettings } from './settings/settings.d';
import {vcard} from "./contacts/vcard";
import {updateFrontMatter} from "./contacts";
import {vcard} from "./contacts/vcard";
import { ContactsPluginSettings } from './settings/settings.d';
export default class ContactsPlugin extends Plugin {
settings: ContactsPluginSettings;
settings!: ContactsPluginSettings;
async onload() {

View file

@ -10,10 +10,11 @@ import { SynchronizationSettings } from "src/ui/settings/components/synchronizat
export class ContactsSettingTab extends PluginSettingTab {
plugin: ContactsPlugin;
app: App;
root: Root | null;
root: Root | null = null;
constructor(app: App, plugin: ContactsPlugin) {
super(app, plugin);
this.app = app;
this.plugin = plugin;
}

View file

@ -103,15 +103,23 @@ export const SidebarRootView = (props: SidebarRootViewProps) => {
}, 450); // place our update after obsidian has a opportunity to run some code
};
// @ts-ignore
vault.on("create", updateFiles);
// @ts-ignore
vault.on("modify", updateFiles);
// @ts-ignore
vault.on("rename", updateFiles);
// @ts-ignore
vault.on("delete", updateFiles);
return () => {
// @ts-ignore
vault.off("create", updateFiles);
// @ts-ignore
vault.off("modify", updateFiles);
// @ts-ignore
vault.off("rename", updateFiles);
// @ts-ignore
vault.off("delete", updateFiles);
};
}, [vault, mySettings.contactsFolder]);
@ -126,6 +134,7 @@ export const SidebarRootView = (props: SidebarRootViewProps) => {
return () => {
myScrollTo.clearDebounceTimer();
// @ts-ignore
workspace.off("active-leaf-change", myScrollTo.handleLeafEvent);
};
}, [workspace]);
@ -153,8 +162,12 @@ export const SidebarRootView = (props: SidebarRootViewProps) => {
<HeaderView
onSortChange={setSort}
importVCF={() => {
openFilePicker('.vcf').then(async (fileContent: string) => {
await importVCFContacts(fileContent, app, mySettings);
openFilePicker('.vcf').then(async (fileContent: string | Blob) => {
const content =
typeof fileContent === 'string'
? fileContent
: await fileContent.text();
await importVCFContacts(content, app, mySettings);
})
}}
exportAllVCF={async() => {
@ -185,7 +198,8 @@ export const SidebarRootView = (props: SidebarRootViewProps) => {
await processAvatar(contact);
setTimeout(() => { parseContacts() }, 50);
} catch (err) {
new Notice(err.message);
const message = err instanceof Error ? err.message : String(err);
new Notice(message);
}
})();
}}

View file

@ -11,7 +11,7 @@
}
.contacts-menu {
padding-right: 12px; // scrollbarSpacing
padding-right: 12px;
}
.contacts-view {

View file

@ -1,6 +1,9 @@
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"src/*": ["./src/*"],
"tests/*": ["./tests/*"]
},
"inlineSourceMap": true,
"inlineSources": true,
"module": "ESNext",
@ -18,7 +21,11 @@
"ES6",
"ES7"
],
"allowSyntheticDefaultImports": true
"types": [
"node"
],
"allowSyntheticDefaultImports": true,
"ignoreDeprecations": "6.0"
},
"include": [
"**/*.ts",

View file

@ -63,4 +63,4 @@ execSync(`git commit -m "version bump: ${version}"`, {
execSync(`git tag ${version}`, { stdio: "inherit" });
console.log(`🚀 Released ${version} ready for push \n git push origin --tags`);
console.log(`🚀 Released ${version} ready for push \n git push && git push origin --tags`);

View file

@ -7,6 +7,8 @@ export default defineConfig({
resolve: {
alias: {
obsidian: path.resolve(__dirname, 'tests/setup/emptyObsidianMock.ts'),
src: path.resolve(__dirname, './src'),
tests: path.resolve(__dirname, './tests'),
},
},
test: {