fix: upgrade eslint-plugin-obsidianmd to 0.4.1 and resolve prefer-create-el warnings

This commit is contained in:
@gapmiss 2026-07-18 03:44:27 -05:00
parent afd54934cd
commit 44d48b31ab
4 changed files with 5264 additions and 5226 deletions

View file

@ -11,6 +11,13 @@ export default [
})),
// Obsidian plugin rules (v0.3.0+)
...obsidianmd.configs.recommended,
// converter.ts uses DOMParser documents, not Obsidian DOM
{
files: ["src/converter.ts"],
rules: {
"obsidianmd/prefer-create-el": "off",
},
},
// Project-specific config
{
files: ["src/**/*.ts"],

10471
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -26,7 +26,7 @@
"esbuild": "^0.28.1",
"eslint": "^9.30.1",
"eslint-plugin-no-unsanitized": "^4.1.2",
"eslint-plugin-obsidianmd": "^0.3.0",
"eslint-plugin-obsidianmd": "^0.4.1",
"globals": "^14.0.0",
"jiti": "^2.6.1",
"tslib": "^2.4.0",

View file

@ -122,7 +122,7 @@ export class HistoryView extends ItemView {
const header = this.listEl.createDiv({ cls: 'substack-clipper-history-header' });
const selectAllCb = header.createEl('input', { type: 'checkbox' });
selectAllCb.setAttribute('aria-label', 'Select all entries');
header.createEl('span', {
header.createSpan({
text: `${String(entries.length)} ${entries.length === 1 ? 'entry' : 'entries'}`,
cls: 'substack-clipper-history-count',
});
@ -151,19 +151,19 @@ export class HistoryView extends ItemView {
});
const info = row.createDiv({ cls: 'substack-clipper-history-info' });
info.createEl('span', { text: entry.title, cls: 'substack-clipper-history-title' });
info.createSpan({ text: entry.title, cls: 'substack-clipper-history-title' });
const meta = info.createDiv({ cls: 'substack-clipper-history-meta' });
const userLine = meta.createDiv({ cls: 'substack-clipper-history-userline' });
userLine.createEl('span', { text: entry.username, cls: 'substack-clipper-history-username' });
userLine.createSpan({ text: entry.username, cls: 'substack-clipper-history-username' });
if (entry.commentCount > 0) {
userLine.createEl('span', {
userLine.createSpan({
text: String(entry.commentCount),
cls: 'substack-clipper-history-badge',
});
}
meta.createEl('span', {
meta.createSpan({
text: new Date(entry.dateSaved).toLocaleDateString(),
cls: 'substack-clipper-history-date',
});