fix(lint): resolve Obsidian plugin linter warnings

- drop unnecessary type assertion in SyncStatusView tab rendering
- use window.setTimeout instead of global setTimeout
- use window instead of globalThis when resolving Electron's require

docs: list supported Git providers at the top of README
This commit is contained in:
ClaudiaFang 2026-07-05 05:14:28 +00:00
parent acebafd94a
commit d11ca94073
3 changed files with 8 additions and 3 deletions

View file

@ -8,6 +8,11 @@
[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg?style=flat-square)](https://conventionalcommits.org)
[![License](https://img.shields.io/github/license/firstsun-dev/git-files-sync?style=flat-square)](LICENSE)
**Supports:**
<img src="https://img.shields.io/badge/GitHub-181717?style=flat-square&logo=github&logoColor=white" alt="GitHub" height="20">
<img src="https://img.shields.io/badge/GitLab-FC6D26?style=flat-square&logo=gitlab&logoColor=white" alt="GitLab" height="20">
<img src="https://img.shields.io/badge/Gitea-609926?style=flat-square&logo=gitea&logoColor=white" alt="Gitea" height="20">
**Git File Sync** is a powerful Obsidian plugin that enables seamless synchronization of individual notes with GitLab, GitHub, or self-hosted Gitea repositories. Unlike full-vault sync solutions, it gives you granular control over what gets pushed and pulled, making it perfect for shared projects, selective backups, and cross-platform workflows.
[繁體中文使用說明](USAGE_zh.md)

View file

@ -143,7 +143,7 @@ export class SyncStatusView extends ItemView {
});
// Share the status icon set with the file list so tabs never drift.
if (tab.value !== 'all') {
setIcon(btn.createSpan(), statusMeta(tab.value as FileStatus['status']).icon);
setIcon(btn.createSpan(), statusMeta(tab.value).icon);
}
btn.createSpan({ cls: 'ssv-tab-label', text: ` ${tab.label}` });
const count = counts[tab.value];
@ -252,7 +252,7 @@ export class SyncStatusView extends ItemView {
await this.plugin.sync.pullFile(fileStatus.file || fileStatus.path);
}
await new Promise(r => setTimeout(r, 500));
await new Promise(r => window.setTimeout(r, 500));
await this.refreshFileStatus(fileStatus.file || fileStatus.path);
this.renderView();
} catch (e) {

View file

@ -36,7 +36,7 @@ export function canUseRealSymlinks(app: App): boolean {
// Electron exposes a CommonJS `require` on the global object on desktop; it is
// absent on mobile. Resolving it dynamically avoids a static node import.
function nodeModules(): { fs: NodeFs; path: NodePath } | null {
const req = (globalThis as unknown as { require?: NodeRequire }).require;
const req = (window as unknown as { require?: NodeRequire }).require;
if (typeof req !== 'function') return null;
try {
return { fs: req('fs') as NodeFs, path: req('path') as NodePath };